Source for file AppManager.php

Documentation is available at AppManager.php

  1. <?php
  2. // vim: foldmethod=marker
  3. /**
  4.  *  AppManager.php
  5.  *
  6.  *  @author     Masaki Fujimoto <fujimoto@php.net>
  7.  *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
  8.  *  @package    Ethna
  9.  *  @version    $Id: 558083604a899088d4edf43748b1434b201d714b $
  10.  */
  11.  
  12. // {{{ Ethna_Plugin_Generator_AppManager
  13. /**
  14.  *  スケルトン生成クラス
  15.  *
  16.  *  @author     Masaki Fujimoto <fujimoto@php.net>
  17.  *  @access     public
  18.  *  @package    Ethna
  19.  */
  20. {
  21.     /**
  22.      *  アプリケーションマネージャのスケルトンを生成する
  23.      *
  24.      *  @access public
  25.      *  @param  string  $manager_name    アプリケーションマネージ名
  26.      *  @return bool    true:成功 false:失敗
  27.      */
  28.     function generate($manager_name)
  29.     {
  30.         $class_name $this->ctl->getManagerClassName($manager_name);
  31.         $app_dir $this->ctl->getDirectory('app');
  32.         $app_path "${class_name}.php";
  33.  
  34.         $macro array();
  35.         $macro['project_id'$this->ctl->getAppId();
  36.         $macro['app_path'$app_path;
  37.         $macro['app_manager'$class_name;
  38.  
  39.         $user_macro $this->_getUserMacro();
  40.         $macro array_merge($macro$user_macro);
  41.  
  42.         $path "$app_dir/$app_path";
  43.         Ethna_Util::mkdir(dirname($path)0755);
  44.         if (file_exists($path)) {
  45.             printf("file [%s] already exists -> skip\n"$path);
  46.         else if ($this->_generateFile("skel.app_manager.php"$path$macro== false{
  47.             printf("[warning] file creation failed [%s]\n"$path);
  48.         else {
  49.             printf("app-manager script(s) successfully created [%s]\n"$path);
  50.         }
  51.     }
  52. }
  53. // }}}

Documentation generated on Fri, 11 Nov 2011 03:57:32 +0900 by phpDocumentor 1.4.3