Hi,
Downloaded Yii 1.1.13
created an app - helloworld
Un commented Gii section in /helloworld/protected/config/main.php
Navigated to ‘Controller Generator’ and entered the names for the controller and actions
Clicked ‘Generate’ and received an error message ‘do not have permission’. It states that the server permissions need to be changed.
I am using MAMP Pro 2.0.3 and changed the permissions (I think?) It seems that permissions in MAMP returns back to default setting, if I am not mistaking. The default settings, I have R W X for Folder and for Files I have R W only.
However instead of the original error message I now get this PHP Warning. (see below)
Not sure if this is a bug.
Running OSX 10.6.8
cheers
Gary
PHP warning
file_put_contents(/Users/me/WebRoot/helloworld/protected/runtime/gii-1.1.13/ControllerCode.php) [<a href=‘function.file-put-contents’>function.file-put-contents</a>]: failed to open stream: Permission denied
/Users/me/YiiRoot/framework/gii/CCodeModel.php(386)
374 }
375 }
376 }
377 }
378
379 /**
380 * Saves sticky attributes into a file.
381 */
382 public function saveStickyAttributes()
383 {
384 $path=$this->getStickyFile();
385 @mkdir(dirname($path),0755,true);
386 file_put_contents($path,"<?php\nreturn ".var_export($this->_stickyAttributes,true).";\n");
387 }
388
389 /**
390 * @return string the file path that stores the sticky attribute values.
391 */
392 public function getStickyFile()
393 {
394 return Yii::app()->runtimePath.’/gii-’.Yii::getVersion().’/’.get_class($this).’.php’;
395 }
396
397 /**
398 * Converts a word to its plural form.
Stack Trace
#0
/Users/me/YiiRoot/framework/gii/CCodeModel.php(386): file_put_contents("/Users/me/WebRoot/helloworld/protected/runtime/gii-1.1.13…", “<?php return array ( ‘template’ => ‘default’, ‘baseClass’ =>…”)
#1
/Users/me/YiiRoot/framework/gii/CCodeGenerator.php(161): CCodeModel->saveStickyAttributes()
#2
/Users/me/YiiRoot/framework/gii/CCodeGenerator.php(63): CCodeGenerator->prepare()
#3
/Users/me/YiiRoot/framework/web/actions/CInlineAction.php(49): CCodeGenerator->actionIndex()
#4
/Users/me/YiiRoot/framework/web/CController.php(308): CInlineAction->runWithParams(array("r" => "gii/controller"))
#5
/Users/me/YiiRoot/framework/web/CController.php(286): CController->runAction(CInlineAction)
#6
/Users/me/YiiRoot/framework/web/CController.php(265): CController->runActionWithFilters(CInlineAction, array())
#7
/Users/me/YiiRoot/framework/web/CWebApplication.php(282): CController->run("")
#8
/Users/me/YiiRoot/framework/web/CWebApplication.php(141): CWebApplication->runController("gii/controller")
#9
/Users/me/YiiRoot/framework/base/CApplication.php(169): CWebApplication->processRequest()
#10
–
/Users/me/WebRoot/helloworld/index.php(13): CApplication->run()
08 defined(‘YII_DEBUG’) or define(‘YII_DEBUG’,true);
09 // specify how many levels of call stack should be shown in each log message
10 defined(‘YII_TRACE_LEVEL’) or define(‘YII_TRACE_LEVEL’,3);
11
12 require_once($yii);
13 Yii::createWebApplication($config)->run();