I am trying to use http://openweathermap.org/api which can be downloaded from https://github.com/c...therMap-PHP-Api in my yii application
I have extracted the Cmfcmf folder under vendors folder in my application as you can see the folder content
protected/vendor/
└── Cmfcmf
├── OpenWeatherMap
│ ├── AbstractCache.php
│ ├── CurrentWeather.php
│ ├── Exception.php
│ ├── Fetcher
│ │ ├── CurlFetcher.php
│ │ ├── CurlFetcherTest.php
│ │ ├── FetcherInterface.php
│ │ ├── FileGetContentsFetcher.php
│ │ └── FileGetContentsFetcherTest.php
│ ├── Forecast.php
│ ├── History.php
│ ├── Util
│ │ ├── City.php
│ │ ├── Sun.php
│ │ ├── SunTest.php
│ │ ├── Temperature.php
│ │ ├── Time.php
│ │ ├── Unit.php
│ │ ├── UnitTest.php
│ │ ├── Weather.php
│ │ └── Wind.php
│ ├── WeatherForecast.php
│ └── WeatherHistory.php
└── OpenWeatherMap.php
then [size="2"]added the following lines of code to my main.php in config folder to set the alias of the namespace Cmfcmf :[/size]
Yii::setPathOfAlias('Cmfcmf',Yii::getPathOfAlias('application.vendors.Cmfcmf'));
then auto import the vendor as below
'import' => array(
.....
......
'application.vendors.*',
...
),
but the problem is whenever I try to use it as below
$wd=new Cmfcmf\OpenWeatherMap();
I got 500 internal server error as below
[color="#FCE94F"]size=“2”[/size][/color] Fatal error: Class ‘Cmfcmf\OpenWeatherMap’ not found in /var/www/html/his_tb/protected/views/page/charter-quotes.php on line 28
[i]
[/i]
anyone can help?!
thanks in advanced.
[i]
[/i]