@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * @param \Illuminate\Contracts\Config\Repository $config Configuration object |
| 51 | 51 | * @param \Illuminate\Session\Store $session Laravel session object |
| 52 | 52 | */ |
| 53 | - public function __construct( \Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session ) |
|
| 53 | + public function __construct(\Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session) |
|
| 54 | 54 | { |
| 55 | 55 | $this->config = $config; |
| 56 | 56 | $this->session = $session; |
@@ -64,53 +64,53 @@ discard block |
||
| 64 | 64 | * @param integer $type Configuration type ("frontend" or "backend") |
| 65 | 65 | * @return \Aimeos\MShop\Context\Item\Iface Context object |
| 66 | 66 | */ |
| 67 | - public function get( $locale = true, $type = 'frontend' ) |
|
| 67 | + public function get($locale = true, $type = 'frontend') |
|
| 68 | 68 | { |
| 69 | - $config = $this->getConfig( $type ); |
|
| 69 | + $config = $this->getConfig($type); |
|
| 70 | 70 | |
| 71 | - if( self::$context === null ) |
|
| 71 | + if (self::$context === null) |
|
| 72 | 72 | { |
| 73 | 73 | $context = new \Aimeos\MShop\Context\Item\Standard(); |
| 74 | 74 | |
| 75 | - $context->setConfig( $config ); |
|
| 75 | + $context->setConfig($config); |
|
| 76 | 76 | |
| 77 | - $dbm = new \Aimeos\MW\DB\Manager\DBAL( $config ); |
|
| 78 | - $context->setDatabaseManager( $dbm ); |
|
| 77 | + $dbm = new \Aimeos\MW\DB\Manager\DBAL($config); |
|
| 78 | + $context->setDatabaseManager($dbm); |
|
| 79 | 79 | |
| 80 | - $fs = new \Aimeos\MW\Filesystem\Manager\Laravel( app( 'filesystem' ), $config, storage_path( 'aimeos' ) ); |
|
| 81 | - $context->setFilesystemManager( $fs ); |
|
| 80 | + $fs = new \Aimeos\MW\Filesystem\Manager\Laravel(app('filesystem'), $config, storage_path('aimeos')); |
|
| 81 | + $context->setFilesystemManager($fs); |
|
| 82 | 82 | |
| 83 | - $mq = new \Aimeos\MW\MQueue\Manager\Standard( $config ); |
|
| 84 | - $context->setMessageQueueManager( $mq ); |
|
| 83 | + $mq = new \Aimeos\MW\MQueue\Manager\Standard($config); |
|
| 84 | + $context->setMessageQueueManager($mq); |
|
| 85 | 85 | |
| 86 | - $mail = new \Aimeos\MW\Mail\Swift( function() { return app( 'mailer' )->getSwiftMailer(); } ); |
|
| 87 | - $context->setMail( $mail ); |
|
| 86 | + $mail = new \Aimeos\MW\Mail\Swift(function() { return app('mailer')->getSwiftMailer(); } ); |
|
| 87 | + $context->setMail($mail); |
|
| 88 | 88 | |
| 89 | - $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context ); |
|
| 90 | - $context->setLogger( $logger ); |
|
| 89 | + $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager($context); |
|
| 90 | + $context->setLogger($logger); |
|
| 91 | 91 | |
| 92 | - $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $context ); |
|
| 93 | - $context->setCache( $cache ); |
|
| 92 | + $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($context); |
|
| 93 | + $context->setCache($cache); |
|
| 94 | 94 | |
| 95 | 95 | self::$context = $context; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | $context = self::$context; |
| 99 | - $context->setConfig( $config ); |
|
| 99 | + $context->setConfig($config); |
|
| 100 | 100 | |
| 101 | - if( $locale === true ) |
|
| 101 | + if ($locale === true) |
|
| 102 | 102 | { |
| 103 | - $localeItem = $this->getLocale( $context ); |
|
| 103 | + $localeItem = $this->getLocale($context); |
|
| 104 | 104 | $langid = $localeItem->getLanguageId(); |
| 105 | 105 | |
| 106 | - $context->setLocale( $localeItem ); |
|
| 107 | - $context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $langid ) ) ); |
|
| 106 | + $context->setLocale($localeItem); |
|
| 107 | + $context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($langid))); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - $session = new \Aimeos\MW\Session\Laravel5( $this->session ); |
|
| 111 | - $context->setSession( $session ); |
|
| 110 | + $session = new \Aimeos\MW\Session\Laravel5($this->session); |
|
| 111 | + $context->setSession($session); |
|
| 112 | 112 | |
| 113 | - $this->addUser( $context ); |
|
| 113 | + $this->addUser($context); |
|
| 114 | 114 | |
| 115 | 115 | return $context; |
| 116 | 116 | } |
@@ -121,20 +121,20 @@ discard block |
||
| 121 | 121 | * |
| 122 | 122 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 123 | 123 | */ |
| 124 | - protected function addUser( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 124 | + protected function addUser(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 125 | 125 | { |
| 126 | - if( ( $userid = Auth::id() ) !== null ) |
|
| 126 | + if (($userid = Auth::id()) !== null) |
|
| 127 | 127 | { |
| 128 | - $context->setUserId( $userid ); |
|
| 129 | - $context->setGroupIds( function() use ( $context, $userid ) |
|
| 128 | + $context->setUserId($userid); |
|
| 129 | + $context->setGroupIds(function() use ($context, $userid) |
|
| 130 | 130 | { |
| 131 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' ); |
|
| 132 | - return $manager->getItem( $userid, array( 'customer/group' ) )->getGroups(); |
|
| 131 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer'); |
|
| 132 | + return $manager->getItem($userid, array('customer/group'))->getGroups(); |
|
| 133 | 133 | } ); |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - if( ( $user = Auth::user() ) !== null ) { |
|
| 137 | - $context->setEditor( $user->name ); |
|
| 136 | + if (($user = Auth::user()) !== null) { |
|
| 137 | + $context->setEditor($user->name); |
|
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | |
@@ -145,19 +145,19 @@ discard block |
||
| 145 | 145 | * @param integer $type Configuration type ("frontend" or "backend") |
| 146 | 146 | * @return \Aimeos\MW\Config\Iface Configuration object |
| 147 | 147 | */ |
| 148 | - protected function getConfig( $type = 'frontend' ) |
|
| 148 | + protected function getConfig($type = 'frontend') |
|
| 149 | 149 | { |
| 150 | - $configPaths = app( '\Aimeos\Shop\Base\Aimeos' )->get()->getConfigPaths(); |
|
| 151 | - $config = new \Aimeos\MW\Config\PHPArray( array(), $configPaths ); |
|
| 150 | + $configPaths = app('\Aimeos\Shop\Base\Aimeos')->get()->getConfigPaths(); |
|
| 151 | + $config = new \Aimeos\MW\Config\PHPArray(array(), $configPaths); |
|
| 152 | 152 | |
| 153 | - if( function_exists( 'apc_store' ) === true && $this->config->get( 'shop.apc_enabled', false ) == true ) { |
|
| 154 | - $config = new \Aimeos\MW\Config\Decorator\APC( $config, $this->config->get( 'shop.apc_prefix', 'laravel:' ) ); |
|
| 153 | + if (function_exists('apc_store') === true && $this->config->get('shop.apc_enabled', false) == true) { |
|
| 154 | + $config = new \Aimeos\MW\Config\Decorator\APC($config, $this->config->get('shop.apc_prefix', 'laravel:')); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - $config = new \Aimeos\MW\Config\Decorator\Memory( $config, $this->config->get( 'shop' ) ); |
|
| 157 | + $config = new \Aimeos\MW\Config\Decorator\Memory($config, $this->config->get('shop')); |
|
| 158 | 158 | |
| 159 | - if( ( $conf = $this->config->get( 'shop.' . $type, null ) ) !== null ) { |
|
| 160 | - $config = new \Aimeos\MW\Config\Decorator\Memory( $config, $conf ); |
|
| 159 | + if (($conf = $this->config->get('shop.'.$type, null)) !== null) { |
|
| 160 | + $config = new \Aimeos\MW\Config\Decorator\Memory($config, $conf); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | return $config; |
@@ -170,18 +170,18 @@ discard block |
||
| 170 | 170 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 171 | 171 | * @return \Aimeos\MShop\Locale\Item\Iface Locale item object |
| 172 | 172 | */ |
| 173 | - protected function getLocale( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 173 | + protected function getLocale(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 174 | 174 | { |
| 175 | - if( $this->locale === null ) |
|
| 175 | + if ($this->locale === null) |
|
| 176 | 176 | { |
| 177 | - $site = Route::input( 'site', Input::get( 'site', 'default' ) ); |
|
| 178 | - $currency = Route::input( 'currency', Input::get( 'currency', '' ) ); |
|
| 179 | - $lang = Route::input( 'locale', Input::get( 'locale', '' ) ); |
|
| 177 | + $site = Route::input('site', Input::get('site', 'default')); |
|
| 178 | + $currency = Route::input('currency', Input::get('currency', '')); |
|
| 179 | + $lang = Route::input('locale', Input::get('locale', '')); |
|
| 180 | 180 | |
| 181 | - $disableSites = $this->config->get( 'shop.disableSites', true ); |
|
| 181 | + $disableSites = $this->config->get('shop.disableSites', true); |
|
| 182 | 182 | |
| 183 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
| 184 | - $this->locale = $localeManager->bootstrap( $site, $lang, $currency, $disableSites ); |
|
| 183 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
| 184 | + $this->locale = $localeManager->bootstrap($site, $lang, $currency, $disableSites); |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | return $this->locale; |
@@ -42,24 +42,24 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function fire() |
| 44 | 44 | { |
| 45 | - $context = $this->getLaravel()->make( 'Aimeos\Shop\Base\Context' )->get( false, 'backend' ); |
|
| 46 | - $context->setEditor( 'aimeos:cache' ); |
|
| 45 | + $context = $this->getLaravel()->make('Aimeos\Shop\Base\Context')->get(false, 'backend'); |
|
| 46 | + $context->setEditor('aimeos:cache'); |
|
| 47 | 47 | |
| 48 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
| 48 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
| 49 | 49 | |
| 50 | - foreach( $this->getSiteItems( $context, $this->argument( 'site' ) ) as $siteItem ) |
|
| 50 | + foreach ($this->getSiteItems($context, $this->argument('site')) as $siteItem) |
|
| 51 | 51 | { |
| 52 | - $localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false ); |
|
| 52 | + $localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false); |
|
| 53 | 53 | |
| 54 | 54 | $lcontext = clone $context; |
| 55 | - $lcontext->setLocale( $localeItem ); |
|
| 55 | + $lcontext->setLocale($localeItem); |
|
| 56 | 56 | |
| 57 | - $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $lcontext ); |
|
| 58 | - $lcontext->setCache( $cache ); |
|
| 57 | + $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($lcontext); |
|
| 58 | + $lcontext->setCache($cache); |
|
| 59 | 59 | |
| 60 | - $this->info( sprintf( 'Clearing the Aimeos cache for site "%1$s"', $siteItem->getCode() ) ); |
|
| 60 | + $this->info(sprintf('Clearing the Aimeos cache for site "%1$s"', $siteItem->getCode())); |
|
| 61 | 61 | |
| 62 | - \Aimeos\MAdmin\Cache\Manager\Factory::createManager( $lcontext )->getCache()->flush(); |
|
| 62 | + \Aimeos\MAdmin\Cache\Manager\Factory::createManager($lcontext)->getCache()->flush(); |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | protected function getArguments() |
| 73 | 73 | { |
| 74 | 74 | return array( |
| 75 | - array( 'site', InputArgument::OPTIONAL, 'Site codes to clear the cache like "default unittest" (none for all)' ), |
|
| 75 | + array('site', InputArgument::OPTIONAL, 'Site codes to clear the cache like "default unittest" (none for all)'), |
|
| 76 | 76 | ); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -42,18 +42,18 @@ discard block |
||
| 42 | 42 | * @param string $classname Name of the setup task class |
| 43 | 43 | * @return boolean True if class is found, false if not |
| 44 | 44 | */ |
| 45 | - public static function autoload( $classname ) |
|
| 45 | + public static function autoload($classname) |
|
| 46 | 46 | { |
| 47 | - if( strncmp( $classname, 'Aimeos\\MW\\Setup\\Task\\', 21 ) === 0 ) |
|
| 47 | + if (strncmp($classname, 'Aimeos\\MW\\Setup\\Task\\', 21) === 0) |
|
| 48 | 48 | { |
| 49 | - $fileName = substr( $classname, 21 ) . '.php'; |
|
| 50 | - $paths = explode( PATH_SEPARATOR, get_include_path() ); |
|
| 49 | + $fileName = substr($classname, 21).'.php'; |
|
| 50 | + $paths = explode(PATH_SEPARATOR, get_include_path()); |
|
| 51 | 51 | |
| 52 | - foreach( $paths as $path ) |
|
| 52 | + foreach ($paths as $path) |
|
| 53 | 53 | { |
| 54 | - $file = $path . DIRECTORY_SEPARATOR . $fileName; |
|
| 54 | + $file = $path.DIRECTORY_SEPARATOR.$fileName; |
|
| 55 | 55 | |
| 56 | - if( file_exists( $file ) === true && ( include_once $file ) !== false ) { |
|
| 56 | + if (file_exists($file) === true && (include_once $file) !== false) { |
|
| 57 | 57 | return true; |
| 58 | 58 | } |
| 59 | 59 | } |
@@ -70,49 +70,49 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public function fire() |
| 72 | 72 | { |
| 73 | - $ctx = $this->getLaravel()->make( '\Aimeos\Shop\Base\Context' )->get( false, 'backend' ); |
|
| 74 | - $ctx->setEditor( 'aimeos:setup' ); |
|
| 73 | + $ctx = $this->getLaravel()->make('\Aimeos\Shop\Base\Context')->get(false, 'backend'); |
|
| 74 | + $ctx->setEditor('aimeos:setup'); |
|
| 75 | 75 | |
| 76 | 76 | $config = $ctx->getConfig(); |
| 77 | - $site = $this->argument( 'site' ); |
|
| 78 | - $template = $this->argument( 'tplsite' ); |
|
| 77 | + $site = $this->argument('site'); |
|
| 78 | + $template = $this->argument('tplsite'); |
|
| 79 | 79 | |
| 80 | - $config->set( 'setup/site', $site ); |
|
| 81 | - $dbconfig = $this->getDbConfig( $config ); |
|
| 82 | - $this->setOptions( $config ); |
|
| 80 | + $config->set('setup/site', $site); |
|
| 81 | + $dbconfig = $this->getDbConfig($config); |
|
| 82 | + $this->setOptions($config); |
|
| 83 | 83 | |
| 84 | - $taskPaths = $this->getLaravel()->make( '\Aimeos\Shop\Base\Aimeos' )->get()->getSetupPaths( $template ); |
|
| 84 | + $taskPaths = $this->getLaravel()->make('\Aimeos\Shop\Base\Aimeos')->get()->getSetupPaths($template); |
|
| 85 | 85 | |
| 86 | 86 | $includePaths = $taskPaths; |
| 87 | 87 | $includePaths[] = get_include_path(); |
| 88 | 88 | |
| 89 | - if( set_include_path( implode( PATH_SEPARATOR, $includePaths ) ) === false ) { |
|
| 90 | - throw new \Exception( 'Unable to extend include path' ); |
|
| 89 | + if (set_include_path(implode(PATH_SEPARATOR, $includePaths)) === false) { |
|
| 90 | + throw new \Exception('Unable to extend include path'); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - spl_autoload_register( '\Aimeos\Shop\Command\SetupCommand::autoload', true ); |
|
| 93 | + spl_autoload_register('\Aimeos\Shop\Command\SetupCommand::autoload', true); |
|
| 94 | 94 | |
| 95 | - $manager = new \Aimeos\MW\Setup\Manager\Multiple( $ctx->getDatabaseManager(), $dbconfig, $taskPaths, $ctx ); |
|
| 95 | + $manager = new \Aimeos\MW\Setup\Manager\Multiple($ctx->getDatabaseManager(), $dbconfig, $taskPaths, $ctx); |
|
| 96 | 96 | |
| 97 | - $this->info( sprintf( 'Initializing or updating the Aimeos database tables for site "%1$s"', $site ) ); |
|
| 97 | + $this->info(sprintf('Initializing or updating the Aimeos database tables for site "%1$s"', $site)); |
|
| 98 | 98 | |
| 99 | - if( ( $task = $this->option( 'task' ) ) && is_array( $task ) ) { |
|
| 100 | - $task = reset( $task ); |
|
| 99 | + if (($task = $this->option('task')) && is_array($task)) { |
|
| 100 | + $task = reset($task); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - switch( $this->option( 'action' ) ) |
|
| 103 | + switch ($this->option('action')) |
|
| 104 | 104 | { |
| 105 | 105 | case 'migrate': |
| 106 | - $manager->migrate( $task ); |
|
| 106 | + $manager->migrate($task); |
|
| 107 | 107 | break; |
| 108 | 108 | case 'rollback': |
| 109 | - $manager->rollback( $task ); |
|
| 109 | + $manager->rollback($task); |
|
| 110 | 110 | break; |
| 111 | 111 | case 'clean': |
| 112 | - $manager->clean( $task ); |
|
| 112 | + $manager->clean($task); |
|
| 113 | 113 | break; |
| 114 | 114 | default: |
| 115 | - throw new \Exception( sprintf( 'Invalid setup action "%1$s"', $this->option( 'action' ) ) ); |
|
| 115 | + throw new \Exception(sprintf('Invalid setup action "%1$s"', $this->option('action'))); |
|
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | |
@@ -125,8 +125,8 @@ discard block |
||
| 125 | 125 | protected function getArguments() |
| 126 | 126 | { |
| 127 | 127 | return array( |
| 128 | - array( 'site', InputArgument::OPTIONAL, 'Site for updating database entries', 'default' ), |
|
| 129 | - array( 'tplsite', InputArgument::OPTIONAL, 'Site used as template for creating the new one', 'default' ), |
|
| 128 | + array('site', InputArgument::OPTIONAL, 'Site for updating database entries', 'default'), |
|
| 129 | + array('tplsite', InputArgument::OPTIONAL, 'Site used as template for creating the new one', 'default'), |
|
| 130 | 130 | ); |
| 131 | 131 | } |
| 132 | 132 | |
@@ -139,9 +139,9 @@ discard block |
||
| 139 | 139 | protected function getOptions() |
| 140 | 140 | { |
| 141 | 141 | return array( |
| 142 | - array( 'option', null, InputOption::VALUE_REQUIRED, 'Setup configuration, name and value are separated by ":" like "setup/default/demo:1"', array() ), |
|
| 143 | - array( 'action', null, InputOption::VALUE_REQUIRED, 'Action name that should be executed, i.e. "migrate", "rollback", "clean"', 'migrate' ), |
|
| 144 | - array( 'task', null, InputOption::VALUE_REQUIRED, 'Name of the setup task that should be executed', null ), |
|
| 142 | + array('option', null, InputOption::VALUE_REQUIRED, 'Setup configuration, name and value are separated by ":" like "setup/default/demo:1"', array()), |
|
| 143 | + array('action', null, InputOption::VALUE_REQUIRED, 'Action name that should be executed, i.e. "migrate", "rollback", "clean"', 'migrate'), |
|
| 144 | + array('task', null, InputOption::VALUE_REQUIRED, 'Name of the setup task that should be executed', null), |
|
| 145 | 145 | ); |
| 146 | 146 | } |
| 147 | 147 | |
@@ -152,14 +152,14 @@ discard block |
||
| 152 | 152 | * @param \Aimeos\MW\Config\Iface $conf Config object |
| 153 | 153 | * @return array Multi-dimensional associative list of database configuration parameters |
| 154 | 154 | */ |
| 155 | - protected function getDbConfig( \Aimeos\MW\Config\Iface $conf ) |
|
| 155 | + protected function getDbConfig(\Aimeos\MW\Config\Iface $conf) |
|
| 156 | 156 | { |
| 157 | - $dbconfig = $conf->get( 'resource', array() ); |
|
| 157 | + $dbconfig = $conf->get('resource', array()); |
|
| 158 | 158 | |
| 159 | - foreach( $dbconfig as $rname => $dbconf ) |
|
| 159 | + foreach ($dbconfig as $rname => $dbconf) |
|
| 160 | 160 | { |
| 161 | - if( strncmp( $rname, 'db', 2 ) !== 0 ) { |
|
| 162 | - unset( $dbconfig[$rname] ); |
|
| 161 | + if (strncmp($rname, 'db', 2) !== 0) { |
|
| 162 | + unset($dbconfig[$rname]); |
|
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | |
@@ -174,12 +174,12 @@ discard block |
||
| 174 | 174 | * @param array Associative list of database configurations |
| 175 | 175 | * @throws \RuntimeException If the format of the options is invalid |
| 176 | 176 | */ |
| 177 | - protected function setOptions( \Aimeos\MW\Config\Iface $conf ) |
|
| 177 | + protected function setOptions(\Aimeos\MW\Config\Iface $conf) |
|
| 178 | 178 | { |
| 179 | - foreach( (array) $this->option( 'option' ) as $option ) |
|
| 179 | + foreach ((array) $this->option('option') as $option) |
|
| 180 | 180 | { |
| 181 | - list( $name, $value ) = explode( ':', $option ); |
|
| 182 | - $conf->set( $name, $value ); |
|
| 181 | + list($name, $value) = explode(':', $option); |
|
| 182 | + $conf->set($name, $value); |
|
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | } |
@@ -43,21 +43,21 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function fire() |
| 45 | 45 | { |
| 46 | - $aimeos = $this->getLaravel()->make( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 46 | + $aimeos = $this->getLaravel()->make('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 47 | 47 | $context = $this->getContext(); |
| 48 | 48 | |
| 49 | - $jobs = explode( ' ', $this->argument( 'jobs' ) ); |
|
| 50 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
| 49 | + $jobs = explode(' ', $this->argument('jobs')); |
|
| 50 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
| 51 | 51 | |
| 52 | - foreach( $this->getSiteItems( $context, $this->argument( 'site' ) ) as $siteItem ) |
|
| 52 | + foreach ($this->getSiteItems($context, $this->argument('site')) as $siteItem) |
|
| 53 | 53 | { |
| 54 | - $localeItem = $localeManager->bootstrap( $siteItem->getCode(), 'en', '', false ); |
|
| 55 | - $context->setLocale( $localeItem ); |
|
| 54 | + $localeItem = $localeManager->bootstrap($siteItem->getCode(), 'en', '', false); |
|
| 55 | + $context->setLocale($localeItem); |
|
| 56 | 56 | |
| 57 | - $this->info( sprintf( 'Executing the Aimeos jobs for "%s"', $siteItem->getCode() ) ); |
|
| 57 | + $this->info(sprintf('Executing the Aimeos jobs for "%s"', $siteItem->getCode())); |
|
| 58 | 58 | |
| 59 | - foreach( $jobs as $jobname ) { |
|
| 60 | - \Aimeos\Controller\Jobs\Factory::createController( $context, $aimeos, $jobname )->run(); |
|
| 59 | + foreach ($jobs as $jobname) { |
|
| 60 | + \Aimeos\Controller\Jobs\Factory::createController($context, $aimeos, $jobname)->run(); |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | } |
@@ -71,8 +71,8 @@ discard block |
||
| 71 | 71 | protected function getArguments() |
| 72 | 72 | { |
| 73 | 73 | return array( |
| 74 | - array( 'jobs', InputArgument::REQUIRED, 'One or more job controller names like "admin/job customer/email/watch"' ), |
|
| 75 | - array( 'site', InputArgument::OPTIONAL, 'Site codes to execute the jobs for like "default unittest" (none for all)' ), |
|
| 74 | + array('jobs', InputArgument::REQUIRED, 'One or more job controller names like "admin/job customer/email/watch"'), |
|
| 75 | + array('site', InputArgument::OPTIONAL, 'Site codes to execute the jobs for like "default unittest" (none for all)'), |
|
| 76 | 76 | ); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -95,19 +95,19 @@ discard block |
||
| 95 | 95 | protected function getContext() |
| 96 | 96 | { |
| 97 | 97 | $lv = $this->getLaravel(); |
| 98 | - $aimeos = $lv->make( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 99 | - $context = $lv->make( '\Aimeos\Shop\Base\Context' )->get( false, 'backend' ); |
|
| 98 | + $aimeos = $lv->make('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 99 | + $context = $lv->make('\Aimeos\Shop\Base\Context')->get(false, 'backend'); |
|
| 100 | 100 | |
| 101 | - $tmplPaths = $aimeos->getCustomPaths( 'controller/jobs/templates' ); |
|
| 102 | - $view = $lv->make( '\Aimeos\Shop\Base\View' )->create( $context, $tmplPaths ); |
|
| 101 | + $tmplPaths = $aimeos->getCustomPaths('controller/jobs/templates'); |
|
| 102 | + $view = $lv->make('\Aimeos\Shop\Base\View')->create($context, $tmplPaths); |
|
| 103 | 103 | |
| 104 | - $langManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context )->getSubManager( 'language' ); |
|
| 105 | - $langids = array_keys( $langManager->searchItems( $langManager->createSearch( true ) ) ); |
|
| 106 | - $i18n = $lv->make( '\Aimeos\Shop\Base\I18n' )->get( $langids ); |
|
| 104 | + $langManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context)->getSubManager('language'); |
|
| 105 | + $langids = array_keys($langManager->searchItems($langManager->createSearch(true))); |
|
| 106 | + $i18n = $lv->make('\Aimeos\Shop\Base\I18n')->get($langids); |
|
| 107 | 107 | |
| 108 | - $context->setEditor( 'aimeos:jobs' ); |
|
| 109 | - $context->setView( $view ); |
|
| 110 | - $context->setI18n( $i18n ); |
|
| 108 | + $context->setEditor('aimeos:jobs'); |
|
| 109 | + $context->setView($view); |
|
| 110 | + $context->setI18n($i18n); |
|
| 111 | 111 | |
| 112 | 112 | return $context; |
| 113 | 113 | } |