Source for file Ethna_Plugin_Generator_Action.php
Documentation is available at Ethna_Plugin_Generator_Action.php
// vim: foldmethod=marker
* Ethna_Plugin_Generator_Action.php
* @author Masaki Fujimoto <fujimoto@php.net>
* @license http://www.opensource.org/licenses/bsd-license.php The BSD License
// {{{ Ethna_Plugin_Generator_Action
* @author Masaki Fujimoto <fujimoto@php.net>
* @param string $action_name アクション名
* @param string $skelton スケルトンファイル名
* @param int $gateway ゲートウェイ
* @return true|Ethna_Error true:成功 Ethna_Error:失敗
function &generate($action_name, $skelton =
null, $gateway =
GATEWAY_WWW)
$action_dir =
$this->ctl->getActiondir($gateway);
$action_class =
$this->ctl->getDefaultActionClass($action_name, $gateway);
$action_form =
$this->ctl->getDefaultFormClass($action_name, $gateway);
$action_path =
$this->ctl->getDefaultActionPath($action_name);
$entity =
$action_dir .
$action_path;
$skelton =
"skel.action.php";
$skelton =
"skel.action_cli.php";
$skelton =
"skel.action_xmlrpc.php";
$macro['project_id'] =
$this->ctl->getAppId();
$macro['action_name'] =
$action_name;
$macro['action_class'] =
$action_class;
$macro['action_form'] =
$action_form;
$macro['action_path'] =
$action_path;
$user_macro =
$this->_getUserMacro();
printf("file [%s] already exists -> skip\n", $entity);
} else if ($this->_generateFile($skelton, $entity, $macro) ==
false) {
printf("[warning] file creation failed [%s]\n", $entity);
printf("action script(s) successfully created [%s]\n", $entity);
Documentation generated on Fri, 11 Nov 2011 04:00:11 +0900 by phpDocumentor 1.4.3