@@ -27,7 +27,6 @@ discard block |
||
| 27 | 27 | * |
| 28 | 28 | * @param \Illuminate\Http\Request $request Request object |
| 29 | 29 | * @param string Resource location, e.g. "product/stock/wareshouse" |
| 30 | - * @param string $sitecode Unique site code |
|
| 31 | 30 | * @param integer|null $id Unique resource ID |
| 32 | 31 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 33 | 32 | */ |
@@ -48,7 +47,6 @@ discard block |
||
| 48 | 47 | * |
| 49 | 48 | * @param \Illuminate\Http\Request $request Request object |
| 50 | 49 | * @param string Resource location, e.g. "product/stock/wareshouse" |
| 51 | - * @param string $sitecode Unique site code |
|
| 52 | 50 | * @param integer|null $id Unique resource ID |
| 53 | 51 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 54 | 52 | */ |
@@ -69,7 +67,6 @@ discard block |
||
| 69 | 67 | * |
| 70 | 68 | * @param \Illuminate\Http\Request $request Request object |
| 71 | 69 | * @param string Resource location, e.g. "product/stock/wareshouse" |
| 72 | - * @param string $sitecode Unique site code |
|
| 73 | 70 | * @param integer|null $id Unique resource ID |
| 74 | 71 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 75 | 72 | */ |
@@ -90,7 +87,6 @@ discard block |
||
| 90 | 87 | * |
| 91 | 88 | * @param \Illuminate\Http\Request $request Request object |
| 92 | 89 | * @param string Resource location, e.g. "product/stock/wareshouse" |
| 93 | - * @param string $sitecode Unique site code |
|
| 94 | 90 | * @param integer $id Unique ID of the resource |
| 95 | 91 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 96 | 92 | */ |
@@ -111,7 +107,6 @@ discard block |
||
| 111 | 107 | * |
| 112 | 108 | * @param \Illuminate\Http\Request $request Request object |
| 113 | 109 | * @param string Resource location, e.g. "product/stock/wareshouse" |
| 114 | - * @param string $sitecode Unique site code |
|
| 115 | 110 | * @param integer|null $id Unique resource ID |
| 116 | 111 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 117 | 112 | */ |
@@ -132,7 +127,6 @@ discard block |
||
| 132 | 127 | * |
| 133 | 128 | * @param \Illuminate\Http\Request $request Request object |
| 134 | 129 | * @param string Resource location, e.g. "product/stock/wareshouse" |
| 135 | - * @param string $sitecode Unique site code |
|
| 136 | 130 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 137 | 131 | */ |
| 138 | 132 | public function optionsAction( Request $request, $site = 'default', $resource = '' ) |
@@ -37,19 +37,19 @@ discard block |
||
| 37 | 37 | * @param integer|null $id Unique resource ID |
| 38 | 38 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 39 | 39 | */ |
| 40 | - public function deleteAction( Request $request, $site = 'default', $resource, $id = null ) |
|
| 40 | + public function deleteAction(Request $request, $site = 'default', $resource, $id = null) |
|
| 41 | 41 | { |
| 42 | - if( config( 'shop.authorize', true ) ) { |
|
| 43 | - $this->authorize( 'admin' ); |
|
| 42 | + if (config('shop.authorize', true)) { |
|
| 43 | + $this->authorize('admin'); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | $status = 500; |
| 47 | 47 | $header = $request->headers->all(); |
| 48 | 48 | |
| 49 | - $cntl = $this->createController( $site, $resource ); |
|
| 50 | - $result = $cntl->delete( $request->getContent(), $header, $status ); |
|
| 49 | + $cntl = $this->createController($site, $resource); |
|
| 50 | + $result = $cntl->delete($request->getContent(), $header, $status); |
|
| 51 | 51 | |
| 52 | - return $this->createResponse( $result, $status, $header ); |
|
| 52 | + return $this->createResponse($result, $status, $header); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
@@ -62,19 +62,19 @@ discard block |
||
| 62 | 62 | * @param integer|null $id Unique resource ID |
| 63 | 63 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 64 | 64 | */ |
| 65 | - public function getAction( Request $request, $site = 'default', $resource, $id = null ) |
|
| 65 | + public function getAction(Request $request, $site = 'default', $resource, $id = null) |
|
| 66 | 66 | { |
| 67 | - if( config( 'shop.authorize', true ) ) { |
|
| 68 | - $this->authorize( 'admin' ); |
|
| 67 | + if (config('shop.authorize', true)) { |
|
| 68 | + $this->authorize('admin'); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | $status = 500; |
| 72 | 72 | $header = $request->headers->all(); |
| 73 | 73 | |
| 74 | - $cntl = $this->createController( $site, $resource ); |
|
| 75 | - $result = $cntl->get( $request->getContent(), $header, $status ); |
|
| 74 | + $cntl = $this->createController($site, $resource); |
|
| 75 | + $result = $cntl->get($request->getContent(), $header, $status); |
|
| 76 | 76 | |
| 77 | - return $this->createResponse( $result, $status, $header ); |
|
| 77 | + return $this->createResponse($result, $status, $header); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
@@ -87,19 +87,19 @@ discard block |
||
| 87 | 87 | * @param integer|null $id Unique resource ID |
| 88 | 88 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 89 | 89 | */ |
| 90 | - public function patchAction( Request $request, $site = 'default', $resource, $id = null ) |
|
| 90 | + public function patchAction(Request $request, $site = 'default', $resource, $id = null) |
|
| 91 | 91 | { |
| 92 | - if( config( 'shop.authorize', true ) ) { |
|
| 93 | - $this->authorize( 'admin' ); |
|
| 92 | + if (config('shop.authorize', true)) { |
|
| 93 | + $this->authorize('admin'); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | $status = 500; |
| 97 | 97 | $header = $request->headers->all(); |
| 98 | 98 | |
| 99 | - $cntl = $this->createController( $site, $resource ); |
|
| 100 | - $result = $cntl->patch( $request->getContent(), $header, $status ); |
|
| 99 | + $cntl = $this->createController($site, $resource); |
|
| 100 | + $result = $cntl->patch($request->getContent(), $header, $status); |
|
| 101 | 101 | |
| 102 | - return $this->createResponse( $result, $status, $header ); |
|
| 102 | + return $this->createResponse($result, $status, $header); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | |
@@ -112,19 +112,19 @@ discard block |
||
| 112 | 112 | * @param integer $id Unique ID of the resource |
| 113 | 113 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 114 | 114 | */ |
| 115 | - public function postAction( Request $request, $site = 'default', $resource, $id = null ) |
|
| 115 | + public function postAction(Request $request, $site = 'default', $resource, $id = null) |
|
| 116 | 116 | { |
| 117 | - if( config( 'shop.authorize', true ) ) { |
|
| 118 | - $this->authorize( 'admin' ); |
|
| 117 | + if (config('shop.authorize', true)) { |
|
| 118 | + $this->authorize('admin'); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | $status = 500; |
| 122 | 122 | $header = $request->headers->all(); |
| 123 | 123 | |
| 124 | - $cntl = $this->createController( $site, $resource ); |
|
| 125 | - $result = $cntl->post( $request->getContent(), $header, $status ); |
|
| 124 | + $cntl = $this->createController($site, $resource); |
|
| 125 | + $result = $cntl->post($request->getContent(), $header, $status); |
|
| 126 | 126 | |
| 127 | - return $this->createResponse( $result, $status, $header ); |
|
| 127 | + return $this->createResponse($result, $status, $header); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | |
@@ -137,19 +137,19 @@ discard block |
||
| 137 | 137 | * @param integer|null $id Unique resource ID |
| 138 | 138 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 139 | 139 | */ |
| 140 | - public function putAction( Request $request, $site = 'default', $resource, $id = null ) |
|
| 140 | + public function putAction(Request $request, $site = 'default', $resource, $id = null) |
|
| 141 | 141 | { |
| 142 | - if( config( 'shop.authorize', true ) ) { |
|
| 143 | - $this->authorize( 'admin' ); |
|
| 142 | + if (config('shop.authorize', true)) { |
|
| 143 | + $this->authorize('admin'); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | $status = 500; |
| 147 | 147 | $header = $request->headers->all(); |
| 148 | 148 | |
| 149 | - $cntl = $this->createController( $site, $resource ); |
|
| 150 | - $result = $cntl->put( $request->getContent(), $header, $status ); |
|
| 149 | + $cntl = $this->createController($site, $resource); |
|
| 150 | + $result = $cntl->put($request->getContent(), $header, $status); |
|
| 151 | 151 | |
| 152 | - return $this->createResponse( $result, $status, $header ); |
|
| 152 | + return $this->createResponse($result, $status, $header); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
@@ -161,19 +161,19 @@ discard block |
||
| 161 | 161 | * @param string $sitecode Unique site code |
| 162 | 162 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 163 | 163 | */ |
| 164 | - public function optionsAction( Request $request, $site = 'default', $resource = '' ) |
|
| 164 | + public function optionsAction(Request $request, $site = 'default', $resource = '') |
|
| 165 | 165 | { |
| 166 | - if( config( 'shop.authorize', true ) ) { |
|
| 167 | - $this->authorize( 'admin' ); |
|
| 166 | + if (config('shop.authorize', true)) { |
|
| 167 | + $this->authorize('admin'); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | $status = 500; |
| 171 | 171 | $header = $request->headers->all(); |
| 172 | 172 | |
| 173 | - $cntl = $this->createController( $site, $resource ); |
|
| 174 | - $result = $cntl->options( $request->getContent(), $header, $status ); |
|
| 173 | + $cntl = $this->createController($site, $resource); |
|
| 174 | + $result = $cntl->options($request->getContent(), $header, $status); |
|
| 175 | 175 | |
| 176 | - return $this->createResponse( $result, $status, $header ); |
|
| 176 | + return $this->createResponse($result, $status, $header); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | |
@@ -183,20 +183,20 @@ discard block |
||
| 183 | 183 | * @param string $sitecode Unique site code |
| 184 | 184 | * @return \Aimeos\MShop\Context\Item\Iface Context item |
| 185 | 185 | */ |
| 186 | - protected function createController( $sitecode, $resource ) |
|
| 186 | + protected function createController($sitecode, $resource) |
|
| 187 | 187 | { |
| 188 | - $lang = Input::get( 'lang', config( 'app.locale', 'en' ) ); |
|
| 188 | + $lang = Input::get('lang', config('app.locale', 'en')); |
|
| 189 | 189 | |
| 190 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 191 | - $templatePaths = $aimeos->getCustomPaths( 'controller/jsonadm/templates' ); |
|
| 190 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 191 | + $templatePaths = $aimeos->getCustomPaths('controller/jsonadm/templates'); |
|
| 192 | 192 | |
| 193 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
| 194 | - $context = $this->setLocale( $context, $sitecode, $lang ); |
|
| 193 | + $context = app('\Aimeos\Shop\Base\Context')->get(false); |
|
| 194 | + $context = $this->setLocale($context, $sitecode, $lang); |
|
| 195 | 195 | |
| 196 | - $view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $templatePaths, $lang ); |
|
| 197 | - $context->setView( $view ); |
|
| 196 | + $view = app('\Aimeos\Shop\Base\View')->create($context->getConfig(), $templatePaths, $lang); |
|
| 197 | + $context->setView($view); |
|
| 198 | 198 | |
| 199 | - return \Aimeos\Controller\JsonAdm\Factory::createController( $context, $templatePaths, $resource ); |
|
| 199 | + return \Aimeos\Controller\JsonAdm\Factory::createController($context, $templatePaths, $resource); |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | |
@@ -208,12 +208,12 @@ discard block |
||
| 208 | 208 | * @param array $header List of HTTP headers |
| 209 | 209 | * @return \Illuminate\Http\Response HTTP response object |
| 210 | 210 | */ |
| 211 | - protected function createResponse( $content, $status, array $header ) |
|
| 211 | + protected function createResponse($content, $status, array $header) |
|
| 212 | 212 | { |
| 213 | - $response = Response::make( $content, $status ); |
|
| 213 | + $response = Response::make($content, $status); |
|
| 214 | 214 | |
| 215 | - foreach( $header as $key => $value ) { |
|
| 216 | - $response->header( $key, $value ); |
|
| 215 | + foreach ($header as $key => $value) { |
|
| 216 | + $response->header($key, $value); |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | return $response; |
@@ -228,23 +228,23 @@ discard block |
||
| 228 | 228 | * @param string $lang ISO language code, e.g. "en" or "en_GB" |
| 229 | 229 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 230 | 230 | */ |
| 231 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang ) |
|
| 231 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang) |
|
| 232 | 232 | { |
| 233 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
| 233 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
| 234 | 234 | |
| 235 | 235 | try |
| 236 | 236 | { |
| 237 | - $localeItem = $localeManager->bootstrap( $sitecode, '', '', false ); |
|
| 238 | - $localeItem->setLanguageId( null ); |
|
| 239 | - $localeItem->setCurrencyId( null ); |
|
| 237 | + $localeItem = $localeManager->bootstrap($sitecode, '', '', false); |
|
| 238 | + $localeItem->setLanguageId(null); |
|
| 239 | + $localeItem->setCurrencyId(null); |
|
| 240 | 240 | } |
| 241 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
| 241 | + catch (\Aimeos\MShop\Locale\Exception $e) |
|
| 242 | 242 | { |
| 243 | 243 | $localeItem = $localeManager->createItem(); |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - $context->setLocale( $localeItem ); |
|
| 247 | - $context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $lang ) ) ); |
|
| 246 | + $context->setLocale($localeItem); |
|
| 247 | + $context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($lang))); |
|
| 248 | 248 | |
| 249 | 249 | return $context; |
| 250 | 250 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * |
| 35 | 35 | * @param \Illuminate\Contracts\Config\Repository $config Configuration object |
| 36 | 36 | */ |
| 37 | - public function __construct( \Illuminate\Contracts\Config\Repository $config ) |
|
| 37 | + public function __construct(\Illuminate\Contracts\Config\Repository $config) |
|
| 38 | 38 | { |
| 39 | 39 | $this->config = $config; |
| 40 | 40 | } |
@@ -47,10 +47,10 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function get() |
| 49 | 49 | { |
| 50 | - if( $this->object === null ) |
|
| 50 | + if ($this->object === null) |
|
| 51 | 51 | { |
| 52 | - $extDirs = (array) $this->config->get( 'shop.extdir', array() ); |
|
| 53 | - $this->object = new \Aimeos\Bootstrap( $extDirs, false ); |
|
| 52 | + $extDirs = (array) $this->config->get('shop.extdir', array()); |
|
| 53 | + $this->object = new \Aimeos\Bootstrap($extDirs, false); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return $this->object; |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * @param \Aimeos\Shop\Base\Aimeos $aimeos Aimeos object |
| 41 | 41 | * @param \Illuminate\Contracts\Config\Repository $config Configuration object |
| 42 | 42 | */ |
| 43 | - public function __construct( \Aimeos\Shop\Base\Aimeos $aimeos, \Illuminate\Contracts\Config\Repository $config ) |
|
| 43 | + public function __construct(\Aimeos\Shop\Base\Aimeos $aimeos, \Illuminate\Contracts\Config\Repository $config) |
|
| 44 | 44 | { |
| 45 | 45 | $this->aimeos = $aimeos; |
| 46 | 46 | $this->config = $config; |
@@ -53,22 +53,22 @@ discard block |
||
| 53 | 53 | * @param array $languageIds List of two letter ISO language IDs |
| 54 | 54 | * @return \Aimeos\MW\Translation\Iface[] List of translation objects |
| 55 | 55 | */ |
| 56 | - public function get( array $languageIds ) |
|
| 56 | + public function get(array $languageIds) |
|
| 57 | 57 | { |
| 58 | 58 | $i18nPaths = $this->aimeos->get()->getI18nPaths(); |
| 59 | 59 | |
| 60 | - foreach( $languageIds as $langid ) |
|
| 60 | + foreach ($languageIds as $langid) |
|
| 61 | 61 | { |
| 62 | - if( !isset( $this->i18n[$langid] ) ) |
|
| 62 | + if (!isset($this->i18n[$langid])) |
|
| 63 | 63 | { |
| 64 | - $i18n = new \Aimeos\MW\Translation\Zend2( $i18nPaths, 'gettext', $langid, array( 'disableNotices' => true ) ); |
|
| 64 | + $i18n = new \Aimeos\MW\Translation\Zend2($i18nPaths, 'gettext', $langid, array('disableNotices' => true)); |
|
| 65 | 65 | |
| 66 | - if( function_exists( 'apc_store' ) === true && $this->config->get( 'shop.apc_enabled', false ) == true ) { |
|
| 67 | - $i18n = new \Aimeos\MW\Translation\Decorator\APC( $i18n, $this->config->get( 'shop.apc_prefix', 'laravel:' ) ); |
|
| 66 | + if (function_exists('apc_store') === true && $this->config->get('shop.apc_enabled', false) == true) { |
|
| 67 | + $i18n = new \Aimeos\MW\Translation\Decorator\APC($i18n, $this->config->get('shop.apc_prefix', 'laravel:')); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - if( $this->config->has( 'shop.i18n.' . $langid ) ) { |
|
| 71 | - $i18n = new \Aimeos\MW\Translation\Decorator\Memory( $i18n, $this->config->get( 'shop.i18n.' . $langid ) ); |
|
| 70 | + if ($this->config->has('shop.i18n.' . $langid)) { |
|
| 71 | + $i18n = new \Aimeos\MW\Translation\Decorator\Memory($i18n, $this->config->get('shop.i18n.' . $langid)); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | $this->i18n[$langid] = $i18n; |
@@ -22,19 +22,19 @@ |
||
| 22 | 22 | * @param string|array $sites Unique site codes |
| 23 | 23 | * @return \Aimeos\MShop\Locale\Item\Site\Iface[] List of site items |
| 24 | 24 | */ |
| 25 | - protected function getSiteItems( \Aimeos\MShop\Context\Item\Iface $context, $sites ) |
|
| 25 | + protected function getSiteItems(\Aimeos\MShop\Context\Item\Iface $context, $sites) |
|
| 26 | 26 | { |
| 27 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' ); |
|
| 27 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site'); |
|
| 28 | 28 | $search = $manager->createSearch(); |
| 29 | 29 | |
| 30 | - if( is_scalar( $sites ) && $sites != '' ) { |
|
| 31 | - $sites = explode( ' ', $sites ); |
|
| 30 | + if (is_scalar($sites) && $sites != '') { |
|
| 31 | + $sites = explode(' ', $sites); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - if( !empty( $sites ) ) { |
|
| 35 | - $search->setConditions( $search->compare( '==', 'locale.site.code', $sites ) ); |
|
| 34 | + if (!empty($sites)) { |
|
| 35 | + $search->setConditions($search->compare('==', 'locale.site.code', $sites)); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - return $manager->searchItems( $search ); |
|
| 38 | + return $manager->searchItems($search); |
|
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | \ No newline at end of file |
@@ -35,24 +35,24 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function fire() |
| 37 | 37 | { |
| 38 | - $context = $this->getLaravel()->make( 'Aimeos\Shop\Base\Context' )->get( false ); |
|
| 39 | - $context->setEditor( 'aimeos:cache' ); |
|
| 38 | + $context = $this->getLaravel()->make('Aimeos\Shop\Base\Context')->get(false); |
|
| 39 | + $context->setEditor('aimeos:cache'); |
|
| 40 | 40 | |
| 41 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
| 41 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
| 42 | 42 | |
| 43 | - foreach( $this->getSiteItems( $context, $this->argument( 'site' ) ) as $siteItem ) |
|
| 43 | + foreach ($this->getSiteItems($context, $this->argument('site')) as $siteItem) |
|
| 44 | 44 | { |
| 45 | - $localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false ); |
|
| 45 | + $localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false); |
|
| 46 | 46 | |
| 47 | 47 | $lcontext = clone $context; |
| 48 | - $lcontext->setLocale( $localeItem ); |
|
| 48 | + $lcontext->setLocale($localeItem); |
|
| 49 | 49 | |
| 50 | - $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $lcontext ); |
|
| 51 | - $lcontext->setCache( $cache ); |
|
| 50 | + $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($lcontext); |
|
| 51 | + $lcontext->setCache($cache); |
|
| 52 | 52 | |
| 53 | - $this->info( sprintf( 'Clearing the Aimeos cache for site "%1$s"', $siteItem->getCode() ) ); |
|
| 53 | + $this->info(sprintf('Clearing the Aimeos cache for site "%1$s"', $siteItem->getCode())); |
|
| 54 | 54 | |
| 55 | - \Aimeos\MAdmin\Cache\Manager\Factory::createManager( $lcontext )->getCache()->flush(); |
|
| 55 | + \Aimeos\MAdmin\Cache\Manager\Factory::createManager($lcontext)->getCache()->flush(); |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | protected function getArguments() |
| 66 | 66 | { |
| 67 | 67 | return array( |
| 68 | - array( 'site', InputArgument::OPTIONAL, 'Site codes to clear the cache like "default unittest" (none for all)' ), |
|
| 68 | + array('site', InputArgument::OPTIONAL, 'Site codes to clear the cache like "default unittest" (none for all)'), |
|
| 69 | 69 | ); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -36,21 +36,21 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | public function fire() |
| 38 | 38 | { |
| 39 | - $aimeos = $this->getLaravel()->make( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 39 | + $aimeos = $this->getLaravel()->make('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 40 | 40 | $context = $this->getContext(); |
| 41 | 41 | |
| 42 | - $jobs = explode( ' ', $this->argument( 'jobs' ) ); |
|
| 43 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
| 42 | + $jobs = explode(' ', $this->argument('jobs')); |
|
| 43 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
| 44 | 44 | |
| 45 | - foreach( $this->getSiteItems( $context, $this->argument( 'site' ) ) as $siteItem ) |
|
| 45 | + foreach ($this->getSiteItems($context, $this->argument('site')) as $siteItem) |
|
| 46 | 46 | { |
| 47 | - $localeItem = $localeManager->bootstrap( $siteItem->getCode(), 'en', '', false ); |
|
| 48 | - $context->setLocale( $localeItem ); |
|
| 47 | + $localeItem = $localeManager->bootstrap($siteItem->getCode(), 'en', '', false); |
|
| 48 | + $context->setLocale($localeItem); |
|
| 49 | 49 | |
| 50 | - $this->info( sprintf( 'Executing the Aimeos jobs for "%s"', $siteItem->getCode() ) ); |
|
| 50 | + $this->info(sprintf('Executing the Aimeos jobs for "%s"', $siteItem->getCode())); |
|
| 51 | 51 | |
| 52 | - foreach( $jobs as $jobname ) { |
|
| 53 | - \Aimeos\Controller\Jobs\Factory::createController( $context, $aimeos, $jobname )->run(); |
|
| 52 | + foreach ($jobs as $jobname) { |
|
| 53 | + \Aimeos\Controller\Jobs\Factory::createController($context, $aimeos, $jobname)->run(); |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -64,8 +64,8 @@ discard block |
||
| 64 | 64 | protected function getArguments() |
| 65 | 65 | { |
| 66 | 66 | return array( |
| 67 | - array( 'jobs', InputArgument::REQUIRED, 'One or more job controller names like "admin/job customer/email/watch"' ), |
|
| 68 | - array( 'site', InputArgument::OPTIONAL, 'Site codes to execute the jobs for like "default unittest" (none for all)' ), |
|
| 67 | + array('jobs', InputArgument::REQUIRED, 'One or more job controller names like "admin/job customer/email/watch"'), |
|
| 68 | + array('site', InputArgument::OPTIONAL, 'Site codes to execute the jobs for like "default unittest" (none for all)'), |
|
| 69 | 69 | ); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -89,17 +89,17 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $lv = $this->getLaravel(); |
| 91 | 91 | |
| 92 | - $context = $lv->make( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
| 93 | - $tmplPaths = $lv->make( '\Aimeos\Shop\Base\Aimeos' )->get()->getCustomPaths( 'controller/jobs/layouts' ); |
|
| 94 | - $view = $lv->make( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $tmplPaths ); |
|
| 92 | + $context = $lv->make('\Aimeos\Shop\Base\Context')->get(false); |
|
| 93 | + $tmplPaths = $lv->make('\Aimeos\Shop\Base\Aimeos')->get()->getCustomPaths('controller/jobs/layouts'); |
|
| 94 | + $view = $lv->make('\Aimeos\Shop\Base\View')->create($context->getConfig(), $tmplPaths); |
|
| 95 | 95 | |
| 96 | - $langManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context )->getSubManager( 'language' ); |
|
| 97 | - $langids = array_keys( $langManager->searchItems( $langManager->createSearch( true ) ) ); |
|
| 98 | - $i18n = $lv->make( '\Aimeos\Shop\Base\I18n' )->get( $langids ); |
|
| 96 | + $langManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context)->getSubManager('language'); |
|
| 97 | + $langids = array_keys($langManager->searchItems($langManager->createSearch(true))); |
|
| 98 | + $i18n = $lv->make('\Aimeos\Shop\Base\I18n')->get($langids); |
|
| 99 | 99 | |
| 100 | - $context->setEditor( 'aimeos:jobs' ); |
|
| 101 | - $context->setView( $view ); |
|
| 102 | - $context->setI18n( $i18n ); |
|
| 100 | + $context->setEditor('aimeos:jobs'); |
|
| 101 | + $context->setView($view); |
|
| 102 | + $context->setI18n($i18n); |
|
| 103 | 103 | |
| 104 | 104 | return $context; |
| 105 | 105 | } |
@@ -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); |