Completed
Push — master ( 0f1d53...462bed )
by Aimeos
02:15
created
src/Aimeos/Shop/Base/Context.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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\Manager\Laravel( app( 'filesystem' ), $config, storage_path( 'aimeos' ) );
74
-			$context->setFilesystemManager( $fs );
73
+			$fs = new \Aimeos\MW\Filesystem\Manager\Laravel(app('filesystem'), $config, storage_path('aimeos'));
74
+			$context->setFilesystemManager($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
 block discarded – undo
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
 block discarded – undo
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,15 +154,15 @@  discard block
 block discarded – undo
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
-			if( \Route::current() !== null )
161
+			if (\Route::current() !== null)
162 162
 			{
163
-				$site = \Route::input( 'site', 'default' );
164
-				$lang = \Route::input( 'locale', '' );
165
-				$currency = \Route::input( 'currency', '' );
163
+				$site = \Route::input('site', 'default');
164
+				$lang = \Route::input('locale', '');
165
+				$currency = \Route::input('currency', '');
166 166
 			}
167 167
 			else
168 168
 			{
@@ -170,10 +170,10 @@  discard block
 block discarded – undo
170 170
 				$lang = $currency = '';
171 171
 			}
172 172
 
173
-			$disableSites = $this->config->has( 'shop.disableSites' );
173
+			$disableSites = $this->config->has('shop.disableSites');
174 174
 
175
-			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
176
-			$this->locale = $localeManager->bootstrap( $site, $lang, $currency, $disableSites );
175
+			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
176
+			$this->locale = $localeManager->bootstrap($site, $lang, $currency, $disableSites);
177 177
 		}
178 178
 
179 179
 		return $this->locale;
Please login to merge, or discard this patch.
src/config/shop.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 return array(
4 4
 	'apc_enabled' => false,
5 5
 	'apc_prefix' => 'laravel:',
6
-	'extdir' => ( is_dir(base_path('ext')) ? base_path('ext') : dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'ext' ),
6
+	'extdir' => (is_dir(base_path('ext')) ? base_path('ext') : dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'ext'),
7 7
 	'uploaddir' => '/',
8 8
 
9 9
 	'routes' => array(
@@ -14,16 +14,16 @@  discard block
 block discarded – undo
14 14
 	),
15 15
 
16 16
 	'page' => array(
17
-		'account-index' => array( 'account/history','account/favorite','account/watch','basket/mini','catalog/session' ),
18
-		'basket-index' => array( 'basket/standard','basket/related' ),
19
-		'catalog-count' => array( 'catalog/count' ),
20
-		'catalog-detail' => array( 'basket/mini','catalog/stage','catalog/detail','catalog/session' ),
21
-		'catalog-list' => array( 'basket/mini','catalog/filter','catalog/stage','catalog/lists' ),
22
-		'catalog-stock' => array( 'catalog/stock' ),
23
-		'catalog-suggest' => array( 'catalog/suggest' ),
24
-		'checkout-confirm' => array( 'checkout/confirm' ),
25
-		'checkout-index' => array( 'checkout/standard' ),
26
-		'checkout-update' => array( 'checkout/update'),
17
+		'account-index' => array('account/history', 'account/favorite', 'account/watch', 'basket/mini', 'catalog/session'),
18
+		'basket-index' => array('basket/standard', 'basket/related'),
19
+		'catalog-count' => array('catalog/count'),
20
+		'catalog-detail' => array('basket/mini', 'catalog/stage', 'catalog/detail', 'catalog/session'),
21
+		'catalog-list' => array('basket/mini', 'catalog/filter', 'catalog/stage', 'catalog/lists'),
22
+		'catalog-stock' => array('catalog/stock'),
23
+		'catalog-suggest' => array('catalog/suggest'),
24
+		'checkout-confirm' => array('checkout/confirm'),
25
+		'checkout-index' => array('checkout/standard'),
26
+		'checkout-update' => array('checkout/update'),
27 27
 	),
28 28
 
29 29
 	'resource' => array(
@@ -34,19 +34,19 @@  discard block
 block discarded – undo
34 34
 			'database' => env('DB_DATABASE', 'laravel'),
35 35
 			'username' => env('DB_USERNAME', 'root'),
36 36
 			'password' => env('DB_PASSWORD', ''),
37
-			'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ),
37
+			'stmt' => array("SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'"),
38 38
 			'opt-persistent' => 0,
39 39
 			'limit' => 2,
40 40
 		),
41 41
 		'fs' => array(
42 42
 			'adapter' => 'Standard',
43 43
 			'basedir' => public_path(),
44
-			'tempdir' => storage_path( 'aimeos' ),
44
+			'tempdir' => storage_path('aimeos'),
45 45
 		),
46 46
 		'fs-admin' => array(
47 47
 			'adapter' => 'Standard',
48
-			'basedir' => public_path( 'uploads' ),
49
-			'tempdir' => storage_path( 'aimeos' ),
48
+			'basedir' => public_path('uploads'),
49
+			'tempdir' => storage_path('aimeos'),
50 50
 		),
51 51
 		/* 'fs-media' => array(
52 52
 			'adapter' => 'Standard',
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 				'default' => array(
192 192
 					'mimeicon' => array(
193 193
 						# Directory where icons for the mime types stored
194
-						'directory' => public_path( '/packages/aimeos/shop/mimeicons' ),
194
+						'directory' => public_path('/packages/aimeos/shop/mimeicons'),
195 195
 						# File extension of mime type icons
196 196
 						'extension' => '.png'
197 197
 					),
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 						# in the "maxwidth" parameter
235 235
 						# maxheight: 280
236 236
 					),
237
-					'tempdir' => storage_path( 'aimeos' ),
237
+					'tempdir' => storage_path('aimeos'),
238 238
 				),
239 239
 			),
240 240
 			'product' => array(
Please login to merge, or discard this patch.