| @@ -23,7 +23,7 @@ | ||
| 23 | 23 | * | 
| 24 | 24 | * @param array $argv Associative array from $_SERVER['argv'] | 
| 25 | 25 | */ | 
| 26 | - public static function run( array $argv ); | |
| 26 | + public static function run(array $argv); | |
| 27 | 27 | |
| 28 | 28 | /** | 
| 29 | 29 | * Returns the command usage and options | 
| @@ -24,31 +24,31 @@ discard block | ||
| 24 | 24 | * @param array &$params List of parameters | 
| 25 | 25 | * @return array Associative list of option name and value(s) | 
| 26 | 26 | */ | 
| 27 | - protected static function getOptions( array &$params ) | |
| 27 | + protected static function getOptions(array &$params) | |
| 28 | 28 |  	{ | 
| 29 | 29 | $options = array(); | 
| 30 | 30 | |
| 31 | - foreach( $params as $key => $option ) | |
| 31 | + foreach ($params as $key => $option) | |
| 32 | 32 |  		{ | 
| 33 | -			if( $option === '--help' ) { | |
| 33 | +			if ($option === '--help') { | |
| 34 | 34 | throw new Exception(); | 
| 35 | 35 | } | 
| 36 | 36 | |
| 37 | - if( strncmp( $option, '--', 2 ) === 0 && ( $pos = strpos( $option, '=', 2 ) ) !== false ) | |
| 37 | + if (strncmp($option, '--', 2) === 0 && ($pos = strpos($option, '=', 2)) !== false) | |
| 38 | 38 |  			{ | 
| 39 | - $name = substr( $option, 2, $pos - 2 ); | |
| 39 | + $name = substr($option, 2, $pos - 2); | |
| 40 | 40 | |
| 41 | - if( isset( $options[$name] ) ) | |
| 41 | + if (isset($options[$name])) | |
| 42 | 42 |  				{ | 
| 43 | 43 | $options[$name] = (array) $options[$name]; | 
| 44 | - $options[$name][] = substr( $option, $pos + 1 ); | |
| 44 | + $options[$name][] = substr($option, $pos + 1); | |
| 45 | 45 | } | 
| 46 | 46 | else | 
| 47 | 47 |  				{ | 
| 48 | - $options[$name] = substr( $option, $pos + 1 ); | |
| 48 | + $options[$name] = substr($option, $pos + 1); | |
| 49 | 49 | } | 
| 50 | 50 | |
| 51 | - unset( $params[$key] ); | |
| 51 | + unset($params[$key]); | |
| 52 | 52 | } | 
| 53 | 53 | } | 
| 54 | 54 | |
| @@ -62,19 +62,19 @@ discard block | ||
| 62 | 62 | * @param \Aimeos\MShop\Context\Item\Iface $ctx Context object | 
| 63 | 63 | * @param string|null $sites List of site codes separated by a space | 
| 64 | 64 | */ | 
| 65 | - protected static function getSiteItems( \Aimeos\MShop\Context\Item\Iface $ctx, $sites ) | |
| 65 | + protected static function getSiteItems(\Aimeos\MShop\Context\Item\Iface $ctx, $sites) | |
| 66 | 66 |  	{ | 
| 67 | - $manager = \Aimeos\MShop\Factory::createManager( $ctx, 'locale/site' ); | |
| 67 | + $manager = \Aimeos\MShop\Factory::createManager($ctx, 'locale/site'); | |
| 68 | 68 | $search = $manager->createSearch(); | 
| 69 | 69 | |
| 70 | -		if( is_scalar( $sites ) && $sites != '' ) { | |
| 71 | - $sites = explode( ' ', $sites ); | |
| 70 | +		if (is_scalar($sites) && $sites != '') { | |
| 71 | +			$sites = explode(' ', $sites); | |
| 72 | 72 | } | 
| 73 | 73 | |
| 74 | -		if( !empty( $sites ) ) { | |
| 75 | - $search->setConditions( $search->compare( '==', 'locale.site.code', $sites ) ); | |
| 74 | +		if (!empty($sites)) { | |
| 75 | +			$search->setConditions($search->compare('==', 'locale.site.code', $sites)); | |
| 76 | 76 | } | 
| 77 | 77 | |
| 78 | - return $manager->searchItems( $search ); | |
| 78 | + return $manager->searchItems($search); | |
| 79 | 79 | } | 
| 80 | 80 | } | 
| 81 | 81 | \ No newline at end of file | 
| @@ -6,28 +6,28 @@ discard block | ||
| 6 | 6 | */ | 
| 7 | 7 | |
| 8 | 8 | |
| 9 | -if( php_sapi_name() != 'cli' ) { | |
| 10 | - exit( 'Setup can only be started via command line for security reasons' ); | |
| 9 | +if (php_sapi_name() != 'cli') { | |
| 10 | +	exit('Setup can only be started via command line for security reasons'); | |
| 11 | 11 | } | 
| 12 | 12 | |
| 13 | -ini_set( 'display_errors', 1 ); | |
| 14 | -date_default_timezone_set( 'UTC' ); | |
| 13 | +ini_set('display_errors', 1); | |
| 14 | +date_default_timezone_set('UTC'); | |
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | try | 
| 19 | 19 |  { | 
| 20 | - require 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'; | |
| 20 | + require 'vendor'.DIRECTORY_SEPARATOR.'autoload.php'; | |
| 21 | 21 | |
| 22 | - \Aimeos\Slim\Command\Jobs::run( $_SERVER['argv'] ); | |
| 22 | + \Aimeos\Slim\Command\Jobs::run($_SERVER['argv']); | |
| 23 | 23 | } | 
| 24 | -catch( \Aimeos\Slim\Command\Exception $e ) | |
| 24 | +catch (\Aimeos\Slim\Command\Exception $e) | |
| 25 | 25 |  { | 
| 26 | - echo $e->getMessage() . "\n"; | |
| 26 | + echo $e->getMessage()."\n"; | |
| 27 | 27 | echo \Aimeos\Slim\Command\Jobs::usage(); | 
| 28 | - exit( 1 ); | |
| 28 | + exit(1); | |
| 29 | 29 | } | 
| 30 | -catch( \Throwable $t ) | |
| 30 | +catch (\Throwable $t) | |
| 31 | 31 |  { | 
| 32 | 32 | echo "\n\nCaught PHP error while processing setup"; | 
| 33 | 33 | echo "\n\nMessage:\n"; | 
| @@ -35,9 +35,9 @@ discard block | ||
| 35 | 35 | echo "\n\nStack trace:\n"; | 
| 36 | 36 | echo $t->getTraceAsString(); | 
| 37 | 37 | echo "\n\n"; | 
| 38 | - exit( 1 ); | |
| 38 | + exit(1); | |
| 39 | 39 | } | 
| 40 | -catch( \Exception $e ) | |
| 40 | +catch (\Exception $e) | |
| 41 | 41 |  { | 
| 42 | 42 | echo "\n\nCaught exception while processing setup"; | 
| 43 | 43 | echo "\n\nMessage:\n"; | 
| @@ -45,5 +45,5 @@ discard block | ||
| 45 | 45 | echo "\n\nStack trace:\n"; | 
| 46 | 46 | echo $e->getTraceAsString(); | 
| 47 | 47 | echo "\n\n"; | 
| 48 | - exit( 1 ); | |
| 48 | + exit(1); | |
| 49 | 49 | } | 
| @@ -6,27 +6,27 @@ discard block | ||
| 6 | 6 | */ | 
| 7 | 7 | |
| 8 | 8 | |
| 9 | -if( php_sapi_name() != 'cli' ) { | |
| 10 | - exit( 'Setup can only be started via command line for security reasons' ); | |
| 9 | +if (php_sapi_name() != 'cli') { | |
| 10 | +	exit('Setup can only be started via command line for security reasons'); | |
| 11 | 11 | } | 
| 12 | 12 | |
| 13 | -ini_set( 'display_errors', 1 ); | |
| 14 | -date_default_timezone_set( 'UTC' ); | |
| 13 | +ini_set('display_errors', 1); | |
| 14 | +date_default_timezone_set('UTC'); | |
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | try | 
| 18 | 18 |  { | 
| 19 | - require 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'; | |
| 19 | + require 'vendor'.DIRECTORY_SEPARATOR.'autoload.php'; | |
| 20 | 20 | |
| 21 | - \Aimeos\Slim\Command\Cache::run( $_SERVER['argv'] ); | |
| 21 | + \Aimeos\Slim\Command\Cache::run($_SERVER['argv']); | |
| 22 | 22 | } | 
| 23 | -catch( \Aimeos\Slim\Command\Exception $e ) | |
| 23 | +catch (\Aimeos\Slim\Command\Exception $e) | |
| 24 | 24 |  { | 
| 25 | - echo $e->getMessage() . "\n"; | |
| 25 | + echo $e->getMessage()."\n"; | |
| 26 | 26 | echo \Aimeos\Slim\Command\Cache::usage(); | 
| 27 | - exit( 1 ); | |
| 27 | + exit(1); | |
| 28 | 28 | } | 
| 29 | -catch( \Throwable $t ) | |
| 29 | +catch (\Throwable $t) | |
| 30 | 30 |  { | 
| 31 | 31 | echo "\n\nCaught PHP error"; | 
| 32 | 32 | echo "\n\nMessage:\n"; | 
| @@ -34,9 +34,9 @@ discard block | ||
| 34 | 34 | echo "\n\nStack trace:\n"; | 
| 35 | 35 | echo $t->getTraceAsString(); | 
| 36 | 36 | echo "\n\n"; | 
| 37 | - exit( 1 ); | |
| 37 | + exit(1); | |
| 38 | 38 | } | 
| 39 | -catch( \Exception $e ) | |
| 39 | +catch (\Exception $e) | |
| 40 | 40 |  { | 
| 41 | 41 | echo "\n\nCaught exception"; | 
| 42 | 42 | echo "\n\nMessage:\n"; | 
| @@ -44,5 +44,5 @@ discard block | ||
| 44 | 44 | echo "\n\nStack trace:\n"; | 
| 45 | 45 | echo $e->getTraceAsString(); | 
| 46 | 46 | echo "\n\n"; | 
| 47 | - exit( 1 ); | |
| 47 | + exit(1); | |
| 48 | 48 | } | 
| @@ -31,10 +31,10 @@ discard block | ||
| 31 | 31 | * @param array $args Associative list of route parameters | 
| 32 | 32 | * @return ResponseInterface $response Modified response object with generated output | 
| 33 | 33 | */ | 
| 34 | - public static function indexAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) | |
| 34 | + public static function indexAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) | |
| 35 | 35 |  	{ | 
| 36 | - $contents = $container->get( 'aimeos_page' )->getSections( 'account-index', $request, $response, $args ); | |
| 37 | - return $container->get( 'view' )->render( $response, 'Account/index.html.twig', $contents ); | |
| 36 | +		$contents = $container->get('aimeos_page')->getSections('account-index', $request, $response, $args); | |
| 37 | +		return $container->get('view')->render($response, 'Account/index.html.twig', $contents); | |
| 38 | 38 | } | 
| 39 | 39 | |
| 40 | 40 | |
| @@ -47,16 +47,16 @@ discard block | ||
| 47 | 47 | * @param array $args Associative list of route parameters | 
| 48 | 48 | * @return ResponseInterface $response Modified response object with generated output | 
| 49 | 49 | */ | 
| 50 | - public static function downloadAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) | |
| 50 | + public static function downloadAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) | |
| 51 | 51 |  	{ | 
| 52 | - $context = $container->get( 'aimeos_context' )->get( true, $args ); | |
| 52 | +		$context = $container->get('aimeos_context')->get(true, $args); | |
| 53 | 53 | $langid = $context->getLocale()->getLanguageId(); | 
| 54 | 54 | |
| 55 | - $view = $container->get( 'aimeos_view' )->create( $context, $request, $response, $args, array(), $langid ); | |
| 56 | - $context->setView( $view ); | |
| 55 | +		$view = $container->get('aimeos_view')->create($context, $request, $response, $args, array(), $langid); | |
| 56 | + $context->setView($view); | |
| 57 | 57 | |
| 58 | - $client = \Aimeos\Client\Html\Factory::createClient( $context, array(), 'account/download' ); | |
| 59 | - $client->setView( $view ); | |
| 58 | + $client = \Aimeos\Client\Html\Factory::createClient($context, array(), 'account/download'); | |
| 59 | + $client->setView($view); | |
| 60 | 60 | $client->process(); | 
| 61 | 61 | |
| 62 | 62 | return $view->response(); | 
| @@ -30,7 +30,7 @@ discard block | ||
| 30 | 30 | * | 
| 31 | 31 | * @param ContainerInterface $container Dependency container | 
| 32 | 32 | */ | 
| 33 | - public function __construct( ContainerInterface $container ) | |
| 33 | + public function __construct(ContainerInterface $container) | |
| 34 | 34 |  	{ | 
| 35 | 35 | $this->container = $container; | 
| 36 | 36 | } | 
| @@ -45,24 +45,24 @@ discard block | ||
| 45 | 45 | * @param array Associative list of URI attributes | 
| 46 | 46 | * @return array Associative list with body and header output separated by client name | 
| 47 | 47 | */ | 
| 48 | - public function getSections( $pageName, ServerRequestInterface $request, ResponseInterface $response, array $attr ) | |
| 48 | + public function getSections($pageName, ServerRequestInterface $request, ResponseInterface $response, array $attr) | |
| 49 | 49 |  	{ | 
| 50 | - $tmplPaths = $this->container->get( 'aimeos' )->getCustomPaths( 'client/html/templates' ); | |
| 51 | - $context = $this->container->get( 'aimeos_context' )->get( true, $attr ); | |
| 50 | +		$tmplPaths = $this->container->get('aimeos')->getCustomPaths('client/html/templates'); | |
| 51 | +		$context = $this->container->get('aimeos_context')->get(true, $attr); | |
| 52 | 52 | $langid = $context->getLocale()->getLanguageId(); | 
| 53 | 53 | |
| 54 | - $view = $this->container->get( 'aimeos_view' )->create( $context, $request, $response, $attr, $tmplPaths, $langid ); | |
| 55 | - $context->setView( $view ); | |
| 54 | +		$view = $this->container->get('aimeos_view')->create($context, $request, $response, $attr, $tmplPaths, $langid); | |
| 55 | + $context->setView($view); | |
| 56 | 56 | |
| 57 | - $pagesConfig = $this->container->get( 'aimeos_config' )->get()->get( 'page', array() ); | |
| 58 | - $result = array( 'aibody' => array(), 'aiheader' => array() ); | |
| 57 | +		$pagesConfig = $this->container->get('aimeos_config')->get()->get('page', array()); | |
| 58 | +		$result = array('aibody' => array(), 'aiheader' => array()); | |
| 59 | 59 | |
| 60 | - if( isset( $pagesConfig[$pageName] ) ) | |
| 60 | + if (isset($pagesConfig[$pageName])) | |
| 61 | 61 |  		{ | 
| 62 | - foreach( (array) $pagesConfig[$pageName] as $clientName ) | |
| 62 | + foreach ((array) $pagesConfig[$pageName] as $clientName) | |
| 63 | 63 |  			{ | 
| 64 | - $client = \Aimeos\Client\Html\Factory::createClient( $context, $tmplPaths, $clientName ); | |
| 65 | - $client->setView( clone $view ); | |
| 64 | + $client = \Aimeos\Client\Html\Factory::createClient($context, $tmplPaths, $clientName); | |
| 65 | + $client->setView(clone $view); | |
| 66 | 66 | $client->process(); | 
| 67 | 67 | |
| 68 | 68 | $result['aibody'][$clientName] = $client->getBody(); | 
| @@ -29,7 +29,7 @@ discard block | ||
| 29 | 29 | * | 
| 30 | 30 | * @param ContainerInterface $container Dependency container | 
| 31 | 31 | */ | 
| 32 | - public function __construct( ContainerInterface $container ) | |
| 32 | + public function __construct(ContainerInterface $container) | |
| 33 | 33 |  	{ | 
| 34 | 34 | $this->container = $container; | 
| 35 | 35 | } | 
| @@ -42,18 +42,18 @@ discard block | ||
| 42 | 42 | * @param array $attributes Associative list of URL parameter | 
| 43 | 43 | * @return \Aimeos\MShop\Locale\Item\Iface Locale item object | 
| 44 | 44 | */ | 
| 45 | - public function get( \Aimeos\MShop\Context\Item\Iface $context, array $attributes ) | |
| 45 | + public function get(\Aimeos\MShop\Context\Item\Iface $context, array $attributes) | |
| 46 | 46 |  	{ | 
| 47 | - if( $this->locale === null ) | |
| 47 | + if ($this->locale === null) | |
| 48 | 48 |  		{ | 
| 49 | - $disableSites = $this->container->get( 'aimeos_config' )->get( 'disableSites', true ); | |
| 49 | +			$disableSites = $this->container->get('aimeos_config')->get('disableSites', true); | |
| 50 | 50 | |
| 51 | - $site = ( isset( $attributes['site'] ) ? $attributes['site'] : 'default' ); | |
| 52 | - $lang = ( isset( $attributes['locale'] ) ? $attributes['locale'] : '' ); | |
| 53 | - $currency = ( isset( $attributes['currency'] ) ? $attributes['currency'] : '' ); | |
| 51 | + $site = (isset($attributes['site']) ? $attributes['site'] : 'default'); | |
| 52 | + $lang = (isset($attributes['locale']) ? $attributes['locale'] : ''); | |
| 53 | + $currency = (isset($attributes['currency']) ? $attributes['currency'] : ''); | |
| 54 | 54 | |
| 55 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); | |
| 56 | - $this->locale = $localeManager->bootstrap( $site, $lang, $currency, $disableSites ); | |
| 55 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); | |
| 56 | + $this->locale = $localeManager->bootstrap($site, $lang, $currency, $disableSites); | |
| 57 | 57 | } | 
| 58 | 58 | |
| 59 | 59 | return $this->locale; | 
| @@ -67,17 +67,17 @@ discard block | ||
| 67 | 67 | * @param string $site Unique site code | 
| 68 | 68 | * @return \Aimeos\MShop\Locale\Item\Iface Locale item object | 
| 69 | 69 | */ | 
| 70 | - public function getBackend( \Aimeos\MShop\Context\Item\Iface $context, $site ) | |
| 70 | + public function getBackend(\Aimeos\MShop\Context\Item\Iface $context, $site) | |
| 71 | 71 |  	{ | 
| 72 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); | |
| 72 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); | |
| 73 | 73 | |
| 74 | 74 | try | 
| 75 | 75 |  		{ | 
| 76 | - $localeItem = $localeManager->bootstrap( $site, '', '', false ); | |
| 77 | - $localeItem->setLanguageId( null ); | |
| 78 | - $localeItem->setCurrencyId( null ); | |
| 76 | + $localeItem = $localeManager->bootstrap($site, '', '', false); | |
| 77 | + $localeItem->setLanguageId(null); | |
| 78 | + $localeItem->setCurrencyId(null); | |
| 79 | 79 | } | 
| 80 | - catch( \Aimeos\MShop\Locale\Exception $e ) | |
| 80 | + catch (\Aimeos\MShop\Locale\Exception $e) | |
| 81 | 81 |  		{ | 
| 82 | 82 | $localeItem = $localeManager->createItem(); | 
| 83 | 83 | } | 
| @@ -34,19 +34,19 @@ discard block | ||
| 34 | 34 | * | 
| 35 | 35 | * @param array $argv Associative array from $_SERVER['argv'] | 
| 36 | 36 | */ | 
| 37 | - public static function run( array $argv ) | |
| 37 | + public static function run(array $argv) | |
| 38 | 38 |  	{ | 
| 39 | - array_shift( $argv ); | |
| 40 | - $options = self::getOptions( $argv ); | |
| 41 | - $sites = array_shift( $argv ); | |
| 39 | + array_shift($argv); | |
| 40 | + $options = self::getOptions($argv); | |
| 41 | + $sites = array_shift($argv); | |
| 42 | 42 | |
| 43 | - $extdirs = ( isset( $options['extdir'] ) ? (array) $options['extdir'] : array() ); | |
| 44 | - $aimeos = new \Aimeos\Bootstrap( $extdirs ); | |
| 43 | + $extdirs = (isset($options['extdir']) ? (array) $options['extdir'] : array()); | |
| 44 | + $aimeos = new \Aimeos\Bootstrap($extdirs); | |
| 45 | 45 | |
| 46 | - $ctx = self::getContext( $aimeos->getConfigPaths(), $options ); | |
| 47 | - $siteItems = self::getSiteItems( $ctx, $sites ); | |
| 46 | + $ctx = self::getContext($aimeos->getConfigPaths(), $options); | |
| 47 | + $siteItems = self::getSiteItems($ctx, $sites); | |
| 48 | 48 | |
| 49 | - self::clear( $ctx, $siteItems ); | |
| 49 | + self::clear($ctx, $siteItems); | |
| 50 | 50 | } | 
| 51 | 51 | |
| 52 | 52 | |
| @@ -57,38 +57,38 @@ discard block | ||
| 57 | 57 | * @param array $options Associative list of configuration options as key/value pairs | 
| 58 | 58 | * @return \Aimeos\MShop\Context\Item\Iface Context object | 
| 59 | 59 | */ | 
| 60 | - protected static function getContext( array $confPaths, array $options ) | |
| 60 | + protected static function getContext(array $confPaths, array $options) | |
| 61 | 61 |  	{ | 
| 62 | 62 | $config = array(); | 
| 63 | 63 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); | 
| 64 | 64 | |
| 65 | - if( isset( $options['config'] ) ) | |
| 65 | + if (isset($options['config'])) | |
| 66 | 66 |  		{ | 
| 67 | - foreach( (array) $options['config'] as $path ) | |
| 67 | + foreach ((array) $options['config'] as $path) | |
| 68 | 68 |  			{ | 
| 69 | -				if( is_file( $path ) ) { | |
| 70 | - $config = array_replace_recursive( $config, require $path ); | |
| 69 | +				if (is_file($path)) { | |
| 70 | + $config = array_replace_recursive($config, require $path); | |
| 71 | 71 |  				} else { | 
| 72 | 72 | $confPaths[] = $path; | 
| 73 | 73 | } | 
| 74 | 74 | } | 
| 75 | 75 | } | 
| 76 | 76 | |
| 77 | - $conf = new \Aimeos\MW\Config\PHPArray( $config, $confPaths ); | |
| 78 | - $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf ); | |
| 77 | + $conf = new \Aimeos\MW\Config\PHPArray($config, $confPaths); | |
| 78 | + $conf = new \Aimeos\MW\Config\Decorator\Memory($conf); | |
| 79 | 79 | |
| 80 | -		if( ( $cfg = $conf->get( 'command' ) ) !== null ) { | |
| 81 | - $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf, $cfg ); | |
| 80 | +		if (($cfg = $conf->get('command')) !== null) { | |
| 81 | + $conf = new \Aimeos\MW\Config\Decorator\Memory($conf, $cfg); | |
| 82 | 82 | } | 
| 83 | 83 | |
| 84 | - $ctx->setConfig( $conf ); | |
| 84 | + $ctx->setConfig($conf); | |
| 85 | 85 | |
| 86 | 86 | |
| 87 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); | |
| 88 | - $ctx->setDatabaseManager( $dbm ); | |
| 87 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($conf); | |
| 88 | + $ctx->setDatabaseManager($dbm); | |
| 89 | 89 | |
| 90 | - $logger = new \Aimeos\MW\Logger\Errorlog( \Aimeos\MW\Logger\Base::INFO ); | |
| 91 | - $ctx->setLogger( $logger ); | |
| 90 | + $logger = new \Aimeos\MW\Logger\Errorlog(\Aimeos\MW\Logger\Base::INFO); | |
| 91 | + $ctx->setLogger($logger); | |
| 92 | 92 | |
| 93 | 93 | return $ctx; | 
| 94 | 94 | } | 
| @@ -100,23 +100,23 @@ discard block | ||
| 100 | 100 | * @param \Aimeos\MShop\Context\Item\Iface $ctx Context object | 
| 101 | 101 | * @param array $siteItems List of site items implementing \Aimeos\MShop\Locale\Site\Iface | 
| 102 | 102 | */ | 
| 103 | - protected static function clear( \Aimeos\MShop\Context\Item\Iface $ctx, array $siteItems ) | |
| 103 | + protected static function clear(\Aimeos\MShop\Context\Item\Iface $ctx, array $siteItems) | |
| 104 | 104 |  	{ | 
| 105 | - $localeManager = \Aimeos\MShop\Factory::createManager( $ctx, 'locale' ); | |
| 105 | + $localeManager = \Aimeos\MShop\Factory::createManager($ctx, 'locale'); | |
| 106 | 106 | |
| 107 | - foreach( $siteItems as $siteItem ) | |
| 107 | + foreach ($siteItems as $siteItem) | |
| 108 | 108 |  		{ | 
| 109 | - $localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false ); | |
| 109 | + $localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false); | |
| 110 | 110 | |
| 111 | 111 | $lcontext = clone $ctx; | 
| 112 | - $lcontext->setLocale( $localeItem ); | |
| 112 | + $lcontext->setLocale($localeItem); | |
| 113 | 113 | |
| 114 | - $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $lcontext ); | |
| 115 | - $lcontext->setCache( $cache ); | |
| 114 | + $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($lcontext); | |
| 115 | + $lcontext->setCache($cache); | |
| 116 | 116 | |
| 117 | - printf( "Clearing the Aimeos cache for site \"%1\$s\"\n", $siteItem->getCode() ); | |
| 117 | +			printf("Clearing the Aimeos cache for site \"%1\$s\"\n", $siteItem->getCode()); | |
| 118 | 118 | |
| 119 | - \Aimeos\MAdmin\Cache\Manager\Factory::createManager( $lcontext )->getCache()->clear(); | |
| 119 | + \Aimeos\MAdmin\Cache\Manager\Factory::createManager($lcontext)->getCache()->clear(); | |
| 120 | 120 | } | 
| 121 | 121 | } | 
| 122 | 122 | } | 
| 123 | 123 | \ No newline at end of file | 
| @@ -29,7 +29,7 @@ discard block | ||
| 29 | 29 | * | 
| 30 | 30 | * @param ContainerInterface $container Dependency container | 
| 31 | 31 | */ | 
| 32 | - public function __construct( ContainerInterface $container, $settings ) | |
| 32 | + public function __construct(ContainerInterface $container, $settings) | |
| 33 | 33 |  	{ | 
| 34 | 34 | $this->container = $container; | 
| 35 | 35 | $this->settings = $settings; | 
| @@ -42,19 +42,19 @@ discard block | ||
| 42 | 42 |  	 * @param string $type Configuration type ("frontend" or "backend") | 
| 43 | 43 | * @return \Aimeos\MW\Config\Iface Config object | 
| 44 | 44 | */ | 
| 45 | - public function get( $type = 'frontend' ) | |
| 45 | + public function get($type = 'frontend') | |
| 46 | 46 |  	{ | 
| 47 | - $paths = $this->container->get( 'aimeos' )->getConfigPaths(); | |
| 48 | - $config = new \Aimeos\MW\Config\PHPArray( array(), $paths ); | |
| 47 | +		$paths = $this->container->get('aimeos')->getConfigPaths(); | |
| 48 | + $config = new \Aimeos\MW\Config\PHPArray(array(), $paths); | |
| 49 | 49 | |
| 50 | -		if( function_exists( 'apcu_store' ) === true && $config->get( 'apc_enabled', false ) == true ) { | |
| 51 | - $config = new \Aimeos\MW\Config\Decorator\APC( $config, $config->get( 'apc_prefix', 'slim:' ) ); | |
| 50 | +		if (function_exists('apcu_store') === true && $config->get('apc_enabled', false) == true) { | |
| 51 | +			$config = new \Aimeos\MW\Config\Decorator\APC($config, $config->get('apc_prefix', 'slim:')); | |
| 52 | 52 | } | 
| 53 | 53 | |
| 54 | - $config = new \Aimeos\MW\Config\Decorator\Memory( $config, $this->settings ); | |
| 54 | + $config = new \Aimeos\MW\Config\Decorator\Memory($config, $this->settings); | |
| 55 | 55 | |
| 56 | -		if( isset( $this->settings[$type] ) ) { | |
| 57 | - $config = new \Aimeos\MW\Config\Decorator\Memory( $config, $this->settings[$type] ); | |
| 56 | +		if (isset($this->settings[$type])) { | |
| 57 | + $config = new \Aimeos\MW\Config\Decorator\Memory($config, $this->settings[$type]); | |
| 58 | 58 | } | 
| 59 | 59 | |
| 60 | 60 | return $config; |