Example #1
0
 public static function buildBehaviors($module, $controller)
 {
     $tempPath = config::get('behaviors_path');
     $file = config::app_path() . '/' . $module . '/behaviors/' . $controller . '.php';
     if (!is_file($file)) {
         $content = file_get_contents($tempPath);
         $content = str_replace(array('[MODULE]', '[CONTROLLER]'), array($module, $controller), $content);
         if (false) {
             $content = preg_replace('/namespace\\s(.*?);/', '', $content, 1);
         }
         $dir = dirname($file);
         if (!is_dir($dir)) {
             mkdir($dir, 0755, true);
         }
         file_put_contents($file, $content);
     }
 }
Example #2
0
 public static function input()
 {
     $param = config::param();
     $arr = System\Directory::explode($param['0']);
     if (empty($arr[0]) || empty($arr[1])) {
         return " module name is null;Enter module/input\n";
     }
     if (empty($param[1])) {
         // ๆ™ฎ้€š
         Build::buildInput($arr['0'], $arr[1]);
     } elseif ($param[1] == '--resource') {
         // ่ต„ๆบ
         Build::buildInput($arr['0'], $arr[1], config::get('input_resource_path'));
     }
 }