@@ -104,7 +104,7 @@ |
||
| 104 | 104 | public static function ensureHttp($url, $https = false) |
| 105 | 105 | { |
| 106 | 106 | if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
| 107 | - $url = ($https ? "https://" : "http://") . $url; |
|
| 107 | + $url = ($https ? "https://" : "http://").$url; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | return $url; |
@@ -64,11 +64,11 @@ discard block |
||
| 64 | 64 | private function getExtraVarDef($type, $varName, $func) |
| 65 | 65 | { |
| 66 | 66 | $info = [ |
| 67 | - 'image-upload' => function ($varName) use ($func) { return '$this->zaaImageUpload($this->'.$func.'(\''.$varName.'\'), false, true),'; }, |
|
| 68 | - 'image-array-upload' => function ($varName) use ($func) { return '$this->zaaImageArrayUpload($this->'.$func.'(\''.$varName.'\'), false, true),'; }, |
|
| 69 | - 'file-upload' => function ($varName) use ($func) { return '$this->zaaFileUpload($this->'.$func.'(\''.$varName.'\'), true),'; }, |
|
| 70 | - 'file-array-upload' => function ($varName) use ($func) { return '$this->zaaFileArrayUpload($this->'.$func.'(\''.$varName.'\'), true),'; }, |
|
| 71 | - 'cms-page' => function ($varName) use ($func) { return 'Yii::$app->menu->findOne([\'nav_id\' => $this->'.$func.'(\''.$varName.'\', 0)]),'; }, |
|
| 67 | + 'image-upload' => function($varName) use ($func) { return '$this->zaaImageUpload($this->'.$func.'(\''.$varName.'\'), false, true),'; }, |
|
| 68 | + 'image-array-upload' => function($varName) use ($func) { return '$this->zaaImageArrayUpload($this->'.$func.'(\''.$varName.'\'), false, true),'; }, |
|
| 69 | + 'file-upload' => function($varName) use ($func) { return '$this->zaaFileUpload($this->'.$func.'(\''.$varName.'\'), true),'; }, |
|
| 70 | + 'file-array-upload' => function($varName) use ($func) { return '$this->zaaFileArrayUpload($this->'.$func.'(\''.$varName.'\'), true),'; }, |
|
| 71 | + 'cms-page' => function($varName) use ($func) { return 'Yii::$app->menu->findOne([\'nav_id\' => $this->'.$func.'(\''.$varName.'\', 0)]),'; }, |
|
| 72 | 72 | ]; |
| 73 | 73 | |
| 74 | 74 | if (array_key_exists($type, $info)) { |
@@ -186,15 +186,15 @@ discard block |
||
| 186 | 186 | $content .= ' * @var bool Choose whether block is a layout/container/segmnet/section block or not, Container elements will be optically displayed'.PHP_EOL; |
| 187 | 187 | $content .= ' * in a different way for a better user experience. Container block will not display isDirty colorizing.'.PHP_EOL; |
| 188 | 188 | $content .= ' */'.PHP_EOL; |
| 189 | - $content .= ' public $isContainer = false;'.PHP_EOL . PHP_EOL; |
|
| 189 | + $content .= ' public $isContainer = false;'.PHP_EOL.PHP_EOL; |
|
| 190 | 190 | $content .= ' /**'.PHP_EOL; |
| 191 | 191 | $content .= ' * @var bool Choose whether a block can be cached trough the caching component. Be carefull with caching container blocks.'.PHP_EOL; |
| 192 | 192 | $content .= ' */'.PHP_EOL; |
| 193 | - $content .= ' public $cacheEnabled = false;'.PHP_EOL . PHP_EOL; |
|
| 193 | + $content .= ' public $cacheEnabled = false;'.PHP_EOL.PHP_EOL; |
|
| 194 | 194 | $content .= ' /**'.PHP_EOL; |
| 195 | 195 | $content .= ' * @var int The cache lifetime for this block in seconds (3600 = 1 hour), only affects when cacheEnabled is true'.PHP_EOL; |
| 196 | 196 | $content .= ' */'.PHP_EOL; |
| 197 | - $content .= ' public $cacheExpiration = 3600;'.PHP_EOL . PHP_EOL; |
|
| 197 | + $content .= ' public $cacheExpiration = 3600;'.PHP_EOL.PHP_EOL; |
|
| 198 | 198 | |
| 199 | 199 | // method name |
| 200 | 200 | $content .= ' public function name()'.PHP_EOL; |
@@ -114,9 +114,9 @@ |
||
| 114 | 114 | $_file = $exception->getFile(); |
| 115 | 115 | $_line = $exception->getLine(); |
| 116 | 116 | } elseif (is_string($exception)) { |
| 117 | - $_message = 'exception string: ' . $exception; |
|
| 117 | + $_message = 'exception string: '.$exception; |
|
| 118 | 118 | } elseif (is_array($exception)) { |
| 119 | - $_message = isset($exception['message']) ? $exception['message'] : 'exception array dump: ' . print_r($exception, true); |
|
| 119 | + $_message = isset($exception['message']) ? $exception['message'] : 'exception array dump: '.print_r($exception, true); |
|
| 120 | 120 | $_file = isset($exception['file']) ? $exception['file'] : __FILE__; |
| 121 | 121 | $_line = isset($exception['line']) ? $exception['line'] : __LINE__; |
| 122 | 122 | } |
@@ -28,26 +28,26 @@ |
||
| 28 | 28 | $this->output($fileName); |
| 29 | 29 | } |
| 30 | 30 | //$this->output(print_r($fileList, true)); |
| 31 | - $this->outputInfo(count($fileList) . " files to remove."); |
|
| 31 | + $this->outputInfo(count($fileList)." files to remove."); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | if (count($fileList) !== 0) { |
| 35 | 35 | $success = true; |
| 36 | - if ($this->confirm("Do you want to delete " . count($fileList) . " files which are not referenced in the database any more? (can not be undon, maybe create a backup first!)")) { |
|
| 36 | + if ($this->confirm("Do you want to delete ".count($fileList)." files which are not referenced in the database any more? (can not be undon, maybe create a backup first!)")) { |
|
| 37 | 37 | foreach ($fileList as $file) { |
| 38 | 38 | if (is_file($file) && @unlink($file)) { |
| 39 | - $this->outputSuccess($file . " successful deleted."); |
|
| 39 | + $this->outputSuccess($file." successful deleted."); |
|
| 40 | 40 | } elseif (is_file($file)) { |
| 41 | - $this->outputError($file . " could not be deleted!"); |
|
| 41 | + $this->outputError($file." could not be deleted!"); |
|
| 42 | 42 | $success = false; |
| 43 | 43 | } else { |
| 44 | - $this->outputError($file . " could not be found!"); |
|
| 44 | + $this->outputError($file." could not be found!"); |
|
| 45 | 45 | $success = false; |
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | if ($success) { |
| 50 | - return $this->outputSuccess(count($fileList) . " files successful deleted."); |
|
| 50 | + return $this->outputSuccess(count($fileList)." files successful deleted."); |
|
| 51 | 51 | } |
| 52 | 52 | return $this->outputError("Cleanup could not be completed. Please look into error above."); |
| 53 | 53 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | $this->verbosePrint('Run import index', __METHOD__); |
| 129 | 129 | foreach (Yii::$app->getModules() as $id => $module) { |
| 130 | 130 | if ($module instanceof \luya\base\Module) { |
| 131 | - $this->verbosePrint('collect module importers from module: ' . $id, __METHOD__); |
|
| 131 | + $this->verbosePrint('collect module importers from module: '.$id, __METHOD__); |
|
| 132 | 132 | $response = $module->import($this); |
| 133 | 133 | if (is_array($response)) { // importer returns an array with class names |
| 134 | 134 | foreach ($response as $class) { |
@@ -150,9 +150,9 @@ discard block |
||
| 150 | 150 | ksort($queue); |
| 151 | 151 | |
| 152 | 152 | foreach ($queue as $pos => $object) { |
| 153 | - $this->verbosePrint("run object '" .$object->className() . " on pos $pos.", __METHOD__); |
|
| 153 | + $this->verbosePrint("run object '".$object->className()." on pos $pos.", __METHOD__); |
|
| 154 | 154 | $objectResponse = $object->run(); |
| 155 | - $this->verbosePrint("run object response: " . var_export($objectResponse, true), __METHOD__); |
|
| 155 | + $this->verbosePrint("run object response: ".var_export($objectResponse, true), __METHOD__); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | if (Yii::$app->hasModule('admin')) { |
@@ -160,21 +160,21 @@ discard block |
||
| 160 | 160 | Yii::$app->db->createCommand()->update('admin_user', ['force_reload' => 1])->execute(); |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - $this->verbosePrint('importer finished, get log output: ' . var_export($this->getLog(), true), __METHOD__); |
|
| 163 | + $this->verbosePrint('importer finished, get log output: '.var_export($this->getLog(), true), __METHOD__); |
|
| 164 | 164 | |
| 165 | 165 | foreach ($this->getLog() as $section => $value) { |
| 166 | - $this->outputInfo(PHP_EOL . $section . ":"); |
|
| 166 | + $this->outputInfo(PHP_EOL.$section.":"); |
|
| 167 | 167 | foreach ($value as $k => $v) { |
| 168 | 168 | if (is_array($v)) { |
| 169 | 169 | foreach ($v as $kk => $kv) { |
| 170 | 170 | if (is_array($kv)) { |
| 171 | - $this->output(" - {$kk}: " . print_r($kv, true)); |
|
| 171 | + $this->output(" - {$kk}: ".print_r($kv, true)); |
|
| 172 | 172 | } else { |
| 173 | 173 | $this->output(" - {$kk}: {$kv}"); |
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | } else { |
| 177 | - $this->output(" - " . $v); |
|
| 177 | + $this->output(" - ".$v); |
|
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | } |