Completed
Push — master ( 0afdc4...0e57e6 )
by Alexey
04:27
created
system/Inji/Router.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
                 $classPath = implode('/', array_slice($classPath, 1));
50 50
                 if (App::$cur) {
51 51
                     if (App::$cur !== App::$primary) {
52
-                        $folders['appModule'] = ['folder' => App::$primary->path . '/modules/' . $moduleName, 'classPath' => $classPath];
52
+                        $folders['appModule'] = ['folder' => App::$primary->path.'/modules/'.$moduleName, 'classPath' => $classPath];
53 53
                     }
54
-                    $folders['primaryAppModule'] = ['folder' => App::$cur->path . '/modules/' . $moduleName, 'classPath' => $classPath];
54
+                    $folders['primaryAppModule'] = ['folder' => App::$cur->path.'/modules/'.$moduleName, 'classPath' => $classPath];
55 55
                 }
56
-                $folders['systemModule'] = ['folder' => INJI_SYSTEM_DIR . '/modules/' . $moduleName, 'classPath' => $classPath];
56
+                $folders['systemModule'] = ['folder' => INJI_SYSTEM_DIR.'/modules/'.$moduleName, 'classPath' => $classPath];
57 57
             }
58 58
         }
59 59
         $classPath = str_replace('\\', '/', $className);
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             if (file_exists($path)) {
74 74
                 include_once $path;
75 75
                 if (in_array('Model', class_parents($className, false)) && \App::$primary) {
76
-                    $filename = Cache::getDir('system') . '/classData.php';
76
+                    $filename = Cache::getDir('system').'/classData.php';
77 77
                     $classData = Config::custom($filename);
78 78
                     if (empty($classData['Model'][$className]['tableCreated'])) {
79 79
                         $classData['Model'][$className]['tableCreated'] = $className::createTable();
@@ -98,18 +98,18 @@  discard block
 block discarded – undo
98 98
     {
99 99
         $paths = [];
100 100
         if (strpos($classPath, '/') === false) {
101
-            $paths[$code . '_Object'] = $folder . '/objects/' . $classPath . '.php';
102
-            $paths[$code . '_ObjectDir'] = $folder . '/objects/' . $classPath . '/' . $classPath . '.php';
103
-            $paths[$code . '_Model'] = $folder . '/models/' . $classPath . '.php';
104
-            $paths[$code . '_ModelDir'] = $folder . '/models/' . $classPath . '/' . $classPath . '.php';
101
+            $paths[$code.'_Object'] = $folder.'/objects/'.$classPath.'.php';
102
+            $paths[$code.'_ObjectDir'] = $folder.'/objects/'.$classPath.'/'.$classPath.'.php';
103
+            $paths[$code.'_Model'] = $folder.'/models/'.$classPath.'.php';
104
+            $paths[$code.'_ModelDir'] = $folder.'/models/'.$classPath.'/'.$classPath.'.php';
105 105
         } else {
106 106
             $classFile = substr($classPath, strrpos($classPath, '/') + 1);
107 107
             $classPathWithotClass = substr($classPath, 0, strrpos($classPath, '/'));
108 108
 
109
-            $paths[$code . '_Object'] = $folder . '/objects/' . $classPathWithotClass . '/' . $classFile . '.php';
110
-            $paths[$code . '_ObjectDir'] = $folder . '/objects/' . $classPath . '/' . $classFile . '.php';
111
-            $paths[$code . '_Model'] = $folder . '/models/' . $classPathWithotClass . '/' . $classFile . '.php';
112
-            $paths[$code . '_ModelDir'] = $folder . '/models/' . $classPath . '/' . $classFile . '.php';
109
+            $paths[$code.'_Object'] = $folder.'/objects/'.$classPathWithotClass.'/'.$classFile.'.php';
110
+            $paths[$code.'_ObjectDir'] = $folder.'/objects/'.$classPath.'/'.$classFile.'.php';
111
+            $paths[$code.'_Model'] = $folder.'/models/'.$classPathWithotClass.'/'.$classFile.'.php';
112
+            $paths[$code.'_ModelDir'] = $folder.'/models/'.$classPath.'/'.$classFile.'.php';
113 113
         }
114 114
         return $paths;
115 115
     }
Please login to merge, or discard this patch.
system/Inji/Controller.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -64,17 +64,17 @@
 block discarded – undo
64 64
      */
65 65
     public function run()
66 66
     {
67
-        if (!empty($this->params[0]) && method_exists($this, $this->params[0] . 'Action')) {
67
+        if (!empty($this->params[0]) && method_exists($this, $this->params[0].'Action')) {
68 68
             $this->method = $this->params[0];
69 69
             $this->params = array_slice($this->params, 1);
70
-        } elseif (!method_exists($this, $this->method . 'Action')) {
70
+        } elseif (!method_exists($this, $this->method.'Action')) {
71 71
             INJI_SYSTEM_ERROR('method not found', true);
72 72
         }
73 73
         if (!$this->checkAccess()) {
74 74
             Tools::redirect($this->access->getDeniedRedirect(), 'У вас нет прав доступа');
75 75
         }
76 76
         $this->run = true;
77
-        call_user_func_array([$this, $this->method . 'Action'], $this->params);
77
+        call_user_func_array([$this, $this->method.'Action'], $this->params);
78 78
     }
79 79
 
80 80
     /**
Please login to merge, or discard this patch.
system/Inji/Log.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -83,22 +83,22 @@
 block discarded – undo
83 83
                     $log['end'] = microtime(true);
84 84
                 if (empty($log['start']))
85 85
                     $log['start'] = microtime(true);
86
-                echo "<tr><td>{$log['name']}</td><td" . (round(($log['end'] - $log['start']), 5) > 0.1 ? ' class ="danger"' : '') . ">" . round(($log['end'] - $log['start']), 5) . "</td></tr>";
86
+                echo "<tr><td>{$log['name']}</td><td".(round(($log['end'] - $log['start']), 5) > 0.1 ? ' class ="danger"' : '').">".round(($log['end'] - $log['start']), 5)."</td></tr>";
87 87
             }
88 88
         }
89
-        echo '<tr><th>Summary</th><th>' . round(( microtime(true) - $this->startTime), 5) . '</th></tr>';
90
-        echo '<tr><th>Memory</th><th>' . $this->convertSize(memory_get_peak_usage()) . ' of ' . ini_get('memory_limit') . '</th></tr></table></div>';
89
+        echo '<tr><th>Summary</th><th>'.round((microtime(true) - $this->startTime), 5).'</th></tr>';
90
+        echo '<tr><th>Memory</th><th>'.$this->convertSize(memory_get_peak_usage()).' of '.ini_get('memory_limit').'</th></tr></table></div>';
91 91
     }
92 92
 
93 93
     public function convertSize($size)
94 94
     {
95 95
 
96 96
         if ($size < 1024)
97
-            return $size . "B";
97
+            return $size."B";
98 98
         elseif ($size < 1048576)
99
-            return round($size / 1024, 2) . "KB";
99
+            return round($size / 1024, 2)."KB";
100 100
         else
101
-            return round($size / 1048576, 2) . "MB";
101
+            return round($size / 1048576, 2)."MB";
102 102
     }
103 103
 
104 104
     public function __destruct()
Please login to merge, or discard this patch.
system/Inji/Cache.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             }
65 65
             return false;
66 66
         }
67
-        $val = @self::$server->get($name . serialize($params));
67
+        $val = @self::$server->get($name.serialize($params));
68 68
         if ($val !== false) {
69 69
             return $val;
70 70
         } else {
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             self::connect();
93 93
         }
94 94
         if (self::$connected) {
95
-            return @self::$server->set($name . serialize($params), $val, false, $lifeTime);
95
+            return @self::$server->set($name.serialize($params), $val, false, $lifeTime);
96 96
         }
97 97
         return false;
98 98
     }
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
         $crop = !empty($options['crop']) ? $options['crop'] : '';
113 113
         $pos = !empty($options['pos']) ? $options['pos'] : 'center';
114 114
         $fileinfo = pathinfo($file);
115
-        $fileCheckSum = md5($fileinfo['dirname'] . filemtime($file));
116
-        $path = static::getDir('static') . '/' . $fileCheckSum . '_' . $fileinfo['filename'];
115
+        $fileCheckSum = md5($fileinfo['dirname'].filemtime($file));
116
+        $path = static::getDir('static').'/'.$fileCheckSum.'_'.$fileinfo['filename'];
117 117
         if ($sizes) {
118
-            $path .= '.' . $sizes['x'] . 'x' . $sizes['y'] . $crop . $pos;
118
+            $path .= '.'.$sizes['x'].'x'.$sizes['y'].$crop.$pos;
119 119
         }
120
-        $path .= '.' . $fileinfo['extension'];
120
+        $path .= '.'.$fileinfo['extension'];
121 121
         if (!file_exists($path)) {
122 122
             copy($file, $path);
123 123
             if ($sizes) {
Please login to merge, or discard this patch.
system/Inji/App.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,8 +71,8 @@
 block discarded – undo
71 71
     {
72 72
         $paths = Module::getModulePaths($moduleName);
73 73
         foreach ($paths as $path) {
74
-            if (file_exists($path . '/' . $moduleName . '.php')) {
75
-                include_once $path . '/' . $moduleName . '.php';
74
+            if (file_exists($path.'/'.$moduleName.'.php')) {
75
+                include_once $path.'/'.$moduleName.'.php';
76 76
                 return $moduleName;
77 77
             }
78 78
         }
Please login to merge, or discard this patch.
system/Inji/Config.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
             return self::$_configs['system'];
29 29
         }
30 30
 
31
-        if (!file_exists(INJI_SYSTEM_DIR . '/config/config.php')) {
31
+        if (!file_exists(INJI_SYSTEM_DIR.'/config/config.php')) {
32 32
             return [];
33 33
         }
34 34
 
35
-        return self::$_configs['system'] = include INJI_SYSTEM_DIR . '/config/config.php';
35
+        return self::$_configs['system'] = include INJI_SYSTEM_DIR.'/config/config.php';
36 36
     }
37 37
 
38 38
     /**
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             return self::$_configs['app'][$app->name];
69 69
         }
70 70
 
71
-        $path = $app->path . "/config/config.php";
71
+        $path = $app->path."/config/config.php";
72 72
         if (!file_exists($path)) {
73 73
             return [];
74 74
         }
@@ -88,16 +88,16 @@  discard block
 block discarded – undo
88 88
             if (isset(self::$_configs['shareModules'][$module])) {
89 89
                 return self::$_configs['shareModules'][$module];
90 90
             }
91
-            $path = INJI_PROGRAM_DIR . "/config/modules/{$module}.php";
91
+            $path = INJI_PROGRAM_DIR."/config/modules/{$module}.php";
92 92
         } else {
93 93
             if (isset(self::$_configs['share'])) {
94 94
                 return self::$_configs['share'];
95 95
             }
96
-            $path = INJI_PROGRAM_DIR . "/config/config.php";
96
+            $path = INJI_PROGRAM_DIR."/config/config.php";
97 97
         }
98 98
         if (!file_exists($path)) {
99
-            if (file_exists(INJI_SYSTEM_DIR . "/modules/{$module}/defaultConfig.php")) {
100
-                $path = INJI_SYSTEM_DIR . "/modules/{$module}/defaultConfig.php";
99
+            if (file_exists(INJI_SYSTEM_DIR."/modules/{$module}/defaultConfig.php")) {
100
+                $path = INJI_SYSTEM_DIR."/modules/{$module}/defaultConfig.php";
101 101
             } else {
102 102
                 return [];
103 103
             }
@@ -136,9 +136,9 @@  discard block
 block discarded – undo
136 136
             return self::$_configs['module'][$appName][$module_name];
137 137
         }
138 138
 
139
-        $path = $appPath . "/config/modules/{$module_name}.php";
139
+        $path = $appPath."/config/modules/{$module_name}.php";
140 140
         if (!file_exists($path)) {
141
-            $path = INJI_SYSTEM_DIR . "/modules/{$module_name}/defaultConfig.php";
141
+            $path = INJI_SYSTEM_DIR."/modules/{$module_name}/defaultConfig.php";
142 142
         }
143 143
 
144 144
 
@@ -163,27 +163,27 @@  discard block
 block discarded – undo
163 163
         }
164 164
         switch ($type) {
165 165
             case 'system':
166
-                $path = INJI_SYSTEM_DIR . '/config/config.php';
166
+                $path = INJI_SYSTEM_DIR.'/config/config.php';
167 167
                 self::$_configs['system'] = $data;
168 168
                 Inji::$inst->event('Config-change-system', $data);
169 169
                 break;
170 170
             case 'app':
171
-                $path = $app->path . "/config/config.php";
171
+                $path = $app->path."/config/config.php";
172 172
                 self::$_configs['app'][$app->name] = $data;
173
-                Inji::$inst->event('Config-change-app-' . $app->name, $data);
173
+                Inji::$inst->event('Config-change-app-'.$app->name, $data);
174 174
                 break;
175 175
             case 'module':
176
-                $path = $app->path . "/config/modules/{$module}.php";
176
+                $path = $app->path."/config/modules/{$module}.php";
177 177
                 self::$_configs['module'][$app->name][$module] = $data;
178
-                Inji::$inst->event('Config-change-module-' . $app->name . '-' . $module, $data);
178
+                Inji::$inst->event('Config-change-module-'.$app->name.'-'.$module, $data);
179 179
                 break;
180 180
             case 'share':
181 181
                 if ($module) {
182
-                    $path = INJI_PROGRAM_DIR . "/config/modules/{$module}.php";
182
+                    $path = INJI_PROGRAM_DIR."/config/modules/{$module}.php";
183 183
                     self::$_configs['shareModules'][$module] = $data;
184
-                    Inji::$inst->event('Config-change-shareModules-' . $module, $data);
184
+                    Inji::$inst->event('Config-change-shareModules-'.$module, $data);
185 185
                 } else {
186
-                    $path = INJI_PROGRAM_DIR . "/config/config.php";
186
+                    $path = INJI_PROGRAM_DIR."/config/config.php";
187 187
                     self::$_configs['share'] = $data;
188 188
                     Inji::$inst->event('Config-change-share', $data);
189 189
                 }
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                 self::$_configs['custom'][$path] = $data;
194 194
                 break;
195 195
         }
196
-        $text = "<?php\nreturn " . CodeGenerator::genArray($data);
196
+        $text = "<?php\nreturn ".CodeGenerator::genArray($data);
197 197
         Tools::createDir(substr($path, 0, strripos($path, '/')));
198 198
         file_put_contents($path, $text);
199 199
     }
Please login to merge, or discard this patch.
system/Inji/UserRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         if ($type == 'array') {
19 19
             return !is_array($_GET[$key]) ? [] : $_GET[$key];
20 20
         }
21
-        return eval('return (' . $type . ') $_GET[$key];');
21
+        return eval('return ('.$type.') $_GET[$key];');
22 22
     }
23 23
 
24 24
 }
Please login to merge, or discard this patch.
system/Inji/Value.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
                 $month = array('января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря');
39 39
                 $yearPosrfix = isset($options['yearPostfix']) ? $options['yearPostfix'] : " г.";
40
-                return ($dd > 0 ? $dd . " " : '') . $month[$mm - 1] . " " . $yy . $yearPosrfix . (empty($options['notime']) ? " " . $hours : '');
40
+                return ($dd > 0 ? $dd." " : '').$month[$mm - 1]." ".$yy.$yearPosrfix.(empty($options['notime']) ? " ".$hours : '');
41 41
             case 'select':
42 42
                 switch ($colInfo['colParams']['source']) {
43 43
                     case 'model':
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             case 'image':
65 65
                 $file = Files\File::get($this->model->{$this->valueKey});
66 66
                 if ($file) {
67
-                    return '<img src="' . $file->path . '?resize=60x120" />';
67
+                    return '<img src="'.$file->path.'?resize=60x120" />';
68 68
                 } else {
69 69
                     return '<img src="/static/system/images/no-image.png?resize=60x120" />';
70 70
                 }
Please login to merge, or discard this patch.
system/Inji/Inji.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
     public function listen($eventName, $listenCode, $callback, $save = false)
50 50
     {
51 51
         if ($save) {
52
-            $config = Config::custom(App::$primary->path . '/config/events.php');
52
+            $config = Config::custom(App::$primary->path.'/config/events.php');
53 53
             $config[$eventName][$listenCode] = serialize($callback);
54
-            Config::save(App::$primary->path . '/config/events.php', $config);
54
+            Config::save(App::$primary->path.'/config/events.php', $config);
55 55
         } else {
56 56
             $this->_listeners[$eventName][$listenCode] = $callback;
57 57
         }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         if (!empty($this->_listeners[$eventName])) {
76 76
             $listeners = $this->_listeners[$eventName];
77 77
         }
78
-        $config = Config::custom(App::$primary->path . '/config/events.php');
78
+        $config = Config::custom(App::$primary->path.'/config/events.php');
79 79
         if (!empty($config[$eventName])) {
80 80
             foreach ($config[$eventName] as $listenCode => $callback) {
81 81
                 $listeners[$listenCode] = (@unserialize($callback) !== false) ? unserialize($callback) : $callback;
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
     public function unlisten($eventName, $listenCode, $save = false)
111 111
     {
112 112
         if ($save) {
113
-            $config = Config::custom(App::$primary->path . '/config/events.php');
113
+            $config = Config::custom(App::$primary->path.'/config/events.php');
114 114
             if (!empty($config[$eventName][$listenCode])) {
115 115
                 unset($config[$eventName][$listenCode]);
116
-                Config::save(App::$primary->path . '/config/events.php', $config);
116
+                Config::save(App::$primary->path.'/config/events.php', $config);
117 117
             }
118 118
         }
119 119
         if (!empty($this->_listeners[$eventName][$listenCode])) {
Please login to merge, or discard this patch.