I try to create small application demo like testdrive.
I create folder WebRoot .then I create testdrive application through command webapp.
Then I go from command line
cd WebRoot/testdrive/Protected
and type
yiic shell yiic.bat
and then
Yii Interactive Tool v1.0
Please type 'help' for help. Type 'exit' to quit.
>> model Product product
the code of index.php of testdrive is as follow:
<?php
// change the following paths if necessary
$yii='C:Program FilesEasyPHP 2.0b1wwwYiiRootframeworkyii.php';
$config=dirname(__FILE__).'/protected/config/main.php';
// remove the following line when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
require_once($yii);
Yii::createWebApplication($config)->run();
?>
When I try to run command with different entry point like this
yiic shell WebRoot/testdrive/index.php
Then I get This error on command line:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <title>
PHP Error</title> <style type="text/css">
/*<![CDATA[*/
body {font-family:"Verdana";font-weight:normal;color:black;background-color:white;}
h1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } h2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
h3 {font-family:"Verdana";font-weight:bold;font-size:11pt}
p {font-family:"Verdana";font-size:9pt;}
pre {font-family:"Lucida Console";font-size:10pt;} .version {color: gray;font-size:8pt;border-top:1px solid #aaaaaa;} .message {color: maroon;}
.source {font-family:"Lucida Console";font-weight:normal;background-color:#ffffee;}
.error {background-color: #ffeeee;} /*]]>*/ </style> </head> <body>
<h1>PHP Error</h1> <h3>Description</h3>
<p class="message">
Illegal offset type in isset or empty</p> <h3>Source File</h3>
<p> C:Program FilesEasyPHP 2.0b1wwwYiiRootframeworkYiiBase.php(175)</p> <div class="source">
<pre>00163: * the class file 'web/CController.php' when needed. 00164: *
00165: * The same alias can be imported multiple times, but only the first time is effective.
00166: * 00167: * @param string path alias to be imported 00168: * @param boolean whether to include the class file immediately. If false, the class file 00169: * will be included only when the class is being used. 00170: * @return string the class name or the directory that this alias refers to 00171: * @throws CException if the alias is invalid 00172: */
00173: public static function import($alias,$forceInclude=false) 00174:
{
<div class="error">00175:
if(isset(self::$_imports[$alias])) // previously imported </div>00176:
return self::$_imports[$alias]; 00177:
00178: if(isset(self::$_coreClasses[$alias]) || ($pos=strrpos($alias,'.'))===false) // a simple class name 00179: {
00180: self::$_imports[$alias]=$alias; 00181: if($forceInclude && !class_exists($alias,false)) 00182: { 00183: if(isset(self::$_coreClasses[$alias])) // a core class 00184: require_once(YII_PATH.self::$_coreClasses[$alias]); 00185: else 00186: require_once($alias.'.php'); 00187: } </pre> </div><!-- end of source --> <h3>Stack Trace</h3>
<div class="callstack"> <pre>
#0 C:Program FilesEasyPHP 2.0b1wwwYiiRootframeworkcollectionsCConfiguration.php(131): import()
#1 C:Program FilesEasyPHP 2.0b1wwwYiiRootframeworkbaseCApplication.php(709): createObject()
#2 C:Program FilesEasyPHP 2.0b1wwwYiiRootframeworkbaseCApplication.php(361): CWebApplication->getComponent()
#3 C:Program FilesEasyPHP 2.0b1wwwYiiRootframeworkclicommandsshellModelCommand.php(92): CWebApplication->getDb()
#4 unknown(0): ModelCommand->generateModel()
#5 C:Program FilesEasyPHP 2.0b1wwwYiiRootframeworkconsoleCConsoleCommand.php(116): call_user_func()
#6 C:Program FilesEasyPHP 2.0b1wwwYiiRootframeworkclicommandsshellModelCommand.php(72): ModelCommand->copyFiles()
#7 C:Program FilesEasyPHP 2.0b1wwwYiiRootframeworkclicommandsShellCommand.php(98): ModelCommand->run()
#8 C:Program FilesEasyPHP 2.0b1wwwYiiRootframeworkclicommandsShellCommand.php(78): ShellCommand->runShell()
#9 C:Program FilesEasyPHP 2.0b1wwwYiiRootframeworkconsoleCConsoleCommandRunner.php(62): ShellCommand->run()
#10 C:Program FilesEasyPHP 2.0b1wwwYiiRootframeworkconsoleCConsoleApplication.php(88): CConsoleCommandRunner->run()
#11 C:Program FilesEasyPHP 2.0b1wwwYiiRootframeworkbaseCApplication.php(146): CConsoleApplication->processRequest()
#12 C:Program FilesEasyPHP 2.0b1wwwYiiRootframeworkyiic.php(30): CConsoleApplication->run()
#13 C:Program FilesEasyPHP 2.0b1wwwYiiRootframeworkyiic(15): require_once() </pre></div>
<!-- end of callstack-->
<div class="version"> 2009-01-05 05:47:35 <a href="http://www.yiiframework.com/">Yii Framework</a>/1.0.0</div> </body> </html>