@@ -16,13 +16,13 @@ |
||
16 | 16 | */ |
17 | 17 | class Service extends \Illuminate\Support\Facades\Facade |
18 | 18 | { |
19 | - /** |
|
20 | - * Returns a new service frontend controller object |
|
21 | - * |
|
22 | - * @return \Aimeos\Controller\Frontend\Service\Iface |
|
23 | - */ |
|
24 | - protected static function getFacadeAccessor() |
|
25 | - { |
|
26 | - return \Aimeos\Controller\Frontend::create( app( 'aimeos.context' )->get(), 'service' ); |
|
27 | - } |
|
19 | + /** |
|
20 | + * Returns a new service frontend controller object |
|
21 | + * |
|
22 | + * @return \Aimeos\Controller\Frontend\Service\Iface |
|
23 | + */ |
|
24 | + protected static function getFacadeAccessor() |
|
25 | + { |
|
26 | + return \Aimeos\Controller\Frontend::create( app( 'aimeos.context' )->get(), 'service' ); |
|
27 | + } |
|
28 | 28 | } |
@@ -16,13 +16,13 @@ |
||
16 | 16 | */ |
17 | 17 | class Attribute extends \Illuminate\Support\Facades\Facade |
18 | 18 | { |
19 | - /** |
|
20 | - * Returns a new attribute frontend controller object |
|
21 | - * |
|
22 | - * @return \Aimeos\Controller\Frontend\Attribute\Iface |
|
23 | - */ |
|
24 | - protected static function getFacadeAccessor() |
|
25 | - { |
|
26 | - return \Aimeos\Controller\Frontend::create( app( 'aimeos.context' )->get(), 'attribute' ); |
|
27 | - } |
|
19 | + /** |
|
20 | + * Returns a new attribute frontend controller object |
|
21 | + * |
|
22 | + * @return \Aimeos\Controller\Frontend\Attribute\Iface |
|
23 | + */ |
|
24 | + protected static function getFacadeAccessor() |
|
25 | + { |
|
26 | + return \Aimeos\Controller\Frontend::create( app( 'aimeos.context' )->get(), 'attribute' ); |
|
27 | + } |
|
28 | 28 | } |
@@ -110,9 +110,9 @@ |
||
110 | 110 | $params['aibody'][$name] = Shop::get( $name )->getBody(); |
111 | 111 | } |
112 | 112 | |
113 | - return Response::view('shop::catalog.suggest', $params) |
|
114 | - ->header('Cache-Control', 'private, max-age=300' ) |
|
115 | - ->header('Content-Type', 'application/json'); |
|
113 | + return Response::view( 'shop::catalog.suggest', $params ) |
|
114 | + ->header( 'Cache-Control', 'private, max-age=300' ) |
|
115 | + ->header( 'Content-Type', 'application/json' ); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 |
@@ -13,11 +13,11 @@ |
||
13 | 13 | $app['config']->set('database.connections.mysql', [ |
14 | 14 | 'driver' => 'mysql', |
15 | 15 | 'host' => env('DB_HOST', '127.0.0.1'), |
16 | - 'port' => env('DB_PORT', '3306'), |
|
16 | + 'port' => env('DB_PORT', '3306'), |
|
17 | 17 | 'database' => env('DB_DATABASE', 'laravel'), |
18 | 18 | 'username' => env('DB_USERNAME', 'aimeos'), |
19 | 19 | 'password' => env('DB_PASSWORD', 'aimeos'), |
20 | - 'unix_socket' => env('DB_SOCKET', ''), |
|
20 | + 'unix_socket' => env('DB_SOCKET', ''), |
|
21 | 21 | 'collation' => 'utf8_unicode_ci', |
22 | 22 | ]); |
23 | 23 |
@@ -2,31 +2,31 @@ discard block |
||
2 | 2 | |
3 | 3 | class AimeosTestAbstract extends Orchestra\Testbench\BrowserKit\TestCase |
4 | 4 | { |
5 | - protected function getEnvironmentSetUp($app) |
|
5 | + protected function getEnvironmentSetUp( $app ) |
|
6 | 6 | { |
7 | 7 | putenv( 'APP_DEBUG=1' ); |
8 | 8 | |
9 | - $app['config']->set('app.key', 'SomeRandomStringWith32Characters'); |
|
10 | - $app['config']->set('app.cipher', 'AES-256-CBC'); |
|
9 | + $app['config']->set( 'app.key', 'SomeRandomStringWith32Characters' ); |
|
10 | + $app['config']->set( 'app.cipher', 'AES-256-CBC' ); |
|
11 | 11 | |
12 | - $app['config']->set('database.default', 'mysql'); |
|
13 | - $app['config']->set('database.connections.mysql', [ |
|
12 | + $app['config']->set( 'database.default', 'mysql' ); |
|
13 | + $app['config']->set( 'database.connections.mysql', [ |
|
14 | 14 | 'driver' => 'mysql', |
15 | - 'host' => env('DB_HOST', '127.0.0.1'), |
|
16 | - 'port' => env('DB_PORT', '3306'), |
|
17 | - 'database' => env('DB_DATABASE', 'laravel'), |
|
18 | - 'username' => env('DB_USERNAME', 'aimeos'), |
|
19 | - 'password' => env('DB_PASSWORD', 'aimeos'), |
|
20 | - 'unix_socket' => env('DB_SOCKET', ''), |
|
15 | + 'host' => env( 'DB_HOST', '127.0.0.1' ), |
|
16 | + 'port' => env( 'DB_PORT', '3306' ), |
|
17 | + 'database' => env( 'DB_DATABASE', 'laravel' ), |
|
18 | + 'username' => env( 'DB_USERNAME', 'aimeos' ), |
|
19 | + 'password' => env( 'DB_PASSWORD', 'aimeos' ), |
|
20 | + 'unix_socket' => env( 'DB_SOCKET', '' ), |
|
21 | 21 | 'collation' => 'utf8_unicode_ci', |
22 | - ]); |
|
22 | + ] ); |
|
23 | 23 | |
24 | - $app['config']->set('shop.resource.db', [ |
|
24 | + $app['config']->set( 'shop.resource.db', [ |
|
25 | 25 | 'adapter' => 'mysql', |
26 | - 'host' => env('DB_HOST', '127.0.0.1'), |
|
27 | - 'database' => env('DB_DATABASE', 'laravel'), |
|
28 | - 'username' => env('DB_USERNAME', 'aimeos'), |
|
29 | - 'password' => env('DB_PASSWORD', 'aimeos'), |
|
26 | + 'host' => env( 'DB_HOST', '127.0.0.1' ), |
|
27 | + 'database' => env( 'DB_DATABASE', 'laravel' ), |
|
28 | + 'username' => env( 'DB_USERNAME', 'aimeos' ), |
|
29 | + 'password' => env( 'DB_PASSWORD', 'aimeos' ), |
|
30 | 30 | 'stmt' => ["SET SESSION sort_buffer_size=2097144; SET SESSION sql_mode='ANSI'; SET NAMES 'utf8_bin'"], |
31 | 31 | 'opt-persistent' => 0, |
32 | 32 | 'limit' => 3, |
@@ -34,23 +34,23 @@ discard block |
||
34 | 34 | 'collate' => 'utf8_unicode_ci', |
35 | 35 | 'charset' => 'utf8', |
36 | 36 | ], |
37 | - ]); |
|
37 | + ] ); |
|
38 | 38 | |
39 | - $app['config']->set('shop.authorize', false); |
|
40 | - $app['config']->set('shop.disableSites', false); |
|
41 | - $app['config']->set('shop.accessControl', false); |
|
42 | - $app['config']->set('shop.routes.jqadm', ['prefix' => '{site}/jqadm']); |
|
43 | - $app['config']->set('shop.routes.jsonadm', ['prefix' => '{site}/jsonadm']); |
|
44 | - $app['config']->set('shop.routes.jsonapi', ['prefix' => '{site}/jsonapi']); |
|
45 | - $app['config']->set('shop.routes.account', ['prefix' => '{site}/myaccount']); |
|
46 | - $app['config']->set('shop.routes.default', ['prefix' => '{site}/shop']); |
|
47 | - $app['config']->set('shop.routes.update', ['prefix' => '{site}']); |
|
48 | - $app['config']->set('shop.routes.login', []); |
|
49 | - $app['config']->set('shop.extdir', dirname( __DIR__ ) . DIRECTORY_SEPARATOR . 'ext' ); |
|
39 | + $app['config']->set( 'shop.authorize', false ); |
|
40 | + $app['config']->set( 'shop.disableSites', false ); |
|
41 | + $app['config']->set( 'shop.accessControl', false ); |
|
42 | + $app['config']->set( 'shop.routes.jqadm', ['prefix' => '{site}/jqadm'] ); |
|
43 | + $app['config']->set( 'shop.routes.jsonadm', ['prefix' => '{site}/jsonadm'] ); |
|
44 | + $app['config']->set( 'shop.routes.jsonapi', ['prefix' => '{site}/jsonapi'] ); |
|
45 | + $app['config']->set( 'shop.routes.account', ['prefix' => '{site}/myaccount'] ); |
|
46 | + $app['config']->set( 'shop.routes.default', ['prefix' => '{site}/shop'] ); |
|
47 | + $app['config']->set( 'shop.routes.update', ['prefix' => '{site}'] ); |
|
48 | + $app['config']->set( 'shop.routes.login', [] ); |
|
49 | + $app['config']->set( 'shop.extdir', dirname( __DIR__ ) . DIRECTORY_SEPARATOR . 'ext' ); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | |
53 | - protected function getPackageProviders($app) |
|
53 | + protected function getPackageProviders( $app ) |
|
54 | 54 | { |
55 | 55 | return ['Aimeos\Shop\ShopServiceProvider']; |
56 | 56 | } |
@@ -4,40 +4,40 @@ |
||
4 | 4 | |
5 | 5 | 'apc_enabled' => false, |
6 | 6 | 'apc_prefix' => 'laravel:', |
7 | - 'extdir' => base_path('ext'), |
|
7 | + 'extdir' => base_path( 'ext' ), |
|
8 | 8 | 'pcntl_max' => 4, |
9 | 9 | 'pcntl_priority' => 19, |
10 | 10 | 'uploaddir' => '/', |
11 | 11 | |
12 | 12 | 'page' => array( |
13 | - 'account-index' => array( 'account/profile','account/subscription','account/history','account/favorite','account/watch','basket/mini','catalog/session' ), |
|
14 | - 'basket-index' => array( 'basket/bulk', 'basket/standard','basket/related' ), |
|
13 | + 'account-index' => array( 'account/profile', 'account/subscription', 'account/history', 'account/favorite', 'account/watch', 'basket/mini', 'catalog/session' ), |
|
14 | + 'basket-index' => array( 'basket/bulk', 'basket/standard', 'basket/related' ), |
|
15 | 15 | 'catalog-count' => array( 'catalog/count' ), |
16 | - 'catalog-detail' => array( 'basket/mini','catalog/stage','catalog/detail','catalog/session' ), |
|
17 | - 'catalog-list' => array( 'basket/mini','catalog/filter','catalog/lists' ), |
|
16 | + 'catalog-detail' => array( 'basket/mini', 'catalog/stage', 'catalog/detail', 'catalog/session' ), |
|
17 | + 'catalog-list' => array( 'basket/mini', 'catalog/filter', 'catalog/lists' ), |
|
18 | 18 | 'catalog-stock' => array( 'catalog/stock' ), |
19 | 19 | 'catalog-suggest' => array( 'catalog/suggest' ), |
20 | - 'catalog-tree' => array( 'basket/mini','catalog/filter','catalog/stage','catalog/lists' ), |
|
20 | + 'catalog-tree' => array( 'basket/mini', 'catalog/filter', 'catalog/stage', 'catalog/lists' ), |
|
21 | 21 | 'checkout-confirm' => array( 'checkout/confirm' ), |
22 | 22 | 'checkout-index' => array( 'checkout/standard' ), |
23 | - 'checkout-update' => array( 'checkout/update'), |
|
23 | + 'checkout-update' => array( 'checkout/update' ), |
|
24 | 24 | ), |
25 | 25 | |
26 | 26 | 'resource' => array( |
27 | 27 | 'db' => array( |
28 | - 'adapter' => config('database.connections.mysql.driver', 'mysql'), |
|
29 | - 'host' => config('database.connections.mysql.host', '127.0.0.1'), |
|
30 | - 'port' => config('database.connections.mysql.port', '3306'), |
|
31 | - 'socket' => config('database.connections.mysql.unix_socket', ''), |
|
32 | - 'database' => config('database.connections.mysql.database', 'forge'), |
|
33 | - 'username' => config('database.connections.mysql.username', 'forge'), |
|
34 | - 'password' => config('database.connections.mysql.password', ''), |
|
28 | + 'adapter' => config( 'database.connections.mysql.driver', 'mysql' ), |
|
29 | + 'host' => config( 'database.connections.mysql.host', '127.0.0.1' ), |
|
30 | + 'port' => config( 'database.connections.mysql.port', '3306' ), |
|
31 | + 'socket' => config( 'database.connections.mysql.unix_socket', '' ), |
|
32 | + 'database' => config( 'database.connections.mysql.database', 'forge' ), |
|
33 | + 'username' => config( 'database.connections.mysql.username', 'forge' ), |
|
34 | + 'password' => config( 'database.connections.mysql.password', '' ), |
|
35 | 35 | 'stmt' => ["SET SESSION sort_buffer_size=2097144; SET NAMES 'utf8mb4'; SET SESSION sql_mode='ANSI'"], |
36 | 36 | 'opt-persistent' => 0, |
37 | 37 | 'limit' => 3, |
38 | 38 | 'defaultTableOptions' => [ |
39 | - 'charset' => config('database.connections.mysql.charset'), |
|
40 | - 'collate' => config('database.connections.mysql.collation'), |
|
39 | + 'charset' => config( 'database.connections.mysql.charset' ), |
|
40 | + 'collate' => config( 'database.connections.mysql.collation' ), |
|
41 | 41 | ], |
42 | 42 | ), |
43 | 43 | 'fs' => array( |
@@ -69,9 +69,12 @@ |
||
69 | 69 | $this->cache[$user->id][$groups] = false; |
70 | 70 | $context = $this->context->get( false ); |
71 | 71 | |
72 | - try { |
|
72 | + try |
|
73 | + { |
|
73 | 74 | $site = \Aimeos\MShop::create( $context, 'locale/site' )->getItem( $user->siteid )->getCode(); |
74 | - } catch( \Exception $e ) { |
|
75 | + } |
|
76 | + catch( \Exception $e ) |
|
77 | + { |
|
75 | 78 | $site = ( Route::current() ? Route::input( 'site', Request::get( 'site', 'default' ) ) : 'default' ); |
76 | 79 | } |
77 | 80 |
@@ -4,72 +4,72 @@ |
||
4 | 4 | { |
5 | 5 | public function testCountAction() |
6 | 6 | { |
7 | - View::addLocation(dirname(__DIR__).'/fixtures/views'); |
|
7 | + View::addLocation( dirname( __DIR__ ) . '/fixtures/views' ); |
|
8 | 8 | |
9 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@countAction', ['site' => 'unittest']); |
|
9 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\CatalogController@countAction', ['site' => 'unittest'] ); |
|
10 | 10 | |
11 | 11 | $this->assertResponseOk(); |
12 | - $this->assertContains('.catalog-filter-count', $response->getContent()); |
|
13 | - $this->assertContains('.catalog-filter-attribute', $response->getContent()); |
|
12 | + $this->assertContains( '.catalog-filter-count', $response->getContent() ); |
|
13 | + $this->assertContains( '.catalog-filter-attribute', $response->getContent() ); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | |
17 | 17 | public function testDetailAction() |
18 | 18 | { |
19 | - View::addLocation(dirname(__DIR__).'/fixtures/views'); |
|
19 | + View::addLocation( dirname( __DIR__ ) . '/fixtures/views' ); |
|
20 | 20 | |
21 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@detailAction', ['site' => 'unittest', 'd_name' => 'Cafe_Noire_Cappuccino']); |
|
21 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\CatalogController@detailAction', ['site' => 'unittest', 'd_name' => 'Cafe_Noire_Cappuccino'] ); |
|
22 | 22 | |
23 | 23 | $this->assertResponseOk(); |
24 | - $this->assertContains('<section class="aimeos catalog-stage"', $response->getContent()); |
|
25 | - $this->assertContains('<section class="aimeos catalog-detail"', $response->getContent()); |
|
26 | - $this->assertContains('<section class="aimeos catalog-session"', $response->getContent()); |
|
24 | + $this->assertContains( '<section class="aimeos catalog-stage"', $response->getContent() ); |
|
25 | + $this->assertContains( '<section class="aimeos catalog-detail"', $response->getContent() ); |
|
26 | + $this->assertContains( '<section class="aimeos catalog-session"', $response->getContent() ); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | public function testListAction() |
31 | 31 | { |
32 | - View::addLocation(dirname(__DIR__).'/fixtures/views'); |
|
32 | + View::addLocation( dirname( __DIR__ ) . '/fixtures/views' ); |
|
33 | 33 | |
34 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@listAction', ['site' => 'unittest']); |
|
34 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\CatalogController@listAction', ['site' => 'unittest'] ); |
|
35 | 35 | |
36 | 36 | $this->assertResponseOk(); |
37 | - $this->assertContains('<section class="aimeos catalog-filter"', $response->getContent()); |
|
38 | - $this->assertContains('<section class="aimeos catalog-list"', $response->getContent()); |
|
37 | + $this->assertContains( '<section class="aimeos catalog-filter"', $response->getContent() ); |
|
38 | + $this->assertContains( '<section class="aimeos catalog-list"', $response->getContent() ); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
42 | 42 | public function testStockAction() |
43 | 43 | { |
44 | - View::addLocation(dirname(__DIR__).'/fixtures/views'); |
|
44 | + View::addLocation( dirname( __DIR__ ) . '/fixtures/views' ); |
|
45 | 45 | |
46 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@stockAction', ['site' => 'unittest']); |
|
46 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\CatalogController@stockAction', ['site' => 'unittest'] ); |
|
47 | 47 | |
48 | 48 | $this->assertResponseOk(); |
49 | - $this->assertContains('.aimeos .product .stock', $response->getContent()); |
|
49 | + $this->assertContains( '.aimeos .product .stock', $response->getContent() ); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | |
53 | 53 | public function testSuggestAction() |
54 | 54 | { |
55 | - View::addLocation(dirname(__DIR__).'/fixtures/views'); |
|
55 | + View::addLocation( dirname( __DIR__ ) . '/fixtures/views' ); |
|
56 | 56 | |
57 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@suggestAction', ['site' => 'unittest'], ['f_search' => 'Cafe']); |
|
57 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\CatalogController@suggestAction', ['site' => 'unittest'], ['f_search' => 'Cafe'] ); |
|
58 | 58 | |
59 | 59 | $this->assertResponseOk(); |
60 | - $this->assertRegexp('/[{.*}]/', $response->getContent()); |
|
60 | + $this->assertRegexp( '/[{.*}]/', $response->getContent() ); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | 64 | public function testTreeAction() |
65 | 65 | { |
66 | - View::addLocation(dirname(__DIR__).'/fixtures/views'); |
|
66 | + View::addLocation( dirname( __DIR__ ) . '/fixtures/views' ); |
|
67 | 67 | |
68 | - $response = $this->action('GET', '\Aimeos\Shop\Controller\CatalogController@treeAction', ['site' => 'unittest', 'f_catid' => 1, 'f_name' => 'test']); |
|
68 | + $response = $this->action( 'GET', '\Aimeos\Shop\Controller\CatalogController@treeAction', ['site' => 'unittest', 'f_catid' => 1, 'f_name' => 'test'] ); |
|
69 | 69 | |
70 | 70 | $this->assertResponseOk(); |
71 | - $this->assertContains('<section class="aimeos catalog-filter', $response->getContent()); |
|
72 | - $this->assertContains('<section class="aimeos catalog-stage', $response->getContent()); |
|
73 | - $this->assertContains('<section class="aimeos catalog-list', $response->getContent()); |
|
71 | + $this->assertContains( '<section class="aimeos catalog-filter', $response->getContent() ); |
|
72 | + $this->assertContains( '<section class="aimeos catalog-stage', $response->getContent() ); |
|
73 | + $this->assertContains( '<section class="aimeos catalog-list', $response->getContent() ); |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 | \ No newline at end of file |
@@ -1,253 +1,253 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(($conf = config('shop.routes.admin', ['prefix' => 'admin', 'middleware' => ['web']])) !== false ) { |
|
3 | +if( ( $conf = config( 'shop.routes.admin', ['prefix' => 'admin', 'middleware' => ['web']] ) ) !== false ) { |
|
4 | 4 | |
5 | - Route::group($conf, function() { |
|
5 | + Route::group( $conf, function() { |
|
6 | 6 | |
7 | 7 | Route::match( array( 'GET' ), '', array( |
8 | 8 | 'as' => 'aimeos_shop_admin', |
9 | 9 | 'uses' => 'Aimeos\Shop\Controller\AdminController@indexAction' |
10 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
10 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
11 | 11 | |
12 | 12 | }); |
13 | 13 | } |
14 | 14 | |
15 | 15 | |
16 | -if(($conf = config('shop.routes.jqadm', ['prefix' => 'admin/{site}/jqadm', 'middleware' => ['web', 'auth']])) !== false ) { |
|
16 | +if( ( $conf = config( 'shop.routes.jqadm', ['prefix' => 'admin/{site}/jqadm', 'middleware' => ['web', 'auth']] ) ) !== false ) { |
|
17 | 17 | |
18 | - Route::group($conf, function() { |
|
18 | + Route::group( $conf, function() { |
|
19 | 19 | |
20 | 20 | Route::match( array( 'GET' ), 'file/{type}', array( |
21 | 21 | 'as' => 'aimeos_shop_jqadm_file', |
22 | 22 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@fileAction' |
23 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
23 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
24 | 24 | |
25 | 25 | Route::match( array( 'GET', 'POST' ), 'copy/{resource}/{id}', array( |
26 | 26 | 'as' => 'aimeos_shop_jqadm_copy', |
27 | 27 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@copyAction' |
28 | - ))->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
28 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
29 | 29 | |
30 | 30 | Route::match( array( 'GET', 'POST' ), 'create/{resource}', array( |
31 | 31 | 'as' => 'aimeos_shop_jqadm_create', |
32 | 32 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@createAction' |
33 | - ))->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
33 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
34 | 34 | |
35 | 35 | Route::match( array( 'GET', 'POST' ), 'delete/{resource}/{id?}', array( |
36 | 36 | 'as' => 'aimeos_shop_jqadm_delete', |
37 | 37 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@deleteAction' |
38 | - ))->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
38 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
39 | 39 | |
40 | 40 | Route::match( array( 'GET', 'POST' ), 'export/{resource}', array( |
41 | 41 | 'as' => 'aimeos_shop_jqadm_export', |
42 | 42 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@exportAction' |
43 | - ))->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
43 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
44 | 44 | |
45 | 45 | Route::match( array( 'GET' ), 'get/{resource}/{id}', array( |
46 | 46 | 'as' => 'aimeos_shop_jqadm_get', |
47 | 47 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@getAction' |
48 | - ))->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
48 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
49 | 49 | |
50 | 50 | Route::match( array( 'POST' ), 'save/{resource}', array( |
51 | 51 | 'as' => 'aimeos_shop_jqadm_save', |
52 | 52 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@saveAction' |
53 | - ))->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
53 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
54 | 54 | |
55 | 55 | Route::match( array( 'GET', 'POST' ), 'search/{resource}', array( |
56 | 56 | 'as' => 'aimeos_shop_jqadm_search', |
57 | 57 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@searchAction' |
58 | - ))->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
58 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
59 | 59 | |
60 | 60 | }); |
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | -if(($conf = config('shop.routes.jsonadm', ['prefix' => 'admin/{site}/jsonadm', 'middleware' => ['web', 'auth']])) !== false ) { |
|
64 | +if( ( $conf = config( 'shop.routes.jsonadm', ['prefix' => 'admin/{site}/jsonadm', 'middleware' => ['web', 'auth']] ) ) !== false ) { |
|
65 | 65 | |
66 | - Route::group($conf, function() { |
|
66 | + Route::group( $conf, function() { |
|
67 | 67 | |
68 | 68 | Route::match( array( 'DELETE' ), '{resource}/{id?}', array( |
69 | 69 | 'as' => 'aimeos_shop_jsonadm_delete', |
70 | 70 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@deleteAction' |
71 | - ))->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
71 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
72 | 72 | |
73 | 73 | Route::match( array( 'GET' ), '{resource}/{id?}', array( |
74 | 74 | 'as' => 'aimeos_shop_jsonadm_get', |
75 | 75 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@getAction' |
76 | - ))->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
76 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
77 | 77 | |
78 | 78 | Route::match( array( 'PATCH' ), '{resource}/{id?}', array( |
79 | 79 | 'as' => 'aimeos_shop_jsonadm_patch', |
80 | 80 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@patchAction' |
81 | - ))->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
81 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
82 | 82 | |
83 | 83 | Route::match( array( 'POST' ), '{resource}/{id?}', array( |
84 | 84 | 'as' => 'aimeos_shop_jsonadm_post', |
85 | 85 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@postAction' |
86 | - ))->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
86 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
87 | 87 | |
88 | 88 | Route::match( array( 'PUT' ), '{resource}/{id?}', array( |
89 | 89 | 'as' => 'aimeos_shop_jsonadm_put', |
90 | 90 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@putAction' |
91 | - ))->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
91 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) ); |
|
92 | 92 | |
93 | 93 | Route::match( array( 'OPTIONS' ), '{resource?}', array( |
94 | 94 | 'as' => 'aimeos_shop_jsonadm_options', |
95 | 95 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@optionsAction' |
96 | - ))->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]*' ) ); |
|
96 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]*' ) ); |
|
97 | 97 | |
98 | 98 | }); |
99 | 99 | } |
100 | 100 | |
101 | 101 | |
102 | -if(($conf = config('shop.routes.jsonapi', ['prefix' => 'jsonapi', 'middleware' => ['web', 'api']])) !== false ) { |
|
102 | +if( ( $conf = config( 'shop.routes.jsonapi', ['prefix' => 'jsonapi', 'middleware' => ['web', 'api']] ) ) !== false ) { |
|
103 | 103 | |
104 | - Route::group($conf, function() { |
|
104 | + Route::group( $conf, function() { |
|
105 | 105 | |
106 | 106 | Route::match( array( 'DELETE' ), '{resource}', array( |
107 | 107 | 'as' => 'aimeos_shop_jsonapi_delete', |
108 | 108 | 'uses' => 'Aimeos\Shop\Controller\JsonapiController@deleteAction' |
109 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
109 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
110 | 110 | |
111 | 111 | Route::match( array( 'GET' ), '{resource}', array( |
112 | 112 | 'as' => 'aimeos_shop_jsonapi_get', |
113 | 113 | 'uses' => 'Aimeos\Shop\Controller\JsonapiController@getAction' |
114 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
114 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
115 | 115 | |
116 | 116 | Route::match( array( 'PATCH' ), '{resource}', array( |
117 | 117 | 'as' => 'aimeos_shop_jsonapi_patch', |
118 | 118 | 'uses' => 'Aimeos\Shop\Controller\JsonapiController@patchAction' |
119 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
119 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
120 | 120 | |
121 | 121 | Route::match( array( 'POST' ), '{resource}', array( |
122 | 122 | 'as' => 'aimeos_shop_jsonapi_post', |
123 | 123 | 'uses' => 'Aimeos\Shop\Controller\JsonapiController@postAction' |
124 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
124 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
125 | 125 | |
126 | 126 | Route::match( array( 'PUT' ), '{resource}', array( |
127 | 127 | 'as' => 'aimeos_shop_jsonapi_put', |
128 | 128 | 'uses' => 'Aimeos\Shop\Controller\JsonapiController@putAction' |
129 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
129 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
130 | 130 | |
131 | 131 | Route::match( array( 'OPTIONS' ), '{resource?}', array( |
132 | 132 | 'as' => 'aimeos_shop_jsonapi_options', |
133 | 133 | 'uses' => 'Aimeos\Shop\Controller\JsonapiController@optionsAction' |
134 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
134 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
135 | 135 | |
136 | 136 | }); |
137 | 137 | } |
138 | 138 | |
139 | 139 | |
140 | -if(($conf = config('shop.routes.update', [])) !== false ) { |
|
140 | +if( ( $conf = config( 'shop.routes.update', [] ) ) !== false ) { |
|
141 | 141 | |
142 | - Route::group($conf, function() { |
|
142 | + Route::group( $conf, function() { |
|
143 | 143 | |
144 | 144 | Route::match( array( 'GET', 'POST' ), 'update', array( |
145 | 145 | 'as' => 'aimeos_shop_update', |
146 | 146 | 'uses' => 'Aimeos\Shop\Controller\CheckoutController@updateAction' |
147 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
147 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
148 | 148 | |
149 | 149 | }); |
150 | 150 | } |
151 | 151 | |
152 | 152 | |
153 | -if(($conf = config('shop.routes.account', ['prefix' => 'myaccount', 'middleware' => ['web', 'auth']])) !== false ) { |
|
153 | +if( ( $conf = config( 'shop.routes.account', ['prefix' => 'myaccount', 'middleware' => ['web', 'auth']] ) ) !== false ) { |
|
154 | 154 | |
155 | - Route::group($conf, function() { |
|
155 | + Route::group( $conf, function() { |
|
156 | 156 | |
157 | 157 | Route::match( array( 'GET', 'POST' ), 'favorite/{fav_action?}/{fav_id?}/{d_name?}/{d_pos?}', array( |
158 | 158 | 'as' => 'aimeos_shop_account_favorite', |
159 | 159 | 'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction' |
160 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
160 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
161 | 161 | |
162 | 162 | Route::match( array( 'GET', 'POST' ), 'watch/{wat_action?}/{wat_id?}/{d_name?}/{d_pos?}', array( |
163 | 163 | 'as' => 'aimeos_shop_account_watch', |
164 | 164 | 'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction' |
165 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
165 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
166 | 166 | |
167 | 167 | Route::match( array( 'GET', 'POST' ), 'download/{dl_id}', array( |
168 | 168 | 'as' => 'aimeos_shop_account_download', |
169 | 169 | 'uses' => 'Aimeos\Shop\Controller\AccountController@downloadAction' |
170 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
170 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
171 | 171 | |
172 | 172 | Route::match( array( 'GET', 'POST' ), '', array( |
173 | 173 | 'as' => 'aimeos_shop_account', |
174 | 174 | 'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction' |
175 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
175 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
176 | 176 | |
177 | 177 | }); |
178 | 178 | } |
179 | 179 | |
180 | 180 | |
181 | -if(($conf = config('shop.routes.default', ['prefix' => 'shop', 'middleware' => ['web']])) !== false ) { |
|
181 | +if( ( $conf = config( 'shop.routes.default', ['prefix' => 'shop', 'middleware' => ['web']] ) ) !== false ) { |
|
182 | 182 | |
183 | - Route::group($conf, function() { |
|
183 | + Route::group( $conf, function() { |
|
184 | 184 | |
185 | 185 | Route::match( array( 'GET', 'POST' ), 'count', array( |
186 | 186 | 'as' => 'aimeos_shop_count', |
187 | 187 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@countAction' |
188 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
188 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
189 | 189 | |
190 | 190 | Route::match( array( 'GET', 'POST' ), 'suggest', array( |
191 | 191 | 'as' => 'aimeos_shop_suggest', |
192 | 192 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@suggestAction' |
193 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
193 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
194 | 194 | |
195 | 195 | Route::match( array( 'GET', 'POST' ), 'stock', array( |
196 | 196 | 'as' => 'aimeos_shop_stock', |
197 | 197 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@stockAction' |
198 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
198 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
199 | 199 | |
200 | 200 | Route::match( array( 'GET', 'POST' ), 'basket', array( |
201 | 201 | 'as' => 'aimeos_shop_basket', |
202 | 202 | 'uses' => 'Aimeos\Shop\Controller\BasketController@indexAction' |
203 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
203 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
204 | 204 | |
205 | 205 | Route::match( array( 'GET', 'POST' ), 'checkout/{c_step?}', array( |
206 | 206 | 'as' => 'aimeos_shop_checkout', |
207 | 207 | 'uses' => 'Aimeos\Shop\Controller\CheckoutController@indexAction' |
208 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
208 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
209 | 209 | |
210 | 210 | Route::match( array( 'GET', 'POST' ), 'confirm/{code?}', array( |
211 | 211 | 'as' => 'aimeos_shop_confirm', |
212 | 212 | 'uses' => 'Aimeos\Shop\Controller\CheckoutController@confirmAction' |
213 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
213 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
214 | 214 | |
215 | 215 | Route::match( array( 'GET', 'POST' ), 'pin/{pin_action}/{pin_id}/{d_name}', array( |
216 | 216 | 'as' => 'aimeos_shop_session_pinned', |
217 | 217 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@detailAction' |
218 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
218 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
219 | 219 | |
220 | 220 | Route::match( array( 'GET', 'POST' ), '{f_name}~{f_catid}', array( |
221 | 221 | 'as' => 'aimeos_shop_tree', |
222 | 222 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@treeAction' |
223 | - ))->where( ['site' => '[a-z0-9\.\-]+', 'f_name' => '[^~]+'] ); |
|
223 | + ) )->where( ['site' => '[a-z0-9\.\-]+', 'f_name' => '[^~]+'] ); |
|
224 | 224 | |
225 | 225 | Route::match( array( 'GET', 'POST' ), '{d_name}/{d_pos?}/{d_prodid?}', array( |
226 | 226 | 'as' => 'aimeos_shop_detail', |
227 | 227 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@detailAction' |
228 | - ))->where( ['site' => '[a-z0-9\.\-]+', 'd_pos' => '[0-9]*'] ); |
|
228 | + ) )->where( ['site' => '[a-z0-9\.\-]+', 'd_pos' => '[0-9]*'] ); |
|
229 | 229 | |
230 | 230 | Route::match( array( 'GET', 'POST' ), '', array( |
231 | 231 | 'as' => 'aimeos_shop_list', |
232 | 232 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@listAction' |
233 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
233 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
234 | 234 | |
235 | 235 | }); |
236 | 236 | } |
237 | 237 | |
238 | 238 | |
239 | -if(($conf = config('shop.routes.legal', [])) !== false ) { |
|
239 | +if( ( $conf = config( 'shop.routes.legal', [] ) ) !== false ) { |
|
240 | 240 | |
241 | - Route::group($conf, function() { |
|
241 | + Route::group( $conf, function() { |
|
242 | 242 | |
243 | - Route::get('terms', array( |
|
243 | + Route::get( 'terms', array( |
|
244 | 244 | 'as' => 'aimeos_shop_terms', |
245 | 245 | 'uses' => 'Aimeos\Shop\Controller\PageController@termsAction' |
246 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
246 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
247 | 247 | |
248 | - Route::get('privacy', array( |
|
248 | + Route::get( 'privacy', array( |
|
249 | 249 | 'as' => 'aimeos_shop_privacy', |
250 | 250 | 'uses' => 'Aimeos\Shop\Controller\PageController@privacyAction' |
251 | - ))->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
251 | + ) )->where( ['site' => '[a-z0-9\.\-]+'] ); |
|
252 | 252 | }); |
253 | 253 | } |
@@ -68,9 +68,12 @@ |
||
68 | 68 | |
69 | 69 | $manager = \Aimeos\MShop::create( $context, 'customer' ); |
70 | 70 | |
71 | - try { |
|
71 | + try |
|
72 | + { |
|
72 | 73 | $item = $manager->findItem( $email ); |
73 | - } catch( \Aimeos\MShop\Exception $e ) { |
|
74 | + } |
|
75 | + catch( \Aimeos\MShop\Exception $e ) |
|
76 | + { |
|
74 | 77 | $item = $manager->createItem(); |
75 | 78 | } |
76 | 79 |