@@ -22,7 +22,7 @@ |
||
| 22 | 22 | * If you don't have this file, copy it to your main CakePHP config folder. |
| 23 | 23 | /*/ |
| 24 | 24 | |
| 25 | -return array ( |
|
| 25 | +return array( |
|
| 26 | 26 | 'Multidimensional/Subdomains' => |
| 27 | 27 | array('subdomains' => |
| 28 | 28 | array('{SUBDOMAIN_1}', '{SUBDOMAIN_2}', ... '{SUBDOMAIN_N}') |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | |
| 25 | 25 | $subdomains = Configure::read('Multidimensional/Subdomains.subdomains'); |
| 26 | 26 | |
| 27 | - if(is_array($subdomains)) { |
|
| 27 | + if (is_array($subdomains)) { |
|
| 28 | 28 | |
| 29 | 29 | foreach ($subdomains AS $prefix) { |
| 30 | 30 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | foreach ($subdomains AS $prefix) { |
| 30 | 30 | |
| 31 | - Router::scope('/', ['prefix' => $prefix], function($routes) { |
|
| 31 | + Router::scope('/', ['prefix' => $prefix], function($routes) { |
|
| 32 | 32 | $routes->fallbacks('InflectedRoute'); |
| 33 | 33 | }); |
| 34 | 34 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - if ((($first_run) ? (strtolower($this->in('Install Subdomains Plugin?', ['y','n'])) == 'y') : (strtolower($this->in('Update Configuration?', ['y','n'])) == 'y'))) { |
|
| 45 | + if ((($first_run) ? (strtolower($this->in('Install Subdomains Plugin?', ['y', 'n'])) == 'y') : (strtolower($this->in('Update Configuration?', ['y', 'n'])) == 'y'))) { |
|
| 46 | 46 | |
| 47 | 47 | do { |
| 48 | 48 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | $this->out(); |
| 62 | 62 | |
| 63 | - if (strtolower($this->in('Add Another Subdomain?', ['y','n'])) == 'n') { |
|
| 63 | + if (strtolower($this->in('Add Another Subdomain?', ['y', 'n'])) == 'n') { |
|
| 64 | 64 | $addMore = false; |
| 65 | 65 | } |
| 66 | 66 | |
@@ -81,13 +81,13 @@ discard block |
||
| 81 | 81 | $subdomains[] = $subdomain; |
| 82 | 82 | $valid = true; |
| 83 | 83 | $this->out(); |
| 84 | - }else{ |
|
| 84 | + } else { |
|
| 85 | 85 | $valid = false; |
| 86 | 86 | $this->out(); |
| 87 | 87 | $this->_io->out('<error>Invalid Subdomain.</error>'); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - } while (!$valid || strtolower($this->in('Add Another Subdomain?', ['y','n'])) == 'y'); |
|
| 90 | + } while (!$valid || strtolower($this->in('Add Another Subdomain?', ['y', 'n'])) == 'y'); |
|
| 91 | 91 | |
| 92 | 92 | } |
| 93 | 93 | |
@@ -106,14 +106,14 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | $this->out(); |
| 108 | 108 | |
| 109 | - while (count($subdomains) > 0 && strtolower($this->in('Delete a Subdomain?', ['y','n'])) == 'y') { |
|
| 109 | + while (count($subdomains) > 0 && strtolower($this->in('Delete a Subdomain?', ['y', 'n'])) == 'y') { |
|
| 110 | 110 | |
| 111 | 111 | $this->out(); |
| 112 | 112 | $deleteKey = (int) $this->in('Enter Number to Delete:', array_keys($subdomains)); |
| 113 | 113 | |
| 114 | 114 | if (isset($subdomains[$deleteKey])) { |
| 115 | 115 | $this->out(); |
| 116 | - $this->out('Deleted: ' . $subdomains[$deleteKey], 2); |
|
| 116 | + $this->out('Deleted: ' . $subdomains[$deleteKey], 2); |
|
| 117 | 117 | unset($subdomains[$deleteKey]); |
| 118 | 118 | } |
| 119 | 119 | |
@@ -127,10 +127,10 @@ discard block |
||
| 127 | 127 | $this->_io->out('<error>No Subdomains Configured.</error>', 2); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - } while (count($subdomains) == 0 && strtolower($this->in('Start Over?', ['y','n'])) == 'y'); |
|
| 130 | + } while (count($subdomains) == 0 && strtolower($this->in('Start Over?', ['y', 'n'])) == 'y'); |
|
| 131 | 131 | |
| 132 | 132 | $this->out(); |
| 133 | - if(count($subdomains) > 0) { |
|
| 133 | + if (count($subdomains) > 0) { |
|
| 134 | 134 | $this->out('Configuration Saved!', 2); |
| 135 | 135 | } else { |
| 136 | 136 | $this->_io->out('<error>Plugin Not Currently Active.</error>', 2); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | private function _modifyArray(array $array) { |
| 143 | 143 | |
| 144 | - return array_combine(range(1, count($array)), array_values($array));; |
|
| 144 | + return array_combine(range(1, count($array)), array_values($array)); ; |
|
| 145 | 145 | |
| 146 | 146 | } |
| 147 | 147 | |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | $subdomains[] = $subdomain; |
| 82 | 82 | $valid = true; |
| 83 | 83 | $this->out(); |
| 84 | - }else{ |
|
| 84 | + } else{ |
|
| 85 | 85 | $valid = false; |
| 86 | 86 | $this->out(); |
| 87 | 87 | $this->_io->out('<error>Invalid Subdomain.</error>'); |
@@ -19,8 +19,7 @@ |
||
| 19 | 19 | use Cake\Routing\Router; |
| 20 | 20 | use Cake\Core\Configure; |
| 21 | 21 | |
| 22 | -trait SubdomainRouteTrait |
|
| 23 | -{ |
|
| 22 | +trait SubdomainRouteTrait { |
|
| 24 | 23 | |
| 25 | 24 | private function _getSubdomains() { |
| 26 | 25 | |
@@ -18,7 +18,6 @@ |
||
| 18 | 18 | use Cake\Routing\Route\DashedRoute as CakeDashedRoute; |
| 19 | 19 | use Multidimensional\Subdomains\Routing\SubdomainRouteTrait; |
| 20 | 20 | |
| 21 | -class DashedRoute extends CakeDashedRoute |
|
| 22 | -{ |
|
| 21 | +class DashedRoute extends CakeDashedRoute { |
|
| 23 | 22 | use SubdomainRouteTrait; |
| 24 | 23 | } |
| 25 | 24 | \ No newline at end of file |
@@ -18,7 +18,6 @@ |
||
| 18 | 18 | use Cake\Routing\Route\Route as CakeRoute; |
| 19 | 19 | use Multidimensional\Subdomains\Routing\SubdomainRouteTrait; |
| 20 | 20 | |
| 21 | -class Route extends CakeRoute |
|
| 22 | -{ |
|
| 21 | +class Route extends CakeRoute { |
|
| 23 | 22 | use SubdomainRouteTrait; |
| 24 | 23 | } |
| 25 | 24 | \ No newline at end of file |
@@ -18,7 +18,6 @@ |
||
| 18 | 18 | use Cake\Routing\Route\InflectedRoute as CakeInflectedRoute; |
| 19 | 19 | use Multidimensional\Subdomains\Routing\SubdomainRouteTrait; |
| 20 | 20 | |
| 21 | -class InflectedRoute extends CakeInflectedRoute |
|
| 22 | -{ |
|
| 21 | +class InflectedRoute extends CakeInflectedRoute { |
|
| 23 | 22 | use SubdomainRouteTrait; |
| 24 | 23 | } |
| 25 | 24 | \ No newline at end of file |
@@ -17,10 +17,8 @@ |
||
| 17 | 17 | |
| 18 | 18 | use Cake\Console\Helper; |
| 19 | 19 | |
| 20 | -class HeaderHelper extends Helper |
|
| 21 | -{ |
|
| 22 | - public function output($args = null) |
|
| 23 | - { |
|
| 20 | +class HeaderHelper extends Helper { |
|
| 21 | + public function output($args = null) { |
|
| 24 | 22 | $this->_io->out("\n\n"); |
| 25 | 23 | $this->_io->styles('header', ['text' => 'green']); |
| 26 | 24 | |