Completed
Push — master ( bb267d...fbe197 )
by Alexey
05:29
created
system/modules/Materials/appControllers/MaterialsController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
         } else {
98 98
             $this->view->setTitle($category->name);
99 99
 
100
-            $pages = new Ui\Pages($_GET, ['count' => Materials\Material::getCount(['where' => ['tree_path', $category->tree_path . $category->id . '/%', 'LIKE']]), 'limit' => 10]);
101
-            $materials = Materials\Material::getList(['where' => ['tree_path', $category->tree_path . $category->id . '/%', 'LIKE'], 'order' => ['date_create', 'desc'], 'start' => $pages->params['start'], 'limit' => $pages->params['limit']]);
100
+            $pages = new Ui\Pages($_GET, ['count' => Materials\Material::getCount(['where' => ['tree_path', $category->tree_path.$category->id.'/%', 'LIKE']]), 'limit' => 10]);
101
+            $materials = Materials\Material::getList(['where' => ['tree_path', $category->tree_path.$category->id.'/%', 'LIKE'], 'order' => ['date_create', 'desc'], 'start' => $pages->params['start'], 'limit' => $pages->params['limit']]);
102 102
 
103 103
             $this->view->page(['page' => $category->resolveTemplate(), 'content' => $category->resolveViewer(), 'data' => compact('materials', 'pages', 'category')]);
104 104
         }
@@ -132,17 +132,17 @@  discard block
 block discarded – undo
132 132
             $this->view->addMetaTag(['name' => 'description', 'content' => $material->description]);
133 133
         }
134 134
         $this->view->addMetaTag(['property' => 'og:title', 'content' => $material->name]);
135
-        $this->view->addMetaTag(['property' => 'og:url', 'content' => 'http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/' . $material->alias]);
135
+        $this->view->addMetaTag(['property' => 'og:url', 'content' => 'http://'.idn_to_utf8(INJI_DOMAIN_NAME).'/'.$material->alias]);
136 136
         if ($material->description) {
137
-            $this->view->addMetaTag(['property' => 'og:description', 'content' => 'http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/' . $material->description]);
137
+            $this->view->addMetaTag(['property' => 'og:description', 'content' => 'http://'.idn_to_utf8(INJI_DOMAIN_NAME).'/'.$material->description]);
138 138
         }
139 139
         if ($material->image) {
140
-            $this->view->addMetaTag(['property' => 'og:image', 'content' => 'http://' . idn_to_utf8(INJI_DOMAIN_NAME) . $material->image->path]);
140
+            $this->view->addMetaTag(['property' => 'og:image', 'content' => 'http://'.idn_to_utf8(INJI_DOMAIN_NAME).$material->image->path]);
141 141
         } elseif ($logo = Files\File::get('site_logo', 'code')) {
142
-            $this->view->addMetaTag(['property' => 'og:image', 'content' => 'http://' . idn_to_utf8(INJI_DOMAIN_NAME) . $logo->path]);
142
+            $this->view->addMetaTag(['property' => 'og:image', 'content' => 'http://'.idn_to_utf8(INJI_DOMAIN_NAME).$logo->path]);
143 143
         }
144 144
         $this->view->setTitle($material->name);
