復制代碼 代碼如下:
[Xdebug]
zend_extension_ts="/usr/local/php/lib/php/extensions/no-debug-non-zts-20020429/xdebug.so"
xdebug.profiler_enable=on
xdebug.trace_output_dir="/tmp/xdebug"
xdebug.profiler_output_dir="/tmp/xdebug"
xdebug.profiler_output_name="script"
復制代碼 代碼如下:
function getForbiddenTags()
{
$tagsPath=TEMPLATE_FILE_PATH."tags/forbidden_tags.txt";
if(file_exists($tagsPath))
{
$fp = fopen($tagsPath, "r");
$arrconf = array ();
if ($fp)
{
while (!feof($fp))
{
$line = fgets($fp, 1024);
$line = trim($line);
$rows = explode("#", $line);
$coumns = explode("=", trim($rows[0]));
if(""!=trim($coumns[0]))
{
$arrconf[trim($coumns[0])] = trim($coumns[1]);
}
}
}
return $arrconf;
}
}
(5)可能造成瓶頸的原因:
要過濾的156個關鍵字逐行存放在/usr/local/apache/template/tags/forbidden_tags.txt文件中,文本數據庫的效率不高。
逐行讀取函數fgets、以及去除字符串兩邊的空白或者指定的字符的函數trim在高負載下的效率低,可以測試fopen、fread、fscanf之類的文件讀取函數,對比一下。
新聞熱點
疑難解答