@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function indexAction() |
32 | 32 | { |
33 | - $params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'account-index' ); |
|
33 | + $params = app('\Aimeos\Shop\Base\Page')->getSections('account-index'); |
|
34 | 34 | return View::make('shop::account.index', $params); |
35 | 35 | } |
36 | 36 | |
@@ -42,17 +42,17 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function downloadAction() |
44 | 44 | { |
45 | - $context = app( '\Aimeos\Shop\Base\Context' )->get(); |
|
45 | + $context = app('\Aimeos\Shop\Base\Context')->get(); |
|
46 | 46 | $langid = $context->getLocale()->getLanguageId(); |
47 | 47 | |
48 | - $view = app( '\Aimeos\Shop\Base\View' )->create( $context, array(), $langid ); |
|
49 | - $context->setView( $view ); |
|
48 | + $view = app('\Aimeos\Shop\Base\View')->create($context, array(), $langid); |
|
49 | + $context->setView($view); |
|
50 | 50 | |
51 | - $client = \Aimeos\Client\Html\Factory::createClient( $context, array(), 'account/download' ); |
|
52 | - $client->setView( $view ); |
|
51 | + $client = \Aimeos\Client\Html\Factory::createClient($context, array(), 'account/download'); |
|
52 | + $client->setView($view); |
|
53 | 53 | $client->process(); |
54 | 54 | |
55 | 55 | $response = $view->response(); |
56 | - return Response::make( (string) $response->getBody(), $response->getStatusCode(), $response->getHeaders() ); |
|
56 | + return Response::make((string) $response->getBody(), $response->getStatusCode(), $response->getHeaders()); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | \ No newline at end of file |
@@ -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/templates' ); |
|
71 | - $view = $this->view->create( $context, $tmplPaths, $langid ); |
|
72 | - $context->setView( $view ); |
|
70 | + $tmplPaths = $this->aimeos->get()->getCustomPaths('client/html/templates'); |
|
71 | + $view = $this->view->create($context, $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(); |
@@ -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,34 +70,34 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function fire() |
72 | 72 | { |
73 | - $ctx = $this->getLaravel()->make( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
74 | - $ctx->setEditor( 'aimeos:setup' ); |
|
73 | + $ctx = $this->getLaravel()->make('\Aimeos\Shop\Base\Context')->get(false); |
|
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 | - $task = $this->option( 'task' ); |
|
100 | - switch( $this->option( 'action' ) ) |
|
99 | + $task = $this->option('task'); |
|
100 | + switch ($this->option('action')) |
|
101 | 101 | { |
102 | 102 | case 'migrate': |
103 | 103 | $manager->migrate(); break; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | case 'clean': |
107 | 107 | $manager->clean(); break; |
108 | 108 | default: |
109 | - throw new \Exception( sprintf( 'Invalid setup action "%1$s"', $this->option( 'action' ) ) ); |
|
109 | + throw new \Exception(sprintf('Invalid setup action "%1$s"', $this->option('action'))); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | protected function getArguments() |
120 | 120 | { |
121 | 121 | return array( |
122 | - array( 'site', InputArgument::OPTIONAL, 'Site for updating database entries', 'default' ), |
|
123 | - array( 'tplsite', InputArgument::OPTIONAL, 'Site used as template for creating the new one', 'default' ), |
|
122 | + array('site', InputArgument::OPTIONAL, 'Site for updating database entries', 'default'), |
|
123 | + array('tplsite', InputArgument::OPTIONAL, 'Site used as template for creating the new one', 'default'), |
|
124 | 124 | ); |
125 | 125 | } |
126 | 126 | |
@@ -133,9 +133,9 @@ discard block |
||
133 | 133 | protected function getOptions() |
134 | 134 | { |
135 | 135 | return array( |
136 | - array( 'option', null, InputOption::VALUE_REQUIRED, 'Setup configuration, name and value are separated by ":" like "setup/default/demo:1"', array() ), |
|
137 | - array( 'action', null, InputOption::VALUE_REQUIRED, 'Action name that should be executed, i.e. "migrate", "rollback", "clean"', 'migrate' ), |
|
138 | - array( 'task', null, InputOption::VALUE_REQUIRED, 'Name of the setup task that should be executed', null ), |
|
136 | + array('option', null, InputOption::VALUE_REQUIRED, 'Setup configuration, name and value are separated by ":" like "setup/default/demo:1"', array()), |
|
137 | + array('action', null, InputOption::VALUE_REQUIRED, 'Action name that should be executed, i.e. "migrate", "rollback", "clean"', 'migrate'), |
|
138 | + array('task', null, InputOption::VALUE_REQUIRED, 'Name of the setup task that should be executed', null), |
|
139 | 139 | ); |
140 | 140 | } |
141 | 141 | |
@@ -146,14 +146,14 @@ discard block |
||
146 | 146 | * @param \Aimeos\MW\Config\Iface $conf Config object |
147 | 147 | * @return array Multi-dimensional associative list of database configuration parameters |
148 | 148 | */ |
149 | - protected function getDbConfig( \Aimeos\MW\Config\Iface $conf ) |
|
149 | + protected function getDbConfig(\Aimeos\MW\Config\Iface $conf) |
|
150 | 150 | { |
151 | - $dbconfig = $conf->get( 'resource', array() ); |
|
151 | + $dbconfig = $conf->get('resource', array()); |
|
152 | 152 | |
153 | - foreach( $dbconfig as $rname => $dbconf ) |
|
153 | + foreach ($dbconfig as $rname => $dbconf) |
|
154 | 154 | { |
155 | - if( strncmp( $rname, 'db', 2 ) !== 0 ) { |
|
156 | - unset( $dbconfig[$rname] ); |
|
155 | + if (strncmp($rname, 'db', 2) !== 0) { |
|
156 | + unset($dbconfig[$rname]); |
|
157 | 157 | } |
158 | 158 | } |
159 | 159 | |
@@ -168,12 +168,12 @@ discard block |
||
168 | 168 | * @param array Associative list of database configurations |
169 | 169 | * @throws \RuntimeException If the format of the options is invalid |
170 | 170 | */ |
171 | - protected function setOptions( \Aimeos\MW\Config\Iface $conf ) |
|
171 | + protected function setOptions(\Aimeos\MW\Config\Iface $conf) |
|
172 | 172 | { |
173 | - foreach( (array) $this->option( 'option' ) as $option ) |
|
173 | + foreach ((array) $this->option('option') as $option) |
|
174 | 174 | { |
175 | - list( $name, $value ) = explode( ':', $option ); |
|
176 | - $conf->set( $name, $value ); |
|
175 | + list($name, $value) = explode(':', $option); |
|
176 | + $conf->set($name, $value); |
|
177 | 177 | } |
178 | 178 | } |
179 | 179 | } |
@@ -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 ); |
|
98 | + $aimeos = $lv->make('\Aimeos\Shop\Base\Aimeos')->get(); |
|
99 | + $context = $lv->make('\Aimeos\Shop\Base\Context')->get(false); |
|
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 | } |