@@ -17,24 +17,24 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class UnregisterCommand extends ModuleCommand |
| 19 | 19 | { |
| 20 | - /** |
|
| 21 | - * {@inheritdoc} |
|
| 22 | - */ |
|
| 23 | - protected function configure() |
|
| 24 | - { |
|
| 25 | - parent::configure(); |
|
| 20 | + /** |
|
| 21 | + * {@inheritdoc} |
|
| 22 | + */ |
|
| 23 | + protected function configure() |
|
| 24 | + { |
|
| 25 | + parent::configure(); |
|
| 26 | 26 | |
| 27 | - $this->setName('module:unregister') |
|
| 28 | - ->setDescription('Uninstall module'); |
|
| 29 | - } |
|
| 27 | + $this->setName('module:unregister') |
|
| 28 | + ->setDescription('Uninstall module'); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * {@inheritdoc} |
|
| 33 | - */ |
|
| 34 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 35 | - { |
|
| 36 | - $module = new Module($input->getArgument('module')); |
|
| 37 | - $module->unRegister(); |
|
| 38 | - $output->writeln(sprintf('unregistered <info>%s</info>', $module->getName())); |
|
| 39 | - } |
|
| 31 | + /** |
|
| 32 | + * {@inheritdoc} |
|
| 33 | + */ |
|
| 34 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
| 35 | + { |
|
| 36 | + $module = new Module($input->getArgument('module')); |
|
| 37 | + $module->unRegister(); |
|
| 38 | + $output->writeln(sprintf('unregistered <info>%s</info>', $module->getName())); |
|
| 39 | + } |
|
| 40 | 40 | } |
| 41 | 41 | \ No newline at end of file |
@@ -19,38 +19,38 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | class UpdateCommand extends ModuleCommand |
| 21 | 21 | { |
| 22 | - use CanRestartTrait; |
|
| 22 | + use CanRestartTrait; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * {@inheritdoc} |
|
| 26 | - */ |
|
| 27 | - protected function configure() |
|
| 28 | - { |
|
| 29 | - parent::configure(); |
|
| 24 | + /** |
|
| 25 | + * {@inheritdoc} |
|
| 26 | + */ |
|
| 27 | + protected function configure() |
|
| 28 | + { |
|
| 29 | + parent::configure(); |
|
| 30 | 30 | |
| 31 | - $this->setName('module:update') |
|
| 32 | - ->setDescription('Load module updates from Marketplace') |
|
| 33 | - ->addOption('beta', 'b', InputOption::VALUE_NONE, 'Allow the installation of beta releases'); |
|
| 34 | - } |
|
| 31 | + $this->setName('module:update') |
|
| 32 | + ->setDescription('Load module updates from Marketplace') |
|
| 33 | + ->addOption('beta', 'b', InputOption::VALUE_NONE, 'Allow the installation of beta releases'); |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * {@inheritdoc} |
|
| 38 | - */ |
|
| 39 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 40 | - { |
|
| 41 | - $module = new Module($input->getArgument('module')); |
|
| 42 | - $modulesUpdated = null; |
|
| 43 | - while ($module->update($modulesUpdated)) |
|
| 44 | - { |
|
| 45 | - if (is_array($modulesUpdated)) |
|
| 46 | - { |
|
| 47 | - foreach ($modulesUpdated as $moduleName => $moduleVersion) |
|
| 48 | - { |
|
| 49 | - $output->writeln(sprintf('updated %s to <info>%s</info>', $moduleName, $moduleVersion)); |
|
| 50 | - } |
|
| 51 | - } |
|
| 52 | - return $this->restartScript($input, $output); |
|
| 53 | - } |
|
| 54 | - return 0; |
|
| 55 | - } |
|
| 36 | + /** |
|
| 37 | + * {@inheritdoc} |
|
| 38 | + */ |
|
| 39 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
| 40 | + { |
|
| 41 | + $module = new Module($input->getArgument('module')); |
|
| 42 | + $modulesUpdated = null; |
|
| 43 | + while ($module->update($modulesUpdated)) |
|
| 44 | + { |
|
| 45 | + if (is_array($modulesUpdated)) |
|
| 46 | + { |
|
| 47 | + foreach ($modulesUpdated as $moduleName => $moduleVersion) |
|
| 48 | + { |
|
| 49 | + $output->writeln(sprintf('updated %s to <info>%s</info>', $moduleName, $moduleVersion)); |
|
| 50 | + } |
|
| 51 | + } |
|
| 52 | + return $this->restartScript($input, $output); |
|
| 53 | + } |
|
| 54 | + return 0; |
|
| 55 | + } |
|
| 56 | 56 | } |
| 57 | 57 | \ No newline at end of file |
@@ -17,24 +17,24 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class RemoveCommand extends ModuleCommand |
| 19 | 19 | { |
| 20 | - /** |
|
| 21 | - * {@inheritdoc} |
|
| 22 | - */ |
|
| 23 | - protected function configure() |
|
| 24 | - { |
|
| 25 | - parent::configure(); |
|
| 20 | + /** |
|
| 21 | + * {@inheritdoc} |
|
| 22 | + */ |
|
| 23 | + protected function configure() |
|
| 24 | + { |
|
| 25 | + parent::configure(); |
|
| 26 | 26 | |
| 27 | - $this->setName('module:remove') |
|
| 28 | - ->setDescription('Uninstall and remove module folder from system'); |
|
| 29 | - } |
|
| 27 | + $this->setName('module:remove') |
|
| 28 | + ->setDescription('Uninstall and remove module folder from system'); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * {@inheritdoc} |
|
| 33 | - */ |
|
| 34 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 35 | - { |
|
| 36 | - $module = new Module($input->getArgument('module')); |
|
| 37 | - $module->remove(); |
|
| 38 | - $output->writeln(sprintf('removed <info>%s</info>', $module->getName())); |
|
| 39 | - } |
|
| 31 | + /** |
|
| 32 | + * {@inheritdoc} |
|
| 33 | + */ |
|
| 34 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
| 35 | + { |
|
| 36 | + $module = new Module($input->getArgument('module')); |
|
| 37 | + $module->remove(); |
|
| 38 | + $output->writeln(sprintf('removed <info>%s</info>', $module->getName())); |
|
| 39 | + } |
|
| 40 | 40 | } |
| 41 | 41 | \ No newline at end of file |
@@ -36,11 +36,11 @@ |
||
| 36 | 36 | throw new ArgumentTypeException('callChain', 'array'); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - $chain .= '->' . $method . '(' . static::convertArgsToString($methodArgs) . ')'; |
|
| 39 | + $chain .= '->'.$method.'('.static::convertArgsToString($methodArgs).')'; |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - return '\\' . $className . '::agent(' . static::convertArgsToString($args) . ')' . $chain . ';'; |
|
| 43 | + return '\\'.$className.'::agent('.static::convertArgsToString($args).')'.$chain.';'; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | protected static function convertArgsToString(array $args) |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | public function setInterval($seconds) |
| 119 | 119 | { |
| 120 | - $this->interval = (int)$seconds; |
|
| 120 | + $this->interval = (int) $seconds; |
|
| 121 | 121 | |
| 122 | 122 | return $this; |
| 123 | 123 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | public function setPeriodically($periodically) |
| 133 | 133 | { |
| 134 | - $this->periodically = (bool)$periodically; |
|
| 134 | + $this->periodically = (bool) $periodically; |
|
| 135 | 135 | |
| 136 | 136 | return $this; |
| 137 | 137 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public function setActive($active) |
| 147 | 147 | { |
| 148 | - $this->active = (bool)$active; |
|
| 148 | + $this->active = (bool) $active; |
|
| 149 | 149 | |
| 150 | 150 | return $this; |
| 151 | 151 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | public function setSort($sort) |
| 175 | 175 | { |
| 176 | - $this->sort = (int)$sort; |
|
| 176 | + $this->sort = (int) $sort; |
|
| 177 | 177 | |
| 178 | 178 | return $this; |
| 179 | 179 | } |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | public function setUserId($userId) |
| 189 | 189 | { |
| 190 | - $this->userId = (int)$userId; |
|
| 190 | + $this->userId = (int) $userId; |
|
| 191 | 191 | |
| 192 | 192 | return $this; |
| 193 | 193 | } |
@@ -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,14 +111,14 @@ 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 | $question = new ConfirmationQuestion( |
| 121 | - ' <error>Directory ' . $targetDir . ' already exists</error>' . PHP_EOL |
|
| 121 | + ' <error>Directory '.$targetDir.' already exists</error>'.PHP_EOL |
|
| 122 | 122 | . ' <info>Overwrite? [Y/n]</info> ', |
| 123 | 123 | true, |
| 124 | 124 | '/^(y|j)/i' |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $iterator = new \RecursiveIteratorIterator($tmplIterator, \RecursiveIteratorIterator::SELF_FIRST); |
| 135 | 135 | |
| 136 | 136 | foreach ($iterator as $item) { |
| 137 | - $itemPath = $targetDir . '/' . $iterator->getSubPathName(); |
|
| 137 | + $itemPath = $targetDir.'/'.$iterator->getSubPathName(); |
|
| 138 | 138 | |
| 139 | 139 | if ($item->isDir()) { |
| 140 | 140 | $fs->mkdir($itemPath); |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - $output->writeln(' Created directory settings of environments: <comment>' . $targetDir . '</comment>'); |
|
| 146 | + $output->writeln(' Created directory settings of environments: <comment>'.$targetDir.'</comment>'); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |
@@ -154,13 +154,13 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | protected function createConfiguration(InputInterface $input, OutputInterface $output) |
| 156 | 156 | { |
| 157 | - $path = $this->getApplication()->getRoot() . '/.jedi.php'; |
|
| 157 | + $path = $this->getApplication()->getRoot().'/.jedi.php'; |
|
| 158 | 158 | |
| 159 | 159 | $output->writeln(' - Configuration'); |
| 160 | 160 | |
| 161 | 161 | if (file_exists($path)) { |
| 162 | 162 | $question = new ConfirmationQuestion( |
| 163 | - ' <error>Configuration file ' . $path . ' already exists</error>' . PHP_EOL |
|
| 163 | + ' <error>Configuration file '.$path.' already exists</error>'.PHP_EOL |
|
| 164 | 164 | . ' <info>Overwrite? [Y/n]</info> ', |
| 165 | 165 | true, |
| 166 | 166 | '/^(y|j)/i' |
@@ -174,20 +174,20 @@ discard block |
||
| 174 | 174 | $fs = new Filesystem(); |
| 175 | 175 | |
| 176 | 176 | $question = new Question(' <info>Enter path to web directory relative to ' |
| 177 | - . $this->getApplication()->getRoot() . ':</info> ' . PHP_EOL |
|
| 178 | - . ' (or do not specify if you are already in the web directory)' . PHP_EOL); |
|
| 177 | + . $this->getApplication()->getRoot().':</info> '.PHP_EOL |
|
| 178 | + . ' (or do not specify if you are already in the web directory)'.PHP_EOL); |
|
| 179 | 179 | |
| 180 | - $question->setValidator(function ($answer) use ($fs) { |
|
| 180 | + $question->setValidator(function($answer) use ($fs) { |
|
| 181 | 181 | $path = $answer; |
| 182 | 182 | |
| 183 | 183 | if ($answer === null) { |
| 184 | 184 | $path = $this->getApplication()->getRoot(); |
| 185 | 185 | } elseif (!$fs->isAbsolutePath($answer)) { |
| 186 | - $path = $this->getApplication()->getRoot() . '/' . $answer; |
|
| 186 | + $path = $this->getApplication()->getRoot().'/'.$answer; |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | if (!is_dir($path)) { |
| 190 | - throw new \RuntimeException('Directory "' . $path . '" is missing'); |
|
| 190 | + throw new \RuntimeException('Directory "'.$path.'" is missing'); |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | return $answer; |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | |
| 196 | 196 | $webDir = $this->questionHelper->ask($input, $output, $question); |
| 197 | 197 | |
| 198 | - $content = file_get_contents($this->tmplDir . '/.jedi.php'); |
|
| 198 | + $content = file_get_contents($this->tmplDir.'/.jedi.php'); |
|
| 199 | 199 | $content = str_replace( |
| 200 | 200 | ['%web-dir%', '%env-dir%'], |
| 201 | 201 | [addslashes($webDir), addslashes($this->envDir)], |
@@ -203,6 +203,6 @@ discard block |
||
| 203 | 203 | ); |
| 204 | 204 | $fs->dumpFile($path, $content); |
| 205 | 205 | |
| 206 | - $output->writeln(' Created configuration file of application <comment>' . $path . '</comment>'); |
|
| 206 | + $output->writeln(' Created configuration file of application <comment>'.$path.'</comment>'); |
|
| 207 | 207 | } |
| 208 | 208 | } |
| 209 | 209 | \ No newline at end of file |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | if ($ex = $APPLICATION->GetException()) { |
| 39 | - throw new static($message ? $message . ': ' . $ex->GetString() : $ex->GetString()); |
|
| 39 | + throw new static($message ? $message.': '.$ex->GetString() : $ex->GetString()); |
|
| 40 | 40 | } else { |
| 41 | 41 | throw new static($message ? $message : 'Unknown exception'); |
| 42 | 42 | } |
@@ -101,22 +101,22 @@ discard block |
||
| 101 | 101 | $exitCode = parent::doRun($input, $output); |
| 102 | 102 | |
| 103 | 103 | if ($this->getConfiguration() === null) { |
| 104 | - $output->writeln(PHP_EOL . '<error>No configuration loaded.</error> ' |
|
| 104 | + $output->writeln(PHP_EOL.'<error>No configuration loaded.</error> ' |
|
| 105 | 105 | . 'Please run <info>init</info> command first'); |
| 106 | 106 | } else { |
| 107 | 107 | switch ($this->getBitrixStatus()) { |
| 108 | 108 | case static::BITRIX_STATUS_UNAVAILABLE: |
| 109 | - $output->writeln(PHP_EOL . sprintf('<error>No Bitrix kernel found in %s.</error> ' |
|
| 109 | + $output->writeln(PHP_EOL.sprintf('<error>No Bitrix kernel found in %s.</error> ' |
|
| 110 | 110 | . 'Please run <info>env:init</info> command to configure', $this->getDocumentRoot())); |
| 111 | 111 | break; |
| 112 | 112 | |
| 113 | 113 | case static::BITRIX_STATUS_NO_DB_CONNECTION: |
| 114 | - $output->writeln(PHP_EOL . '<error>Bitrix database connection is unavailable.</error>'); |
|
| 114 | + $output->writeln(PHP_EOL.'<error>Bitrix database connection is unavailable.</error>'); |
|
| 115 | 115 | break; |
| 116 | 116 | |
| 117 | 117 | case static::BITRIX_STATUS_COMPLETE: |
| 118 | 118 | if ($this->getCommandName($input) === null) { |
| 119 | - $output->writeln(PHP_EOL . sprintf('Using Bitrix <info>kernel v%s</info>.</info>', SM_VERSION), |
|
| 119 | + $output->writeln(PHP_EOL.sprintf('Using Bitrix <info>kernel v%s</info>.</info>', SM_VERSION), |
|
| 120 | 120 | OutputInterface::VERBOSITY_VERY_VERBOSE); |
| 121 | 121 | } |
| 122 | 122 | break; |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $commands = []; |
| 169 | 169 | |
| 170 | 170 | foreach (ModuleManager::getInstalledModules() as $module) { |
| 171 | - $cliFile = getLocalPath('modules/' . $module['ID'] . '/cli.php'); |
|
| 171 | + $cliFile = getLocalPath('modules/'.$module['ID'].'/cli.php'); |
|
| 172 | 172 | |
| 173 | 173 | if ($cliFile === false) { |
| 174 | 174 | continue; |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | continue; |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - $config = include_once $this->getDocumentRoot() . $cliFile; |
|
| 179 | + $config = include_once $this->getDocumentRoot().$cliFile; |
|
| 180 | 180 | |
| 181 | 181 | if (isset($config['commands']) && is_array($config['commands'])) { |
| 182 | 182 | $commands = array_merge($commands, $config['commands']); |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | $this->configuration = include $path; |
| 205 | 205 | |
| 206 | 206 | if (!is_array($this->configuration)) { |
| 207 | - throw new ConfigurationException('Configuration file ' . $path . ' must return an array'); |
|
| 207 | + throw new ConfigurationException('Configuration file '.$path.' must return an array'); |
|
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | $filesystem = new Filesystem(); |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | if ($filesystem->isAbsolutePath($this->configuration['web-dir'])) { |
| 213 | 213 | $this->setDocumentRoot($this->configuration['web-dir']); |
| 214 | 214 | } else { |
| 215 | - $this->setDocumentRoot($this->getRoot() . '/' . $this->configuration['web-dir']); |
|
| 215 | + $this->setDocumentRoot($this->getRoot().'/'.$this->configuration['web-dir']); |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | if (!is_dir($_SERVER['DOCUMENT_ROOT'])) { |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | /** @noinspection PhpUnusedLocalVariableInspection */ |
| 259 | 259 | $DB, $DBType, $DBHost, $DBLogin, $DBPassword, $DBName, $DBDebug, $DBDebugToFile, $APPLICATION, $USER, $DBSQLServerType; |
| 260 | 260 | |
| 261 | - require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php'; |
|
| 261 | + require_once $_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_before.php'; |
|
| 262 | 262 | |
| 263 | 263 | if (defined('B_PROLOG_INCLUDED') && B_PROLOG_INCLUDED === true) { |
| 264 | 264 | $this->bitrixStatus = static::BITRIX_STATUS_COMPLETE; |
@@ -278,8 +278,8 @@ discard block |
||
| 278 | 278 | public function checkBitrix() |
| 279 | 279 | { |
| 280 | 280 | if ( |
| 281 | - !is_file($_SERVER['DOCUMENT_ROOT'] . '/bitrix/.settings.php') |
|
| 282 | - && !is_file($_SERVER['DOCUMENT_ROOT'] . '/bitrix/.settings_extra.php') |
|
| 281 | + !is_file($_SERVER['DOCUMENT_ROOT'].'/bitrix/.settings.php') |
|
| 282 | + && !is_file($_SERVER['DOCUMENT_ROOT'].'/bitrix/.settings_extra.php') |
|
| 283 | 283 | ) { |
| 284 | 284 | return false; |
| 285 | 285 | } |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | |
| 324 | 324 | $this->initializeBitrix(); |
| 325 | 325 | |
| 326 | - spl_autoload_register(function ($className) { |
|
| 326 | + spl_autoload_register(function($className) { |
|
| 327 | 327 | $file = ltrim($className, "\\"); |
| 328 | 328 | $file = strtr($file, Loader::ALPHA_UPPER, Loader::ALPHA_LOWER); |
| 329 | 329 | $file = str_replace('\\', '/', $file); |
@@ -342,16 +342,16 @@ discard block |
||
| 342 | 342 | return false; |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | - $module = array_shift($arFile) . '.' . array_shift($arFile); |
|
| 345 | + $module = array_shift($arFile).'.'.array_shift($arFile); |
|
| 346 | 346 | |
| 347 | 347 | if (!Loader::includeModule($module)) { |
| 348 | 348 | return false; |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | - $path = getLocalPath('/modules/' . $module . '/' . implode('/', $arFile) . '.php'); |
|
| 351 | + $path = getLocalPath('/modules/'.$module.'/'.implode('/', $arFile).'.php'); |
|
| 352 | 352 | |
| 353 | 353 | if ($path !== false) { |
| 354 | - include_once $this->getDocumentRoot() . $path; |
|
| 354 | + include_once $this->getDocumentRoot().$path; |
|
| 355 | 355 | } |
| 356 | 356 | }); |
| 357 | 357 | } |
@@ -73,13 +73,13 @@ discard block |
||
| 73 | 73 | throw new \Exception('Config env-dir is missing'); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - $dir = $this->getApplication()->getRoot() . '/' . $this->getApplication()->getConfiguration()['env-dir']; |
|
| 76 | + $dir = $this->getApplication()->getRoot().'/'.$this->getApplication()->getConfiguration()['env-dir']; |
|
| 77 | 77 | |
| 78 | 78 | if (!is_dir($dir)) { |
| 79 | - throw new \Exception('Directory ' . $dir . ' is missing'); |
|
| 79 | + throw new \Exception('Directory '.$dir.' is missing'); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - $environments = include $dir . '/index.php'; |
|
| 82 | + $environments = include $dir.'/index.php'; |
|
| 83 | 83 | |
| 84 | 84 | if (!is_array($environments)) { |
| 85 | 85 | throw new \Exception('File with description of environments is missing'); |
@@ -107,8 +107,8 @@ discard block |
||
| 107 | 107 | throw new \Exception('Environment path not found!'); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - $this->dir = $dir . '/' . $environments[$code]['path']; |
|
| 111 | - $this->config = include $this->dir . '/config.php'; |
|
| 110 | + $this->dir = $dir.'/'.$environments[$code]['path']; |
|
| 111 | + $this->config = include $this->dir.'/config.php'; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
@@ -121,10 +121,10 @@ discard block |
||
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | foreach ($this->config as $config => $settings) { |
| 124 | - $method = 'configure' . ucfirst($config); |
|
| 124 | + $method = 'configure'.ucfirst($config); |
|
| 125 | 125 | |
| 126 | 126 | if (!in_array($method, $this->bootstrap) && method_exists($this, $method)) { |
| 127 | - $output->writeln('<comment>Setup "' . $config . '"</comment>'); |
|
| 127 | + $output->writeln('<comment>Setup "'.$config.'"</comment>'); |
|
| 128 | 128 | $this->$method($input, $output, $settings); |
| 129 | 129 | } |
| 130 | 130 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | continue; |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | - $itemPath = $this->getApplication()->getRoot() . '/' . $iterator->getSubPathName(); |
|
| 153 | + $itemPath = $this->getApplication()->getRoot().'/'.$iterator->getSubPathName(); |
|
| 154 | 154 | |
| 155 | 155 | if ($item->isDir()) { |
| 156 | 156 | $fs->mkdir($itemPath); |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $fs->copy($item, $itemPath, true); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - $output->writeln(' ' . $itemPath); |
|
| 161 | + $output->writeln(' '.$itemPath); |
|
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | |
@@ -186,8 +186,8 @@ discard block |
||
| 186 | 186 | throw new \InvalidArgumentException('Config "licenseKey" must be string type.'); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - $licenseFileContent = "<" . "? $" . "LICENSE_KEY = \"" . EscapePHPString($licenseKey) . "\"; ?" . ">"; |
|
| 190 | - File::putFileContents(Application::getDocumentRoot() . BX_ROOT . '/license_key.php', $licenseFileContent); |
|
| 189 | + $licenseFileContent = "<"."? $"."LICENSE_KEY = \"".EscapePHPString($licenseKey)."\"; ?".">"; |
|
| 190 | + File::putFileContents(Application::getDocumentRoot().BX_ROOT.'/license_key.php', $licenseFileContent); |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | /** |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | $bar->setFormat('verbose'); |
| 226 | 226 | |
| 227 | 227 | foreach ($modules as $moduleName) { |
| 228 | - $message = "\r" . ' module:load ' . $moduleName . ': '; |
|
| 228 | + $message = "\r".' module:load '.$moduleName.': '; |
|
| 229 | 229 | |
| 230 | 230 | try { |
| 231 | 231 | if (isset($bar)) { |
@@ -236,15 +236,15 @@ discard block |
||
| 236 | 236 | (new Module($moduleName))->load()->register(); |
| 237 | 237 | |
| 238 | 238 | $bar->clear(); |
| 239 | - $output->writeln($message . '<info>ok</info>'); |
|
| 239 | + $output->writeln($message.'<info>ok</info>'); |
|
| 240 | 240 | } catch (ModuleInstallException $e) { |
| 241 | 241 | $bar->clear(); |
| 242 | 242 | $output->writeln($e->getMessage(), OutputInterface::VERBOSITY_VERBOSE); |
| 243 | - $output->writeln($message . '<comment>not registered</comment> (install it in admin panel)'); |
|
| 243 | + $output->writeln($message.'<comment>not registered</comment> (install it in admin panel)'); |
|
| 244 | 244 | } catch (ModuleException $e) { |
| 245 | 245 | $bar->clear(); |
| 246 | 246 | $output->writeln($e->getMessage(), OutputInterface::VERBOSITY_VERBOSE); |
| 247 | - $output->writeln($message . '<error>FAILED</error>'); |
|
| 247 | + $output->writeln($message.'<error>FAILED</error>'); |
|
| 248 | 248 | } |
| 249 | 249 | $bar->advance(); |
| 250 | 250 | } |
@@ -309,13 +309,13 @@ discard block |
||
| 309 | 309 | $memcache->Resume($serverId); |
| 310 | 310 | } else { |
| 311 | 311 | $exception = $APPLICATION->GetException(); |
| 312 | - $message = 'Invalid memcache config with index ' . $index; |
|
| 312 | + $message = 'Invalid memcache config with index '.$index; |
|
| 313 | 313 | |
| 314 | 314 | if ($exception->GetString()) { |
| 315 | 315 | $message = str_replace('<br>', "\n", $exception->GetString()); |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | - $output->writeln('<error>' . $message . '</error>'); |
|
| 318 | + $output->writeln('<error>'.$message.'</error>'); |
|
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | 321 | } |
@@ -344,12 +344,12 @@ discard block |
||
| 344 | 344 | if (isset($value['value']) && isset($value['siteId'])) { |
| 345 | 345 | Option::set($module, $code, $value['value'], $value['siteId']); |
| 346 | 346 | } else { |
| 347 | - $output->writeln('<error>Invalid option for module "' . $module . '" with code "' . $code . '"</error>'); |
|
| 347 | + $output->writeln('<error>Invalid option for module "'.$module.'" with code "'.$code.'"</error>'); |
|
| 348 | 348 | } |
| 349 | 349 | } else { |
| 350 | 350 | Option::set($module, $code, $value); |
| 351 | 351 | |
| 352 | - $output->writeln(' option: "' . $code . '", module: "' . $module . '"'); |
|
| 352 | + $output->writeln(' option: "'.$code.'", module: "'.$module.'"'); |
|
| 353 | 353 | } |
| 354 | 354 | } |
| 355 | 355 | } |