2 // vim: foldmethod=marker
6 * @author Masaki Fujimoto <fujimoto@php.net>
7 * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
12 // {{{ Ethna_Generator
16 * @author Masaki Fujimoto <fujimoto@php.net>
26 * @param string $type 生成する対象
27 * @param string $app_dir アプリケーションのディレクトリ
28 * (nullのときはアプリケーションを特定しない)
29 * @param mixed residue プラグインのgenerate()にそのまま渡す
32 public static function generate()
34 $arg_list = func_get_args();
35 $type = array_shift($arg_list);
36 $app_dir = array_shift($arg_list);
38 if ($app_dir === null) {
39 $ctl = Ethna_Handle::getEthnaController();
41 $ctl = Ethna_Handle::getAppController($app_dir);
43 if (Ethna::isError($ctl)) {
47 $plugin_manager = $ctl->getPlugin();
48 if (Ethna::isError($plugin_manager)) {
49 return $plugin_manager;
52 $generator = $plugin_manager->getPlugin('Generator', $type);
53 if (Ethna::isError($generator)) {
58 $ret = call_user_func_array(array(&$generator, 'generate'), $arg_list);
66 * @param string $type 生成する対象
67 * @param string $app_dir アプリケーションのディレクトリ
68 * (nullのときはアプリケーションを特定しない)
69 * @param mixed residue プラグインのremove()にそのまま渡す
72 public static function remove()
74 $arg_list = func_get_args();
75 $type = array_shift($arg_list);
76 $app_dir = array_shift($arg_list);
78 if ($app_dir === null) {
79 $ctl = Ethna_Handle::getEthnaController();
81 $ctl = Ethna_Handle::getAppController($app_dir);
83 if (Ethna::isError($ctl)) {
87 $plugin_manager = $ctl->getPlugin();
88 if (Ethna::isError($plugin_manager)) {
89 return $plugin_manager;
92 $generator = $plugin_manager->getPlugin('Generator', $type);
93 if (Ethna::isError($generator)) {
98 $ret = call_user_func_array(array(&$generator, 'remove'), $arg_list);