@@ -77,8 +77,7 @@ |
||
| 77 | 77 | if($type === 'custom' && !is_dir("phoponent/app/components/core/{$tag}")) { |
| 78 | 78 | $this->create_component('core', $tag); |
| 79 | 79 | $this->create_component('custom', $tag); |
| 80 | - } |
|
| 81 | - else { |
|
| 80 | + } else { |
|
| 82 | 81 | $this->create_component($type, $tag); |
| 83 | 82 | } |
| 84 | 83 | } |
@@ -36,8 +36,7 @@ |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | file_put_contents(self::$LOG_FILE, $content."\n".date('#~ '.exec('echo $USER').': '.$text)); |
| 39 | - } |
|
| 40 | - else { |
|
| 39 | + } else { |
|
| 41 | 40 | echo date('Y-m-d H:i:s').' '.exec('echo $USER').' #~ '.$text."\n"; |
| 42 | 41 | } |
| 43 | 42 | } |
@@ -13,8 +13,7 @@ discard block |
||
| 13 | 13 | public function get($name) { |
| 14 | 14 | if(in_array($name, get_class_vars(get_class($this)))) { |
| 15 | 15 | return $this->$name; |
| 16 | - } |
|
| 17 | - elseif (in_array("get_{$name}", get_class_methods($this))) { |
|
| 16 | + } elseif (in_array("get_{$name}", get_class_methods($this))) { |
|
| 18 | 17 | $func = "get_{$name}"; |
| 19 | 18 | return $this->$func(); |
| 20 | 19 | } |
@@ -24,8 +23,7 @@ discard block |
||
| 24 | 23 | public function set($name, $value) { |
| 25 | 24 | if(in_array($name, array_keys(get_class_vars(get_class($this))))) { |
| 26 | 25 | $this->$name = $value; |
| 27 | - } |
|
| 28 | - elseif (in_array("set_{$name}", get_class_methods($this))) { |
|
| 26 | + } elseif (in_array("set_{$name}", get_class_methods($this))) { |
|
| 29 | 27 | $func = "set_{$name}"; |
| 30 | 28 | return $this->$func($value); |
| 31 | 29 | } |
@@ -44,8 +44,7 @@ |
||
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | - } |
|
| 48 | - else { |
|
| 47 | + } else { |
|
| 49 | 48 | $translated = $translate_object->translate($text); |
| 50 | 49 | if(!empty($array)) { |
| 51 | 50 | foreach ($array as $id => $value) { |
@@ -28,8 +28,7 @@ discard block |
||
| 28 | 28 | $model = str_replace('.php', '', $file); |
| 29 | 29 | $model_class = "\\phoponent\\app\\component\\custom\\$component\\mvc\\model\\$model"; |
| 30 | 30 | $models[$model] = new $model_class(self::get_services($class_tag), $component); |
| 31 | - } |
|
| 32 | - elseif(is_file("phoponent/app/components/core/{$component}/models/{$file}")) { |
|
| 31 | + } elseif(is_file("phoponent/app/components/core/{$component}/models/{$file}")) { |
|
| 33 | 32 | require_once "phoponent/app/components/core/{$component}/models/{$file}"; |
| 34 | 33 | $class_tag = "\phoponent\app\component\core\{$component}"; |
| 35 | 34 | $model = str_replace('.php', '', $file); |
@@ -54,8 +53,7 @@ discard block |
||
| 54 | 53 | $view_parent_class = "\\phoponent\\app\\component\\core\\$component\\mvc\\view\\$view"; |
| 55 | 54 | $views[$view] = new $view_class("phoponent/app/components/custom/{$component}/views"); |
| 56 | 55 | $views[$view]->set_parent(new $view_parent_class("phoponent/app/components/core/{$component}/views")); |
| 57 | - } |
|
| 58 | - elseif(is_file("phoponent/app/components/core/{$component}/views/{$file}")) { |
|
| 56 | + } elseif(is_file("phoponent/app/components/core/{$component}/views/{$file}")) { |
|
| 59 | 57 | require_once "phoponent/app/components/core/{$component}/views/{$file}"; |
| 60 | 58 | $view = str_replace('.view.php', '', $file); |
| 61 | 59 | $view_class = "\\phoponent\\app\\component\\core\\$component\\mvc\\view\\$view"; |
@@ -128,8 +126,7 @@ discard block |
||
| 128 | 126 | $tag = new $class_tag(self::get_models($class), self::get_views($class), self::get_services($class_tag), $template); |
| 129 | 127 | $tag->value($matches[2]); |
| 130 | 128 | $template = str_replace($matches[0], $tag->render(), $template); |
| 131 | - } |
|
| 132 | - elseif(is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 129 | + } elseif(is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 133 | 130 | require_once "phoponent/app/components/core/{$class}/{$class}.php"; |
| 134 | 131 | $class_tag = "\\phoponent\\app\\component\\core\\$class"; |
| 135 | 132 | /** |
@@ -153,8 +150,7 @@ discard block |
||
| 153 | 150 | $tag = new $class_tag(self::get_models($class), self::get_views($class), self::get_services($class_tag), $template); |
| 154 | 151 | $tag->value($matches[2]); |
| 155 | 152 | $template = str_replace($matches[0], $tag->render(), $template); |
| 156 | - } |
|
| 157 | - elseif (is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 153 | + } elseif (is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 158 | 154 | require_once "phoponent/app/components/core/{$class}/{$class}.php"; |
| 159 | 155 | $class_tag = "\\phoponent\\app\\component\\core\\$class"; |
| 160 | 156 | /** |
@@ -206,8 +202,7 @@ discard block |
||
| 206 | 202 | } |
| 207 | 203 | } |
| 208 | 204 | $template = str_replace($matches[0], $tag->render(), $template); |
| 209 | - } |
|
| 210 | - elseif (is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 205 | + } elseif (is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 211 | 206 | require_once "phoponent/app/components/core/{$class}/{$class}.php"; |
| 212 | 207 | $class_tag = "\\phoponent\\app\\component\\core\\$class"; |
| 213 | 208 | /** |
@@ -238,8 +233,7 @@ discard block |
||
| 238 | 233 | */ |
| 239 | 234 | $tag = new $class_tag(self::get_models($class), self::get_views($class), self::get_services($class_tag), $template); |
| 240 | 235 | $template = str_replace($matches[0], $tag->render(), $template); |
| 241 | - } |
|
| 242 | - elseif(is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 236 | + } elseif(is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 243 | 237 | require_once "phoponent/app/components/core/{$class}/{$class}.php"; |
| 244 | 238 | $class_tag = "\\phoponent\\app\\component\\core\\$class"; |
| 245 | 239 | /** |
@@ -261,8 +255,7 @@ discard block |
||
| 261 | 255 | */ |
| 262 | 256 | $tag = new $class_tag(self::get_models($class), self::get_views($class), self::get_services($class_tag), $template); |
| 263 | 257 | $template = str_replace($matches[0], $tag->render(), $template); |
| 264 | - } |
|
| 265 | - elseif(is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 258 | + } elseif(is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 266 | 259 | require_once "phoponent/app/components/core/{$class}/{$class}.php"; |
| 267 | 260 | $class_tag = "\\phoponent\\app\\component\\core\\$class"; |
| 268 | 261 | /** |
@@ -313,8 +306,7 @@ discard block |
||
| 313 | 306 | } |
| 314 | 307 | } |
| 315 | 308 | $template = str_replace($matches[0], $tag->render(), $template); |
| 316 | - } |
|
| 317 | - elseif(is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 309 | + } elseif(is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 318 | 310 | require_once "phoponent/app/components/core/{$class}/{$class}.php"; |
| 319 | 311 | $class_tag = "\\phoponent\\app\\component\\core\\class"; |
| 320 | 312 | /** |
@@ -345,8 +337,7 @@ discard block |
||
| 345 | 337 | */ |
| 346 | 338 | $tag = new $class_tag(self::get_models($class), self::get_views($class), self::get_services($class_tag), $template); |
| 347 | 339 | $template = str_replace($matches[0], $tag->render(), $template); |
| 348 | - } |
|
| 349 | - elseif(is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 340 | + } elseif(is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 350 | 341 | require_once "phoponent/app/components/core/{$class}/{$class}.php"; |
| 351 | 342 | $class_tag = "\\phoponent\\app\\component\\core\\$class"; |
| 352 | 343 | /** |
@@ -368,8 +359,7 @@ discard block |
||
| 368 | 359 | */ |
| 369 | 360 | $tag = new $class_tag(self::get_models($class), self::get_views($class), self::get_services($class_tag), $template); |
| 370 | 361 | $template = str_replace($matches[0], $tag->render(), $template); |
| 371 | - } |
|
| 372 | - elseif(is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 362 | + } elseif(is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 373 | 363 | require_once "phoponent/app/components/core/{$class}/{$class}.php"; |
| 374 | 364 | $class_tag = "\\phoponent\\app\\component\\core\\$class"; |
| 375 | 365 | /** |
@@ -420,8 +410,7 @@ discard block |
||
| 420 | 410 | } |
| 421 | 411 | } |
| 422 | 412 | $template = str_replace($matches[0], $tag->render(), $template); |
| 423 | - } |
|
| 424 | - elseif(is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 413 | + } elseif(is_file("phoponent/app/components/core/{$class}/{$class}.php")) { |
|
| 425 | 414 | require_once "phoponent/app/components/core/{$class}/{$class}.php"; |
| 426 | 415 | $class_tag = "\\phoponent\\app\\component\\core\\$class"; |
| 427 | 416 | /** |
@@ -35,8 +35,7 @@ discard block |
||
| 35 | 35 | $argv = self::clean_argv($argv); |
| 36 | 36 | if(is_file("phoponent/commands/help.php")) { |
| 37 | 37 | require_once "phoponent/commands/help.php"; |
| 38 | - } |
|
| 39 | - else { |
|
| 38 | + } else { |
|
| 40 | 39 | throw new Exception("command help not found !"); |
| 41 | 40 | } |
| 42 | 41 | $command = new help($argv); |
@@ -49,16 +48,14 @@ discard block |
||
| 49 | 48 | $argv = self::clean_argv($argv); |
| 50 | 49 | if(is_file("phoponent/commands/{$command_class}.php")) { |
| 51 | 50 | require_once "phoponent/commands/{$command_class}.php"; |
| 52 | - } |
|
| 53 | - else { |
|
| 51 | + } else { |
|
| 54 | 52 | throw new Exception("command {$command_class} not found !"); |
| 55 | 53 | } |
| 56 | 54 | $command_class = "\\phoponent\\framework\\command\\{$command_class}"; |
| 57 | 55 | $command_obj = new $command_class($argv); |
| 58 | 56 | if($command_method) { |
| 59 | 57 | $command_obj->execute($command_method); |
| 60 | - } |
|
| 61 | - else { |
|
| 58 | + } else { |
|
| 62 | 59 | $command_obj->execute(); |
| 63 | 60 | } |
| 64 | 61 | } |
@@ -22,8 +22,7 @@ |
||
| 22 | 22 | } |
| 23 | 23 | if((integer)file_get_contents(self::$file_path) === 1) { |
| 24 | 24 | file_put_contents(self::$file_path, self::FALSE); |
| 25 | - } |
|
| 26 | - else { |
|
| 25 | + } else { |
|
| 27 | 26 | file_put_contents(self::$file_path, self::TRUE); |
| 28 | 27 | } |
| 29 | 28 | } |