onurbaran
(Onurbaran19)
February 5, 2010, 10:02am
1
Hi,
I want to running Yii Shell, I applied following code. Return to me error message. I dont know why!
Thanks.
php yiic shell ../index.php
error messages
CException
Description
Property "CWebApplication.import" is not defined.
Source File
/srv/www/yii/framework/base/CModule.php(435)
00423: }
00424: }
00425:
00426: /**
00427: * Configures the module with the specified configuration.
00428: * @param array the configuration array
00429: */
00430: public function configure($config)
00431: {
00432: if(is_array($config))
00433: {
00434: foreach($config as $key=>$value)
00435: $this->$key=$value;
00436: }
00437: }
00438:
00439: /**
00440: * Loads static application components.
00441: */
00442: protected function preloadComponents()
00443: {
00444: foreach($this->preload as $id)
00445: $this->getComponent($id);
00446: }
00447:
Stack Trace
#0 /srv/www/yii/framework/base/CModule.php(435): CComponent->__set('import', Array)
#1 /srv/www/yii/framework/base/CApplication.php(117): CModule->configure(Array)
#2 /srv/www/yii/framework/YiiBase.php(112): CApplication->__construct('/srv/www/sys/pr...')
#3 /srv/www/yii/framework/YiiBase.php(85): YiiBase::createApplication('CWebApplication', '/srv/www/sys/pr...')
#4 /srv/www/sys/index.php(11): YiiBase::createWebApplication('/srv/www/sys/pr...')
#5 /srv/www/yii/framework/cli/commands/ShellCommand.php(78): require('/srv/www/sys/in...')
#6 /srv/www/yii/framework/console/CConsoleCommandRunner.php(62): ShellCommand->run(Array)
#7 /srv/www/yii/framework/console/CConsoleApplication.php(88): CConsoleCommandRunner->run(Array)
#8 /srv/www/yii/framework/base/CApplication.php(135): CConsoleApplication->processRequest()
#9 /srv/www/yii/framework/yiic.php(31): CApplication->run()
#10 {main}
cmx
(Pagemechanix)
February 6, 2010, 4:40am
2
Try…
yiic shell config/main.php
onurbaran
(Onurbaran19)
February 6, 2010, 10:30am
3
Thank you for reply. I applied your code but result not change!
CException
Description
Property "CWebApplication.import" is not defined.
Source File
/srv/www/yii/framework/base/CModule.php(435)
00423: }
00424: }
00425:
00426: /**
00427: * Configures the module with the specified configuration.
00428: * @param array the configuration array
00429: */
00430: public function configure($config)
00431: {
00432: if(is_array($config))
00433: {
00434: foreach($config as $key=>$value)
00435: $this->$key=$value;
00436: }
00437: }
00438:
00439: /**
00440: * Loads static application components.
00441: */
00442: protected function preloadComponents()
00443: {
00444: foreach($this->preload as $id)
00445: $this->getComponent($id);
00446: }
00447:
Stack Trace
#0 /srv/www/yii/framework/base/CModule.php(435): CComponent->__set('import', Array)
#1 /srv/www/yii/framework/base/CApplication.php(117): CModule->configure(Array)
#2 /srv/www/yii/framework/YiiBase.php(112): CApplication->__construct(Array)
#3 /srv/www/yii/framework/YiiBase.php(85): YiiBase::createApplication('CWebApplication', Array)
#4 /srv/www/yii/framework/cli/commands/ShellCommand.php(88): YiiBase::createWebApplication(Array)
#5 /srv/www/yii/framework/console/CConsoleCommandRunner.php(62): ShellCommand->run(Array)
#6 /srv/www/yii/framework/console/CConsoleApplication.php(88): CConsoleCommandRunner->run(Array)
#7 /srv/www/yii/framework/base/CApplication.php(135): CConsoleApplication->processRequest()
#8 /srv/www/yii/framework/yiic.php(31): CApplication->run()
#9 /srv/www/yii/framework/yiic(15): require_once('/srv/www/yii/fr...')
#10 {main}
Y11
(Y!!)
February 6, 2010, 12:31pm
4
#4 /srv/www/yii/framework/cli/commands/ShellCommand.php(88): YiiBase::createWebApplication(Array)
You’re trying ot run a web-application from console. You should use console-applications and console-commands only.
onurbaran
(Onurbaran19)
February 6, 2010, 5:50pm
5
#4 /srv/www/yii/framework/cli/commands/ShellCommand.php(88): YiiBase::createWebApplication(Array)
You’re trying ot run a web-application from console. You should use console-applications and console-commands only.
Before your anwser he said "yiic shell config/main.php". I want to create to CRUD units. How can I do it?
tri
(tri - Tommy Riboe)
February 6, 2010, 6:44pm
6
Did the requirements check pass?
http://your_server/yii/requirements
/Tommy
cmx
(Pagemechanix)
February 6, 2010, 8:07pm
7
Depending on where you put your yii directory, you may need to change the relative path to that directory in protected/yiic.php. Changing it is not necessary if you can already load the yiic shell. Were you able to create your models using the shell?
onurbaran
(Onurbaran19)
February 6, 2010, 10:44pm
8
requirements details following:
Name Result Required By Memo
PHP version Passed Yii Framework PHP 5.1.0 or higher is required.
$_SERVER variable Passed Yii Framework
Reflection extension Passed Yii Framework
PCRE extension Passed Yii Framework
SPL extension Passed Yii Framework
DOM extension Passed CWsdlGenerator
PDO extension Passed All DB-related classes
PDO SQLite extension Passed All DB-related classes This is required if you are using SQLite database.
PDO MySQL extension Passed All DB-related classes This is required if you are using MySQL database. (I use this)
PDO PostgreSQL extensionWarning All DB-related classes This is required if you are using PostgreSQL database.
Memcache extension Passed CMemCache
APC extension Warning CApcCache
Mcrypt extension Passed CSecurityManager This is required by encrypt and decrypt methods.
SOAP extension Passed CWebService, CWebServiceAction
GD extension Passed CCaptchaAction
tri
(tri - Tommy Riboe)
February 6, 2010, 11:07pm
9
Let’s have a look at your config/main.php. According to the error message, something seems to be wrong with the ‘import’ section.
/Tommy
onurbaran
(Onurbaran19)
February 15, 2010, 4:37pm
10
I solved my problem.
LC_ALL=C ./yiic shell config/main.php