十月 30 2011

PHP 5.2.X 升級 PHP 5.3.X 後不宜使用的function

by 分類: PHP 人氣:141

分享到Facebook

Deprecated features in PHP 5.3.x

PHP 5.3.0 introduces two new error levels: E_DEPRECATED and E_USER_DEPRECATED. The E_DEPRECATED error level is used to indicate that a function or feature has been deprecated. The E_USER_DEPRECATED level is intended for indicating deprecated features in user code, similarly to the E_USER_ERROR and E_USER_WARNING levels.

The following is a list of deprecated INI directives. Use of any of these INI directives will cause an E_DEPRECATED error to be thrown at startup.

  • define_syslog_variables
  • register_globals
  • register_long_arrays
  • safe_mode
  • magic_quotes_gpc
  • magic_quotes_runtime
  • magic_quotes_sybase
  • Comments starting with ‘#’ are now deprecated in .INI files.

Deprecated functions:

  • call_user_method() (use call_user_func() instead)
  • call_user_method_array() (use call_user_func_array() instead)
  • define_syslog_variables()
  • dl()
  • ereg() (use preg_match() instead)
  • ereg_replace() (use preg_replace() instead)
  • eregi() (use preg_match() with the ‘i’ modifier instead)
    仍是使用preg_match()這個函式,只是在比對時,要忽略大小寫,加上『/i』的參數。
    ex: preg_match("/^[a-z0-9]*$/i",$text);
  • eregi_replace() (use preg_replace() with the ‘i’ modifier instead)
    仍是使用preg_replace()這個函式,只是在比對時,要忽略大小寫,加上『/i』的參數。
    ex: preg_replace("/^[a-z0-9]*$/i",$text);
  • set_magic_quotes_runtime() and its alias, magic_quotes_runtime()
    建議將它disabled
  • session_register() (use the $_SESSION superglobal instead)
    將session_register()改為使用$_SESSION superglobal的寫法代替
    ex: session_register("abc"); 改為 $_SESSION["abc"];
  • session_unregister() (use the $_SESSION superglobal instead)
    同上
  • session_is_registered() (use the $_SESSION superglobal instead)
    同上
  • set_socket_blocking() (use stream_set_blocking() instead)
  • split() (use preg_split() instead)
    仍是使用preg_split()這個函式,只是在比對時,要忽略大小寫,加上『/i』的參數。
    ex: preg_split("/^[a-z0-9]*$/i",$text);
  • spliti() (use preg_split() with the ‘i’ modifier instead)
    仍是使用preg_split()這個函式,只是在比對時,要忽略大小寫,加上『/i』的參數。
    ex: preg_split("/^[a-z0-9]*$/i",$text);
  • sql_regcase()
  • mysql_db_query() (use mysql_select_db() and mysql_query() instead)
  • mysql_escape_string() (use mysql_real_escape_string() instead)
  • Passing locale category names as strings is now deprecated. Use the LC_* family of constants instead.
  • The is_dst parameter to mktime(). Use the new timezone handling functions instead.

Deprecated features:

  • Assigning the return value of new by reference is now deprecated.
  • Call-time pass-by-reference is now deprecated.
  • The use of {} to access string offsets is deprecated. Use [] instead.

document source from (資料來源) : http://www.php.net/manual/en/migration53.deprecated.php

 

若在更新的過程中,發現以下的錯誤訊息,解決方法如下:

Deprecated: Function split() is deprecated in …….  將split 改為 preg_split
Deprecated: Function ereg_replace() is deprecated in……… 將ereg_replace 換成preg_replace
Deprecated: Function ereg() is deprecated in …….. 將ereg換成preg_match
Deprecated: Assigning the return value of new by reference is deprecated in …….. 把"&" 移掉
Warning: preg_match() [function.preg-match]: Empty regular expression in……. patten的前後要用『/』包起來
Warning: preg_split() [function.preg-split]: Delimiter must not be alphanumeric or backslash in……. 將"\"移掉,若為"\n"換成chr(13)
SYSTEM WARNING: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash patten的前後要用『/』包起來
SYSTEM WARNING: preg_match() [function.preg-match]: No ending delimiter ‘^’ found patten的前後要用『/』包起來
SYSTEM WARNING: preg_replace() [function.preg-replace]: No ending delimiter ‘^’ found patten的前後要用『/』包起來
Warning: preg_replace() [function.preg-replace]: No ending delimiter ‘/’ found in D:\www\mantis118_new\core\string_api.php on line 464 patten的後面要用『/』包起來
SYSTEM WARNING: preg_split() [function.preg-split]: Empty regular expression patten的前後要用『/』包起來
SYSTEM WARNING: preg_match() [function.preg-match]: Unknown modifier ‘/’ patten若是使用類似http://的雙斜線 要寫成 http:\/\/
Function magic_quotes_runtime() is deprecated in 改使用
ini_set(‘magic_quotes_runtime’, 0)

