@@ -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 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | public function register() |
| 109 | 109 | { |
| 110 | 110 | if (!$this->isRegistered()) { |
| 111 | - $moduleObject =& $this->getObject(); |
|
| 111 | + $moduleObject = & $this->getObject(); |
|
| 112 | 112 | |
| 113 | 113 | /** |
| 114 | 114 | * It's important to check if module class defines InstallDB method (it must register module) |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | if (!$moduleObject->InstallDB() && BitrixException::hasException()) { |
| 125 | 125 | throw new Exception\ModuleInstallException( |
| 126 | - get_class($moduleObject) . '::InstallDB() returned false', |
|
| 126 | + get_class($moduleObject).'::InstallDB() returned false', |
|
| 127 | 127 | $this->name |
| 128 | 128 | ); |
| 129 | 129 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | /** @noinspection PhpVoidFunctionResultUsedInspection */ |
| 134 | 134 | if (!$moduleObject->InstallFiles() && BitrixException::hasException()) { |
| 135 | 135 | throw new Exception\ModuleInstallException( |
| 136 | - get_class($moduleObject) . '::InstallFiles() returned false', |
|
| 136 | + get_class($moduleObject).'::InstallFiles() returned false', |
|
| 137 | 137 | $this->name |
| 138 | 138 | ); |
| 139 | 139 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | { |
| 159 | 159 | if (!$this->isRegistered()) { |
| 160 | 160 | if (!$this->exist()) { |
| 161 | - require_once($_SERVER["DOCUMENT_ROOT"] . '/bitrix/modules/main/classes/general/update_client_partner.php'); |
|
| 161 | + require_once($_SERVER["DOCUMENT_ROOT"].'/bitrix/modules/main/classes/general/update_client_partner.php'); |
|
| 162 | 162 | |
| 163 | 163 | if (!\CUpdateClientPartner::LoadModuleNoDemand( |
| 164 | 164 | $this->getName(), |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | /** @noinspection PhpVoidFunctionResultUsedInspection */ |
| 200 | 200 | if (!$moduleObject->UnInstallFiles() && BitrixException::hasException()) { |
| 201 | 201 | throw new Exception\ModuleUninstallException( |
| 202 | - get_class($moduleObject) . '::UnInstallFiles() returned false', |
|
| 202 | + get_class($moduleObject).'::UnInstallFiles() returned false', |
|
| 203 | 203 | $this->name |
| 204 | 204 | ); |
| 205 | 205 | } |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | /** @noinspection PhpVoidFunctionResultUsedInspection */ |
| 210 | 210 | if (!$moduleObject->UnInstallDB() && BitrixException::hasException()) { |
| 211 | 211 | throw new Exception\ModuleUninstallException( |
| 212 | - get_class($moduleObject) . '::UnInstallFiles() returned false', |
|
| 212 | + get_class($moduleObject).'::UnInstallFiles() returned false', |
|
| 213 | 213 | $this->name |
| 214 | 214 | ); |
| 215 | 215 | } |
@@ -231,10 +231,10 @@ discard block |
||
| 231 | 231 | $this->unRegister(); |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - $path = getLocalPath('modules/' . $this->getName()); |
|
| 234 | + $path = getLocalPath('modules/'.$this->getName()); |
|
| 235 | 235 | |
| 236 | 236 | if ($path) { |
| 237 | - (new Filesystem())->remove($_SERVER['DOCUMENT_ROOT'] . $path); |
|
| 237 | + (new Filesystem())->remove($_SERVER['DOCUMENT_ROOT'].$path); |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | unset($this->object); |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | */ |
| 254 | 254 | public function update(&$modulesUpdated = null) |
| 255 | 255 | { |
| 256 | - require_once($_SERVER["DOCUMENT_ROOT"] . '/bitrix/modules/main/classes/general/update_client_partner.php'); |
|
| 256 | + require_once($_SERVER["DOCUMENT_ROOT"].'/bitrix/modules/main/classes/general/update_client_partner.php'); |
|
| 257 | 257 | |
| 258 | 258 | if (!$this->isThirdParty()) { |
| 259 | 259 | throw new Exception\ModuleUpdateException('Kernel module updates are currently not supported.', |
@@ -294,14 +294,14 @@ discard block |
||
| 294 | 294 | $updateDir = null; |
| 295 | 295 | |
| 296 | 296 | if (!\CUpdateClientPartner::UnGzipArchive($updateDir, $errorMessage, true)) { |
| 297 | - throw new Exception\ModuleUpdateException('[CL02] UnGzipArchive failed. ' . $errorMessage, |
|
| 297 | + throw new Exception\ModuleUpdateException('[CL02] UnGzipArchive failed. '.$errorMessage, |
|
| 298 | 298 | $this->getName()); |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | $this->validateUpdate($updateDir); |
| 302 | 302 | |
| 303 | 303 | if (isset($updateDescription["DATA"]["#"]["NOUPDATES"])) { |
| 304 | - \CUpdateClientPartner::ClearUpdateFolder($_SERVER["DOCUMENT_ROOT"] . "/bitrix/updates/" . $updateDir); |
|
| 304 | + \CUpdateClientPartner::ClearUpdateFolder($_SERVER["DOCUMENT_ROOT"]."/bitrix/updates/".$updateDir); |
|
| 305 | 305 | return false; |
| 306 | 306 | } |
| 307 | 307 | |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | } |
| 321 | 321 | } |
| 322 | 322 | } else { |
| 323 | - throw new Exception\ModuleUpdateException('[CL04] UpdateStepModules failed. ' . $errorMessage, |
|
| 323 | + throw new Exception\ModuleUpdateException('[CL04] UpdateStepModules failed. '.$errorMessage, |
|
| 324 | 324 | $this->getName()); |
| 325 | 325 | } |
| 326 | 326 | |
@@ -336,14 +336,14 @@ discard block |
||
| 336 | 336 | { |
| 337 | 337 | $errorMessage = null; |
| 338 | 338 | if (!\CUpdateClientPartner::CheckUpdatability($updateDir, $errorMessage)) { |
| 339 | - throw new Exception\ModuleUpdateException('[CL03] CheckUpdatability failed. ' . $errorMessage, |
|
| 339 | + throw new Exception\ModuleUpdateException('[CL03] CheckUpdatability failed. '.$errorMessage, |
|
| 340 | 340 | $this->getName()); |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | if (isset($updateDescription["DATA"]["#"]["ERROR"])) { |
| 344 | 344 | $errorMessage = ""; |
| 345 | 345 | foreach ($updateDescription["DATA"]["#"]["ERROR"] as $errorDescription) { |
| 346 | - $errorMessage .= "[" . $errorDescription["@"]["TYPE"] . "] " . $errorDescription["#"]; |
|
| 346 | + $errorMessage .= "[".$errorDescription["@"]["TYPE"]."] ".$errorDescription["#"]; |
|
| 347 | 347 | } |
| 348 | 348 | throw new Exception\ModuleUpdateException($errorMessage, $this->getName()); |
| 349 | 349 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | if (in_array($this->getName(), ['module:register', 'module:unregister']) |
| 45 | 45 | && $module->isThirdParty() && !$input->getOption('confirm-thirdparty') |
| 46 | 46 | ) { |
| 47 | - $output->writeln($module->isThirdParty() . ' is not a kernel module. Correct operation cannot be guaranteed for third-party modules!'); |
|
| 47 | + $output->writeln($module->isThirdParty().' is not a kernel module. Correct operation cannot be guaranteed for third-party modules!'); |
|
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
@@ -17,6 +17,6 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function __construct($message, $moduleName, \Exception $previous = null) |
| 19 | 19 | { |
| 20 | - parent::__construct("[$moduleName] " . $message, 0, $previous); |
|
| 20 | + parent::__construct("[$moduleName] ".$message, 0, $previous); |
|
| 21 | 21 | } |
| 22 | 22 | } |
| 23 | 23 | \ No newline at end of file |