@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function getName() |
31 | 31 | { |
32 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Cache cleanup' ); |
|
32 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Cache cleanup'); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function getDescription() |
42 | 42 | { |
43 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Removes the expired entries from the cache' ); |
|
43 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Removes the expired entries from the cache'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -51,6 +51,6 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function run() |
53 | 53 | { |
54 | - \Aimeos\MAdmin\Cache\Manager\Factory::createManager( $this->getContext() )->getCache()->cleanup(); |
|
54 | + \Aimeos\MAdmin\Cache\Manager\Factory::createManager($this->getContext())->getCache()->cleanup(); |
|
55 | 55 | } |
56 | 56 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param string|null $name Name of the controller or "Standard" if null |
31 | 31 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
32 | 32 | */ |
33 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
33 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
34 | 34 | { |
35 | 35 | /** controller/jobs/admin/log/name |
36 | 36 | * Class name of the used admin log scheduler controller implementation |
@@ -65,20 +65,20 @@ discard block |
||
65 | 65 | * @since 2014.09 |
66 | 66 | * @category Developer |
67 | 67 | */ |
68 | - if( $name === null ) { |
|
69 | - $name = $context->getConfig()->get( 'controller/jobs/admin/log/name', 'Standard' ); |
|
68 | + if ($name === null) { |
|
69 | + $name = $context->getConfig()->get('controller/jobs/admin/log/name', 'Standard'); |
|
70 | 70 | } |
71 | 71 | |
72 | - if( ctype_alnum( $name ) === false ) |
|
72 | + if (ctype_alnum($name) === false) |
|
73 | 73 | { |
74 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Admin\\Log\\' . $name : '<not a string>'; |
|
75 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Admin\\Log\\' . $name : '<not a string>'; |
|
75 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
79 | 79 | $classname = '\\Aimeos\\Controller\\Jobs\\Admin\\Log\\' . $name; |
80 | 80 | |
81 | - $controller = self::createControllerBase( $context, $aimeos, $classname, $iface ); |
|
81 | + $controller = self::createControllerBase($context, $aimeos, $classname, $iface); |
|
82 | 82 | |
83 | 83 | /** controller/jobs/admin/log/decorators/excludes |
84 | 84 | * Excludes decorators added by the "common" option from the admin log controllers |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/admin/log/decorators/excludes |
155 | 155 | * @see controller/jobs/admin/log/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'admin/log' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'admin/log'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function getName() |
31 | 31 | { |
32 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Log cleanup' ); |
|
32 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Log cleanup'); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function getDescription() |
42 | 42 | { |
43 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Removes the old log entries from the database and archives them (optional)' ); |
|
43 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Removes the old log entries from the database and archives them (optional)'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | * @see controller/jobs/admin/log/standard/container/format |
72 | 72 | * @see controller/jobs/admin/log/standard/container/options |
73 | 73 | */ |
74 | - $limit = $config->get( 'controller/jobs/admin/log/standard/limit-days', 30 ); |
|
75 | - $limitDate = date( 'Y-m-d H:i:s', time() - $limit * 86400 ); |
|
74 | + $limit = $config->get('controller/jobs/admin/log/standard/limit-days', 30); |
|
75 | + $limitDate = date('Y-m-d H:i:s', time() - $limit * 86400); |
|
76 | 76 | |
77 | 77 | /** controller/jobs/admin/log/standard/path |
78 | 78 | * Path to a writable directory where the log archive files should be stored |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @see controller/jobs/admin/log/standard/container/options |
102 | 102 | * @see controller/jobs/admin/log/standard/limit-days |
103 | 103 | */ |
104 | - if( ( $path = $config->get( 'controller/jobs/admin/log/standard/path', null ) ) !== null ) |
|
104 | + if (($path = $config->get('controller/jobs/admin/log/standard/path', null)) !== null) |
|
105 | 105 | { |
106 | 106 | /** controller/jobs/admin/log/standard/container/type |
107 | 107 | * Container file type storing all coupon code files to import |
@@ -175,19 +175,19 @@ discard block |
||
175 | 175 | * @see controller/jobs/admin/log/standard/limit-days |
176 | 176 | */ |
177 | 177 | |
178 | - $type = $config->get( 'controller/jobs/admin/log/standard/container/type', 'Zip' ); |
|
179 | - $format = $config->get( 'controller/jobs/admin/log/standard/container/format', 'CSV' ); |
|
180 | - $options = $config->get( 'controller/jobs/admin/log/standard/container/options', array() ); |
|
178 | + $type = $config->get('controller/jobs/admin/log/standard/container/type', 'Zip'); |
|
179 | + $format = $config->get('controller/jobs/admin/log/standard/container/format', 'CSV'); |
|
180 | + $options = $config->get('controller/jobs/admin/log/standard/container/options', array()); |
|
181 | 181 | |
182 | - $path .= DIRECTORY_SEPARATOR . str_replace( ' ', '_', $limitDate ); |
|
183 | - $container = \Aimeos\MW\Container\Factory::getContainer( $path, $type, $format, $options ); |
|
182 | + $path .= DIRECTORY_SEPARATOR . str_replace(' ', '_', $limitDate); |
|
183 | + $container = \Aimeos\MW\Container\Factory::getContainer($path, $type, $format, $options); |
|
184 | 184 | } |
185 | 185 | |
186 | - $manager = \Aimeos\MAdmin\Factory::createManager( $context, 'log' ); |
|
186 | + $manager = \Aimeos\MAdmin\Factory::createManager($context, 'log'); |
|
187 | 187 | |
188 | 188 | $search = $manager->createSearch(); |
189 | - $search->setConditions( $search->compare( '<=', 'log.timestamp', $limitDate ) ); |
|
190 | - $search->setSortations( array( $search->sort( '+', 'log.timestamp' ) ) ); |
|
189 | + $search->setConditions($search->compare('<=', 'log.timestamp', $limitDate)); |
|
190 | + $search->setSortations(array($search->sort('+', 'log.timestamp'))); |
|
191 | 191 | |
192 | 192 | $start = 0; |
193 | 193 | $contents = array(); |
@@ -195,37 +195,37 @@ discard block |
||
195 | 195 | do |
196 | 196 | { |
197 | 197 | $ids = array(); |
198 | - $items = $manager->searchItems( $search ); |
|
198 | + $items = $manager->searchItems($search); |
|
199 | 199 | |
200 | - foreach( $items as $id => $item ) |
|
200 | + foreach ($items as $id => $item) |
|
201 | 201 | { |
202 | - if( $container !== null ) |
|
202 | + if ($container !== null) |
|
203 | 203 | { |
204 | 204 | $facility = $item->getFacility(); |
205 | 205 | |
206 | - if( !isset( $contents[$facility] ) ) { |
|
207 | - $contents[$facility] = $container->create( $facility ); |
|
206 | + if (!isset($contents[$facility])) { |
|
207 | + $contents[$facility] = $container->create($facility); |
|
208 | 208 | } |
209 | 209 | |
210 | - $contents[$facility]->add( $item->toArray() ); |
|
210 | + $contents[$facility]->add($item->toArray()); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | $ids[] = $id; |
214 | 214 | } |
215 | 215 | |
216 | - $manager->deleteItems( $ids ); |
|
216 | + $manager->deleteItems($ids); |
|
217 | 217 | |
218 | - $count = count( $items ); |
|
218 | + $count = count($items); |
|
219 | 219 | $start += $count; |
220 | - $search->setSlice( $start ); |
|
220 | + $search->setSlice($start); |
|
221 | 221 | } |
222 | - while( $count >= $search->getSliceSize() ); |
|
222 | + while ($count >= $search->getSliceSize()); |
|
223 | 223 | |
224 | 224 | |
225 | - if( $container !== null && !empty( $contents ) ) |
|
225 | + if ($container !== null && !empty($contents)) |
|
226 | 226 | { |
227 | - foreach( $contents as $content ) { |
|
228 | - $container->add( $content ); |
|
227 | + foreach ($contents as $content) { |
|
228 | + $container->add($content); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | $container->close(); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param string|null $name Name of the controller or "Standard" if null |
31 | 31 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
32 | 32 | */ |
33 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
33 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
34 | 34 | { |
35 | 35 | /** controller/jobs/index/optimize/name |
36 | 36 | * Class name of the used catalog index optimize scheduler controller implementation |
@@ -65,20 +65,20 @@ discard block |
||
65 | 65 | * @since 2014.03 |
66 | 66 | * @category Developer |
67 | 67 | */ |
68 | - if( $name === null ) { |
|
69 | - $name = $context->getConfig()->get( 'controller/jobs/index/optimize/name', 'Standard' ); |
|
68 | + if ($name === null) { |
|
69 | + $name = $context->getConfig()->get('controller/jobs/index/optimize/name', 'Standard'); |
|
70 | 70 | } |
71 | 71 | |
72 | - if( ctype_alnum( $name ) === false ) |
|
72 | + if (ctype_alnum($name) === false) |
|
73 | 73 | { |
74 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Index\\Optimize\\' . $name : '<not a string>'; |
|
75 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Index\\Optimize\\' . $name : '<not a string>'; |
|
75 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
79 | 79 | $classname = '\\Aimeos\\Controller\\Jobs\\Index\\Optimize\\' . $name; |
80 | 80 | |
81 | - $controller = self::createControllerBase( $context, $aimeos, $classname, $iface ); |
|
81 | + $controller = self::createControllerBase($context, $aimeos, $classname, $iface); |
|
82 | 82 | |
83 | 83 | /** controller/jobs/index/optimize/decorators/excludes |
84 | 84 | * Excludes decorators added by the "common" option from the catalog index optimize controllers |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/index/optimize/decorators/excludes |
155 | 155 | * @see controller/jobs/index/optimize/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'index/optimize' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'index/optimize'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param string|null $name Name of the controller or "Standard" if null |
31 | 31 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
32 | 32 | */ |
33 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
33 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
34 | 34 | { |
35 | 35 | /** controller/jobs/index/rebuild/name |
36 | 36 | * Class name of the used catalog index rebuild scheduler controller implementation |
@@ -65,20 +65,20 @@ discard block |
||
65 | 65 | * @since 2014.03 |
66 | 66 | * @category Developer |
67 | 67 | */ |
68 | - if( $name === null ) { |
|
69 | - $name = $context->getConfig()->get( 'controller/jobs/index/rebuild/name', 'Standard' ); |
|
68 | + if ($name === null) { |
|
69 | + $name = $context->getConfig()->get('controller/jobs/index/rebuild/name', 'Standard'); |
|
70 | 70 | } |
71 | 71 | |
72 | - if( ctype_alnum( $name ) === false ) |
|
72 | + if (ctype_alnum($name) === false) |
|
73 | 73 | { |
74 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Index\\Rebuild\\' . $name : '<not a string>'; |
|
75 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Index\\Rebuild\\' . $name : '<not a string>'; |
|
75 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
79 | 79 | $classname = '\\Aimeos\\Controller\\Jobs\\Index\\Rebuild\\' . $name; |
80 | 80 | |
81 | - $controller = self::createControllerBase( $context, $aimeos, $classname, $iface ); |
|
81 | + $controller = self::createControllerBase($context, $aimeos, $classname, $iface); |
|
82 | 82 | |
83 | 83 | /** controller/jobs/index/rebuild/decorators/excludes |
84 | 84 | * Excludes decorators added by the "common" option from the catalog index rebuild controllers |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/index/rebuild/decorators/excludes |
155 | 155 | * @see controller/jobs/index/rebuild/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'index/rebuild' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'index/rebuild'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string|null $name Name of the controller or "Standard" if null |
30 | 30 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
31 | 31 | */ |
32 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
32 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
33 | 33 | { |
34 | 34 | /** controller/jobs/product/export/name |
35 | 35 | * Class name of the used product suggestions scheduler controller implementation |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | * @since 2015.01 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if ( $name === null ) { |
|
67 | + if ($name === null) { |
|
68 | 68 | $name = $context->getConfig()->get('controller/jobs/product/export/name', 'Standard'); |
69 | 69 | } |
70 | 70 | |
71 | - if ( ctype_alnum($name) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | 73 | $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Product\\Export\\' . $name : '<not a string>'; |
74 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Controller\\Jobs\\Product\\Export\\' . $name; |
79 | 79 | |
80 | - $controller = self::createControllerBase( $context, $aimeos, $classname, $iface ); |
|
80 | + $controller = self::createControllerBase($context, $aimeos, $classname, $iface); |
|
81 | 81 | |
82 | 82 | /** controller/jobs/product/export/decorators/excludes |
83 | 83 | * Excludes decorators added by the "common" option from the product export job controller |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/product/export/decorators/excludes |
155 | 155 | * @see controller/jobs/product/export/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'product/export' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'product/export'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string|null $name Name of the controller or "Standard" if null |
30 | 30 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
31 | 31 | */ |
32 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
32 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
33 | 33 | { |
34 | 34 | /** controller/jobs/product/export/sitemap/name |
35 | 35 | * Class name of the used product suggestions scheduler controller implementation |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | * @since 2015.01 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if ( $name === null ) { |
|
67 | + if ($name === null) { |
|
68 | 68 | $name = $context->getConfig()->get('controller/jobs/product/export/sitemap/name', 'Standard'); |
69 | 69 | } |
70 | 70 | |
71 | - if ( ctype_alnum($name) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | 73 | $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Product\\Export\\Sitemap\\' . $name : '<not a string>'; |
74 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
74 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Controller\\Jobs\\Product\\Export\\Sitemap\\' . $name; |
79 | 79 | |
80 | - $controller = self::createControllerBase( $context, $aimeos, $classname, $iface ); |
|
80 | + $controller = self::createControllerBase($context, $aimeos, $classname, $iface); |
|
81 | 81 | |
82 | 82 | /** controller/jobs/product/export/sitemap/decorators/excludes |
83 | 83 | * Excludes decorators added by the "common" option from the product export sitemap job controller |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | * @see controller/jobs/product/export/sitemap/export/sitemap/decorators/excludes |
155 | 155 | * @see controller/jobs/product/export/sitemap/export/sitemap/decorators/global |
156 | 156 | */ |
157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'product/export/sitemap' ); |
|
157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'product/export/sitemap'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function getName() |
30 | 30 | { |
31 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Product site map' ); |
|
31 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Product site map'); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function getDescription() |
41 | 41 | { |
42 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Creates a product site map for search engines' ); |
|
42 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Creates a product site map for search engines'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | { |
53 | 53 | $container = $this->createContainer(); |
54 | 54 | |
55 | - $files = $this->export( $container ); |
|
56 | - $this->createSitemapIndex( $container, $files ); |
|
55 | + $files = $this->export($container); |
|
56 | + $this->createSitemapIndex($container, $files); |
|
57 | 57 | |
58 | 58 | $container->close(); |
59 | 59 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @param \Aimeos\MW\Container\Content\Iface $content File content object |
66 | 66 | * @param \Aimeos\MShop\Product\Item\Iface[] $items List of product items |
67 | 67 | */ |
68 | - protected function addItems( \Aimeos\MW\Container\Content\Iface $content, array $items ) |
|
68 | + protected function addItems(\Aimeos\MW\Container\Content\Iface $content, array $items) |
|
69 | 69 | { |
70 | 70 | $config = $this->getContext()->getConfig(); |
71 | 71 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @see controller/jobs/product/export/sitemap/max-items |
97 | 97 | * @see controller/jobs/product/export/sitemap/max-query |
98 | 98 | */ |
99 | - $changefreq = $config->get( 'controller/jobs/product/export/sitemap/changefreq', 'daily' ); |
|
99 | + $changefreq = $config->get('controller/jobs/product/export/sitemap/changefreq', 'daily'); |
|
100 | 100 | |
101 | 101 | /** controller/jobs/product/export/sitemap/standard/template-items |
102 | 102 | * Relative path to the XML items template of the product site map job controller. |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $view->siteItems = $items; |
129 | 129 | $view->siteFreq = $changefreq; |
130 | 130 | |
131 | - $content->add( $view->render( $view->config( $tplconf, $default ) ) ); |
|
131 | + $content->add($view->render($view->config($tplconf, $default))); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | * @see controller/jobs/product/export/sitemap/max-query |
175 | 175 | * @see controller/jobs/product/export/sitemap/changefreq |
176 | 176 | */ |
177 | - $location = $config->get( 'controller/jobs/product/export/sitemap/location', sys_get_temp_dir() ); |
|
177 | + $location = $config->get('controller/jobs/product/export/sitemap/location', sys_get_temp_dir()); |
|
178 | 178 | |
179 | 179 | /** controller/jobs/product/export/sitemap/container/options |
180 | 180 | * List of file container options for the site map files |
@@ -194,9 +194,9 @@ discard block |
||
194 | 194 | * @see controller/jobs/product/export/sitemap/max-query |
195 | 195 | * @see controller/jobs/product/export/sitemap/changefreq |
196 | 196 | */ |
197 | - $options = $config->get( 'controller/jobs/product/export/sitemap/container/options', array() ); |
|
197 | + $options = $config->get('controller/jobs/product/export/sitemap/container/options', array()); |
|
198 | 198 | |
199 | - return \Aimeos\MW\Container\Factory::getContainer( $location, 'Directory', 'Gzip', $options ); |
|
199 | + return \Aimeos\MW\Container\Factory::getContainer($location, 'Directory', 'Gzip', $options); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | * @param integer $filenum New file number |
208 | 208 | * @return \Aimeos\MW\Container\Content\Iface New content object |
209 | 209 | */ |
210 | - protected function createContent( \Aimeos\MW\Container\Iface $container, $filenum ) |
|
210 | + protected function createContent(\Aimeos\MW\Container\Iface $container, $filenum) |
|
211 | 211 | { |
212 | 212 | $config = $this->getContext()->getConfig(); |
213 | 213 | |
@@ -238,9 +238,9 @@ discard block |
||
238 | 238 | |
239 | 239 | $view = $this->getContext()->getView(); |
240 | 240 | |
241 | - $content = $container->create( $this->getFilename( $filenum ) ); |
|
242 | - $content->add( $view->render( $view->config( $tplconf, $default ) ) ); |
|
243 | - $container->add( $content ); |
|
241 | + $content = $container->create($this->getFilename($filenum)); |
|
242 | + $content->add($view->render($view->config($tplconf, $default))); |
|
243 | + $container->add($content); |
|
244 | 244 | |
245 | 245 | return $content; |
246 | 246 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | * |
252 | 252 | * @param \Aimeos\MW\Container\Content\Iface $content |
253 | 253 | */ |
254 | - protected function closeContent( \Aimeos\MW\Container\Content\Iface $content ) |
|
254 | + protected function closeContent(\Aimeos\MW\Container\Content\Iface $content) |
|
255 | 255 | { |
256 | 256 | $config = $this->getContext()->getConfig(); |
257 | 257 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | |
283 | 283 | $view = $this->getContext()->getView(); |
284 | 284 | |
285 | - $content->add( $view->render( $view->config( $tplconf, $default ) ) ); |
|
285 | + $content->add($view->render($view->config($tplconf, $default))); |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | * @param \Aimeos\MW\Container\Iface $container File container object |
293 | 293 | * @param array $files List of generated site map file names |
294 | 294 | */ |
295 | - protected function createSitemapIndex( \Aimeos\MW\Container\Iface $container, array $files ) |
|
295 | + protected function createSitemapIndex(\Aimeos\MW\Container\Iface $container, array $files) |
|
296 | 296 | { |
297 | 297 | $config = $this->getContext()->getConfig(); |
298 | 298 | |
@@ -324,9 +324,9 @@ discard block |
||
324 | 324 | $view = $this->getContext()->getView(); |
325 | 325 | $view->siteFiles = $files; |
326 | 326 | |
327 | - $content = $container->create( 'aimeos-sitemap-index.xml' ); |
|
328 | - $content->add( $view->render( $view->config( $tplconf, $default ) ) ); |
|
329 | - $container->add( $content ); |
|
327 | + $content = $container->create('aimeos-sitemap-index.xml'); |
|
328 | + $content->add($view->render($view->config($tplconf, $default))); |
|
329 | + $container->add($content); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | |
@@ -337,11 +337,11 @@ discard block |
||
337 | 337 | * @param mixed $default Default value if name is unknown |
338 | 338 | * @return mixed Configuration value |
339 | 339 | */ |
340 | - protected function getConfig( $name, $default = null ) |
|
340 | + protected function getConfig($name, $default = null) |
|
341 | 341 | { |
342 | 342 | $config = $this->getContext()->getConfig(); |
343 | 343 | |
344 | - switch( $name ) |
|
344 | + switch ($name) |
|
345 | 345 | { |
346 | 346 | case 'domain': |
347 | 347 | return array(); |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | * @see controller/jobs/product/export/sitemap/max-query |
369 | 369 | * @see controller/jobs/product/export/sitemap/changefreq |
370 | 370 | */ |
371 | - return $config->get( 'controller/jobs/product/export/sitemap/max-items', 50000 ); |
|
371 | + return $config->get('controller/jobs/product/export/sitemap/max-items', 50000); |
|
372 | 372 | |
373 | 373 | case 'max-query': |
374 | 374 | /** controller/jobs/product/export/sitemap/max-query |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | * @see controller/jobs/product/export/sitemap/max-items |
389 | 389 | * @see controller/jobs/product/export/sitemap/changefreq |
390 | 390 | */ |
391 | - return $config->get( 'controller/jobs/product/export/sitemap/max-query', 1000 ); |
|
391 | + return $config->get('controller/jobs/product/export/sitemap/max-query', 1000); |
|
392 | 392 | } |
393 | 393 | |
394 | 394 | return $default; |
@@ -401,8 +401,8 @@ discard block |
||
401 | 401 | * @param integer $number Current file number |
402 | 402 | * @return string New file name |
403 | 403 | */ |
404 | - protected function getFilename( $number ) |
|
404 | + protected function getFilename($number) |
|
405 | 405 | { |
406 | - return sprintf( 'aimeos-sitemap-%d.xml', $number ); |
|
406 | + return sprintf('aimeos-sitemap-%d.xml', $number); |
|
407 | 407 | } |
408 | 408 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function getName() |
30 | 30 | { |
31 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Product export' ); |
|
31 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Product export'); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function getDescription() |
41 | 41 | { |
42 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Exports all available products' ); |
|
42 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Exports all available products'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | public function run() |
52 | 52 | { |
53 | 53 | $container = $this->createContainer(); |
54 | - $this->export( $container ); |
|
54 | + $this->export($container); |
|
55 | 55 | $container->close(); |
56 | 56 | } |
57 | 57 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * @param \Aimeos\MW\Container\Content\Iface $content File content object |
63 | 63 | * @param \Aimeos\MShop\Product\Item\Iface[] $items List of product items |
64 | 64 | */ |
65 | - protected function addItems( \Aimeos\MW\Container\Content\Iface $content, array $items ) |
|
65 | + protected function addItems(\Aimeos\MW\Container\Content\Iface $content, array $items) |
|
66 | 66 | { |
67 | 67 | $config = $this->getContext()->getConfig(); |
68 | 68 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | $view->exportItems = $items; |
97 | 97 | |
98 | - $content->add( $view->render( $view->config( $tplconf, $default ) ) ); |
|
98 | + $content->add($view->render($view->config($tplconf, $default))); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * @see controller/jobs/product/export/max-items |
125 | 125 | * @see controller/jobs/product/export/max-query |
126 | 126 | */ |
127 | - $location = $config->get( 'controller/jobs/product/export/location', sys_get_temp_dir() ); |
|
127 | + $location = $config->get('controller/jobs/product/export/location', sys_get_temp_dir()); |
|
128 | 128 | |
129 | 129 | /** controller/jobs/product/export/standard/container/type |
130 | 130 | * List of file container options for the export files |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | * @see controller/jobs/product/export/max-items |
142 | 142 | * @see controller/jobs/product/export/max-query |
143 | 143 | */ |
144 | - $container = $config->get( 'controller/jobs/product/export/standard/container/type', 'Directory' ); |
|
144 | + $container = $config->get('controller/jobs/product/export/standard/container/type', 'Directory'); |
|
145 | 145 | |
146 | 146 | /** controller/jobs/product/export/standard/container/content |
147 | 147 | * List of file container options for the export files |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * @see controller/jobs/product/export/max-items |
159 | 159 | * @see controller/jobs/product/export/max-query |
160 | 160 | */ |
161 | - $content = $config->get( 'controller/jobs/product/export/standard/container/content', 'Binary' ); |
|
161 | + $content = $config->get('controller/jobs/product/export/standard/container/content', 'Binary'); |
|
162 | 162 | |
163 | 163 | /** controller/jobs/product/export/standard/container/options |
164 | 164 | * List of file container options for the export files |
@@ -175,9 +175,9 @@ discard block |
||
175 | 175 | * @see controller/jobs/product/export/max-items |
176 | 176 | * @see controller/jobs/product/export/max-query |
177 | 177 | */ |
178 | - $options = $config->get( 'controller/jobs/product/export/standard/container/options', array() ); |
|
178 | + $options = $config->get('controller/jobs/product/export/standard/container/options', array()); |
|
179 | 179 | |
180 | - return \Aimeos\MW\Container\Factory::getContainer( $location, $container, $content, $options ); |
|
180 | + return \Aimeos\MW\Container\Factory::getContainer($location, $container, $content, $options); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | * @param integer $filenum New file number |
189 | 189 | * @return \Aimeos\MW\Container\Content\Iface New content object |
190 | 190 | */ |
191 | - protected function createContent( \Aimeos\MW\Container\Iface $container, $filenum ) |
|
191 | + protected function createContent(\Aimeos\MW\Container\Iface $container, $filenum) |
|
192 | 192 | { |
193 | 193 | $config = $this->getContext()->getConfig(); |
194 | 194 | |
@@ -219,9 +219,9 @@ discard block |
||
219 | 219 | |
220 | 220 | $view = $this->getContext()->getView(); |
221 | 221 | |
222 | - $content = $container->create( $this->getFilename( $filenum ) ); |
|
223 | - $content->add( $view->render( $view->config( $tplconf, $default ) ) ); |
|
224 | - $container->add( $content ); |
|
222 | + $content = $container->create($this->getFilename($filenum)); |
|
223 | + $content->add($view->render($view->config($tplconf, $default))); |
|
224 | + $container->add($content); |
|
225 | 225 | |
226 | 226 | return $content; |
227 | 227 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | * |
233 | 233 | * @param \Aimeos\MW\Container\Content\Iface $content |
234 | 234 | */ |
235 | - protected function closeContent( \Aimeos\MW\Container\Content\Iface $content ) |
|
235 | + protected function closeContent(\Aimeos\MW\Container\Content\Iface $content) |
|
236 | 236 | { |
237 | 237 | $config = $this->getContext()->getConfig(); |
238 | 238 | |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | |
264 | 264 | $view = $this->getContext()->getView(); |
265 | 265 | |
266 | - $content->add( $view->render( $view->config( $tplconf, $default ) ) ); |
|
266 | + $content->add($view->render($view->config($tplconf, $default))); |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | |
@@ -273,45 +273,45 @@ discard block |
||
273 | 273 | * @param \Aimeos\MW\Container\Iface $container Container object |
274 | 274 | * @return array List of content (file) names |
275 | 275 | */ |
276 | - protected function export( \Aimeos\MW\Container\Iface $container ) |
|
276 | + protected function export(\Aimeos\MW\Container\Iface $container) |
|
277 | 277 | { |
278 | - $default = array( 'attribute', 'media', 'price', 'product', 'text' ); |
|
278 | + $default = array('attribute', 'media', 'price', 'product', 'text'); |
|
279 | 279 | |
280 | - $domains = $this->getConfig( 'domains', $default ); |
|
281 | - $maxItems = $this->getConfig( 'max-items', 10000 ); |
|
282 | - $maxQuery = $this->getConfig( 'max-query', 1000 ); |
|
280 | + $domains = $this->getConfig('domains', $default); |
|
281 | + $maxItems = $this->getConfig('max-items', 10000); |
|
282 | + $maxQuery = $this->getConfig('max-query', 1000); |
|
283 | 283 | |
284 | 284 | $start = 0; $filenum = 1; |
285 | 285 | $names = array(); |
286 | 286 | |
287 | - $productManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product' ); |
|
287 | + $productManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product'); |
|
288 | 288 | |
289 | - $search = $productManager->createSearch( true ); |
|
290 | - $search->setSortations( array( $search->sort( '+', 'product.id' ) ) ); |
|
291 | - $search->setSlice( 0, $maxQuery ); |
|
289 | + $search = $productManager->createSearch(true); |
|
290 | + $search->setSortations(array($search->sort('+', 'product.id'))); |
|
291 | + $search->setSlice(0, $maxQuery); |
|
292 | 292 | |
293 | - $content = $this->createContent( $container, $filenum ); |
|
293 | + $content = $this->createContent($container, $filenum); |
|
294 | 294 | $names[] = $content->getResource(); |
295 | 295 | |
296 | 296 | do |
297 | 297 | { |
298 | - $items = $productManager->searchItems( $search, $domains ); |
|
299 | - $this->addItems( $content, $items ); |
|
298 | + $items = $productManager->searchItems($search, $domains); |
|
299 | + $this->addItems($content, $items); |
|
300 | 300 | |
301 | - $count = count( $items ); |
|
301 | + $count = count($items); |
|
302 | 302 | $start += $count; |
303 | - $search->setSlice( $start, $maxQuery ); |
|
303 | + $search->setSlice($start, $maxQuery); |
|
304 | 304 | |
305 | - if( $start + $maxQuery > $maxItems * $filenum ) |
|
305 | + if ($start + $maxQuery > $maxItems * $filenum) |
|
306 | 306 | { |
307 | - $this->closeContent( $content ); |
|
308 | - $content = $this->createContent( $container, ++$filenum ); |
|
307 | + $this->closeContent($content); |
|
308 | + $content = $this->createContent($container, ++$filenum); |
|
309 | 309 | $names[] = $content->getResource(); |
310 | 310 | } |
311 | 311 | } |
312 | - while( $count >= $search->getSliceSize() ); |
|
312 | + while ($count >= $search->getSliceSize()); |
|
313 | 313 | |
314 | - $this->closeContent( $content ); |
|
314 | + $this->closeContent($content); |
|
315 | 315 | |
316 | 316 | return $names; |
317 | 317 | } |
@@ -324,11 +324,11 @@ discard block |
||
324 | 324 | * @param mixed $default Default value if name is unknown |
325 | 325 | * @return mixed Configuration value |
326 | 326 | */ |
327 | - protected function getConfig( $name, $default = null ) |
|
327 | + protected function getConfig($name, $default = null) |
|
328 | 328 | { |
329 | 329 | $config = $this->getContext()->getConfig(); |
330 | 330 | |
331 | - switch( $name ) |
|
331 | + switch ($name) |
|
332 | 332 | { |
333 | 333 | case 'domain': |
334 | 334 | /** controller/jobs/product/export/domains |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | * @see controller/jobs/product/export/max-items |
351 | 351 | * @see controller/jobs/product/export/max-query |
352 | 352 | */ |
353 | - return $config->get( 'controller/jobs/product/export/domains', $default ); |
|
353 | + return $config->get('controller/jobs/product/export/domains', $default); |
|
354 | 354 | |
355 | 355 | case 'max-items': |
356 | 356 | /** controller/jobs/product/export/max-items |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | * @see controller/jobs/product/export/max-query |
373 | 373 | * @see controller/jobs/product/export/domains |
374 | 374 | */ |
375 | - return $config->get( 'controller/jobs/product/export/max-items', $default ); |
|
375 | + return $config->get('controller/jobs/product/export/max-items', $default); |
|
376 | 376 | |
377 | 377 | case 'max-query': |
378 | 378 | /** controller/jobs/product/export/max-query |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | * @see controller/jobs/product/export/max-items |
395 | 395 | * @see controller/jobs/product/export/domains |
396 | 396 | */ |
397 | - return $config->get( 'controller/jobs/product/export/max-query', $default ); |
|
397 | + return $config->get('controller/jobs/product/export/max-query', $default); |
|
398 | 398 | } |
399 | 399 | |
400 | 400 | return $default; |
@@ -407,8 +407,8 @@ discard block |
||
407 | 407 | * @param integer $number Current file number |
408 | 408 | * @return string New file name |
409 | 409 | */ |
410 | - protected function getFilename( $number ) |
|
410 | + protected function getFilename($number) |
|
411 | 411 | { |
412 | - return sprintf( 'aimeos-products-%d.xml', $number ); |
|
412 | + return sprintf('aimeos-products-%d.xml', $number); |
|
413 | 413 | } |
414 | 414 | } |