@@ -120,8 +120,7 @@ discard block |
||
| 120 | 120 | { |
| 121 | 121 | $capdate = date( 'Y-m-d 00:00:00', time() - 86400 * $capDays ); |
| 122 | 122 | $expr[] = $orderSearch->compare( '<=', 'order.datepayment', $capdate ); |
| 123 | - } |
|
| 124 | - else |
|
| 123 | + } else |
|
| 125 | 124 | { |
| 126 | 125 | $expr[] = $orderSearch->compare( '==', 'order.statusdelivery', $status ); |
| 127 | 126 | } |
@@ -144,8 +143,7 @@ discard block |
||
| 144 | 143 | try |
| 145 | 144 | { |
| 146 | 145 | $serviceProvider->capture( $orderItem ); |
| 147 | - } |
|
| 148 | - catch( \Exception $e ) |
|
| 146 | + } catch( \Exception $e ) |
|
| 149 | 147 | { |
| 150 | 148 | $str = 'Error while capturing payment for order with ID "%1$s": %2$s'; |
| 151 | 149 | $context->getLogger()->log( sprintf( $str, $orderItem->getId(), $e->getMessage() ) ); |
@@ -157,8 +155,7 @@ discard block |
||
| 157 | 155 | $orderSearch->setSlice( $orderStart ); |
| 158 | 156 | } |
| 159 | 157 | while( $orderCount >= $orderSearch->getSliceSize() ); |
| 160 | - } |
|
| 161 | - catch( \Exception $e ) |
|
| 158 | + } catch( \Exception $e ) |
|
| 162 | 159 | { |
| 163 | 160 | $str = 'Error while capturing payments for service with ID "%1$s": %2$s'; |
| 164 | 161 | $context->getLogger()->log( sprintf( $str, $serviceItem->getId(), $e->getMessage() ) ); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function getName() |
| 31 | 31 | { |
| 32 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Capture authorized payments' ); |
|
| 32 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Capture authorized payments'); |
|
| 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', 'Authorized payments of orders will be captured after dispatching or after a configurable amount of time' ); |
|
| 43 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Authorized payments of orders will be captured after dispatching or after a configurable amount of time'); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
@@ -68,8 +68,8 @@ discard block |
||
| 68 | 68 | * @category User |
| 69 | 69 | * @category Developer |
| 70 | 70 | */ |
| 71 | - $days = $config->get( 'controller/jobs/order/service/payment/limit-days', 90 ); |
|
| 72 | - $date = date( 'Y-m-d 00:00:00', time() - 86400 * $days ); |
|
| 71 | + $days = $config->get('controller/jobs/order/service/payment/limit-days', 90); |
|
| 72 | + $date = date('Y-m-d 00:00:00', time() - 86400 * $days); |
|
| 73 | 73 | |
| 74 | 74 | /** controller/jobs/order/service/payment/capture-days |
| 75 | 75 | * Automatically capture payments after the configured amount of days |
@@ -84,90 +84,90 @@ discard block |
||
| 84 | 84 | * @category User |
| 85 | 85 | * @category Developer |
| 86 | 86 | */ |
| 87 | - $capDays = $config->get( 'controller/jobs/order/service/payment/capture-days', null ); |
|
| 87 | + $capDays = $config->get('controller/jobs/order/service/payment/capture-days', null); |
|
| 88 | 88 | |
| 89 | 89 | |
| 90 | - $serviceManager = \Aimeos\MShop\Factory::createManager( $context, 'service' ); |
|
| 90 | + $serviceManager = \Aimeos\MShop\Factory::createManager($context, 'service'); |
|
| 91 | 91 | $serviceSearch = $serviceManager->createSearch(); |
| 92 | - $serviceSearch->setConditions( $serviceSearch->compare( '==', 'service.type.code', 'payment' ) ); |
|
| 92 | + $serviceSearch->setConditions($serviceSearch->compare('==', 'service.type.code', 'payment')); |
|
| 93 | 93 | |
| 94 | - $orderManager = \Aimeos\MShop\Factory::createManager( $context, 'order' ); |
|
| 94 | + $orderManager = \Aimeos\MShop\Factory::createManager($context, 'order'); |
|
| 95 | 95 | $orderSearch = $orderManager->createSearch(); |
| 96 | 96 | |
| 97 | - $status = array( \Aimeos\MShop\Order\Item\Base::STAT_DISPATCHED, \Aimeos\MShop\Order\Item\Base::STAT_DELIVERED ); |
|
| 97 | + $status = array(\Aimeos\MShop\Order\Item\Base::STAT_DISPATCHED, \Aimeos\MShop\Order\Item\Base::STAT_DELIVERED); |
|
| 98 | 98 | $start = 0; |
| 99 | 99 | |
| 100 | 100 | do |
| 101 | 101 | { |
| 102 | - $serviceItems = $serviceManager->searchItems( $serviceSearch ); |
|
| 102 | + $serviceItems = $serviceManager->searchItems($serviceSearch); |
|
| 103 | 103 | |
| 104 | - foreach( $serviceItems as $serviceItem ) |
|
| 104 | + foreach ($serviceItems as $serviceItem) |
|
| 105 | 105 | { |
| 106 | 106 | try |
| 107 | 107 | { |
| 108 | - $serviceProvider = $serviceManager->getProvider( $serviceItem ); |
|
| 108 | + $serviceProvider = $serviceManager->getProvider($serviceItem); |
|
| 109 | 109 | |
| 110 | - if( !$serviceProvider->isImplemented( \Aimeos\MShop\Service\Provider\Payment\Base::FEAT_CAPTURE ) ) { |
|
| 110 | + if (!$serviceProvider->isImplemented(\Aimeos\MShop\Service\Provider\Payment\Base::FEAT_CAPTURE)) { |
|
| 111 | 111 | continue; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | |
| 115 | 115 | $expr = array(); |
| 116 | - $expr[] = $orderSearch->compare( '>', 'order.datepayment', $date ); |
|
| 116 | + $expr[] = $orderSearch->compare('>', 'order.datepayment', $date); |
|
| 117 | 117 | |
| 118 | - if( $capDays !== null ) |
|
| 118 | + if ($capDays !== null) |
|
| 119 | 119 | { |
| 120 | - $capdate = date( 'Y-m-d 00:00:00', time() - 86400 * $capDays ); |
|
| 121 | - $expr[] = $orderSearch->compare( '<=', 'order.datepayment', $capdate ); |
|
| 120 | + $capdate = date('Y-m-d 00:00:00', time() - 86400 * $capDays); |
|
| 121 | + $expr[] = $orderSearch->compare('<=', 'order.datepayment', $capdate); |
|
| 122 | 122 | } |
| 123 | 123 | else |
| 124 | 124 | { |
| 125 | - $expr[] = $orderSearch->compare( '==', 'order.statusdelivery', $status ); |
|
| 125 | + $expr[] = $orderSearch->compare('==', 'order.statusdelivery', $status); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - $expr[] = $orderSearch->compare( '==', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_AUTHORIZED ); |
|
| 129 | - $expr[] = $orderSearch->compare( '==', 'order.base.service.code', $serviceItem->getCode() ); |
|
| 130 | - $expr[] = $orderSearch->compare( '==', 'order.base.service.type', 'payment' ); |
|
| 128 | + $expr[] = $orderSearch->compare('==', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_AUTHORIZED); |
|
| 129 | + $expr[] = $orderSearch->compare('==', 'order.base.service.code', $serviceItem->getCode()); |
|
| 130 | + $expr[] = $orderSearch->compare('==', 'order.base.service.type', 'payment'); |
|
| 131 | 131 | |
| 132 | - $orderSearch->setConditions( $orderSearch->combine( '&&', $expr ) ); |
|
| 132 | + $orderSearch->setConditions($orderSearch->combine('&&', $expr)); |
|
| 133 | 133 | |
| 134 | 134 | |
| 135 | 135 | $orderStart = 0; |
| 136 | 136 | |
| 137 | 137 | do |
| 138 | 138 | { |
| 139 | - $orderItems = $orderManager->searchItems( $orderSearch ); |
|
| 139 | + $orderItems = $orderManager->searchItems($orderSearch); |
|
| 140 | 140 | |
| 141 | - foreach( $orderItems as $orderItem ) |
|
| 141 | + foreach ($orderItems as $orderItem) |
|
| 142 | 142 | { |
| 143 | 143 | try |
| 144 | 144 | { |
| 145 | - $serviceProvider->capture( $orderItem ); |
|
| 145 | + $serviceProvider->capture($orderItem); |
|
| 146 | 146 | } |
| 147 | - catch( \Exception $e ) |
|
| 147 | + catch (\Exception $e) |
|
| 148 | 148 | { |
| 149 | 149 | $str = 'Error while capturing payment for order with ID "%1$s": %2$s'; |
| 150 | - $context->getLogger()->log( sprintf( $str, $orderItem->getId(), $e->getMessage() ) ); |
|
| 150 | + $context->getLogger()->log(sprintf($str, $orderItem->getId(), $e->getMessage())); |
|
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - $orderCount = count( $orderItems ); |
|
| 154 | + $orderCount = count($orderItems); |
|
| 155 | 155 | $orderStart += $orderCount; |
| 156 | - $orderSearch->setSlice( $orderStart ); |
|
| 156 | + $orderSearch->setSlice($orderStart); |
|
| 157 | 157 | } |
| 158 | - while( $orderCount >= $orderSearch->getSliceSize() ); |
|
| 158 | + while ($orderCount >= $orderSearch->getSliceSize()); |
|
| 159 | 159 | } |
| 160 | - catch( \Exception $e ) |
|
| 160 | + catch (\Exception $e) |
|
| 161 | 161 | { |
| 162 | 162 | $str = 'Error while capturing payments for service with ID "%1$s": %2$s'; |
| 163 | - $context->getLogger()->log( sprintf( $str, $serviceItem->getId(), $e->getMessage() ) ); |
|
| 163 | + $context->getLogger()->log(sprintf($str, $serviceItem->getId(), $e->getMessage())); |
|
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - $count = count( $serviceItems ); |
|
| 167 | + $count = count($serviceItems); |
|
| 168 | 168 | $start += $count; |
| 169 | - $serviceSearch->setSlice( $start ); |
|
| 169 | + $serviceSearch->setSlice($start); |
|
| 170 | 170 | } |
| 171 | - while( $count >= $serviceSearch->getSliceSize() ); |
|
| 171 | + while ($count >= $serviceSearch->getSliceSize()); |
|
| 172 | 172 | } |
| 173 | 173 | } |
@@ -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/order/service/delivery/name |
| 36 | 36 | * Class name of the used order service delivery 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/order/service/delivery/name', 'Standard' ); |
|
| 68 | + if ($name === null) { |
|
| 69 | + $name = $context->getConfig()->get('controller/jobs/order/service/delivery/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\\Order\\Service\\Delivery\\' . $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\\Order\\Service\\Delivery\\' . $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\\Order\\Service\\Delivery\\' . $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/order/service/delivery/decorators/excludes |
| 84 | 84 | * Excludes decorators added by the "common" option from the order service delivery controllers |
@@ -154,6 +154,6 @@ discard block |
||
| 154 | 154 | * @see controller/jobs/order/service/delivery/decorators/excludes |
| 155 | 155 | * @see controller/jobs/order/service/delivery/decorators/global |
| 156 | 156 | */ |
| 157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'order/service/delivery' ); |
|
| 157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'order/service/delivery'); |
|
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | \ No newline at end of file |
@@ -112,8 +112,7 @@ discard block |
||
| 112 | 112 | { |
| 113 | 113 | $serviceProvider->process( $orderItem ); |
| 114 | 114 | $orderManager->saveItem( $orderItem ); |
| 115 | - } |
|
| 116 | - catch( \Exception $e ) |
|
| 115 | + } catch( \Exception $e ) |
|
| 117 | 116 | { |
| 118 | 117 | $str = 'Error while processing order with ID "%1$s": %2$s'; |
| 119 | 118 | $context->getLogger()->log( sprintf( $str, $orderItem->getId(), $e->getMessage() ) ); |
@@ -125,8 +124,7 @@ discard block |
||
| 125 | 124 | $orderSearch->setSlice( $orderStart ); |
| 126 | 125 | } |
| 127 | 126 | while( $orderCount >= $orderSearch->getSliceSize() ); |
| 128 | - } |
|
| 129 | - catch( \Exception $e ) |
|
| 127 | + } catch( \Exception $e ) |
|
| 130 | 128 | { |
| 131 | 129 | $str = 'Error while processing service with ID "%1$s": %2$s'; |
| 132 | 130 | $context->getLogger()->log( sprintf( $str, $serviceItem->getId(), $e->getMessage() ) ); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function getName() |
| 31 | 31 | { |
| 32 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Process order delivery services' ); |
|
| 32 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Process order delivery services'); |
|
| 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', 'Sends paid orders to the ERP system or logistic partner' ); |
|
| 43 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Sends paid orders to the ERP system or logistic partner'); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
@@ -68,74 +68,74 @@ discard block |
||
| 68 | 68 | * @see controller/jobs/order/email/payment/standard/limit-days |
| 69 | 69 | * @see controller/jobs/order/email/delivery/standard/limit-days |
| 70 | 70 | */ |
| 71 | - $days = $context->getConfig()->get( 'controller/jobs/order/service/delivery/limit-days', 90 ); |
|
| 72 | - $date = date( 'Y-m-d 00:00:00', time() - 86400 * $days ); |
|
| 71 | + $days = $context->getConfig()->get('controller/jobs/order/service/delivery/limit-days', 90); |
|
| 72 | + $date = date('Y-m-d 00:00:00', time() - 86400 * $days); |
|
| 73 | 73 | |
| 74 | - $serviceManager = \Aimeos\MShop\Service\Manager\Factory::createManager( $context ); |
|
| 74 | + $serviceManager = \Aimeos\MShop\Service\Manager\Factory::createManager($context); |
|
| 75 | 75 | $serviceSearch = $serviceManager->createSearch(); |
| 76 | - $serviceSearch->setConditions( $serviceSearch->compare( '==', 'service.type.code', 'delivery' ) ); |
|
| 76 | + $serviceSearch->setConditions($serviceSearch->compare('==', 'service.type.code', 'delivery')); |
|
| 77 | 77 | |
| 78 | - $orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager( $context ); |
|
| 78 | + $orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager($context); |
|
| 79 | 79 | $orderSearch = $orderManager->createSearch(); |
| 80 | 80 | |
| 81 | 81 | $start = 0; |
| 82 | 82 | |
| 83 | 83 | do |
| 84 | 84 | { |
| 85 | - $serviceItems = $serviceManager->searchItems( $serviceSearch ); |
|
| 85 | + $serviceItems = $serviceManager->searchItems($serviceSearch); |
|
| 86 | 86 | |
| 87 | - foreach( $serviceItems as $serviceItem ) |
|
| 87 | + foreach ($serviceItems as $serviceItem) |
|
| 88 | 88 | { |
| 89 | 89 | try |
| 90 | 90 | { |
| 91 | - $serviceProvider = $serviceManager->getProvider( $serviceItem ); |
|
| 91 | + $serviceProvider = $serviceManager->getProvider($serviceItem); |
|
| 92 | 92 | |
| 93 | 93 | $expr = array( |
| 94 | - $orderSearch->compare( '>', 'order.datepayment', $date ), |
|
| 95 | - $orderSearch->compare( '>', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_PENDING ), |
|
| 96 | - $orderSearch->compare( '==', 'order.statusdelivery', \Aimeos\MShop\Order\Item\Base::STAT_UNFINISHED ), |
|
| 97 | - $orderSearch->compare( '==', 'order.base.service.code', $serviceItem->getCode() ), |
|
| 98 | - $orderSearch->compare( '==', 'order.base.service.type', 'delivery' ), |
|
| 94 | + $orderSearch->compare('>', 'order.datepayment', $date), |
|
| 95 | + $orderSearch->compare('>', 'order.statuspayment', \Aimeos\MShop\Order\Item\Base::PAY_PENDING), |
|
| 96 | + $orderSearch->compare('==', 'order.statusdelivery', \Aimeos\MShop\Order\Item\Base::STAT_UNFINISHED), |
|
| 97 | + $orderSearch->compare('==', 'order.base.service.code', $serviceItem->getCode()), |
|
| 98 | + $orderSearch->compare('==', 'order.base.service.type', 'delivery'), |
|
| 99 | 99 | ); |
| 100 | - $orderSearch->setConditions( $orderSearch->combine( '&&', $expr ) ); |
|
| 100 | + $orderSearch->setConditions($orderSearch->combine('&&', $expr)); |
|
| 101 | 101 | |
| 102 | 102 | $orderStart = 0; |
| 103 | 103 | |
| 104 | 104 | do |
| 105 | 105 | { |
| 106 | - $orderItems = $orderManager->searchItems( $orderSearch ); |
|
| 106 | + $orderItems = $orderManager->searchItems($orderSearch); |
|
| 107 | 107 | |
| 108 | - foreach( $orderItems as $orderItem ) |
|
| 108 | + foreach ($orderItems as $orderItem) |
|
| 109 | 109 | { |
| 110 | 110 | try |
| 111 | 111 | { |
| 112 | - $serviceProvider->process( $orderItem ); |
|
| 113 | - $orderManager->saveItem( $orderItem ); |
|
| 112 | + $serviceProvider->process($orderItem); |
|
| 113 | + $orderManager->saveItem($orderItem); |
|
| 114 | 114 | } |
| 115 | - catch( \Exception $e ) |
|
| 115 | + catch (\Exception $e) |
|
| 116 | 116 | { |
| 117 | 117 | $str = 'Error while processing order with ID "%1$s": %2$s'; |
| 118 | - $context->getLogger()->log( sprintf( $str, $orderItem->getId(), $e->getMessage() ) ); |
|
| 118 | + $context->getLogger()->log(sprintf($str, $orderItem->getId(), $e->getMessage())); |
|
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - $orderCount = count( $orderItems ); |
|
| 122 | + $orderCount = count($orderItems); |
|
| 123 | 123 | $orderStart += $orderCount; |
| 124 | - $orderSearch->setSlice( $orderStart ); |
|
| 124 | + $orderSearch->setSlice($orderStart); |
|
| 125 | 125 | } |
| 126 | - while( $orderCount >= $orderSearch->getSliceSize() ); |
|
| 126 | + while ($orderCount >= $orderSearch->getSliceSize()); |
|
| 127 | 127 | } |
| 128 | - catch( \Exception $e ) |
|
| 128 | + catch (\Exception $e) |
|
| 129 | 129 | { |
| 130 | 130 | $str = 'Error while processing service with ID "%1$s": %2$s'; |
| 131 | - $context->getLogger()->log( sprintf( $str, $serviceItem->getId(), $e->getMessage() ) ); |
|
| 131 | + $context->getLogger()->log(sprintf($str, $serviceItem->getId(), $e->getMessage())); |
|
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - $count = count( $serviceItems ); |
|
| 135 | + $count = count($serviceItems); |
|
| 136 | 136 | $start += $count; |
| 137 | - $serviceSearch->setSlice( $start ); |
|
| 137 | + $serviceSearch->setSlice($start); |
|
| 138 | 138 | } |
| 139 | - while( $count >= $serviceSearch->getSliceSize() ); |
|
| 139 | + while ($count >= $serviceSearch->getSliceSize()); |
|
| 140 | 140 | } |
| 141 | 141 | } |
@@ -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/cache/name |
| 36 | 36 | * Class name of the used admin cache 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/admin/cache/name', 'Standard' ); |
|
| 68 | + if ($name === null) { |
|
| 69 | + $name = $context->getConfig()->get('controller/jobs/admin/cache/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\\Cache\\' . $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\\Cache\\' . $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\\Cache\\' . $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/cache/decorators/excludes |
| 84 | 84 | * Excludes decorators added by the "common" option from the admin cache controllers |
@@ -154,6 +154,6 @@ discard block |
||
| 154 | 154 | * @see controller/jobs/admin/cache/decorators/excludes |
| 155 | 155 | * @see controller/jobs/admin/cache/decorators/global |
| 156 | 156 | */ |
| 157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'admin/cache' ); |
|
| 157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'admin/cache'); |
|
| 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', '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 |