@@ -35,18 +35,18 @@ discard block |
||
| 35 | 35 | * @param string $classname Name of the setup task class |
| 36 | 36 | * @return boolean True if class is found, false if not |
| 37 | 37 | */ |
| 38 | - public static function autoload( $classname ) |
|
| 38 | + public static function autoload($classname) |
|
| 39 | 39 | { |
| 40 | - if( strncmp( $classname, 'Aimeos\\MW\\Setup\\Task\\', 21 ) === 0 ) |
|
| 40 | + if (strncmp($classname, 'Aimeos\\MW\\Setup\\Task\\', 21) === 0) |
|
| 41 | 41 | { |
| 42 | - $fileName = substr( $classname, 21 ) . '.php'; |
|
| 43 | - $paths = explode( PATH_SEPARATOR, get_include_path() ); |
|
| 42 | + $fileName = substr($classname, 21) . '.php'; |
|
| 43 | + $paths = explode(PATH_SEPARATOR, get_include_path()); |
|
| 44 | 44 | |
| 45 | - foreach( $paths as $path ) |
|
| 45 | + foreach ($paths as $path) |
|
| 46 | 46 | { |
| 47 | 47 | $file = $path . DIRECTORY_SEPARATOR . $fileName; |
| 48 | 48 | |
| 49 | - if( file_exists( $file ) === true && ( include_once $file ) !== false ) { |
|
| 49 | + if (file_exists($file) === true && (include_once $file) !== false) { |
|
| 50 | 50 | return true; |
| 51 | 51 | } |
| 52 | 52 | } |
@@ -63,33 +63,33 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function fire() |
| 65 | 65 | { |
| 66 | - $ctx = $this->getLaravel()->make( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
| 67 | - $ctx->setEditor( 'aimeos:setup' ); |
|
| 66 | + $ctx = $this->getLaravel()->make('\Aimeos\Shop\Base\Context')->get(false); |
|
| 67 | + $ctx->setEditor('aimeos:setup'); |
|
| 68 | 68 | |
| 69 | 69 | $config = $ctx->getConfig(); |
| 70 | - $site = $this->argument( 'site' ); |
|
| 71 | - $template = $this->argument( 'tplsite' ); |
|
| 70 | + $site = $this->argument('site'); |
|
| 71 | + $template = $this->argument('tplsite'); |
|
| 72 | 72 | |
| 73 | - $config->set( 'setup/site', $site ); |
|
| 74 | - $dbconfig = $this->getDbConfig( $config ); |
|
| 75 | - $this->setOptions( $config ); |
|
| 73 | + $config->set('setup/site', $site); |
|
| 74 | + $dbconfig = $this->getDbConfig($config); |
|
| 75 | + $this->setOptions($config); |
|
| 76 | 76 | |
| 77 | - $taskPaths = $this->getLaravel()->make( '\Aimeos\Shop\Base\Aimeos' )->get()->getSetupPaths( $template ); |
|
| 77 | + $taskPaths = $this->getLaravel()->make('\Aimeos\Shop\Base\Aimeos')->get()->getSetupPaths($template); |
|
| 78 | 78 | |
| 79 | 79 | $includePaths = $taskPaths; |
| 80 | 80 | $includePaths[] = get_include_path(); |
| 81 | 81 | |
| 82 | - if( set_include_path( implode( PATH_SEPARATOR, $includePaths ) ) === false ) { |
|
| 83 | - throw new Exception( 'Unable to extend include path' ); |
|
| 82 | + if (set_include_path(implode(PATH_SEPARATOR, $includePaths)) === false) { |
|
| 83 | + throw new Exception('Unable to extend include path'); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - spl_autoload_register( '\Aimeos\Shop\Command\SetupCommand::autoload', true ); |
|
| 86 | + spl_autoload_register('\Aimeos\Shop\Command\SetupCommand::autoload', true); |
|
| 87 | 87 | |
| 88 | - $manager = new \Aimeos\MW\Setup\Manager\Multiple( $ctx->getDatabaseManager(), $dbconfig, $taskPaths, $ctx ); |
|
| 88 | + $manager = new \Aimeos\MW\Setup\Manager\Multiple($ctx->getDatabaseManager(), $dbconfig, $taskPaths, $ctx); |
|
| 89 | 89 | |
| 90 | - $this->info( sprintf( 'Initializing or updating the Aimeos database tables for site "%1$s"', $site ) ); |
|
| 90 | + $this->info(sprintf('Initializing or updating the Aimeos database tables for site "%1$s"', $site)); |
|
| 91 | 91 | |
| 92 | - $manager->run( 'mysql' ); |
|
| 92 | + $manager->run('mysql'); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | protected function getArguments() |
| 102 | 102 | { |
| 103 | 103 | return array( |
| 104 | - array( 'site', InputArgument::OPTIONAL, 'Site for updating database entries', 'default' ), |
|
| 105 | - array( 'tplsite', InputArgument::OPTIONAL, 'Site used as template for creating the new one', 'default' ), |
|
| 104 | + array('site', InputArgument::OPTIONAL, 'Site for updating database entries', 'default'), |
|
| 105 | + array('tplsite', InputArgument::OPTIONAL, 'Site used as template for creating the new one', 'default'), |
|
| 106 | 106 | ); |
| 107 | 107 | } |
| 108 | 108 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | protected function getOptions() |
| 116 | 116 | { |
| 117 | 117 | return array( |
| 118 | - array( 'option', null, InputOption::VALUE_REQUIRED, 'Optional setup configuration, name and value are separated by ":" like "setup/default/demo:1"', array() ), |
|
| 118 | + array('option', null, InputOption::VALUE_REQUIRED, 'Optional setup configuration, name and value are separated by ":" like "setup/default/demo:1"', array()), |
|
| 119 | 119 | ); |
| 120 | 120 | } |
| 121 | 121 | |
@@ -126,14 +126,14 @@ discard block |
||
| 126 | 126 | * @param \Aimeos\MW\Config\Iface $conf Config object |
| 127 | 127 | * @return array Multi-dimensional associative list of database configuration parameters |
| 128 | 128 | */ |
| 129 | - protected function getDbConfig( \Aimeos\MW\Config\Iface $conf ) |
|
| 129 | + protected function getDbConfig(\Aimeos\MW\Config\Iface $conf) |
|
| 130 | 130 | { |
| 131 | - $dbconfig = $conf->get( 'resource', array() ); |
|
| 131 | + $dbconfig = $conf->get('resource', array()); |
|
| 132 | 132 | |
| 133 | - foreach( $dbconfig as $rname => $dbconf ) |
|
| 133 | + foreach ($dbconfig as $rname => $dbconf) |
|
| 134 | 134 | { |
| 135 | - if( strncmp( $rname, 'db', 2 ) !== 0 ) { |
|
| 136 | - unset( $dbconfig[$rname] ); |
|
| 135 | + if (strncmp($rname, 'db', 2) !== 0) { |
|
| 136 | + unset($dbconfig[$rname]); |
|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | |
@@ -148,12 +148,12 @@ discard block |
||
| 148 | 148 | * @param array Associative list of database configurations |
| 149 | 149 | * @throws \RuntimeException If the format of the options is invalid |
| 150 | 150 | */ |
| 151 | - protected function setOptions( \Aimeos\MW\Config\Iface $conf ) |
|
| 151 | + protected function setOptions(\Aimeos\MW\Config\Iface $conf) |
|
| 152 | 152 | { |
| 153 | - foreach( (array) $this->option( 'option' ) as $option ) |
|
| 153 | + foreach ((array) $this->option('option') as $option) |
|
| 154 | 154 | { |
| 155 | - list( $name, $value ) = explode( ':', $option ); |
|
| 156 | - $conf->set( $name, $value ); |
|
| 155 | + list($name, $value) = explode(':', $option); |
|
| 156 | + $conf->set($name, $value); |
|
| 157 | 157 | } |
| 158 | 158 | } |
| 159 | 159 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function indexAction() |
| 30 | 30 | { |
| 31 | - $params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'account-index' ); |
|
| 31 | + $params = app('\Aimeos\Shop\Base\Page')->getSections('account-index'); |
|
| 32 | 32 | return \View::make('shop::account.index', $params); |
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | \ No newline at end of file |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function indexAction() |
| 30 | 30 | { |
| 31 | - $params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'basket-index' ); |
|
| 31 | + $params = app('\Aimeos\Shop\Base\Page')->getSections('basket-index'); |
|
| 32 | 32 | return \View::make('shop::basket.index', $params); |
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | \ No newline at end of file |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function countAction() |
| 30 | 30 | { |
| 31 | - $params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'catalog-count' ); |
|
| 31 | + $params = app('\Aimeos\Shop\Base\Page')->getSections('catalog-count'); |
|
| 32 | 32 | $contents = \View::make('shop::catalog.count', $params); |
| 33 | 33 | |
| 34 | 34 | $response = \Response::make($contents, 200); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function detailAction() |
| 47 | 47 | { |
| 48 | - $params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-detail' ); |
|
| 48 | + $params = app('Aimeos\Shop\Base\Page')->getSections('catalog-detail'); |
|
| 49 | 49 | return \View::make('shop::catalog.detail', $params); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function listAction() |
| 59 | 59 | { |
| 60 | - $params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-list' ); |
|
| 60 | + $params = app('Aimeos\Shop\Base\Page')->getSections('catalog-list'); |
|
| 61 | 61 | return \View::make('shop::catalog.list', $params); |
| 62 | 62 | } |
| 63 | 63 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function stockAction() |
| 71 | 71 | { |
| 72 | - $params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-stock' ); |
|
| 72 | + $params = app('Aimeos\Shop\Base\Page')->getSections('catalog-stock'); |
|
| 73 | 73 | $contents = \View::make('shop::catalog.stock', $params); |
| 74 | 74 | |
| 75 | 75 | $response = \Response::make($contents, 200); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function suggestAction() |
| 88 | 88 | { |
| 89 | - $params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-suggest' ); |
|
| 89 | + $params = app('Aimeos\Shop\Base\Page')->getSections('catalog-suggest'); |
|
| 90 | 90 | $contents = \View::make('shop::catalog.suggest', $params); |
| 91 | 91 | |
| 92 | 92 | $response = \Response::make($contents, 200); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function confirmAction() |
| 30 | 30 | { |
| 31 | - $params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'checkout-confirm' ); |
|
| 31 | + $params = app('\Aimeos\Shop\Base\Page')->getSections('checkout-confirm'); |
|
| 32 | 32 | return \View::make('shop::checkout.confirm', $params); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function indexAction() |
| 42 | 42 | { |
| 43 | - $params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'checkout-index' ); |
|
| 43 | + $params = app('\Aimeos\Shop\Base\Page')->getSections('checkout-index'); |
|
| 44 | 44 | return \View::make('shop::checkout.index', $params); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function updateAction() |
| 54 | 54 | { |
| 55 | - $params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'checkout-update' ); |
|
| 55 | + $params = app('\Aimeos\Shop\Base\Page')->getSections('checkout-update'); |
|
| 56 | 56 | return \View::make('shop::checkout.update', $params); |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | \ No newline at end of file |
@@ -28,31 +28,31 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function boot() |
| 30 | 30 | { |
| 31 | - $basedir = dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR; |
|
| 31 | + $basedir = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR; |
|
| 32 | 32 | |
| 33 | - $this->mergeConfigFrom(dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR.'config/shop.php', 'shop'); |
|
| 33 | + $this->mergeConfigFrom(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'config/shop.php', 'shop'); |
|
| 34 | 34 | |
| 35 | - $this->loadViewsFrom($basedir.'views', 'shop'); |
|
| 35 | + $this->loadViewsFrom($basedir . 'views', 'shop'); |
|
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | $this->publishes(array( |
| 39 | - $basedir.'config/shop.php' => config_path('shop.php'), |
|
| 39 | + $basedir . 'config/shop.php' => config_path('shop.php'), |
|
| 40 | 40 | ), 'config'); |
| 41 | 41 | |
| 42 | 42 | $this->publishes(array( |
| 43 | - $basedir.'database/migrations' => base_path('database/migrations'), |
|
| 43 | + $basedir . 'database/migrations' => base_path('database/migrations'), |
|
| 44 | 44 | ), 'migrations'); |
| 45 | 45 | |
| 46 | 46 | $this->publishes(array( |
| 47 | - $basedir.'views' => base_path('resources/views/vendor/shop'), |
|
| 47 | + $basedir . 'views' => base_path('resources/views/vendor/shop'), |
|
| 48 | 48 | ), 'views'); |
| 49 | 49 | |
| 50 | 50 | $this->publishes(array( |
| 51 | - dirname($basedir).DIRECTORY_SEPARATOR.'public' => public_path('packages/aimeos/shop'), |
|
| 51 | + dirname($basedir) . DIRECTORY_SEPARATOR . 'public' => public_path('packages/aimeos/shop'), |
|
| 52 | 52 | ), 'public'); |
| 53 | 53 | |
| 54 | 54 | |
| 55 | - require $basedir.'routes.php'; |
|
| 55 | + require $basedir . 'routes.php'; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | return array( |
| 4 | 4 | 'apc_enabled' => false, |
| 5 | 5 | 'apc_prefix' => 'laravel:', |
| 6 | - 'extdir' => ( is_dir(base_path('ext')) ? base_path('ext') : dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'ext' ), |
|
| 6 | + 'extdir' => (is_dir(base_path('ext')) ? base_path('ext') : dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'ext'), |
|
| 7 | 7 | 'uploaddir' => '/', |
| 8 | 8 | |
| 9 | 9 | 'routes' => array( |
@@ -14,16 +14,16 @@ discard block |
||
| 14 | 14 | ), |
| 15 | 15 | |
| 16 | 16 | 'page' => array( |
| 17 | - 'account-index' => array( 'account/history','account/favorite','account/watch','basket/mini','catalog/session' ), |
|
| 18 | - 'basket-index' => array( 'basket/standard','basket/related' ), |
|
| 19 | - 'catalog-count' => array( 'catalog/count' ), |
|
| 20 | - 'catalog-detail' => array( 'basket/mini','catalog/stage','catalog/detail','catalog/session' ), |
|
| 21 | - 'catalog-list' => array( 'basket/mini','catalog/filter','catalog/stage','catalog/lists' ), |
|
| 22 | - 'catalog-stock' => array( 'catalog/stock' ), |
|
| 23 | - 'catalog-suggest' => array( 'catalog/suggest' ), |
|
| 24 | - 'checkout-confirm' => array( 'checkout/confirm' ), |
|
| 25 | - 'checkout-index' => array( 'checkout/standard' ), |
|
| 26 | - 'checkout-update' => array( 'checkout/update'), |
|
| 17 | + 'account-index' => array('account/history', 'account/favorite', 'account/watch', 'basket/mini', 'catalog/session'), |
|
| 18 | + 'basket-index' => array('basket/standard', 'basket/related'), |
|
| 19 | + 'catalog-count' => array('catalog/count'), |
|
| 20 | + 'catalog-detail' => array('basket/mini', 'catalog/stage', 'catalog/detail', 'catalog/session'), |
|
| 21 | + 'catalog-list' => array('basket/mini', 'catalog/filter', 'catalog/stage', 'catalog/lists'), |
|
| 22 | + 'catalog-stock' => array('catalog/stock'), |
|
| 23 | + 'catalog-suggest' => array('catalog/suggest'), |
|
| 24 | + 'checkout-confirm' => array('checkout/confirm'), |
|
| 25 | + 'checkout-index' => array('checkout/standard'), |
|
| 26 | + 'checkout-update' => array('checkout/update'), |
|
| 27 | 27 | ), |
| 28 | 28 | |
| 29 | 29 | 'resource' => array( |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | 'database' => env('DB_DATABASE', 'laravel'), |
| 35 | 35 | 'username' => env('DB_USERNAME', 'root'), |
| 36 | 36 | 'password' => env('DB_PASSWORD', ''), |
| 37 | - 'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ), |
|
| 37 | + 'stmt' => array("SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'"), |
|
| 38 | 38 | 'opt-persistent' => 0, |
| 39 | 39 | 'limit' => 2, |
| 40 | 40 | ), |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | 'import' => array( |
| 159 | 159 | 'text' => array( |
| 160 | 160 | 'default' => array( |
| 161 | - 'uploaddir' => public_path( 'uploads' ), |
|
| 161 | + 'uploaddir' => public_path('uploads'), |
|
| 162 | 162 | 'fileperms' => '0660', |
| 163 | 163 | ), |
| 164 | 164 | ), |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | 'export' => array( |
| 167 | 167 | 'text' => array( |
| 168 | 168 | 'default' => array( |
| 169 | - 'exportdir' => public_path( 'uploads' ), |
|
| 169 | + 'exportdir' => public_path('uploads'), |
|
| 170 | 170 | 'downloaddir' => 'uploads', |
| 171 | 171 | ), |
| 172 | 172 | ), |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | 'import' => array( |
| 177 | 177 | 'text' => array( |
| 178 | 178 | 'default' => array( |
| 179 | - 'uploaddir' => public_path( 'uploads' ), |
|
| 179 | + 'uploaddir' => public_path('uploads'), |
|
| 180 | 180 | 'fileperms' => '0660', |
| 181 | 181 | ), |
| 182 | 182 | ), |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | 'export' => array( |
| 185 | 185 | 'text' => array( |
| 186 | 186 | 'default' => array( |
| 187 | - 'exportdir' => public_path( 'uploads' ), |
|
| 187 | + 'exportdir' => public_path('uploads'), |
|
| 188 | 188 | 'downloaddir' => 'uploads', |
| 189 | 189 | ), |
| 190 | 190 | ), |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | 'import' => array( |
| 255 | 255 | 'text' => array( |
| 256 | 256 | 'default' => array( |
| 257 | - 'uploaddir' => public_path( 'uploads' ), |
|
| 257 | + 'uploaddir' => public_path('uploads'), |
|
| 258 | 258 | 'fileperms' => '0660', |
| 259 | 259 | ), |
| 260 | 260 | ), |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | 'export' => array( |
| 263 | 263 | 'text' => array( |
| 264 | 264 | 'default' => array( |
| 265 | - 'exportdir' => public_path( 'uploads' ), |
|
| 265 | + 'exportdir' => public_path('uploads'), |
|
| 266 | 266 | 'downloaddir' => 'uploads', |
| 267 | 267 | ), |
| 268 | 268 | ), |
@@ -2,15 +2,15 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | Route::group(config('shop.routes.admin', []), function() { |
| 4 | 4 | |
| 5 | - Route::match( array( 'GET' ), 'admin/file', array( |
|
| 5 | + Route::match(array('GET'), 'admin/file', array( |
|
| 6 | 6 | 'as' => 'aimeos_shop_admin_file', |
| 7 | 7 | 'uses' => 'Aimeos\Shop\Controller\AdminController@fileAction' |
| 8 | 8 | )); |
| 9 | - Route::match( array( 'POST' ), 'admin/do', array( |
|
| 9 | + Route::match(array('POST'), 'admin/do', array( |
|
| 10 | 10 | 'as' => 'aimeos_shop_admin_json', |
| 11 | 11 | 'uses' => 'Aimeos\Shop\Controller\AdminController@doAction' |
| 12 | 12 | )); |
| 13 | - Route::match( array( 'GET' ), 'admin', array( |
|
| 13 | + Route::match(array('GET'), 'admin', array( |
|
| 14 | 14 | 'as' => 'aimeos_shop_admin', |
| 15 | 15 | 'uses' => 'Aimeos\Shop\Controller\AdminController@indexAction' |
| 16 | 16 | )); |
@@ -20,50 +20,50 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | Route::group(config('shop.routes.jsonadm', []), function() { |
| 22 | 22 | |
| 23 | - Route::match( array( 'DELETE' ), 'jsonadm/{resource}/{id?}', array( |
|
| 23 | + Route::match(array('DELETE'), 'jsonadm/{resource}/{id?}', array( |
|
| 24 | 24 | 'as' => 'aimeos_shop_jsonadm_delete', |
| 25 | 25 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@deleteAction' |
| 26 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
| 26 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
| 27 | 27 | |
| 28 | - Route::match( array( 'GET' ), 'jsonadm/{resource}/{id?}', array( |
|
| 28 | + Route::match(array('GET'), 'jsonadm/{resource}/{id?}', array( |
|
| 29 | 29 | 'as' => 'aimeos_shop_jsonadm_get', |
| 30 | 30 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@getAction' |
| 31 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
| 31 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
| 32 | 32 | |
| 33 | - Route::match( array( 'PATCH' ), 'jsonadm/{resource}/{id?}', array( |
|
| 33 | + Route::match(array('PATCH'), 'jsonadm/{resource}/{id?}', array( |
|
| 34 | 34 | 'as' => 'aimeos_shop_jsonadm_patch', |
| 35 | 35 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@patchAction' |
| 36 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
| 36 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
| 37 | 37 | |
| 38 | - Route::match( array( 'POST' ), 'jsonadm/{resource}/{id?}', array( |
|
| 38 | + Route::match(array('POST'), 'jsonadm/{resource}/{id?}', array( |
|
| 39 | 39 | 'as' => 'aimeos_shop_jsonadm_post', |
| 40 | 40 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@postAction' |
| 41 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
| 41 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
| 42 | 42 | |
| 43 | - Route::match( array( 'PUT' ), 'jsonadm/{resource}/{id?}', array( |
|
| 43 | + Route::match(array('PUT'), 'jsonadm/{resource}/{id?}', array( |
|
| 44 | 44 | 'as' => 'aimeos_shop_jsonadm_put', |
| 45 | 45 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@putAction' |
| 46 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
| 46 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
| 47 | 47 | |
| 48 | - Route::match( array( 'OPTIONS' ), 'jsonadm/{resource?}', array( |
|
| 48 | + Route::match(array('OPTIONS'), 'jsonadm/{resource?}', array( |
|
| 49 | 49 | 'as' => 'aimeos_shop_jsonadm_options', |
| 50 | 50 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@optionsAction' |
| 51 | - ))->where( array( 'resource' => '[^0-9]*' ) ); |
|
| 51 | + ))->where(array('resource' => '[^0-9]*')); |
|
| 52 | 52 | |
| 53 | 53 | }); |
| 54 | 54 | |
| 55 | 55 | |
| 56 | 56 | Route::group(config('shop.routes.account', ['middleware' => 'auth']), function() { |
| 57 | 57 | |
| 58 | - Route::match( array( 'GET', 'POST' ), 'myaccount', array( |
|
| 58 | + Route::match(array('GET', 'POST'), 'myaccount', array( |
|
| 59 | 59 | 'as' => 'aimeos_shop_account', |
| 60 | 60 | 'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction' |
| 61 | 61 | )); |
| 62 | - Route::match( array( 'GET', 'POST' ), 'myaccount/favorite/{fav_action?}/{fav_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
| 62 | + Route::match(array('GET', 'POST'), 'myaccount/favorite/{fav_action?}/{fav_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
| 63 | 63 | 'as' => 'aimeos_shop_account_favorite', |
| 64 | 64 | 'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction' |
| 65 | 65 | )); |
| 66 | - Route::match( array( 'GET', 'POST' ), 'myaccount/watch/{wat_action?}/{wat_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
| 66 | + Route::match(array('GET', 'POST'), 'myaccount/watch/{wat_action?}/{wat_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
| 67 | 67 | 'as' => 'aimeos_shop_account_watch', |
| 68 | 68 | 'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction' |
| 69 | 69 | )); |
@@ -73,45 +73,45 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | Route::group(config('shop.routes.default', []), function() { |
| 75 | 75 | |
| 76 | - Route::match( array( 'GET', 'POST' ), 'basket', array( |
|
| 76 | + Route::match(array('GET', 'POST'), 'basket', array( |
|
| 77 | 77 | 'as' => 'aimeos_shop_basket', |
| 78 | 78 | 'uses' => 'Aimeos\Shop\Controller\BasketController@indexAction' |
| 79 | 79 | )); |
| 80 | 80 | |
| 81 | - Route::match( array( 'GET', 'POST' ), 'count', array( |
|
| 81 | + Route::match(array('GET', 'POST'), 'count', array( |
|
| 82 | 82 | 'as' => 'aimeos_shop_count', |
| 83 | 83 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@countAction' |
| 84 | 84 | )); |
| 85 | - Route::match( array( 'GET', 'POST' ), 'detail/{d_prodid}/{d_name?}/{l_pos?}', array( |
|
| 85 | + Route::match(array('GET', 'POST'), 'detail/{d_prodid}/{d_name?}/{l_pos?}', array( |
|
| 86 | 86 | 'as' => 'aimeos_shop_detail', |
| 87 | 87 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@detailAction' |
| 88 | 88 | )); |
| 89 | - Route::match( array( 'GET', 'POST' ), 'detail/pin/{pin_action?}/{pin_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
| 89 | + Route::match(array('GET', 'POST'), 'detail/pin/{pin_action?}/{pin_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
| 90 | 90 | 'as' => 'aimeos_shop_session_pinned', |
| 91 | 91 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@detailAction' |
| 92 | 92 | )); |
| 93 | - Route::match( array( 'GET', 'POST' ), 'list', array( |
|
| 93 | + Route::match(array('GET', 'POST'), 'list', array( |
|
| 94 | 94 | 'as' => 'aimeos_shop_list', |
| 95 | 95 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@listAction' |
| 96 | 96 | )); |
| 97 | - Route::match( array( 'GET', 'POST' ), 'suggest', array( |
|
| 97 | + Route::match(array('GET', 'POST'), 'suggest', array( |
|
| 98 | 98 | 'as' => 'aimeos_shop_suggest', |
| 99 | 99 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@suggestAction' |
| 100 | 100 | )); |
| 101 | - Route::match( array( 'GET', 'POST' ), 'stock', array( |
|
| 101 | + Route::match(array('GET', 'POST'), 'stock', array( |
|
| 102 | 102 | 'as' => 'aimeos_shop_stock', |
| 103 | 103 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@stockAction' |
| 104 | 104 | )); |
| 105 | 105 | |
| 106 | - Route::match( array( 'GET', 'POST' ), 'checkout/{c_step?}', array( |
|
| 106 | + Route::match(array('GET', 'POST'), 'checkout/{c_step?}', array( |
|
| 107 | 107 | 'as' => 'aimeos_shop_checkout', |
| 108 | 108 | 'uses' => 'Aimeos\Shop\Controller\CheckoutController@indexAction' |
| 109 | 109 | )); |
| 110 | - Route::match( array( 'GET', 'POST' ), 'confirm', array( |
|
| 110 | + Route::match(array('GET', 'POST'), 'confirm', array( |
|
| 111 | 111 | 'as' => 'aimeos_shop_confirm', |
| 112 | 112 | 'uses' => 'Aimeos\Shop\Controller\CheckoutController@confirmAction' |
| 113 | 113 | )); |
| 114 | - Route::match( array( 'GET', 'POST' ), 'update', array( |
|
| 114 | + Route::match(array('GET', 'POST'), 'update', array( |
|
| 115 | 115 | 'as' => 'aimeos_shop_update', |
| 116 | 116 | 'uses' => 'Aimeos\Shop\Controller\CheckoutController@updateAction' |
| 117 | 117 | )); |
@@ -39,18 +39,18 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | public function fire() |
| 41 | 41 | { |
| 42 | - $context = $this->getLaravel()->make( 'Aimeos\Shop\Base\Context' )->get( false ); |
|
| 43 | - $context->setEditor( 'aimeos:account' ); |
|
| 42 | + $context = $this->getLaravel()->make('Aimeos\Shop\Base\Context')->get(false); |
|
| 43 | + $context->setEditor('aimeos:account'); |
|
| 44 | 44 | |
| 45 | - $code = $this->argument( 'email' ); |
|
| 46 | - if( ( $password = $this->option( 'password' ) ) === null ) { |
|
| 47 | - $password = $this->secret( 'Password' ); |
|
| 45 | + $code = $this->argument('email'); |
|
| 46 | + if (($password = $this->option('password')) === null) { |
|
| 47 | + $password = $this->secret('Password'); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - $user = $this->getCustomerItem( $context, $code, $password ); |
|
| 50 | + $user = $this->getCustomerItem($context, $code, $password); |
|
| 51 | 51 | |
| 52 | - if( $this->option( 'admin' ) ) { |
|
| 53 | - $this->addPrivilege( $context, $user, 'admin' ); |
|
| 52 | + if ($this->option('admin')) { |
|
| 53 | + $this->addPrivilege($context, $user, 'admin'); |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
@@ -62,31 +62,31 @@ discard block |
||
| 62 | 62 | * @param string $userid Unique user ID |
| 63 | 63 | * @param string $groupid Unique group ID |
| 64 | 64 | */ |
| 65 | - protected function addListItem( \Aimeos\MShop\Context\Item\Iface $context, $userid, $groupid ) |
|
| 65 | + protected function addListItem(\Aimeos\MShop\Context\Item\Iface $context, $userid, $groupid) |
|
| 66 | 66 | { |
| 67 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context )->getSubmanager( 'lists' ); |
|
| 68 | - $typeid = $this->getTypeItem( $manager, 'default' )->getId(); |
|
| 67 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context)->getSubmanager('lists'); |
|
| 68 | + $typeid = $this->getTypeItem($manager, 'default')->getId(); |
|
| 69 | 69 | |
| 70 | 70 | $search = $manager->createSearch(); |
| 71 | 71 | $expr = array( |
| 72 | - $search->compare( '==', 'customer.lists.parentid', $userid ), |
|
| 73 | - $search->compare( '==', 'customer.lists.refid', $groupid ), |
|
| 74 | - $search->compare( '==', 'customer.lists.domain', 'customer/group' ), |
|
| 75 | - $search->compare( '==', 'customer.lists.typeid', $typeid ), |
|
| 72 | + $search->compare('==', 'customer.lists.parentid', $userid), |
|
| 73 | + $search->compare('==', 'customer.lists.refid', $groupid), |
|
| 74 | + $search->compare('==', 'customer.lists.domain', 'customer/group'), |
|
| 75 | + $search->compare('==', 'customer.lists.typeid', $typeid), |
|
| 76 | 76 | ); |
| 77 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 78 | - $search->setSlice( 0, 1 ); |
|
| 77 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 78 | + $search->setSlice(0, 1); |
|
| 79 | 79 | |
| 80 | - if( count( $manager->searchItems( $search ) ) === 0 ) |
|
| 80 | + if (count($manager->searchItems($search)) === 0) |
|
| 81 | 81 | { |
| 82 | 82 | $item = $manager->createItem(); |
| 83 | - $item->setDomain( 'customer/group' ); |
|
| 84 | - $item->setParentId( $userid ); |
|
| 85 | - $item->setTypeId( $typeid ); |
|
| 86 | - $item->setRefId( $groupid ); |
|
| 87 | - $item->setStatus( 1 ); |
|
| 83 | + $item->setDomain('customer/group'); |
|
| 84 | + $item->setParentId($userid); |
|
| 85 | + $item->setTypeId($typeid); |
|
| 86 | + $item->setRefId($groupid); |
|
| 87 | + $item->setStatus(1); |
|
| 88 | 88 | |
| 89 | - $manager->saveItem( $item, false ); |
|
| 89 | + $manager->saveItem($item, false); |
|
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | |
@@ -98,23 +98,23 @@ discard block |
||
| 98 | 98 | * @param \Aimeos\MShop\Customer\Item\Iface $user Aimeos customer object |
| 99 | 99 | * @param string $privilege Unique customer group code |
| 100 | 100 | */ |
| 101 | - protected function addPrivilege( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Customer\Item\Iface $user, $privilege ) |
|
| 101 | + protected function addPrivilege(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Customer\Item\Iface $user, $privilege) |
|
| 102 | 102 | { |
| 103 | - $this->info( sprintf( 'Add "%1$s" privilege to user "%2$s" for sites', $privilege, $user->getCode() ) ); |
|
| 103 | + $this->info(sprintf('Add "%1$s" privilege to user "%2$s" for sites', $privilege, $user->getCode())); |
|
| 104 | 104 | |
| 105 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
| 105 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
| 106 | 106 | |
| 107 | - foreach( $this->getSiteItems( $context, $this->argument( 'site' ) ) as $siteItem ) |
|
| 107 | + foreach ($this->getSiteItems($context, $this->argument('site')) as $siteItem) |
|
| 108 | 108 | { |
| 109 | - $localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false ); |
|
| 109 | + $localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false); |
|
| 110 | 110 | |
| 111 | 111 | $lcontext = clone $context; |
| 112 | - $lcontext->setLocale( $localeItem ); |
|
| 112 | + $lcontext->setLocale($localeItem); |
|
| 113 | 113 | |
| 114 | - $this->info( $siteItem->getCode() ); |
|
| 114 | + $this->info($siteItem->getCode()); |
|
| 115 | 115 | |
| 116 | - $groupItem = $this->getGroupItem( $lcontext, $privilege ); |
|
| 117 | - $this->addListItem( $lcontext, $user->getId(), $groupItem->getId() ); |
|
| 116 | + $groupItem = $this->getGroupItem($lcontext, $privilege); |
|
| 117 | + $this->addListItem($lcontext, $user->getId(), $groupItem->getId()); |
|
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
@@ -127,8 +127,8 @@ discard block |
||
| 127 | 127 | protected function getArguments() |
| 128 | 128 | { |
| 129 | 129 | return array( |
| 130 | - array( 'email', InputArgument::REQUIRED, 'E-mail address of the account that should be created' ), |
|
| 131 | - array( 'site', InputArgument::OPTIONAL, 'Site codes to create accounts for like "default unittest" (none for all)' ), |
|
| 130 | + array('email', InputArgument::REQUIRED, 'E-mail address of the account that should be created'), |
|
| 131 | + array('site', InputArgument::OPTIONAL, 'Site codes to create accounts for like "default unittest" (none for all)'), |
|
| 132 | 132 | ); |
| 133 | 133 | } |
| 134 | 134 | |
@@ -143,21 +143,21 @@ discard block |
||
| 143 | 143 | * @param string $password New user password |
| 144 | 144 | * @return \Aimeos\MShop\Customer\Item\Iface Aimeos customer item object |
| 145 | 145 | */ |
| 146 | - protected function getCustomerItem( \Aimeos\MShop\Context\Item\Iface $context, $email, $password ) |
|
| 146 | + protected function getCustomerItem(\Aimeos\MShop\Context\Item\Iface $context, $email, $password) |
|
| 147 | 147 | { |
| 148 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' ); |
|
| 148 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer'); |
|
| 149 | 149 | |
| 150 | 150 | try { |
| 151 | - $item = $manager->getItem( $email ); |
|
| 152 | - } catch( \Aimeos\MShop\Exception $e ) { |
|
| 151 | + $item = $manager->getItem($email); |
|
| 152 | + } catch (\Aimeos\MShop\Exception $e) { |
|
| 153 | 153 | $item = $manager->createItem(); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - $item->setCode( $email ); |
|
| 157 | - $item->getPaymentAddress()->setEmail( $email ); |
|
| 158 | - $item->setPassword( $password ); |
|
| 156 | + $item->setCode($email); |
|
| 157 | + $item->getPaymentAddress()->setEmail($email); |
|
| 158 | + $item->setPassword($password); |
|
| 159 | 159 | |
| 160 | - $manager->saveItem( $item ); |
|
| 160 | + $manager->saveItem($item); |
|
| 161 | 161 | |
| 162 | 162 | return $item; |
| 163 | 163 | } |
@@ -170,21 +170,21 @@ discard block |
||
| 170 | 170 | * @param string $code Unique customer group code |
| 171 | 171 | * @return \Aimeos\MShop\Customer\Item\Group\Iface Aimeos customer group item object |
| 172 | 172 | */ |
| 173 | - protected function getGroupItem( \Aimeos\MShop\Context\Item\Iface $context, $code ) |
|
| 173 | + protected function getGroupItem(\Aimeos\MShop\Context\Item\Iface $context, $code) |
|
| 174 | 174 | { |
| 175 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context )->getSubmanager( 'group' ); |
|
| 175 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context)->getSubmanager('group'); |
|
| 176 | 176 | |
| 177 | 177 | try |
| 178 | 178 | { |
| 179 | - $item = $manager->getItem( $code ); |
|
| 179 | + $item = $manager->getItem($code); |
|
| 180 | 180 | } |
| 181 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 181 | + catch (\Aimeos\MShop\Exception $e) |
|
| 182 | 182 | { |
| 183 | 183 | $item = $manager->createItem(); |
| 184 | - $item->setLabel( $code ); |
|
| 185 | - $item->setCode( $code ); |
|
| 184 | + $item->setLabel($code); |
|
| 185 | + $item->setCode($code); |
|
| 186 | 186 | |
| 187 | - $manager->saveItem( $item ); |
|
| 187 | + $manager->saveItem($item); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | return $item; |
@@ -199,8 +199,8 @@ discard block |
||
| 199 | 199 | protected function getOptions() |
| 200 | 200 | { |
| 201 | 201 | return array( |
| 202 | - array( 'password', null, InputOption::VALUE_REQUIRED, 'Optional password for the account (will ask for if not given)' ), |
|
| 203 | - array( 'admin', null, InputOption::VALUE_NONE, 'If account should have administrator privileges' ), |
|
| 202 | + array('password', null, InputOption::VALUE_REQUIRED, 'Optional password for the account (will ask for if not given)'), |
|
| 203 | + array('admin', null, InputOption::VALUE_NONE, 'If account should have administrator privileges'), |
|
| 204 | 204 | ); |
| 205 | 205 | } |
| 206 | 206 | |
@@ -213,23 +213,23 @@ discard block |
||
| 213 | 213 | * @return \Aimeos\MShop\Common\Item\Type\Iface Aimeos customer list type item object |
| 214 | 214 | * @throws \Exception If no customer list type item for the given code is found |
| 215 | 215 | */ |
| 216 | - protected function getTypeItem( \Aimeos\MShop\Common\Manager\Iface $listManager, $code ) |
|
| 216 | + protected function getTypeItem(\Aimeos\MShop\Common\Manager\Iface $listManager, $code) |
|
| 217 | 217 | { |
| 218 | - $manager = $listManager->getSubmanager( 'type' ); |
|
| 218 | + $manager = $listManager->getSubmanager('type'); |
|
| 219 | 219 | |
| 220 | 220 | $search = $manager->createSearch(); |
| 221 | 221 | $expr = array( |
| 222 | - $search->compare( '==', 'customer.lists.type.domain', 'customer/group' ), |
|
| 223 | - $search->compare( '==', 'customer.lists.type.code', $code ), |
|
| 222 | + $search->compare('==', 'customer.lists.type.domain', 'customer/group'), |
|
| 223 | + $search->compare('==', 'customer.lists.type.code', $code), |
|
| 224 | 224 | ); |
| 225 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 225 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 226 | 226 | |
| 227 | - $result = $manager->searchItems( $search ); |
|
| 227 | + $result = $manager->searchItems($search); |
|
| 228 | 228 | |
| 229 | - if( ( $item = reset( $result ) ) === false ) |
|
| 229 | + if (($item = reset($result)) === false) |
|
| 230 | 230 | { |
| 231 | - $msg = sprintf( 'No user list type item for domain "%1$s" and code "%2$s" found', 'customer/group', $code ); |
|
| 232 | - throw new \Exception( $msg ); |
|
| 231 | + $msg = sprintf('No user list type item for domain "%1$s" and code "%2$s" found', 'customer/group', $code); |
|
| 232 | + throw new \Exception($msg); |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | return $item; |
@@ -177,8 +177,7 @@ |
||
| 177 | 177 | try |
| 178 | 178 | { |
| 179 | 179 | $item = $manager->getItem( $code ); |
| 180 | - } |
|
| 181 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 180 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 182 | 181 | { |
| 183 | 182 | $item = $manager->createItem(); |
| 184 | 183 | $item->setLabel( $code ); |