145
-        $bread[] = ['text' => $material->name, 'href' => '/' . $material->alias];
145
+        $bread[] = ['text' => $material->name, 'href' => '/'.$material->alias];
146 146
         $this->view->page([
147 147
             'page' => $material->resolveTemplate(),
148 148
             'content' => $material->resolveViewer(),
Please login to merge, or discard this patch.
system/modules/Materials/Materials.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
         if (!empty($conf['files']['aditionTemplateFiels'])) {
42 42
             foreach ($conf['files']['aditionTemplateFiels'] as $file) {
43
-                $return[$file['file']] = '- ' . $file['name'];
43
+                $return[$file['file']] = '- '.$file['name'];
44 44
             }
45 45
         }
46 46
         return $return;
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
         if (!empty($conf['files']['aditionTemplateFiels'])) {
78 78
             foreach ($conf['files']['aditionTemplateFiels'] as $file) {
79
-                $return[$file['file']] = '- ' . $file['name'];
79
+                $return[$file['file']] = '- '.$file['name'];
80 80
             }
81 81
         }
82 82
         return $return;
Please login to merge, or discard this patch.
system/objects/CodeGenerator/Property.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,13 +20,13 @@
 block discarded – undo
20 20
 
21 21
     public function generate()
22 22
     {
23
-        $code = $this->security . ' ';
23
+        $code = $this->security.' ';
24 24
         $code .= $this->static ? 'static ' : '';
25
-        $code .= '$' . $this->name . ' = ';
25
+        $code .= '$'.$this->name.' = ';
26 26
         if (is_array($this->value)) {
27 27
             $code .= \CodeGenerator::genArray($this->value);
28 28
         } else {
29
-            $code .= '"' . str_replace('"', '\"', $this->value) . '";';
29
+            $code .= '"'.str_replace('"', '\"', $this->value).'";';
30 30
         }
31 31
         return $code;
32 32
     }
Please login to merge, or discard this patch.
system/objects/CodeGenerator/Method.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@
 block discarded – undo
21 21
 
22 22
     public function generate()
23 23
     {
24
-        $code = $this->security . ' ';
24
+        $code = $this->security.' ';
25 25
         $code .= $this->static ? 'static ' : '';
26
-        $code .= 'function ' . $this->name . '(';
26
+        $code .= 'function '.$this->name.'(';
27 27
         foreach ($this->propertys as $param) {
28
-            $code .= '$' . $param . ',';
28
+            $code .= '$'.$param.',';
29 29
         }
30 30
         $code = rtrim($code, ',');
31
-        $code.= ") {\n";
32
-        $code.= '    ' . str_replace("\n", "\n    ", $this->body);
33
-        $code .="\n}";
31
+        $code .= ") {\n";
32
+        $code .= '    '.str_replace("\n", "\n    ", $this->body);
33
+        $code .= "\n}";
34 34
         return $code;
35 35
     }
36 36
 
Please login to merge, or discard this patch.
system/objects/CodeGenerator/ClassGenerator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,16 +39,16 @@
 block discarded – undo
39 39
 
40 40
     public function generate()
41 41
     {
42
-        $code = 'class ' . $this->name . ' ';
42
+        $code = 'class '.$this->name.' ';
43 43
         if ($this->extends) {
44
-            $code .= 'extends ' . $this->extends . ' ';
44
+            $code .= 'extends '.$this->extends.' ';
45 45
         }
46 46
         $code .= "{\n";
47 47
         foreach ($this->propertys as $property) {
48
-            $code .= '    ' . str_replace("\n", "\n    ", $property->generate()) . "\n";
48
+            $code .= '    '.str_replace("\n", "\n    ", $property->generate())."\n";
49 49
         }
50 50
         foreach ($this->methods as $method) {
51
-            $code .= '    ' . str_replace("\n", "\n    ", $method->generate()) . "\n";
51
+            $code .= '    '.str_replace("\n", "\n    ", $method->generate())."\n";
52 52
         }
53 53
         $code .= "}\n";
54 54
         return $code;
Please login to merge, or discard this patch.
system/objects/CodeGenerator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,17 +16,17 @@
 block discarded – undo
16 16
         if ($level == 0)
17 17
             $return = "[";
18 18
         foreach ($data as $key => $item) {
19
-            $return .= "\n" . str_repeat(' ', ( $level * 4 + 4)) . "'{$key}' => ";
19
+            $return .= "\n".str_repeat(' ', ($level * 4 + 4))."'{$key}' => ";
20 20
             if (!is_array($item))
21 21
                 $return .= "'{$item}',";
22 22
             else {
23 23
                 $return .= "[";
24 24
                 $return .= rtrim(self::genArray($item, $level + 1), ',');
25
-                $return .= "\n" . str_repeat(' ', ( $level * 4 + 4)) . "],";
25
+                $return .= "\n".str_repeat(' ', ($level * 4 + 4))."],";
26 26
             }
27 27
         }
28 28
         if ($level == 0)
29
-            $return = rtrim($return, ',') . "\n];";
29
+            $return = rtrim($return, ',')."\n];";
30 30
 
31 31
         return $return;
32 32
     }
Please login to merge, or discard this patch.
system/init.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
 define('INJI_DOMAIN_NAME', $_SERVER['SERVER_NAME']);
14 14
 
15 15
 spl_autoload_register(function($class_name) {
16
-    if (file_exists(INJI_SYSTEM_DIR . '/Inji/' . $class_name . '.php')) {
17
-        include_once INJI_SYSTEM_DIR . '/Inji/' . $class_name . '.php';
16
+    if (file_exists(INJI_SYSTEM_DIR.'/Inji/'.$class_name.'.php')) {
17
+        include_once INJI_SYSTEM_DIR.'/Inji/'.$class_name.'.php';
18 18
     }
19 19
 });
20 20
 
@@ -49,39 +49,39 @@  discard block
 block discarded – undo
49 49
 $params = Tools::uriParse($_SERVER['REQUEST_URI']);
50 50
 
51 51
 App::$cur->type = 'app';
52
-App::$cur->path = INJI_PROGRAM_DIR . '/' . App::$cur->dir;
52
+App::$cur->path = INJI_PROGRAM_DIR.'/'.App::$cur->dir;
53 53
 App::$cur->params = $params;
54 54
 App::$cur->config = Config::app(App::$cur);
55 55
 App::$primary = App::$cur;
56 56
 
57
-if (!empty($params[0]) && file_exists(INJI_SYSTEM_DIR . '/program/' . $params[0] . '/')) {
57
+if (!empty($params[0]) && file_exists(INJI_SYSTEM_DIR.'/program/'.$params[0].'/')) {
58 58
 
59 59
     App::$primary->params = [];
60 60
 
61 61
     App::$cur = new App();
62 62
     App::$cur->name = $params[0];
63 63
     App::$cur->system = true;
64
-    App::$cur->staticPath = "/" . App::$cur->name . "/static";
65
-    App::$cur->templatesPath = "/" . App::$cur->name . "/static/templates";
66
-    App::$cur->path = INJI_SYSTEM_DIR . '/program/' . App::$cur->name;
67
-    App::$cur->type = 'app' . ucfirst(strtolower(App::$cur->name));
64
+    App::$cur->staticPath = "/".App::$cur->name."/static";
65
+    App::$cur->templatesPath = "/".App::$cur->name."/static/templates";
66
+    App::$cur->path = INJI_SYSTEM_DIR.'/program/'.App::$cur->name;
67
+    App::$cur->type = 'app'.ucfirst(strtolower(App::$cur->name));
68 68
     App::$cur->installed = true;
69 69
     App::$cur->params = array_slice($params, 1);
70 70
     App::$cur->config = Config::app(App::$cur);
71 71
 
72
-    Inji::$inst->listen('Config-change-app-' . App::$primary->name, 'primaryAppConfig', function($event) {
72
+    Inji::$inst->listen('Config-change-app-'.App::$primary->name, 'primaryAppConfig', function($event) {
73 73
         App::$primary->config = $event['eventObject'];
74 74
     });
75 75
 }
76
-Inji::$inst->listen('Config-change-app-' . App::$cur->name, 'curAppConfig', function($event) {
76
+Inji::$inst->listen('Config-change-app-'.App::$cur->name, 'curAppConfig', function($event) {
77 77
     App::$cur->config = $event['eventObject'];
78 78
 });
79 79
 $shareConfig = Config::share();
80 80
 if (empty($shareConfig['installed']) && App::$cur->name != 'setup' && (empty(App::$cur->params[0]) || App::$cur->params[0] != 'static')) {
81 81
     Tools::redirect('/setup');
82 82
 }
83
-putenv('COMPOSER_HOME=' . getcwd());
84
-putenv('COMPOSER_CACHE_DIR=' . getcwd() . DIRECTORY_SEPARATOR . 'composerCache');
83
+putenv('COMPOSER_HOME='.getcwd());
84
+putenv('COMPOSER_CACHE_DIR='.getcwd().DIRECTORY_SEPARATOR.'composerCache');
85 85
 ComposerCmd::check();
86 86
 if (!function_exists('idn_to_utf8')) {
87 87
     ComposerCmd::requirePackage("mabrahamde/idna-converter", "dev-master", './');
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
 if (file_exists('vendor/autoload.php')) {
98 98
     include_once 'vendor/autoload.php';
99 99
 }
100
-if (file_exists(App::$primary->path . '/vendor/autoload.php')) {
101
-    include_once App::$primary->path . '/vendor/autoload.php';
100
+if (file_exists(App::$primary->path.'/vendor/autoload.php')) {
101
+    include_once App::$primary->path.'/vendor/autoload.php';
102 102
 }
103 103
 Module::$cur = Module::resolveModule(App::$cur);
104 104
 
Please login to merge, or discard this patch.
system/Inji/ComposerCmd.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
             ;
20 20
             self::initComposer('./');
21 21
         }
22
-        if (!file_exists(App::$primary->path . '/vendor/autoload.php')) {
22
+        if (!file_exists(App::$primary->path.'/vendor/autoload.php')) {
23 23
             self::initComposer();
24 24
         }
25 25
     }
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
             if (!file_exists('composer/composer.phar')) {
32 32
                 file_put_contents('composer/composerInstall.php', file_get_contents('https://getcomposer.org/installer'));
33 33
                 $argv = ['install', '--install-dir', 'composer/'];
34
-                header("Location: " . filter_input(INPUT_SERVER, 'REQUEST_URI'));
34
+                header("Location: ".filter_input(INPUT_SERVER, 'REQUEST_URI'));
35 35
                 include_once 'composer/composerInstall.php';
36 36
             }
37 37
             $composer = new Phar('composer/composer.phar');
@@ -42,18 +42,18 @@  discard block
 block discarded – undo
42 42
     public static function initComposer($path = '')
43 43
     {
44 44
         if (!$path) {
45
-            $path = App::$primary->path . '/';
45
+            $path = App::$primary->path.'/';
46 46
         }
47
-        if (!file_exists($path . 'composer.json')) {
47
+        if (!file_exists($path.'composer.json')) {
48 48
             $json = [
49
-                "name" => get_current_user() . "/" . App::$primary->name,
49
+                "name" => get_current_user()."/".App::$primary->name,
50 50
                 "config" => [
51 51
                     "cache-dir" => "./composerCache/"
52 52
                 ],
53 53
                 "authors" => [
54 54
                     [
55 55
                         "name" => get_current_user(),
56
-                        "email" => get_current_user() . "@" . INJI_DOMAIN_NAME
56
+                        "email" => get_current_user()."@".INJI_DOMAIN_NAME
57 57
                     ]
58 58
                 ],
59 59
                 "require" => [
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
                 ]
62 62
             ];
63 63
             Tools::createDir($path);
64
-            file_put_contents($path . 'composer.json', json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
64
+            file_put_contents($path.'composer.json', json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
65 65
         }
66 66
         self::command('install', false, $path);
67 67
     }
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
         } else {
75 75
             $output = null;
76 76
         }
77
-        $path = str_replace('\\', '/', $path === null ? App::$primary->path . '/' : $path);
78
-        $input = new Symfony\Component\Console\Input\StringInput($command . ' -d ' . $path);
77
+        $path = str_replace('\\', '/', $path === null ? App::$primary->path.'/' : $path);
78
+        $input = new Symfony\Component\Console\Input\StringInput($command.' -d '.$path);
79 79
         $app = new Composer\Console\Application();
80 80
         $app->setAutoExit(false);
81 81
         $dir = getcwd();
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
     public static function requirePackage($packageName, $version = '', $path = '')
87 87
     {
88 88
         if (!$path) {
89
-            $path = App::$primary->path . '/';
89
+            $path = App::$primary->path.'/';
90 90
         }
91
-        if (file_exists($path . 'composer.lock')) {
92
-            $lockFile = json_decode(file_get_contents($path . 'composer.lock'), true);
91
+        if (file_exists($path.'composer.lock')) {
92
+            $lockFile = json_decode(file_get_contents($path.'composer.lock'), true);
93 93
         }
94 94
         if (!empty($lockFile['packages'])) {
95 95
             foreach ($lockFile['packages'] as $package) {
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             }
100 100
         }
101 101
 
102
-        ComposerCmd::command('require ' . $packageName . ($version ? ':' . $version : ''), false, $path);
102
+        ComposerCmd::command('require '.$packageName.($version ? ':'.$version : ''), false, $path);
103 103
         return true;
104 104
     }
105 105
 
Please login to merge, or discard this patch.
system/Inji/Statics.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
             $options['pos'] = $resizePos;
40 40
             $path = Cache::file($absolutePath, $options);
41 41
             $path = $convet ? mb_convert_encoding($path, 'UTF-8', 'Windows-1251') : $path;
42
-            return '/' . $path;
42
+            return '/'.$path;
43 43
         }
44 44
     }
45 45
 
Please login to merge, or discard this patch.