@@ -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; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param \Illuminate\Contracts\Config\Repository $config Configuration object |
46 | 46 | * @param \Illuminate\Session\Store $session Laravel session object |
47 | 47 | */ |
48 | - public function __construct( \Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session ) |
|
48 | + public function __construct(\Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session) |
|
49 | 49 | { |
50 | 50 | $this->config = $config; |
51 | 51 | $this->session = $session; |
@@ -58,48 +58,48 @@ discard block |
||
58 | 58 | * @param boolean $locale True to add locale object to context, false if not |
59 | 59 | * @return \Aimeos\MShop\Context\Item\Iface Context object |
60 | 60 | */ |
61 | - public function get( $locale = true ) |
|
61 | + public function get($locale = true) |
|
62 | 62 | { |
63 | - if( self::$context === null ) |
|
63 | + if (self::$context === null) |
|
64 | 64 | { |
65 | 65 | $context = new \Aimeos\MShop\Context\Item\Standard(); |
66 | 66 | |
67 | 67 | $config = $this->getConfig(); |
68 | - $context->setConfig( $config ); |
|
68 | + $context->setConfig($config); |
|
69 | 69 | |
70 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $config ); |
|
71 | - $context->setDatabaseManager( $dbm ); |
|
70 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($config); |
|
71 | + $context->setDatabaseManager($dbm); |
|
72 | 72 | |
73 | - $fs = new \Aimeos\MW\Filesystem\Laravel( app( 'filesystem.disk' ) ); |
|
74 | - $context->setFilesystem( $fs ); |
|
73 | + $fs = new \Aimeos\MW\Filesystem\Laravel(app('filesystem.disk')); |
|
74 | + $context->setFilesystem($fs); |
|
75 | 75 | |
76 | - $mail = new \Aimeos\MW\Mail\Swift( function() { return app( 'mailer' )->getSwiftMailer(); } ); |
|
77 | - $context->setMail( $mail ); |
|
76 | + $mail = new \Aimeos\MW\Mail\Swift(function() { return app('mailer')->getSwiftMailer(); } ); |
|
77 | + $context->setMail($mail); |
|
78 | 78 | |
79 | - $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context ); |
|
80 | - $context->setLogger( $logger ); |
|
79 | + $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager($context); |
|
80 | + $context->setLogger($logger); |
|
81 | 81 | |
82 | - $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $context ); |
|
83 | - $context->setCache( $cache ); |
|
82 | + $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($context); |
|
83 | + $context->setCache($cache); |
|
84 | 84 | |
85 | 85 | self::$context = $context; |
86 | 86 | } |
87 | 87 | |
88 | 88 | $context = self::$context; |
89 | 89 | |
90 | - if( $locale === true ) |
|
90 | + if ($locale === true) |
|
91 | 91 | { |
92 | - $localeItem = $this->getLocale( $context ); |
|
92 | + $localeItem = $this->getLocale($context); |
|
93 | 93 | $langid = $localeItem->getLanguageId(); |
94 | 94 | |
95 | - $context->setLocale( $localeItem ); |
|
96 | - $context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $langid ) ) ); |
|
95 | + $context->setLocale($localeItem); |
|
96 | + $context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($langid))); |
|
97 | 97 | } |
98 | 98 | |
99 | - $session = new \Aimeos\MW\Session\Laravel4( $this->session ); |
|
100 | - $context->setSession( $session ); |
|
99 | + $session = new \Aimeos\MW\Session\Laravel4($this->session); |
|
100 | + $context->setSession($session); |
|
101 | 101 | |
102 | - $this->addUser( $context ); |
|
102 | + $this->addUser($context); |
|
103 | 103 | |
104 | 104 | return $context; |
105 | 105 | } |
@@ -110,20 +110,20 @@ discard block |
||
110 | 110 | * |
111 | 111 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
112 | 112 | */ |
113 | - protected function addUser( \Aimeos\MShop\Context\Item\Iface $context ) |
|
113 | + protected function addUser(\Aimeos\MShop\Context\Item\Iface $context) |
|
114 | 114 | { |
115 | - if( ( $userid = \Auth::id() ) !== null ) |
|
115 | + if (($userid = \Auth::id()) !== null) |
|
116 | 116 | { |
117 | - $context->setUserId( $userid ); |
|
118 | - $context->setGroupIds( function() use ( $context, $userid ) |
|
117 | + $context->setUserId($userid); |
|
118 | + $context->setGroupIds(function() use ($context, $userid) |
|
119 | 119 | { |
120 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' ); |
|
121 | - return $manager->getItem( $userid, array( 'customer/group' ) )->getGroups(); |
|
120 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer'); |
|
121 | + return $manager->getItem($userid, array('customer/group'))->getGroups(); |
|
122 | 122 | } ); |
123 | 123 | } |
124 | 124 | |
125 | - if( ( $user = \Auth::user() ) !== null ) { |
|
126 | - $context->setEditor( $user->name ); |
|
125 | + if (($user = \Auth::user()) !== null) { |
|
126 | + $context->setEditor($user->name); |
|
127 | 127 | } |
128 | 128 | } |
129 | 129 | |
@@ -135,13 +135,13 @@ discard block |
||
135 | 135 | */ |
136 | 136 | protected function getConfig() |
137 | 137 | { |
138 | - $conf = $this->config->get( 'shop' ); |
|
138 | + $conf = $this->config->get('shop'); |
|
139 | 139 | |
140 | - $configPaths = app( '\Aimeos\Shop\Base\Aimeos' )->get()->getConfigPaths( 'mysql' ); |
|
141 | - $config = new \Aimeos\MW\Config\PHPArray( $conf, $configPaths ); |
|
140 | + $configPaths = app('\Aimeos\Shop\Base\Aimeos')->get()->getConfigPaths('mysql'); |
|
141 | + $config = new \Aimeos\MW\Config\PHPArray($conf, $configPaths); |
|
142 | 142 | |
143 | - if( function_exists( 'apc_store' ) === true && $this->config->get( 'shop.apc_enabled', false ) == true ) { |
|
144 | - $config = new \Aimeos\MW\Config\Decorator\APC( $config, $this->config->get( 'shop.apc_prefix', 'laravel:' ) ); |
|
143 | + if (function_exists('apc_store') === true && $this->config->get('shop.apc_enabled', false) == true) { |
|
144 | + $config = new \Aimeos\MW\Config\Decorator\APC($config, $this->config->get('shop.apc_prefix', 'laravel:')); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | return $config; |
@@ -154,18 +154,18 @@ discard block |
||
154 | 154 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
155 | 155 | * @return \Aimeos\MShop\Locale\Item\Iface Locale item object |
156 | 156 | */ |
157 | - protected function getLocale( \Aimeos\MShop\Context\Item\Iface $context ) |
|
157 | + protected function getLocale(\Aimeos\MShop\Context\Item\Iface $context) |
|
158 | 158 | { |
159 | - if( $this->locale === null ) |
|
159 | + if ($this->locale === null) |
|
160 | 160 | { |
161 | - $site = \Route::input( 'site', 'default' ); |
|
162 | - $lang = \Route::input( 'locale', '' ); |
|
163 | - $currency = \Route::input( 'currency', '' ); |
|
161 | + $site = \Route::input('site', 'default'); |
|
162 | + $lang = \Route::input('locale', ''); |
|
163 | + $currency = \Route::input('currency', ''); |
|
164 | 164 | |
165 | - $disableSites = $this->config->has( 'shop.disableSites' ); |
|
165 | + $disableSites = $this->config->has('shop.disableSites'); |
|
166 | 166 | |
167 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
168 | - $this->locale = $localeManager->bootstrap( $site, $lang, $currency, $disableSites ); |
|
167 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
168 | + $this->locale = $localeManager->bootstrap($site, $lang, $currency, $disableSites); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | return $this->locale; |
@@ -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; |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | * @param \Aimeos\Shop\Base\Context $context Context object |
48 | 48 | * @param \Aimeos\Shop\Base\View $view View object |
49 | 49 | */ |
50 | - public function __construct( \Illuminate\Contracts\Config\Repository $config, |
|
51 | - \Aimeos\Shop\Base\Aimeos $aimeos, \Aimeos\Shop\Base\Context $context, \Aimeos\Shop\Base\View $view ) |
|
50 | + public function __construct(\Illuminate\Contracts\Config\Repository $config, |
|
51 | + \Aimeos\Shop\Base\Aimeos $aimeos, \Aimeos\Shop\Base\Context $context, \Aimeos\Shop\Base\View $view) |
|
52 | 52 | { |
53 | 53 | $this->config = $config; |
54 | 54 | $this->aimeos = $aimeos; |
@@ -63,23 +63,23 @@ discard block |
||
63 | 63 | * @param string $pageName Name of the configured page |
64 | 64 | * @return array Associative list with body and header output separated by client name |
65 | 65 | */ |
66 | - public function getSections( $pageName ) |
|
66 | + public function getSections($pageName) |
|
67 | 67 | { |
68 | 68 | $context = $this->context->get(); |
69 | 69 | $langid = $context->getLocale()->getLanguageId(); |
70 | - $tmplPaths = $this->aimeos->get()->getCustomPaths( 'client/html' ); |
|
71 | - $view = $this->view->create( $context->getConfig(), $tmplPaths, $langid ); |
|
72 | - $context->setView( $view ); |
|
70 | + $tmplPaths = $this->aimeos->get()->getCustomPaths('client/html'); |
|
71 | + $view = $this->view->create($context->getConfig(), $tmplPaths, $langid); |
|
72 | + $context->setView($view); |
|
73 | 73 | |
74 | - $pagesConfig = $this->config->get( 'shop.page', array() ); |
|
75 | - $result = array( 'aibody' => array(), 'aiheader' => array() ); |
|
74 | + $pagesConfig = $this->config->get('shop.page', array()); |
|
75 | + $result = array('aibody' => array(), 'aiheader' => array()); |
|
76 | 76 | |
77 | - if( isset( $pagesConfig[$pageName] ) ) |
|
77 | + if (isset($pagesConfig[$pageName])) |
|
78 | 78 | { |
79 | - foreach( (array) $pagesConfig[$pageName] as $clientName ) |
|
79 | + foreach ((array) $pagesConfig[$pageName] as $clientName) |
|
80 | 80 | { |
81 | - $client = \Aimeos\Client\Html\Factory::createClient( $context, $tmplPaths, $clientName ); |
|
82 | - $client->setView( clone $view ); |
|
81 | + $client = \Aimeos\Client\Html\Factory::createClient($context, $tmplPaths, $clientName); |
|
82 | + $client->setView(clone $view); |
|
83 | 83 | $client->process(); |
84 | 84 | |
85 | 85 | $result['aibody'][$clientName] = $client->getBody(); |
@@ -26,59 +26,59 @@ discard block |
||
26 | 26 | * @param string|null $locale Code of the current language or null for no translation |
27 | 27 | * @return \Aimeos\MW\View\Iface View object |
28 | 28 | */ |
29 | - public function create( \Aimeos\MW\Config\Iface $config, array $templatePaths, $locale = null ) |
|
29 | + public function create(\Aimeos\MW\Config\Iface $config, array $templatePaths, $locale = null) |
|
30 | 30 | { |
31 | 31 | $params = $fixed = array(); |
32 | 32 | |
33 | - if( $locale !== null ) |
|
33 | + if ($locale !== null) |
|
34 | 34 | { |
35 | 35 | $params = \Route::current()->parameters() + \Input::all(); |
36 | 36 | $params['target'] = \Route::currentRouteName(); |
37 | 37 | |
38 | 38 | $fixed = $this->getFixedParams(); |
39 | 39 | |
40 | - $i18n = app('\Aimeos\Shop\Base\I18n')->get( array( $locale ) ); |
|
40 | + $i18n = app('\Aimeos\Shop\Base\I18n')->get(array($locale)); |
|
41 | 41 | $translation = $i18n[$locale]; |
42 | 42 | } |
43 | 43 | else |
44 | 44 | { |
45 | - $translation = new \Aimeos\MW\Translation\None( 'en' ); |
|
45 | + $translation = new \Aimeos\MW\Translation\None('en'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | $view = new \Aimeos\MW\View\Standard(); |
50 | 50 | |
51 | - $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $translation ); |
|
52 | - $view->addHelper( 'translate', $helper ); |
|
51 | + $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation); |
|
52 | + $view->addHelper('translate', $helper); |
|
53 | 53 | |
54 | - $helper = new \Aimeos\MW\View\Helper\Url\Laravel5( $view, app('url'), $fixed ); |
|
55 | - $view->addHelper( 'url', $helper ); |
|
54 | + $helper = new \Aimeos\MW\View\Helper\Url\Laravel5($view, app('url'), $fixed); |
|
55 | + $view->addHelper('url', $helper); |
|
56 | 56 | |
57 | - $helper = new \Aimeos\MW\View\Helper\Partial\Standard( $view, $config, $templatePaths ); |
|
58 | - $view->addHelper( 'partial', $helper ); |
|
57 | + $helper = new \Aimeos\MW\View\Helper\Partial\Standard($view, $config, $templatePaths); |
|
58 | + $view->addHelper('partial', $helper); |
|
59 | 59 | |
60 | - $helper = new \Aimeos\MW\View\Helper\Parameter\Standard( $view, $params ); |
|
61 | - $view->addHelper( 'param', $helper ); |
|
60 | + $helper = new \Aimeos\MW\View\Helper\Parameter\Standard($view, $params); |
|
61 | + $view->addHelper('param', $helper); |
|
62 | 62 | |
63 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
64 | - $view->addHelper( 'config', $helper ); |
|
63 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
64 | + $view->addHelper('config', $helper); |
|
65 | 65 | |
66 | - $sepDec = $config->get( 'client/html/common/format/seperatorDecimal', '.' ); |
|
67 | - $sep1000 = $config->get( 'client/html/common/format/seperator1000', ' ' ); |
|
68 | - $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, $sepDec, $sep1000 ); |
|
69 | - $view->addHelper( 'number', $helper ); |
|
66 | + $sepDec = $config->get('client/html/common/format/seperatorDecimal', '.'); |
|
67 | + $sep1000 = $config->get('client/html/common/format/seperator1000', ' '); |
|
68 | + $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000); |
|
69 | + $view->addHelper('number', $helper); |
|
70 | 70 | |
71 | - $helper = new \Aimeos\MW\View\Helper\FormParam\Standard( $view, array() ); |
|
72 | - $view->addHelper( 'formparam', $helper ); |
|
71 | + $helper = new \Aimeos\MW\View\Helper\FormParam\Standard($view, array()); |
|
72 | + $view->addHelper('formparam', $helper); |
|
73 | 73 | |
74 | - $helper = new \Aimeos\MW\View\Helper\Encoder\Standard( $view ); |
|
75 | - $view->addHelper( 'encoder', $helper ); |
|
74 | + $helper = new \Aimeos\MW\View\Helper\Encoder\Standard($view); |
|
75 | + $view->addHelper('encoder', $helper); |
|
76 | 76 | |
77 | - $helper = new \Aimeos\MW\View\Helper\Request\Laravel5( $view, \Request::instance() ); |
|
78 | - $view->addHelper( 'request', $helper ); |
|
77 | + $helper = new \Aimeos\MW\View\Helper\Request\Laravel5($view, \Request::instance()); |
|
78 | + $view->addHelper('request', $helper); |
|
79 | 79 | |
80 | - $helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_token', csrf_token() ); |
|
81 | - $view->addHelper( 'csrf', $helper ); |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_token', csrf_token()); |
|
81 | + $view->addHelper('csrf', $helper); |
|
82 | 82 | |
83 | 83 | return $view; |
84 | 84 | } |
@@ -93,15 +93,15 @@ discard block |
||
93 | 93 | { |
94 | 94 | $fixed = array(); |
95 | 95 | |
96 | - if( ( $value = \Route::input( 'site' ) ) !== null ) { |
|
96 | + if (($value = \Route::input('site')) !== null) { |
|
97 | 97 | $fixed['site'] = $value; |
98 | 98 | } |
99 | 99 | |
100 | - if( ( $value = \Route::input( 'locale' ) ) !== null ) { |
|
100 | + if (($value = \Route::input('locale')) !== null) { |
|
101 | 101 | $fixed['locale'] = $value; |
102 | 102 | } |
103 | 103 | |
104 | - if( ( $value = \Route::input( 'currency' ) ) !== null ) { |
|
104 | + if (($value = \Route::input('currency')) !== null) { |
|
105 | 105 | $fixed['currency'] = $value; |
106 | 106 | } |
107 | 107 |
@@ -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 | } |
@@ -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 | } |