目前沒有任何回應

九月 11 2011

Windows裝機免費軟體分享

by 分類: SoftWare 人氣:148

分享到Facebook

防毒軟體

avast! Antivirus


官網 : http://www.avast.com/
下載 : http://files.avast.com/iavs5x/setup_av_free.exe
中文 : 有
維基 : http://zh.wikipedia.org/wiki/Avast!
說明 : 難得一見的內建中文語系的免費防毒軟體,防毒能力還不錯,佔用資源也沒有卡巴斯基的多
教學 : http://briian.com/?p=523

 

解壓縮軟體

7-Zip


官網 : http://www.7-zip.org/
下載 : http://www.7-zip.org/download.html
中文 : 有
維基 : http://zh.wikipedia.org/wiki/7-Zip
說明 : 媲美WinRAR跟WinZIP的軟體

 

美編軟體

Paint.NET


官網 : http://www.getpaint.net/
下載 : http://www.getpaint.net/download.html
中文 : 有
維基 : http://zh.wikipedia.org/wiki/Paint.NET
說明 : 號稱免費版的Photoshop,超級強大的小畫家

PhotoFiltre


官網 : http://www.photofiltre-studio.com/
下載 : http://www.photofiltre-studio.com/download-en.htm
中文 : 有
說明 : 各種簡單的處理,不論是亮度調整、打光、去雜訊

PhotoScape


官網 : http://www.photoscape.org/
下載 : http://www.photoscape.org/ps/main/download.php?lc=cn
中文 : 有
說明 : 不論是 影像編輯 裁剪 邊框 多圖模版 美化 各項功能 都讓人驚豔

看圖軟體

FastStone Image Viewer


官網 : http://www.faststone.org/
下載 : http://www.faststone.org/FSViewerDownload.htm
中文 : 有
說明 : 一套跟ACDSee差不多的軟體,還支援整批改名跟編輯

XnView


官網 : http://www.xnview.com/
下載 : http://www.xnview.com/en/download.html
維基 : http://zh.wikipedia.org/wiki/XnView
中文 : 有
說明 : 一套跟ACDSee差不多的軟體,還支援整批改名跟編輯

 

影音軟體

VLC media player


官網 : http://www.videolan.org
下載 : http://www.videolan.org/vlc/download-windows.html
維基 : http://zh.wikipedia.org/wiki/Vlc
中文 : 有
說明 : 各種影片格式跟音樂格式都可以撥放的軟體,連ISO映像檔也可撥

 

轉檔工具

Free Video Converter


官網 : http://www.freemake.com/tw/free_video_converter/
下載 : http://www.freemake.com/download?id=FreemakeVideoConverter.exe
中文 : 有
說明 : 各種影片格式跟音樂格式互相轉換,也可直接抓取YouTube的影片

格式工廠


官網 : http://www.formatoz.com/
下載 : http://www.formatoz.com/download.html
維基 : http://zh.wikipedia.org/wiki/%E6%A0%BC%E5%BC%8F%E5%B7%A5%E5%8E%82
中文 : 有
說明 : 各種影片格式跟音樂格式互相轉換

目前沒有任何回應

八月 06 2010

在Linux安裝 php + mcrypt

by 分類: Linux,PHP 人氣:741

分享到Facebook

首先先到mcrypt網站下載為新版本
http://sourceforge.net/projects/mcrypt/files/Libmcrypt/
下載完解壓縮

tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8

先安裝 ltdl

cd libltdl
./configure --enable-ltdl-install
make;make install

再安裝libmcrypt套件

cd ..
./configure --disable-posix-threads
make;make install

然後再去編譯php

./configure  --with-mcrypt=/usr/local

目前沒有任何回應

七月 09 2010

jQuery 教學說明

by 分類: jQuery 人氣:726

分享到Facebook

jQuery 1.6 下載位置
正常版本:http://code.jquery.com/jquery-1.6.js
壓縮版本:http://code.jquery.com/jquery-1.6.min.js

 

同時 Google 跟 Microsoft 都有提供了 CDN 服務:
Google:https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js
Microsoft:http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.min.js

點此閱讀更多訊息 »

目前沒有任何回應

五月 03 2010

PHP Easter Egg

by 分類: PHP 人氣:582

分享到Facebook

如何關閉 PHP 彩蛋

在安裝php時預設只要在php檔案後面加上
?=PHPE9568F36-D428-11d2-A769-00AA001ACF42(圖片)
?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000(說明)

修改php.ini
將下述
expose_php 由 On 改成 Off 即可

目前沒有任何回應