@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | protected function initialize(InputInterface $input, OutputInterface $output) |
86 | 86 | { |
87 | - $this->tmplDir = __DIR__ . '/../../../tmpl'; |
|
87 | + $this->tmplDir = __DIR__.'/../../../tmpl'; |
|
88 | 88 | $this->questionHelper = $this->getHelper('question'); |
89 | 89 | |
90 | 90 | parent::initialize($input, $output); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $this->createEnvironmentsDir($input, $output); |
101 | 101 | $this->createConfiguration($input, $output); |
102 | 102 | |
103 | - $output->writeln('<info>' . static::COMPLETED_LOGO . '</info>'); |
|
103 | + $output->writeln('<info>'.static::COMPLETED_LOGO.'</info>'); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -111,15 +111,15 @@ discard block |
||
111 | 111 | */ |
112 | 112 | protected function createEnvironmentsDir(InputInterface $input, OutputInterface $output) |
113 | 113 | { |
114 | - $targetDir = getcwd() . '/' . $this->envDir; |
|
115 | - $tmplDir = $this->tmplDir . '/environments'; |
|
114 | + $targetDir = getcwd().'/'.$this->envDir; |
|
115 | + $tmplDir = $this->tmplDir.'/environments'; |
|
116 | 116 | |
117 | 117 | $output->writeln(' - Environment settings'); |
118 | 118 | |
119 | 119 | if (file_exists($targetDir)) |
120 | 120 | { |
121 | 121 | $question = new ConfirmationQuestion( |
122 | - ' <error>Directory ' . $targetDir . ' already exists</error>' . PHP_EOL |
|
122 | + ' <error>Directory '.$targetDir.' already exists</error>'.PHP_EOL |
|
123 | 123 | . ' <info>Overwrite? [Y/n]</info> ', |
124 | 124 | true, |
125 | 125 | '/^(y|j)/i' |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | |
138 | 138 | foreach ($iterator as $item) |
139 | 139 | { |
140 | - $itemPath = $targetDir . '/' . $iterator->getSubPathName(); |
|
140 | + $itemPath = $targetDir.'/'.$iterator->getSubPathName(); |
|
141 | 141 | |
142 | 142 | if ($item->isDir()) |
143 | 143 | { |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | } |
150 | 150 | } |
151 | 151 | |
152 | - $output->writeln(' Created directory settings of environments: <comment>' . $targetDir . '</comment>'); |
|
152 | + $output->writeln(' Created directory settings of environments: <comment>'.$targetDir.'</comment>'); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |
@@ -160,14 +160,14 @@ discard block |
||
160 | 160 | */ |
161 | 161 | protected function createConfiguration(InputInterface $input, OutputInterface $output) |
162 | 162 | { |
163 | - $path = $this->getApplication()->getRoot() . '/.jedi.php'; |
|
163 | + $path = $this->getApplication()->getRoot().'/.jedi.php'; |
|
164 | 164 | |
165 | 165 | $output->writeln(' - Configuration'); |
166 | 166 | |
167 | 167 | if (file_exists($path)) |
168 | 168 | { |
169 | 169 | $question = new ConfirmationQuestion( |
170 | - ' <error>Configuration file ' . $path . ' already exists</error>' . PHP_EOL |
|
170 | + ' <error>Configuration file '.$path.' already exists</error>'.PHP_EOL |
|
171 | 171 | . ' <info>Overwrite? [Y/n]</info> ', |
172 | 172 | true, |
173 | 173 | '/^(y|j)/i' |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | $question = new Question(' <info>Enter path to web directory relative to ('.getcwd().'):</info> '); |
183 | - $question->setValidator(function ($answer) { |
|
183 | + $question->setValidator(function($answer) { |
|
184 | 184 | /*if (!is_dir($answer)) |
185 | 185 | { |
186 | 186 | throw new \RuntimeException('Directory "' . $answer . '" is missing'); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $webDir = $this->questionHelper->ask($input, $output, $question); |
192 | 192 | |
193 | 193 | $fs = new Filesystem(); |
194 | - $content = file_get_contents($this->tmplDir . '/.jedi.php'); |
|
194 | + $content = file_get_contents($this->tmplDir.'/.jedi.php'); |
|
195 | 195 | $content = str_replace( |
196 | 196 | ['%web-dir%', '%env-dir%'], |
197 | 197 | [addslashes($webDir), addslashes($this->envDir)], |
@@ -199,6 +199,6 @@ discard block |
||
199 | 199 | ); |
200 | 200 | $fs->dumpFile($path, $content); |
201 | 201 | |
202 | - $output->writeln(' Created configuration file of application <comment>' . $path . '</comment>'); |
|
202 | + $output->writeln(' Created configuration file of application <comment>'.$path.'</comment>'); |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | \ No newline at end of file |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | if ($this->getConfiguration() === null) |
110 | 110 | { |
111 | - $output->writeln(PHP_EOL . '<error>No configuration loaded.</error> ' |
|
111 | + $output->writeln(PHP_EOL.'<error>No configuration loaded.</error> ' |
|
112 | 112 | . 'Please run <info>init</info> command first'); |
113 | 113 | } |
114 | 114 | else |
@@ -116,18 +116,18 @@ discard block |
||
116 | 116 | switch ($this->getBitrixStatus()) |
117 | 117 | { |
118 | 118 | case static::BITRIX_STATUS_UNAVAILABLE: |
119 | - $output->writeln(PHP_EOL . sprintf('<error>No Bitrix kernel found in %s.</error> ' |
|
119 | + $output->writeln(PHP_EOL.sprintf('<error>No Bitrix kernel found in %s.</error> ' |
|
120 | 120 | . 'Please run <info>env:init</info> command to configure', $this->getDocumentRoot())); |
121 | 121 | break; |
122 | 122 | |
123 | 123 | case static::BITRIX_STATUS_NO_DB_CONNECTION: |
124 | - $output->writeln(PHP_EOL . '<error>Bitrix database connection is unavailable.</error>'); |
|
124 | + $output->writeln(PHP_EOL.'<error>Bitrix database connection is unavailable.</error>'); |
|
125 | 125 | break; |
126 | 126 | |
127 | 127 | case static::BITRIX_STATUS_COMPLETE: |
128 | 128 | if ($this->getCommandName($input) === null) |
129 | 129 | { |
130 | - $output->writeln(PHP_EOL . sprintf('Using Bitrix <info>kernel v%s</info>.</info>', SM_VERSION), |
|
130 | + $output->writeln(PHP_EOL.sprintf('Using Bitrix <info>kernel v%s</info>.</info>', SM_VERSION), |
|
131 | 131 | OutputInterface::VERBOSITY_VERY_VERBOSE); |
132 | 132 | } |
133 | 133 | break; |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | foreach (ModuleManager::getInstalledModules() as $module) |
181 | 181 | { |
182 | - $cliFile = getLocalPath('modules/' . $module['ID'] . '/cli.php'); |
|
182 | + $cliFile = getLocalPath('modules/'.$module['ID'].'/cli.php'); |
|
183 | 183 | |
184 | 184 | if ($cliFile === false) |
185 | 185 | { |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | continue; |
191 | 191 | } |
192 | 192 | |
193 | - $config = include_once $this->getDocumentRoot() . $cliFile; |
|
193 | + $config = include_once $this->getDocumentRoot().$cliFile; |
|
194 | 194 | |
195 | 195 | if (isset($config['commands']) && is_array($config['commands'])) |
196 | 196 | { |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | |
222 | 222 | if (!is_array($this->configuration)) |
223 | 223 | { |
224 | - throw new ConfigurationException('Configuration file ' . $path . ' must return an array'); |
|
224 | + throw new ConfigurationException('Configuration file '.$path.' must return an array'); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | //TODO-fox: Проверка на указание в качестве относительного пути / |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | } |
237 | 237 | else |
238 | 238 | { |
239 | - $this->setDocumentRoot($this->getRoot() . '/' . $this->configuration['web-dir']); |
|
239 | + $this->setDocumentRoot($this->getRoot().'/'.$this->configuration['web-dir']); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | if (!is_dir($_SERVER['DOCUMENT_ROOT'])) |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | /** @noinspection PhpUnusedLocalVariableInspection */ |
288 | 288 | $DB, $DBType, $DBHost, $DBLogin, $DBPassword, $DBName, $DBDebug, $DBDebugToFile, $APPLICATION, $USER, $DBSQLServerType; |
289 | 289 | |
290 | - require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php'; |
|
290 | + require_once $_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_before.php'; |
|
291 | 291 | |
292 | 292 | if (defined('B_PROLOG_INCLUDED') && B_PROLOG_INCLUDED === true) |
293 | 293 | { |
@@ -310,8 +310,8 @@ discard block |
||
310 | 310 | public function checkBitrix() |
311 | 311 | { |
312 | 312 | if ( |
313 | - !is_file($_SERVER['DOCUMENT_ROOT'] . '/bitrix/.settings.php') |
|
314 | - && !is_file($_SERVER['DOCUMENT_ROOT'] . '/bitrix/.settings_extra.php') |
|
313 | + !is_file($_SERVER['DOCUMENT_ROOT'].'/bitrix/.settings.php') |
|
314 | + && !is_file($_SERVER['DOCUMENT_ROOT'].'/bitrix/.settings_extra.php') |
|
315 | 315 | ) |
316 | 316 | { |
317 | 317 | return false; |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | |
358 | 358 | $this->initializeBitrix(); |
359 | 359 | |
360 | - spl_autoload_register(function ($className) { |
|
360 | + spl_autoload_register(function($className) { |
|
361 | 361 | $file = ltrim($className, "\\"); |
362 | 362 | $file = strtr($file, Loader::ALPHA_UPPER, Loader::ALPHA_LOWER); |
363 | 363 | $file = str_replace('\\', '/', $file); |
@@ -382,18 +382,18 @@ discard block |
||
382 | 382 | return false; |
383 | 383 | } |
384 | 384 | |
385 | - $module = array_shift($arFile) . '.' . array_shift($arFile); |
|
385 | + $module = array_shift($arFile).'.'.array_shift($arFile); |
|
386 | 386 | |
387 | 387 | if (!Loader::includeModule($module)) |
388 | 388 | { |
389 | 389 | return false; |
390 | 390 | } |
391 | 391 | |
392 | - $path = getLocalPath('/modules/' . $module . '/' . implode('/', $arFile) . '.php'); |
|
392 | + $path = getLocalPath('/modules/'.$module.'/'.implode('/', $arFile).'.php'); |
|
393 | 393 | |
394 | 394 | if ($path !== false) |
395 | 395 | { |
396 | - include_once $this->getDocumentRoot() . $path; |
|
396 | + include_once $this->getDocumentRoot().$path; |
|
397 | 397 | } |
398 | 398 | }); |
399 | 399 | } |
@@ -110,8 +110,7 @@ discard block |
||
110 | 110 | { |
111 | 111 | $output->writeln(PHP_EOL . '<error>No configuration loaded.</error> ' |
112 | 112 | . 'Please run <info>init</info> command first'); |
113 | - } |
|
114 | - else |
|
113 | + } else |
|
115 | 114 | { |
116 | 115 | switch ($this->getBitrixStatus()) |
117 | 116 | { |
@@ -184,8 +183,7 @@ discard block |
||
184 | 183 | if ($cliFile === false) |
185 | 184 | { |
186 | 185 | continue; |
187 | - } |
|
188 | - elseif (!Loader::includeModule($module['ID'])) |
|
186 | + } elseif (!Loader::includeModule($module['ID'])) |
|
189 | 187 | { |
190 | 188 | continue; |
191 | 189 | } |
@@ -225,16 +223,16 @@ discard block |
||
225 | 223 | } |
226 | 224 | |
227 | 225 | //TODO-fox: Проверка на указание в качестве относительного пути / |
228 | - if ($this->configuration['web-dir'] == '/') |
|
229 | - $this->configuration['web-dir'] = ''; |
|
226 | + if ($this->configuration['web-dir'] == '/') { |
|
227 | + $this->configuration['web-dir'] = ''; |
|
228 | + } |
|
230 | 229 | |
231 | 230 | $filesystem = new Filesystem(); |
232 | 231 | |
233 | 232 | if ($filesystem->isAbsolutePath($this->configuration['web-dir'])) |
234 | 233 | { |
235 | 234 | $this->setDocumentRoot($this->configuration['web-dir']); |
236 | - } |
|
237 | - else |
|
235 | + } else |
|
238 | 236 | { |
239 | 237 | $this->setDocumentRoot($this->getRoot() . '/' . $this->configuration['web-dir']); |
240 | 238 | } |
@@ -267,8 +265,7 @@ discard block |
||
267 | 265 | if ($this->bitrixStatus === static::BITRIX_STATUS_COMPLETE) |
268 | 266 | { |
269 | 267 | return static::BITRIX_STATUS_COMPLETE; |
270 | - } |
|
271 | - elseif (!$this->checkBitrix()) |
|
268 | + } elseif (!$this->checkBitrix()) |
|
272 | 269 | { |
273 | 270 | return static::BITRIX_STATUS_UNAVAILABLE; |
274 | 271 | } |
@@ -293,8 +290,7 @@ discard block |
||
293 | 290 | { |
294 | 291 | $this->bitrixStatus = static::BITRIX_STATUS_COMPLETE; |
295 | 292 | } |
296 | - } |
|
297 | - catch (ConnectionException $e) |
|
293 | + } catch (ConnectionException $e) |
|
298 | 294 | { |
299 | 295 | $this->bitrixStatus = static::BITRIX_STATUS_NO_DB_CONNECTION; |
300 | 296 | } |
@@ -372,12 +368,10 @@ discard block |
||
372 | 368 | if (preg_match("#[^\\\\/a-zA-Z0-9_]#", $file)) |
373 | 369 | { |
374 | 370 | return false; |
375 | - } |
|
376 | - elseif ($arFile[0] === 'bitrix') |
|
371 | + } elseif ($arFile[0] === 'bitrix') |
|
377 | 372 | { |
378 | 373 | return false; |
379 | - } |
|
380 | - elseif ($arFile[2] !== 'tests') |
|
374 | + } elseif ($arFile[2] !== 'tests') |
|
381 | 375 | { |
382 | 376 | return false; |
383 | 377 | } |