第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定

Fatal error: spl_autoload(): Class Test could not be loaded in /home/vilay/www/spl/index.php

spl_autoload_extensions('.class.php');

? ? define('CLASS_DIR','Class/');

? ? set_include_path(get_include_path().PATH_SEPARATOR.CLASS_DIR);

? ? spl_autoload_register();

? ? new Test();


正在回答

2 回答

你使用的是默認(rèn)的spl_autoload() 函數(shù),這個(gè)函數(shù)的默認(rèn)extension參數(shù)是會把類名自動(dòng)轉(zhuǎn)換為小寫,在加上后綴名也就是spl_autoload_extensions()設(shè)置的后綴。

如果想要實(shí)現(xiàn)大寫,你可以自己實(shí)現(xiàn)一個(gè)類加載方法, 讓后spl_autoload_register() 注冊這個(gè)函數(shù),這樣應(yīng)該可以滿足你的DIY 需求。這種方式也是很多PHP框架實(shí)現(xiàn)的方式

0 回復(fù) 有任何疑惑可以回復(fù)我~

找到原因了,類名要小寫,Test.class.php,不行,需要test.class.php

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

慕萊塢4304824 提問者

但是如果要寫成大寫,不懂需要怎么配置
2015-03-01 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

Fatal error: spl_autoload(): Class Test could not be loaded in /home/vilay/www/spl/index.php

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號