0
我使用的wiki軟件:DokuWiki的和自安裝模板:http://www.dokuwiki.org/template:monobookPHP parse_ini_file在Windows PHP 5.3.0斜線
本地測試使用WAMP在64位Windows 7的時候我已經收到此錯誤: 阿帕奇:2.2.11
PHP:5.3.0
UPDATE我已經升級我的PHP版本5.3.1,這已修復錯誤。
警告:在 Ç解析錯誤:\瓦帕\ WWW \維基\ lib中\ EXE /../../ LIB/TPL上線/的MonoBook/style.ini在-C 30 : \瓦帕\ WWW \維基\ lib中\ EXE \ css.php線
警告:在 C()提供的foreach參數無效:\瓦帕\ WWW \維基\ lib中\ EXE \ CSS。 php on line
style.ini
; INI to handle loading of the CSS files of the "monobook" template for DokuWiki
;
;
; LICENSE: This file is open source software (OSS) and may be copied under
; certain conditions. See COPYING file for details or try to contact
; the author(s) of this file in doubt.
;
; @license GPLv2 (http://www.gnu.org/licenses/gpl2.html)
; @author Andreas Haerter <[email protected]>
; @link http://andreas-haerter.com/projects/dokuwiki-template-monobook
; @link http://www.dokuwiki.org/template:monobook
; @link http://www.dokuwiki.org/devel:css#styleini
; Please see http://www.php.net/manual/en/function.parse-ini-file.php
; for limitations of the ini format used here
; Define the stylesheets your template uses here. The second value
; defines for which output media the style should be loaded. Currently
; print, screen and rtl are supported. rtl styles are loaded additionally
; to screen styles if a right-to-left language is selected (eg. hebrew)
[stylesheets]
; screen
; note to myself: don't forget to respect the workaround within "bug49642.php"
; when adding new screen styles.
; load the DokuWiki styles. See <http://j.mp/eq8zSo> why I am doing this.
[line:30] static/3rd/dokuwiki/_imgdetail.css = screen
static/3rd/dokuwiki/_media_popup.css = screen
static/3rd/dokuwiki/_media_fullscreen.css = screen
static/3rd/dokuwiki/_fileuploader.css = screen
static/3rd/dokuwiki/_tabs.css = screen
static/3rd/dokuwiki/_links.css = screen
static/3rd/dokuwiki/_toc.css = screen
static/3rd/dokuwiki/_footnotes.css = screen
static/3rd/dokuwiki/_search.css = screen
static/3rd/dokuwiki/_recent.css = screen
static/3rd/dokuwiki/_diff.css = screen
static/3rd/dokuwiki/_edit.css = screen
static/3rd/dokuwiki/_modal.css = screen
static/3rd/dokuwiki/_forms.css = screen
static/3rd/dokuwiki/_admin.css = screen
; load the most important MediaWiki monobook styles
static/3rd/monobook/main.css = screen
; load the specific "monobook for dokuwiki" styles
static/css/screen.css = screen
user/screen.css = screen
這是css.php的PHP代碼加載ini文件:
// load template styles
$tplstyles = array();
if(@file_exists($tplinc.'style.ini')){
$ini = parse_ini_file($tplinc.'style.ini',true);
foreach($ini['stylesheets'] as $file => $mode){
$tplstyles[$mode][$tplinc.$file] = $tpldir;
}
}
上述文件使用PHP/5.2.17-win32解析了我(我的編輯器中實際上第29行的'[line:30]'已經被刪除]。 ini文件中的斜槓不是AFAIK特殊字符,並且在密鑰中應該是合法的。這是一個簡單的ISO-8859-1文件嗎?沒有UTF搞砸你? – DaveRandom 2012-03-14 10:52:52
PHP 5.3正在解析這個沒有probs的文件(在mac上) – clops 2012-03-14 10:55:20
是的,這兩個都是正確的,我剛剛在Linux服務器上測試過,它正常工作。它一定是PHP版本的問題,因爲一旦我升級到5.3.1,錯誤就消失了。 – 2012-03-14 13:27:11