{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii/issues/3904","labels_url":"https://api.github.com/repos/yiisoft/yii/issues/3904/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii/issues/3904/comments","events_url":"https://api.github.com/repos/yiisoft/yii/issues/3904/events","html_url":"https://github.com/yiisoft/yii/issues/3904","id":93850068,"number":3904,"title":"Console commands doesn't autoload classes","user":{"login":"x-yuri","id":730588,"avatar_url":"https://avatars.githubusercontent.com/u/730588?v=3","gravatar_id":"","url":"https://api.github.com/users/x-yuri","html_url":"https://github.com/x-yuri","followers_url":"https://api.github.com/users/x-yuri/followers","following_url":"https://api.github.com/users/x-yuri/following{/other_user}","gists_url":"https://api.github.com/users/x-yuri/gists{/gist_id}","starred_url":"https://api.github.com/users/x-yuri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/x-yuri/subscriptions","organizations_url":"https://api.github.com/users/x-yuri/orgs","repos_url":"https://api.github.com/users/x-yuri/repos","events_url":"https://api.github.com/users/x-yuri/events{/privacy}","received_events_url":"https://api.github.com/users/x-yuri/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-08T17:50:23Z","updated_at":"2015-07-08T18:36:54Z","closed_at":"2015-07-08T18:36:54Z","body":"I'm running `yii-1.1.14`. And I'm trying to create console command, but when I run it, it says:\r\n\r\n```\r\nPHP Error[2]: include(Model.php): failed to open stream: No such file or directory\r\n    in file /srv/http/bg/framework/YiiBase.php at line 427\r\n#0 /srv/http/bg/framework/YiiBase.php(427): autoload()\r\n#1 unknown(0): autoload()\r\n#2 /srv/http/bg/protected/commands/C1Command.php(19): spl_autoload_call()\r\n#3 /srv/http/bg/framework/console/CConsoleCommandRunner.php(71): C1Command->run()\r\n#4 /srv/http/bg/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()\r\n#5 /srv/http/bg/framework/base/CApplication.php(180): CConsoleApplication->processRequest()\r\n#6 /srv/http/bg/framework/yiic.php(33): CConsoleApplication->run()\r\n#7 /srv/http/bg/protected/yiic.php(7): require_once()\r\n#8 /srv/http/bg/protected/yiic(4): require_once()\r\n```\r\n\r\nI saw [this other issue][1], and [this `stackoverflow question][2], but it doesn't help me. Adding\r\n\r\n```\r\n    'components' => array(\r\n        ...\r\n        'import' => array(                                                                                             \r\n            'application.models.*',                                                                                    \r\n        ),\r\n    ),\r\n```\r\n\r\nto config makes no difference.\r\n\r\n[1]: https://github.com/yiisoft/yii/issues/2344\r\n[2]: http://stackoverflow.com/questions/25428526/console-app-in-yii-fails-to-include-ar-model"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii/issues/comments/119692097","html_url":"https://github.com/yiisoft/yii/issues/3904#issuecomment-119692097","issue_url":"https://api.github.com/repos/yiisoft/yii/issues/3904","id":119692097,"user":{"login":"cebe","id":189796,"avatar_url":"https://avatars.githubusercontent.com/u/189796?v=3","gravatar_id":"","url":"https://api.github.com/users/cebe","html_url":"https://github.com/cebe","followers_url":"https://api.github.com/users/cebe/followers","following_url":"https://api.github.com/users/cebe/following{/other_user}","gists_url":"https://api.github.com/users/cebe/gists{/gist_id}","starred_url":"https://api.github.com/users/cebe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cebe/subscriptions","organizations_url":"https://api.github.com/users/cebe/orgs","repos_url":"https://api.github.com/users/cebe/repos","events_url":"https://api.github.com/users/cebe/events{/privacy}","received_events_url":"https://api.github.com/users/cebe/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T18:36:54Z","updated_at":"2015-07-08T18:36:54Z","body":"import is a property of the application so it has to be outside of 'components'. please use the forum to ask further questions, github is for bug tracking."}}