@@ -29,19 +29,19 @@ discard block |
||
29 | 29 | protected function configure() |
30 | 30 | { |
31 | 31 | $names = ''; |
32 | - $aimeos = new \Aimeos\Bootstrap( array() ); |
|
33 | - $cntlPaths = $aimeos->getCustomPaths( 'controller/jobs' ); |
|
34 | - $controllers = \Aimeos\Controller\Jobs\Factory::getControllers( $this->getBareContext(), $aimeos, $cntlPaths ); |
|
32 | + $aimeos = new \Aimeos\Bootstrap(array()); |
|
33 | + $cntlPaths = $aimeos->getCustomPaths('controller/jobs'); |
|
34 | + $controllers = \Aimeos\Controller\Jobs\Factory::getControllers($this->getBareContext(), $aimeos, $cntlPaths); |
|
35 | 35 | |
36 | - foreach( $controllers as $key => $controller ) { |
|
37 | - $names .= str_pad( $key, 30 ) . $controller->getName() . PHP_EOL; |
|
36 | + foreach ($controllers as $key => $controller) { |
|
37 | + $names .= str_pad($key, 30) . $controller->getName() . PHP_EOL; |
|
38 | 38 | } |
39 | 39 | |
40 | - $this->setName( 'aimeos:jobs' ); |
|
41 | - $this->setDescription( 'Executes the job controllers' ); |
|
42 | - $this->addArgument( 'jobs', InputArgument::REQUIRED, 'One or more job controller names like "admin/job customer/email/watch"' ); |
|
43 | - $this->addArgument( 'site', InputArgument::OPTIONAL, 'Site codes to execute the jobs for like "default unittest" (none for all)' ); |
|
44 | - $this->setHelp( "Available jobs are:\n" . $names ); |
|
40 | + $this->setName('aimeos:jobs'); |
|
41 | + $this->setDescription('Executes the job controllers'); |
|
42 | + $this->addArgument('jobs', InputArgument::REQUIRED, 'One or more job controller names like "admin/job customer/email/watch"'); |
|
43 | + $this->addArgument('site', InputArgument::OPTIONAL, 'Site codes to execute the jobs for like "default unittest" (none for all)'); |
|
44 | + $this->setHelp("Available jobs are:\n" . $names); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -51,23 +51,23 @@ discard block |
||
51 | 51 | * @param InputInterface $input Input object |
52 | 52 | * @param OutputInterface $output Output object |
53 | 53 | */ |
54 | - protected function execute( InputInterface $input, OutputInterface $output ) |
|
54 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
55 | 55 | { |
56 | 56 | $context = $this->getContext(); |
57 | - $aimeos = $this->getContainer()->get( 'aimeos' )->get(); |
|
57 | + $aimeos = $this->getContainer()->get('aimeos')->get(); |
|
58 | 58 | |
59 | - $jobs = explode( ' ', $input->getArgument( 'jobs' ) ); |
|
60 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
59 | + $jobs = explode(' ', $input->getArgument('jobs')); |
|
60 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
61 | 61 | |
62 | - foreach( $this->getSiteItems( $context, $input ) as $siteItem ) |
|
62 | + foreach ($this->getSiteItems($context, $input) as $siteItem) |
|
63 | 63 | { |
64 | - $localeItem = $localeManager->bootstrap( $siteItem->getCode(), 'en', '', false ); |
|
65 | - $context->setLocale( $localeItem ); |
|
64 | + $localeItem = $localeManager->bootstrap($siteItem->getCode(), 'en', '', false); |
|
65 | + $context->setLocale($localeItem); |
|
66 | 66 | |
67 | - $output->writeln( sprintf( 'Executing the Aimeos jobs for "<info>%s</info>"', $siteItem->getCode() ) ); |
|
67 | + $output->writeln(sprintf('Executing the Aimeos jobs for "<info>%s</info>"', $siteItem->getCode())); |
|
68 | 68 | |
69 | - foreach( $jobs as $jobname ) { |
|
70 | - \Aimeos\Controller\Jobs\Factory::createController( $context, $aimeos, $jobname )->run(); |
|
69 | + foreach ($jobs as $jobname) { |
|
70 | + \Aimeos\Controller\Jobs\Factory::createController($context, $aimeos, $jobname)->run(); |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | } |
@@ -82,15 +82,15 @@ discard block |
||
82 | 82 | { |
83 | 83 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
84 | 84 | |
85 | - $conf = new \Aimeos\MW\Config\PHPArray( array(), array() ); |
|
86 | - $ctx->setConfig( $conf ); |
|
85 | + $conf = new \Aimeos\MW\Config\PHPArray(array(), array()); |
|
86 | + $ctx->setConfig($conf); |
|
87 | 87 | |
88 | - $locale = \Aimeos\MShop\Factory::createManager( $ctx, 'locale' )->createItem(); |
|
89 | - $locale->setLanguageId( 'en' ); |
|
90 | - $ctx->setLocale( $locale ); |
|
88 | + $locale = \Aimeos\MShop\Factory::createManager($ctx, 'locale')->createItem(); |
|
89 | + $locale->setLanguageId('en'); |
|
90 | + $ctx->setLocale($locale); |
|
91 | 91 | |
92 | - $i18n = new \Aimeos\MW\Translation\None( 'en' ); |
|
93 | - $ctx->setI18n( array( 'en' => $i18n ) ); |
|
92 | + $i18n = new \Aimeos\MW\Translation\None('en'); |
|
93 | + $ctx->setI18n(array('en' => $i18n)); |
|
94 | 94 | |
95 | 95 | return $ctx; |
96 | 96 | } |
@@ -105,19 +105,19 @@ discard block |
||
105 | 105 | { |
106 | 106 | $container = $this->getContainer(); |
107 | 107 | $aimeos = $container->get('aimeos')->get(); |
108 | - $context = $container->get( 'aimeos_context' )->get( false ); |
|
108 | + $context = $container->get('aimeos_context')->get(false); |
|
109 | 109 | |
110 | - $tmplPaths = $aimeos->getCustomPaths( 'controller/jobs/templates' ); |
|
111 | - $tmplPaths = array_merge( $tmplPaths, $aimeos->getCustomPaths( 'client/html/templates' ) ); |
|
112 | - $view = $container->get('aimeos_view')->create( $context->getConfig(), $tmplPaths ); |
|
110 | + $tmplPaths = $aimeos->getCustomPaths('controller/jobs/templates'); |
|
111 | + $tmplPaths = array_merge($tmplPaths, $aimeos->getCustomPaths('client/html/templates')); |
|
112 | + $view = $container->get('aimeos_view')->create($context->getConfig(), $tmplPaths); |
|
113 | 113 | |
114 | - $langManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context )->getSubManager( 'language' ); |
|
115 | - $langids = array_keys( $langManager->searchItems( $langManager->createSearch( true ) ) ); |
|
116 | - $i18n = $this->getContainer()->get( 'aimeos_i18n' )->get( $langids ); |
|
114 | + $langManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context)->getSubManager('language'); |
|
115 | + $langids = array_keys($langManager->searchItems($langManager->createSearch(true))); |
|
116 | + $i18n = $this->getContainer()->get('aimeos_i18n')->get($langids); |
|
117 | 117 | |
118 | - $context->setEditor( 'aimeos:jobs' ); |
|
119 | - $context->setView( $view ); |
|
120 | - $context->setI18n( $i18n ); |
|
118 | + $context->setEditor('aimeos:jobs'); |
|
119 | + $context->setView($view); |
|
120 | + $context->setI18n($i18n); |
|
121 | 121 | |
122 | 122 | return $context; |
123 | 123 | } |
@@ -30,62 +30,62 @@ discard block |
||
30 | 30 | * @param Request $request Symfony request object |
31 | 31 | * @return Response Generated output for the admin interface |
32 | 32 | */ |
33 | - public function indexAction( Request $request ) |
|
33 | + public function indexAction(Request $request) |
|
34 | 34 | { |
35 | - $site = $request->attributes->get( 'site', 'default' ); |
|
36 | - $lang = $request->query->get( 'lang', 'en' ); |
|
35 | + $site = $request->attributes->get('site', 'default'); |
|
36 | + $lang = $request->query->get('lang', 'en'); |
|
37 | 37 | |
38 | - $context = $this->get( 'aimeos_context' )->get( false ); |
|
39 | - $context = $this->setLocale( $context, $site, $lang ); |
|
38 | + $context = $this->get('aimeos_context')->get(false); |
|
39 | + $context = $this->setLocale($context, $site, $lang); |
|
40 | 40 | |
41 | - $aimeos = $this->get( 'aimeos' ); |
|
41 | + $aimeos = $this->get('aimeos'); |
|
42 | 42 | $bootstrap = $aimeos->get(); |
43 | 43 | |
44 | - $cntlPaths = $bootstrap->getCustomPaths( 'controller/extjs' ); |
|
45 | - $controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths ); |
|
44 | + $cntlPaths = $bootstrap->getCustomPaths('controller/extjs'); |
|
45 | + $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); |
|
46 | 46 | $cssFiles = array(); |
47 | 47 | |
48 | - foreach( $bootstrap->getCustomPaths( 'admin/extjs' ) as $base => $paths ) |
|
48 | + foreach ($bootstrap->getCustomPaths('admin/extjs') as $base => $paths) |
|
49 | 49 | { |
50 | - foreach( $paths as $path ) |
|
50 | + foreach ($paths as $path) |
|
51 | 51 | { |
52 | 52 | $jsbAbsPath = $base . '/' . $path; |
53 | 53 | |
54 | - if( !is_file( $jsbAbsPath ) ) { |
|
55 | - throw new \Exception( sprintf( 'JSB2 file "%1$s" not found', $jsbAbsPath ) ); |
|
54 | + if (!is_file($jsbAbsPath)) { |
|
55 | + throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath)); |
|
56 | 56 | } |
57 | 57 | |
58 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $path ) ); |
|
59 | - $cssFiles = array_merge( $cssFiles, $jsb2->getUrls( 'css' ) ); |
|
58 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path)); |
|
59 | + $cssFiles = array_merge($cssFiles, $jsb2->getUrls('css')); |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | - $params = array( 'site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}' ); |
|
64 | - $adminUrl = $this->generateUrl( 'aimeos_shop_extadm', $params ); |
|
63 | + $params = array('site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}'); |
|
64 | + $adminUrl = $this->generateUrl('aimeos_shop_extadm', $params); |
|
65 | 65 | |
66 | - $token = $this->get( 'security.csrf.token_manager' )->getToken( 'aimeos_admin_token' )->getValue(); |
|
67 | - $jsonUrl = $this->generateUrl( 'aimeos_shop_extadm_json', array( '_token' => $token, 'site' => $site ) ); |
|
66 | + $token = $this->get('security.csrf.token_manager')->getToken('aimeos_admin_token')->getValue(); |
|
67 | + $jsonUrl = $this->generateUrl('aimeos_shop_extadm_json', array('_token' => $token, 'site' => $site)); |
|
68 | 68 | |
69 | - $jqadmUrl = $this->generateUrl( 'aimeos_shop_jqadm_search', array( 'site' => $site, 'resource' => 'product' ) ); |
|
69 | + $jqadmUrl = $this->generateUrl('aimeos_shop_jqadm_search', array('site' => $site, 'resource' => 'product')); |
|
70 | 70 | |
71 | 71 | $vars = array( |
72 | 72 | 'lang' => $lang, |
73 | 73 | 'cssFiles' => $cssFiles, |
74 | 74 | 'languages' => $this->getJsonLanguages(), |
75 | - 'config' => $this->getJsonClientConfig( $context ), |
|
76 | - 'site' => $this->getJsonSiteItem( $context, $site ), |
|
77 | - 'i18nContent' => $this->getJsonClientI18n( $bootstrap->getI18nPaths(), $lang ), |
|
75 | + 'config' => $this->getJsonClientConfig($context), |
|
76 | + 'site' => $this->getJsonSiteItem($context, $site), |
|
77 | + 'i18nContent' => $this->getJsonClientI18n($bootstrap->getI18nPaths(), $lang), |
|
78 | 78 | 'searchSchemas' => $controller->getJsonSearchSchemas(), |
79 | 79 | 'itemSchemas' => $controller->getJsonItemSchemas(), |
80 | - 'smd' => $controller->getJsonSmd( $jsonUrl ), |
|
81 | - 'urlTemplate' => urldecode( $adminUrl ), |
|
82 | - 'uploaddir' => $this->container->getParameter( 'aimeos_shop.uploaddir' ), |
|
83 | - 'activeTab' => $request->query->get( 'tab', 0 ), |
|
80 | + 'smd' => $controller->getJsonSmd($jsonUrl), |
|
81 | + 'urlTemplate' => urldecode($adminUrl), |
|
82 | + 'uploaddir' => $this->container->getParameter('aimeos_shop.uploaddir'), |
|
83 | + 'activeTab' => $request->query->get('tab', 0), |
|
84 | 84 | 'version' => $aimeos->getVersion(), |
85 | 85 | 'jqadmurl' => $jqadmUrl, |
86 | 86 | ); |
87 | 87 | |
88 | - return $this->render( 'AimeosShopBundle:Extadm:index.html.twig', $vars ); |
|
88 | + return $this->render('AimeosShopBundle:Extadm:index.html.twig', $vars); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | |
@@ -95,22 +95,22 @@ discard block |
||
95 | 95 | * @param Request $request Symfony request object |
96 | 96 | * @return Response JSON RPC message response |
97 | 97 | */ |
98 | - public function doAction( Request $request ) |
|
98 | + public function doAction(Request $request) |
|
99 | 99 | { |
100 | 100 | $csrfProvider = $this->get('security.csrf.token_manager'); |
101 | 101 | |
102 | - if( $csrfProvider->isTokenValid( new CsrfToken( 'aimeos_admin_token', $request->query->get( '_token' ) ) ) !== true ) { |
|
103 | - throw new \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException( 'CSRF token is invalid' ); |
|
102 | + if ($csrfProvider->isTokenValid(new CsrfToken('aimeos_admin_token', $request->query->get('_token'))) !== true) { |
|
103 | + throw new \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException('CSRF token is invalid'); |
|
104 | 104 | } |
105 | 105 | |
106 | - $cntlPaths = $this->get( 'aimeos' )->get()->getCustomPaths( 'controller/extjs' ); |
|
107 | - $context = $this->get( 'aimeos_context' )->get( false ); |
|
108 | - $context = $this->setLocale( $context ); |
|
106 | + $cntlPaths = $this->get('aimeos')->get()->getCustomPaths('controller/extjs'); |
|
107 | + $context = $this->get('aimeos_context')->get(false); |
|
108 | + $context = $this->setLocale($context); |
|
109 | 109 | |
110 | - $controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths ); |
|
110 | + $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); |
|
111 | 111 | |
112 | - $response = $controller->process( $request->request->all(), 'php://input' ); |
|
113 | - return $this->render( 'AimeosShopBundle:Extadm:do.html.twig', array( 'output' => $response ) ); |
|
112 | + $response = $controller->process($request->request->all(), 'php://input'); |
|
113 | + return $this->render('AimeosShopBundle:Extadm:do.html.twig', array('output' => $response)); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | |
@@ -123,27 +123,27 @@ discard block |
||
123 | 123 | { |
124 | 124 | $contents = ''; |
125 | 125 | $jsFiles = array(); |
126 | - $aimeos = $this->get( 'aimeos' )->get(); |
|
126 | + $aimeos = $this->get('aimeos')->get(); |
|
127 | 127 | |
128 | - foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths ) |
|
128 | + foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths) |
|
129 | 129 | { |
130 | - foreach( $paths as $path ) |
|
130 | + foreach ($paths as $path) |
|
131 | 131 | { |
132 | 132 | $jsbAbsPath = $base . '/' . $path; |
133 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) ); |
|
134 | - $jsFiles = array_merge( $jsFiles, $jsb2->getFiles( 'js' ) ); |
|
133 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath)); |
|
134 | + $jsFiles = array_merge($jsFiles, $jsb2->getFiles('js')); |
|
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
138 | - foreach( $jsFiles as $file ) |
|
138 | + foreach ($jsFiles as $file) |
|
139 | 139 | { |
140 | - if( ( $content = file_get_contents( $file ) ) !== false ) { |
|
140 | + if (($content = file_get_contents($file)) !== false) { |
|
141 | 141 | $contents .= $content; |
142 | 142 | } |
143 | 143 | } |
144 | 144 | |
145 | - $response = new Response( $contents ); |
|
146 | - $response->headers->set( 'Content-Type', 'application/javascript' ); |
|
145 | + $response = new Response($contents); |
|
146 | + $response->headers->set('Content-Type', 'application/javascript'); |
|
147 | 147 | |
148 | 148 | return $response; |
149 | 149 | } |
@@ -158,11 +158,11 @@ discard block |
||
158 | 158 | { |
159 | 159 | $result = array(); |
160 | 160 | |
161 | - foreach( $this->get( 'aimeos' )->get()->getI18nList( 'admin' ) as $id ) { |
|
162 | - $result[] = array( 'id' => $id, 'label' => $id ); |
|
161 | + foreach ($this->get('aimeos')->get()->getI18nList('admin') as $id) { |
|
162 | + $result[] = array('id' => $id, 'label' => $id); |
|
163 | 163 | } |
164 | 164 | |
165 | - return json_encode( $result ); |
|
165 | + return json_encode($result); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | |
@@ -172,10 +172,10 @@ discard block |
||
172 | 172 | * @param \Aimeos\MShop\Context\Item\Iface $context Context item object |
173 | 173 | * @return string JSON encoded configuration object |
174 | 174 | */ |
175 | - protected function getJsonClientConfig( \Aimeos\MShop\Context\Item\Iface $context ) |
|
175 | + protected function getJsonClientConfig(\Aimeos\MShop\Context\Item\Iface $context) |
|
176 | 176 | { |
177 | - $config = $context->getConfig()->get( 'admin/extjs', array() ); |
|
178 | - return json_encode( array( 'admin' => array( 'extjs' => $config ) ), JSON_FORCE_OBJECT ); |
|
177 | + $config = $context->getConfig()->get('admin/extjs', array()); |
|
178 | + return json_encode(array('admin' => array('extjs' => $config)), JSON_FORCE_OBJECT); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | |
@@ -186,16 +186,16 @@ discard block |
||
186 | 186 | * @param string $lang ISO language code like "en" or "en_GB" |
187 | 187 | * @return string JSON encoded translation object |
188 | 188 | */ |
189 | - protected function getJsonClientI18n( array $i18nPaths, $lang ) |
|
189 | + protected function getJsonClientI18n(array $i18nPaths, $lang) |
|
190 | 190 | { |
191 | - $i18n = new \Aimeos\MW\Translation\Gettext( $i18nPaths, $lang ); |
|
191 | + $i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $lang); |
|
192 | 192 | |
193 | 193 | $content = array( |
194 | - 'admin' => $i18n->getAll( 'admin' ), |
|
195 | - 'admin/ext' => $i18n->getAll( 'admin/ext' ), |
|
194 | + 'admin' => $i18n->getAll('admin'), |
|
195 | + 'admin/ext' => $i18n->getAll('admin/ext'), |
|
196 | 196 | ); |
197 | 197 | |
198 | - return json_encode( $content, JSON_FORCE_OBJECT ); |
|
198 | + return json_encode($content, JSON_FORCE_OBJECT); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | |
@@ -207,19 +207,19 @@ discard block |
||
207 | 207 | * @return string JSON encoded site item object |
208 | 208 | * @throws Exception If no site item was found for the code |
209 | 209 | */ |
210 | - protected function getJsonSiteItem( \Aimeos\MShop\Context\Item\Iface $context, $site ) |
|
210 | + protected function getJsonSiteItem(\Aimeos\MShop\Context\Item\Iface $context, $site) |
|
211 | 211 | { |
212 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' ); |
|
212 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site'); |
|
213 | 213 | |
214 | 214 | $criteria = $manager->createSearch(); |
215 | - $criteria->setConditions( $criteria->compare( '==', 'locale.site.code', $site ) ); |
|
216 | - $items = $manager->searchItems( $criteria ); |
|
215 | + $criteria->setConditions($criteria->compare('==', 'locale.site.code', $site)); |
|
216 | + $items = $manager->searchItems($criteria); |
|
217 | 217 | |
218 | - if( ( $item = reset( $items ) ) === false ) { |
|
219 | - throw new \Exception( sprintf( 'No site found for code "%1$s"', $site ) ); |
|
218 | + if (($item = reset($items)) === false) { |
|
219 | + throw new \Exception(sprintf('No site found for code "%1$s"', $site)); |
|
220 | 220 | } |
221 | 221 | |
222 | - return json_encode( $item->toArray() ); |
|
222 | + return json_encode($item->toArray()); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | |
@@ -231,17 +231,17 @@ discard block |
||
231 | 231 | * @param string $locale ISO language code, e.g. "en" or "en_GB" |
232 | 232 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
233 | 233 | */ |
234 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null ) |
|
234 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null) |
|
235 | 235 | { |
236 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
236 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
237 | 237 | |
238 | 238 | try { |
239 | - $localeItem = $localeManager->bootstrap( $sitecode, $locale, '', false ); |
|
240 | - } catch( \Aimeos\MShop\Locale\Exception $e ) { |
|
239 | + $localeItem = $localeManager->bootstrap($sitecode, $locale, '', false); |
|
240 | + } catch (\Aimeos\MShop\Locale\Exception $e) { |
|
241 | 241 | $localeItem = $localeManager->createItem(); |
242 | 242 | } |
243 | 243 | |
244 | - $context->setLocale( $localeItem ); |
|
244 | + $context->setLocale($localeItem); |
|
245 | 245 | |
246 | 246 | return $context; |
247 | 247 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @param Container $container Container object to access parameters |
31 | 31 | */ |
32 | - public function __construct( Container $container ) |
|
32 | + public function __construct(Container $container) |
|
33 | 33 | { |
34 | 34 | $this->container = $container; |
35 | 35 | } |
@@ -41,27 +41,27 @@ discard block |
||
41 | 41 | * @param array $languageIds List of two letter ISO language IDs |
42 | 42 | * @return \Aimeos\MW\Translation\Interface[] List of translation objects |
43 | 43 | */ |
44 | - public function get( array $languageIds ) |
|
44 | + public function get(array $languageIds) |
|
45 | 45 | { |
46 | - $i18nPaths = $this->container->get( 'aimeos' )->get()->getI18nPaths(); |
|
46 | + $i18nPaths = $this->container->get('aimeos')->get()->getI18nPaths(); |
|
47 | 47 | |
48 | - foreach( $languageIds as $langid ) |
|
48 | + foreach ($languageIds as $langid) |
|
49 | 49 | { |
50 | - if( !isset( $this->i18n[$langid] ) ) |
|
50 | + if (!isset($this->i18n[$langid])) |
|
51 | 51 | { |
52 | - $i18n = new \Aimeos\MW\Translation\Gettext( $i18nPaths, $langid ); |
|
52 | + $i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $langid); |
|
53 | 53 | |
54 | - $apc = (bool) $this->container->getParameter( 'aimeos_shop.apc_enable' ); |
|
55 | - $prefix = $this->container->getParameter( 'aimeos_shop.apc_prefix' ); |
|
54 | + $apc = (bool) $this->container->getParameter('aimeos_shop.apc_enable'); |
|
55 | + $prefix = $this->container->getParameter('aimeos_shop.apc_prefix'); |
|
56 | 56 | |
57 | - if( function_exists( 'apc_store' ) === true && $apc === true ) { |
|
58 | - $i18n = new \Aimeos\MW\Translation\Decorator\APC( $i18n, $prefix ); |
|
57 | + if (function_exists('apc_store') === true && $apc === true) { |
|
58 | + $i18n = new \Aimeos\MW\Translation\Decorator\APC($i18n, $prefix); |
|
59 | 59 | } |
60 | 60 | |
61 | - $translations = $this->container->getParameter( 'aimeos_shop.i18n' ); |
|
61 | + $translations = $this->container->getParameter('aimeos_shop.i18n'); |
|
62 | 62 | |
63 | - if( isset( $translations[$langid] ) ) { |
|
64 | - $i18n = new \Aimeos\MW\Translation\Decorator\Memory( $i18n, $translations[$langid] ); |
|
63 | + if (isset($translations[$langid])) { |
|
64 | + $i18n = new \Aimeos\MW\Translation\Decorator\Memory($i18n, $translations[$langid]); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | $this->i18n[$langid] = $i18n; |