2
我需要在Yii版本1項目中使用https://github.com/maxmind/GeoIP2-php擴展(即沒有命名空間概念項目)。如何在Yii中使用命名空間編程的擴展1
嘗試:$reader = new \GeoIp2\Database\Reader('/path/to/GeoIP2-City.mmdb');
的main.php已以下代碼:
'import' => array(
'common.extensions.*',
)
也常見/擴展文件夾具有下 'GeoIP2' 文件夾中的上述延伸部。
但沒有運氣。錯誤是:
Fatal error: Class 'GeoIp2\Database\Reader' not found in .....Controller.php on line ..
任何想法。