@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @param ContainerInterface $container Dependency container |
| 31 | 31 | */ |
| 32 | - public function __construct( ContainerInterface $container, $settings ) |
|
| 32 | + public function __construct(ContainerInterface $container, $settings) |
|
| 33 | 33 | { |
| 34 | 34 | $this->container = $container; |
| 35 | 35 | $this->settings = $settings; |
@@ -42,19 +42,19 @@ discard block |
||
| 42 | 42 | * @param string $type Configuration type ("frontend" or "backend") |
| 43 | 43 | * @return \Aimeos\MW\Config\Iface Config object |
| 44 | 44 | */ |
| 45 | - public function get( $type = 'frontend' ) |
|
| 45 | + public function get($type = 'frontend') |
|
| 46 | 46 | { |
| 47 | - $paths = $this->container->get( 'aimeos' )->getConfigPaths(); |
|
| 48 | - $config = new \Aimeos\MW\Config\PHPArray( array(), $paths ); |
|
| 47 | + $paths = $this->container->get('aimeos')->getConfigPaths(); |
|
| 48 | + $config = new \Aimeos\MW\Config\PHPArray(array(), $paths); |
|
| 49 | 49 | |
| 50 | - if( function_exists( 'apcu_store' ) === true && $config->get( 'apc_enabled', false ) == true ) { |
|
| 51 | - $config = new \Aimeos\MW\Config\Decorator\APC( $config, $config->get( 'apc_prefix', 'slim:' ) ); |
|
| 50 | + if (function_exists('apcu_store') === true && $config->get('apc_enabled', false) == true) { |
|
| 51 | + $config = new \Aimeos\MW\Config\Decorator\APC($config, $config->get('apc_prefix', 'slim:')); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - $config = new \Aimeos\MW\Config\Decorator\Memory( $config, $this->settings ); |
|
| 54 | + $config = new \Aimeos\MW\Config\Decorator\Memory($config, $this->settings); |
|
| 55 | 55 | |
| 56 | - if( isset( $this->settings[$type] ) ) { |
|
| 57 | - $config = new \Aimeos\MW\Config\Decorator\Memory( $config, $this->settings[$type] ); |
|
| 56 | + if (isset($this->settings[$type])) { |
|
| 57 | + $config = new \Aimeos\MW\Config\Decorator\Memory($config, $this->settings[$type]); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | return $config; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @param ContainerInterface $container Dependency container |
| 31 | 31 | */ |
| 32 | - public function __construct( ContainerInterface $container ) |
|
| 32 | + public function __construct(ContainerInterface $container) |
|
| 33 | 33 | { |
| 34 | 34 | $this->container = $container; |
| 35 | 35 | } |
@@ -41,23 +41,23 @@ discard block |
||
| 41 | 41 | * @param array $languageIds List of two letter ISO language IDs |
| 42 | 42 | * @return \Aimeos\MW\Translation\Iface[] List of translation objects |
| 43 | 43 | */ |
| 44 | - public function get( array $languageIds ) |
|
| 44 | + public function get(array $languageIds) |
|
| 45 | 45 | { |
| 46 | - $config = $this->container->get( 'aimeos_config' )->get(); |
|
| 47 | - $i18nPaths = $this->container->get( 'aimeos' )->getI18nPaths(); |
|
| 46 | + $config = $this->container->get('aimeos_config')->get(); |
|
| 47 | + $i18nPaths = $this->container->get('aimeos')->getI18nPaths(); |
|
| 48 | 48 | |
| 49 | - foreach( $languageIds as $langid ) |
|
| 49 | + foreach ($languageIds as $langid) |
|
| 50 | 50 | { |
| 51 | - if( !isset( $this->i18n[$langid] ) ) |
|
| 51 | + if (!isset($this->i18n[$langid])) |
|
| 52 | 52 | { |
| 53 | - $i18n = new \Aimeos\MW\Translation\Gettext( $i18nPaths, $langid ); |
|
| 53 | + $i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $langid); |
|
| 54 | 54 | |
| 55 | - if( function_exists( 'apcu_store' ) === true && $config->get( 'apc_enabled', false ) == true ) { |
|
| 56 | - $i18n = new \Aimeos\MW\Translation\Decorator\APC( $i18n, $config->get( 'apc_prefix', 'slim:' ) ); |
|
| 55 | + if (function_exists('apcu_store') === true && $config->get('apc_enabled', false) == true) { |
|
| 56 | + $i18n = new \Aimeos\MW\Translation\Decorator\APC($i18n, $config->get('apc_prefix', 'slim:')); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if( ( $cfg = $config->get( 'i18n/' . $langid, array() ) ) !== array() ) { |
|
| 60 | - $i18n = new \Aimeos\MW\Translation\Decorator\Memory( $i18n, $cfg ); |
|
| 59 | + if (($cfg = $config->get('i18n/'.$langid, array())) !== array()) { |
|
| 60 | + $i18n = new \Aimeos\MW\Translation\Decorator\Memory($i18n, $cfg); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | $this->i18n[$langid] = $i18n; |
@@ -31,11 +31,11 @@ |
||
| 31 | 31 | * @param array $args Associative list of route parameters |
| 32 | 32 | * @return ResponseInterface $response Modified response object with generated output |
| 33 | 33 | */ |
| 34 | - public static function indexAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
| 34 | + public static function indexAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
| 35 | 35 | { |
| 36 | - $contents = $container->get( 'aimeos_page' )->getSections( 'basket-index', $request, $response, $args ); |
|
| 37 | - $response = $container->get( 'view' )->render( $response, 'Basket/index.html.twig', $contents ); |
|
| 36 | + $contents = $container->get('aimeos_page')->getSections('basket-index', $request, $response, $args); |
|
| 37 | + $response = $container->get('view')->render($response, 'Basket/index.html.twig', $contents); |
|
| 38 | 38 | |
| 39 | - return $response->withHeader( 'Cache-Control', 'no-store' ); |
|
| 39 | + return $response->withHeader('Cache-Control', 'no-store'); |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | \ No newline at end of file |
@@ -31,12 +31,12 @@ discard block |
||
| 31 | 31 | * @param array $args Associative list of route parameters |
| 32 | 32 | * @return ResponseInterface $response Modified response object with generated output |
| 33 | 33 | */ |
| 34 | - public static function confirmAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
| 34 | + public static function confirmAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
| 35 | 35 | { |
| 36 | - $contents = $container->get( 'aimeos_page' )->getSections( 'checkout-confirm', $request, $response, $args ); |
|
| 37 | - $response = $container->get( 'view' )->render( $response, 'Checkout/confirm.html.twig', $contents ); |
|
| 36 | + $contents = $container->get('aimeos_page')->getSections('checkout-confirm', $request, $response, $args); |
|
| 37 | + $response = $container->get('view')->render($response, 'Checkout/confirm.html.twig', $contents); |
|
| 38 | 38 | |
| 39 | - return $response->withHeader( 'Cache-Control', 'no-store' ); |
|
| 39 | + return $response->withHeader('Cache-Control', 'no-store'); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
@@ -49,12 +49,12 @@ discard block |
||
| 49 | 49 | * @param array $args Associative list of route parameters |
| 50 | 50 | * @return ResponseInterface $response Modified response object with generated output |
| 51 | 51 | */ |
| 52 | - public static function indexAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
| 52 | + public static function indexAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
| 53 | 53 | { |
| 54 | - $contents = $container->get( 'aimeos_page' )->getSections( 'checkout-index', $request, $response, $args ); |
|
| 55 | - $response = $container->get( 'view' )->render( $response, 'Checkout/index.html.twig', $contents ); |
|
| 54 | + $contents = $container->get('aimeos_page')->getSections('checkout-index', $request, $response, $args); |
|
| 55 | + $response = $container->get('view')->render($response, 'Checkout/index.html.twig', $contents); |
|
| 56 | 56 | |
| 57 | - return $response->withHeader( 'Cache-Control', 'no-store' ); |
|
| 57 | + return $response->withHeader('Cache-Control', 'no-store'); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | * @param array $args Associative list of route parameters |
| 68 | 68 | * @return ResponseInterface $response Modified response object with generated output |
| 69 | 69 | */ |
| 70 | - public static function updateAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
| 70 | + public static function updateAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
| 71 | 71 | { |
| 72 | - $contents = $container->get( 'aimeos_page' )->getSections( 'checkout-update', $request, $response, $args ); |
|
| 73 | - $response = $container->get( 'view' )->render( $response, 'Checkout/update.html.twig', $contents ); |
|
| 72 | + $contents = $container->get('aimeos_page')->getSections('checkout-update', $request, $response, $args); |
|
| 73 | + $response = $container->get('view')->render($response, 'Checkout/update.html.twig', $contents); |
|
| 74 | 74 | |
| 75 | - return $response->withHeader( 'Cache-Control', 'no-store' ); |
|
| 75 | + return $response->withHeader('Cache-Control', 'no-store'); |
|
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | \ No newline at end of file |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * @param \Slim\App $app Slim application |
| 28 | 28 | * @param array $settings Multi-dimensional array of configuration settings |
| 29 | 29 | */ |
| 30 | - public function __construct( \Slim\App $app, array $settings ) |
|
| 30 | + public function __construct(\Slim\App $app, array $settings) |
|
| 31 | 31 | { |
| 32 | 32 | $this->app = $app; |
| 33 | 33 | $this->settings = $settings; |
@@ -40,16 +40,16 @@ discard block |
||
| 40 | 40 | * @param string $path Absolute or relative path to the Aimeos route file |
| 41 | 41 | * @return \Aimeos\Slim\Bootstrap Self instance |
| 42 | 42 | */ |
| 43 | - public function routes( $path ) |
|
| 43 | + public function routes($path) |
|
| 44 | 44 | { |
| 45 | 45 | $app = $this->app; |
| 46 | 46 | $settings = $this->settings; |
| 47 | 47 | |
| 48 | - $config = function( $key, $default ) use ( $settings ) |
|
| 48 | + $config = function($key, $default) use ($settings) |
|
| 49 | 49 | { |
| 50 | - foreach( explode( '/', trim( $key, '/' ) ) as $part ) |
|
| 50 | + foreach (explode('/', trim($key, '/')) as $part) |
|
| 51 | 51 | { |
| 52 | - if( isset( $settings[$part] ) ) { |
|
| 52 | + if (isset($settings[$part])) { |
|
| 53 | 53 | $settings = $settings[$part]; |
| 54 | 54 | } else { |
| 55 | 55 | return $default; |
@@ -71,52 +71,52 @@ discard block |
||
| 71 | 71 | * @param string $extdir Absolute or relative path to the Aimeos extension directory |
| 72 | 72 | * @return \Aimeos\Slim\Bootstrap Self instance |
| 73 | 73 | */ |
| 74 | - public function setup( $extdir = '../ext' ) |
|
| 74 | + public function setup($extdir = '../ext') |
|
| 75 | 75 | { |
| 76 | 76 | $container = $this->app->getContainer(); |
| 77 | 77 | |
| 78 | - $container['router'] = function( $c ) { |
|
| 78 | + $container['router'] = function($c) { |
|
| 79 | 79 | return new \Aimeos\Slim\Router(); |
| 80 | 80 | }; |
| 81 | 81 | |
| 82 | - $container['mailer'] = function( $c ) { |
|
| 83 | - return new \Swift_Mailer( new \Swift_SendmailTransport() ); |
|
| 82 | + $container['mailer'] = function($c) { |
|
| 83 | + return new \Swift_Mailer(new \Swift_SendmailTransport()); |
|
| 84 | 84 | }; |
| 85 | 85 | |
| 86 | 86 | |
| 87 | - $default = require __DIR__ . DIRECTORY_SEPARATOR . 'aimeos-default.php'; |
|
| 88 | - $settings = array_replace_recursive( $default, $this->settings ); |
|
| 87 | + $default = require __DIR__.DIRECTORY_SEPARATOR.'aimeos-default.php'; |
|
| 88 | + $settings = array_replace_recursive($default, $this->settings); |
|
| 89 | 89 | |
| 90 | - $container['aimeos'] = function( $c ) use ( $extdir ) { |
|
| 91 | - return new \Aimeos\Bootstrap( (array) $extdir, false ); |
|
| 90 | + $container['aimeos'] = function($c) use ($extdir) { |
|
| 91 | + return new \Aimeos\Bootstrap((array) $extdir, false); |
|
| 92 | 92 | }; |
| 93 | 93 | |
| 94 | - $container['aimeos_config'] = function( $c ) use ( $settings ) { |
|
| 95 | - return new \Aimeos\Slim\Base\Config( $c, $settings ); |
|
| 94 | + $container['aimeos_config'] = function($c) use ($settings) { |
|
| 95 | + return new \Aimeos\Slim\Base\Config($c, $settings); |
|
| 96 | 96 | }; |
| 97 | 97 | |
| 98 | - $container['aimeos_context'] = function( $c ) { |
|
| 99 | - return new \Aimeos\Slim\Base\Context( $c ); |
|
| 98 | + $container['aimeos_context'] = function($c) { |
|
| 99 | + return new \Aimeos\Slim\Base\Context($c); |
|
| 100 | 100 | }; |
| 101 | 101 | |
| 102 | - $container['aimeos_i18n'] = function( $c ) { |
|
| 103 | - return new \Aimeos\Slim\Base\I18n( $c ); |
|
| 102 | + $container['aimeos_i18n'] = function($c) { |
|
| 103 | + return new \Aimeos\Slim\Base\I18n($c); |
|
| 104 | 104 | }; |
| 105 | 105 | |
| 106 | - $container['aimeos_locale'] = function( $c ) { |
|
| 107 | - return new \Aimeos\Slim\Base\Locale( $c ); |
|
| 106 | + $container['aimeos_locale'] = function($c) { |
|
| 107 | + return new \Aimeos\Slim\Base\Locale($c); |
|
| 108 | 108 | }; |
| 109 | 109 | |
| 110 | - $container['aimeos_page'] = function( $c ) { |
|
| 111 | - return new \Aimeos\Slim\Base\Page( $c ); |
|
| 110 | + $container['aimeos_page'] = function($c) { |
|
| 111 | + return new \Aimeos\Slim\Base\Page($c); |
|
| 112 | 112 | }; |
| 113 | 113 | |
| 114 | - $container['aimeos_view'] = function( $c ) { |
|
| 115 | - return new \Aimeos\Slim\Base\View( $c ); |
|
| 114 | + $container['aimeos_view'] = function($c) { |
|
| 115 | + return new \Aimeos\Slim\Base\View($c); |
|
| 116 | 116 | }; |
| 117 | 117 | |
| 118 | 118 | // add client IP address to requests |
| 119 | - $this->app->add( new \RKA\Middleware\IpAddress( true, [] ) ); |
|
| 119 | + $this->app->add(new \RKA\Middleware\IpAddress(true, [])); |
|
| 120 | 120 | |
| 121 | 121 | return $this; |
| 122 | 122 | } |
@@ -129,14 +129,14 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | public static function getVersion() |
| 131 | 131 | { |
| 132 | - $basedir = dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) . DIRECTORY_SEPARATOR; |
|
| 132 | + $basedir = dirname(dirname(dirname(dirname(__DIR__)))).DIRECTORY_SEPARATOR; |
|
| 133 | 133 | |
| 134 | - if( ( $content = @file_get_contents( $basedir . 'composer.lock' ) ) !== false |
|
| 135 | - && ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] ) |
|
| 134 | + if (($content = @file_get_contents($basedir.'composer.lock')) !== false |
|
| 135 | + && ($content = json_decode($content, true)) !== null && isset($content['packages']) |
|
| 136 | 136 | ) { |
| 137 | - foreach( (array) $content['packages'] as $item ) |
|
| 137 | + foreach ((array) $content['packages'] as $item) |
|
| 138 | 138 | { |
| 139 | - if( $item['name'] === 'aimeos/aimeos-slim' ) { |
|
| 139 | + if ($item['name'] === 'aimeos/aimeos-slim') { |
|
| 140 | 140 | return $item['version']; |
| 141 | 141 | } |
| 142 | 142 | } |
@@ -31,13 +31,13 @@ discard block |
||
| 31 | 31 | * @param array $args Associative list of route parameters |
| 32 | 32 | * @return ResponseInterface $response Modified response object with generated output |
| 33 | 33 | */ |
| 34 | - public static function countAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
| 34 | + public static function countAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
| 35 | 35 | { |
| 36 | - $contents = $container->get( 'aimeos_page' )->getSections( 'catalog-count', $request, $response, $args ); |
|
| 37 | - $response = $container->get( 'view' )->render( $response, 'Catalog/count.html.twig', $contents ); |
|
| 36 | + $contents = $container->get('aimeos_page')->getSections('catalog-count', $request, $response, $args); |
|
| 37 | + $response = $container->get('view')->render($response, 'Catalog/count.html.twig', $contents); |
|
| 38 | 38 | |
| 39 | - return $response->withHeader( 'Content-Type', 'application/javascript' ) |
|
| 40 | - ->withHeader( 'Cache-Control', 'max-age=300' ); |
|
| 39 | + return $response->withHeader('Content-Type', 'application/javascript') |
|
| 40 | + ->withHeader('Cache-Control', 'max-age=300'); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
@@ -50,10 +50,10 @@ discard block |
||
| 50 | 50 | * @param array $args Associative list of route parameters |
| 51 | 51 | * @return ResponseInterface $response Modified response object with generated output |
| 52 | 52 | */ |
| 53 | - public static function detailAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
| 53 | + public static function detailAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
| 54 | 54 | { |
| 55 | - $contents = $container->get( 'aimeos_page' )->getSections( 'catalog-detail', $request, $response, $args ); |
|
| 56 | - return $container->get( 'view' )->render( $response, 'Catalog/detail.html.twig', $contents ); |
|
| 55 | + $contents = $container->get('aimeos_page')->getSections('catalog-detail', $request, $response, $args); |
|
| 56 | + return $container->get('view')->render($response, 'Catalog/detail.html.twig', $contents); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
@@ -66,10 +66,10 @@ discard block |
||
| 66 | 66 | * @param array $args Associative list of route parameters |
| 67 | 67 | * @return ResponseInterface $response Modified response object with generated output |
| 68 | 68 | */ |
| 69 | - public static function listAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
| 69 | + public static function listAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
| 70 | 70 | { |
| 71 | - $contents = $container->get( 'aimeos_page' )->getSections( 'catalog-list', $request, $response, $args ); |
|
| 72 | - return $container->get( 'view' )->render( $response, 'Catalog/list.html.twig', $contents ); |
|
| 71 | + $contents = $container->get('aimeos_page')->getSections('catalog-list', $request, $response, $args); |
|
| 72 | + return $container->get('view')->render($response, 'Catalog/list.html.twig', $contents); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | |
@@ -82,13 +82,13 @@ discard block |
||
| 82 | 82 | * @param array $args Associative list of route parameters |
| 83 | 83 | * @return ResponseInterface $response Modified response object with generated output |
| 84 | 84 | */ |
| 85 | - public static function stockAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
| 85 | + public static function stockAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
| 86 | 86 | { |
| 87 | - $contents = $container->get( 'aimeos_page' )->getSections( 'catalog-stock', $request, $response, $args ); |
|
| 88 | - $response = $container->get( 'view' )->render( $response, 'Catalog/stock.html.twig', $contents ); |
|
| 87 | + $contents = $container->get('aimeos_page')->getSections('catalog-stock', $request, $response, $args); |
|
| 88 | + $response = $container->get('view')->render($response, 'Catalog/stock.html.twig', $contents); |
|
| 89 | 89 | |
| 90 | - return $response->withHeader( 'Cache-Control', 'max-age=30' ) |
|
| 91 | - ->withHeader( 'Content-Type', 'application/javascript' ); |
|
| 90 | + return $response->withHeader('Cache-Control', 'max-age=30') |
|
| 91 | + ->withHeader('Content-Type', 'application/javascript'); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
@@ -101,11 +101,11 @@ discard block |
||
| 101 | 101 | * @param array $args Associative list of route parameters |
| 102 | 102 | * @return ResponseInterface $response Modified response object with generated output |
| 103 | 103 | */ |
| 104 | - public static function suggestAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
| 104 | + public static function suggestAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
| 105 | 105 | { |
| 106 | - $contents = $container->get( 'aimeos_page' )->getSections( 'catalog-suggest', $request, $response, $args ); |
|
| 107 | - $response = $container->get( 'view' )->render( $response, 'Catalog/suggest.html.twig', $contents ); |
|
| 106 | + $contents = $container->get('aimeos_page')->getSections('catalog-suggest', $request, $response, $args); |
|
| 107 | + $response = $container->get('view')->render($response, 'Catalog/suggest.html.twig', $contents); |
|
| 108 | 108 | |
| 109 | - return $response->withHeader( 'Content-Type', 'application/json' ); |
|
| 109 | + return $response->withHeader('Content-Type', 'application/json'); |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @param ContainerInterface $container Dependency container |
| 31 | 31 | */ |
| 32 | - public function __construct( ContainerInterface $container ) |
|
| 32 | + public function __construct(ContainerInterface $container) |
|
| 33 | 33 | { |
| 34 | 34 | $this->container = $container; |
| 35 | 35 | } |
@@ -43,35 +43,35 @@ discard block |
||
| 43 | 43 | * @param string $type Configuration type ("frontend" or "backend") |
| 44 | 44 | * @return \Aimeos\MShop\Context\Item\Iface Context object |
| 45 | 45 | */ |
| 46 | - public function get( $locale = true, array $attributes = array(), $type = 'frontend' ) |
|
| 46 | + public function get($locale = true, array $attributes = array(), $type = 'frontend') |
|
| 47 | 47 | { |
| 48 | - $config = $this->container->get( 'aimeos_config' )->get( $type ); |
|
| 48 | + $config = $this->container->get('aimeos_config')->get($type); |
|
| 49 | 49 | |
| 50 | - if( $this->context === null ) |
|
| 50 | + if ($this->context === null) |
|
| 51 | 51 | { |
| 52 | 52 | $context = new \Aimeos\MShop\Context\Item\Standard(); |
| 53 | - $context->setConfig( $config ); |
|
| 54 | - |
|
| 55 | - $this->addDataBaseManager( $context ); |
|
| 56 | - $this->addFilesystemManager( $context ); |
|
| 57 | - $this->addMessageQueueManager( $context ); |
|
| 58 | - $this->addLogger( $context ); |
|
| 59 | - $this->addCache( $context ); |
|
| 60 | - $this->addMailer( $context); |
|
| 61 | - $this->addProcess( $context ); |
|
| 62 | - $this->addSession( $context ); |
|
| 63 | - $this->addUser( $context ); |
|
| 53 | + $context->setConfig($config); |
|
| 54 | + |
|
| 55 | + $this->addDataBaseManager($context); |
|
| 56 | + $this->addFilesystemManager($context); |
|
| 57 | + $this->addMessageQueueManager($context); |
|
| 58 | + $this->addLogger($context); |
|
| 59 | + $this->addCache($context); |
|
| 60 | + $this->addMailer($context); |
|
| 61 | + $this->addProcess($context); |
|
| 62 | + $this->addSession($context); |
|
| 63 | + $this->addUser($context); |
|
| 64 | 64 | |
| 65 | 65 | $this->context = $context; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - $this->context->setConfig( $config ); |
|
| 68 | + $this->context->setConfig($config); |
|
| 69 | 69 | |
| 70 | - if( $locale === true ) |
|
| 70 | + if ($locale === true) |
|
| 71 | 71 | { |
| 72 | - $localeItem = $this->container->get( 'aimeos_locale' )->get( $this->context, $attributes ); |
|
| 73 | - $this->context->setLocale( $localeItem ); |
|
| 74 | - $this->context->setI18n( $this->container->get( 'aimeos_i18n' )->get( array( $localeItem->getLanguageId() ) ) ); |
|
| 72 | + $localeItem = $this->container->get('aimeos_locale')->get($this->context, $attributes); |
|
| 73 | + $this->context->setLocale($localeItem); |
|
| 74 | + $this->context->setI18n($this->container->get('aimeos_i18n')->get(array($localeItem->getLanguageId()))); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | return $this->context; |
@@ -84,11 +84,11 @@ discard block |
||
| 84 | 84 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object including config |
| 85 | 85 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 86 | 86 | */ |
| 87 | - protected function addCache( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 87 | + protected function addCache(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 88 | 88 | { |
| 89 | - $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $context ); |
|
| 89 | + $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($context); |
|
| 90 | 90 | |
| 91 | - return $context->setCache( $cache ); |
|
| 91 | + return $context->setCache($cache); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
@@ -98,11 +98,11 @@ discard block |
||
| 98 | 98 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 99 | 99 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 100 | 100 | */ |
| 101 | - protected function addDatabaseManager( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 101 | + protected function addDatabaseManager(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 102 | 102 | { |
| 103 | - $dbm = new \Aimeos\MW\DB\Manager\DBAL( $context->getConfig() ); |
|
| 103 | + $dbm = new \Aimeos\MW\DB\Manager\DBAL($context->getConfig()); |
|
| 104 | 104 | |
| 105 | - return $context->setDatabaseManager( $dbm ); |
|
| 105 | + return $context->setDatabaseManager($dbm); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
@@ -112,11 +112,11 @@ discard block |
||
| 112 | 112 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 113 | 113 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 114 | 114 | */ |
| 115 | - protected function addFilesystemManager( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 115 | + protected function addFilesystemManager(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 116 | 116 | { |
| 117 | - $fs = new \Aimeos\MW\Filesystem\Manager\Standard( $context->getConfig() ); |
|
| 117 | + $fs = new \Aimeos\MW\Filesystem\Manager\Standard($context->getConfig()); |
|
| 118 | 118 | |
| 119 | - return $context->setFilesystemManager( $fs ); |
|
| 119 | + return $context->setFilesystemManager($fs); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | |
@@ -126,11 +126,11 @@ discard block |
||
| 126 | 126 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 127 | 127 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 128 | 128 | */ |
| 129 | - protected function addLogger( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 129 | + protected function addLogger(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 130 | 130 | { |
| 131 | - $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context ); |
|
| 131 | + $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager($context); |
|
| 132 | 132 | |
| 133 | - return $context->setLogger( $logger ); |
|
| 133 | + return $context->setLogger($logger); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | |
@@ -141,11 +141,11 @@ discard block |
||
| 141 | 141 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 142 | 142 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 143 | 143 | */ |
| 144 | - protected function addMailer( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 144 | + protected function addMailer(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 145 | 145 | { |
| 146 | - $mail = new \Aimeos\MW\Mail\Swift( $this->container->get( 'mailer' ) ); |
|
| 146 | + $mail = new \Aimeos\MW\Mail\Swift($this->container->get('mailer')); |
|
| 147 | 147 | |
| 148 | - return $context->setMail( $mail ); |
|
| 148 | + return $context->setMail($mail); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | |
@@ -155,11 +155,11 @@ discard block |
||
| 155 | 155 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 156 | 156 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 157 | 157 | */ |
| 158 | - protected function addMessageQueueManager( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 158 | + protected function addMessageQueueManager(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 159 | 159 | { |
| 160 | - $mq = new \Aimeos\MW\MQueue\Manager\Standard( $context->getConfig() ); |
|
| 160 | + $mq = new \Aimeos\MW\MQueue\Manager\Standard($context->getConfig()); |
|
| 161 | 161 | |
| 162 | - return $context->setMessageQueueManager( $mq ); |
|
| 162 | + return $context->setMessageQueueManager($mq); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | |
@@ -169,16 +169,16 @@ discard block |
||
| 169 | 169 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 170 | 170 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 171 | 171 | */ |
| 172 | - protected function addProcess( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 172 | + protected function addProcess(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 173 | 173 | { |
| 174 | 174 | $config = $context->getConfig(); |
| 175 | - $max = $config->get( 'pcntl_max', 4 ); |
|
| 176 | - $prio = $config->get( 'pcntl_priority', 19 ); |
|
| 175 | + $max = $config->get('pcntl_max', 4); |
|
| 176 | + $prio = $config->get('pcntl_priority', 19); |
|
| 177 | 177 | |
| 178 | - $process = new \Aimeos\MW\Process\Pcntl( $max, $prio ); |
|
| 179 | - $process = new \Aimeos\MW\Process\Decorator\Check( $process ); |
|
| 178 | + $process = new \Aimeos\MW\Process\Pcntl($max, $prio); |
|
| 179 | + $process = new \Aimeos\MW\Process\Decorator\Check($process); |
|
| 180 | 180 | |
| 181 | - return $context->setProcess( $process ); |
|
| 181 | + return $context->setProcess($process); |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | |
@@ -188,11 +188,11 @@ discard block |
||
| 188 | 188 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 189 | 189 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 190 | 190 | */ |
| 191 | - protected function addSession( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 191 | + protected function addSession(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 192 | 192 | { |
| 193 | 193 | $session = new \Aimeos\MW\Session\PHP(); |
| 194 | 194 | |
| 195 | - return $context->setSession( $session ); |
|
| 195 | + return $context->setSession($session); |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | |
@@ -202,10 +202,10 @@ discard block |
||
| 202 | 202 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 203 | 203 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 204 | 204 | */ |
| 205 | - protected function addUser( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 205 | + protected function addUser(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 206 | 206 | { |
| 207 | 207 | $ipaddr = $this->container->request->getAttribute('ip_address'); |
| 208 | 208 | |
| 209 | - return $context->setEditor( $ipaddr ); |
|
| 209 | + return $context->setEditor($ipaddr); |
|
| 210 | 210 | } |
| 211 | 211 | } |
@@ -7,16 +7,16 @@ |
||
| 7 | 7 | 'uploaddir' => '/', |
| 8 | 8 | |
| 9 | 9 | 'page' => array( |
| 10 | - 'account-index' => array( 'account/profile','account/history','account/favorite','account/watch','basket/mini','catalog/session' ), |
|
| 11 | - 'basket-index' => array( 'basket/standard','basket/related' ), |
|
| 12 | - 'catalog-count' => array( 'catalog/count' ), |
|
| 13 | - 'catalog-detail' => array( 'basket/mini','catalog/stage','catalog/detail','catalog/session' ), |
|
| 14 | - 'catalog-list' => array( 'basket/mini','catalog/filter','catalog/stage','catalog/lists' ), |
|
| 15 | - 'catalog-stock' => array( 'catalog/stock' ), |
|
| 16 | - 'catalog-suggest' => array( 'catalog/suggest' ), |
|
| 17 | - 'checkout-confirm' => array( 'checkout/confirm' ), |
|
| 18 | - 'checkout-index' => array( 'checkout/standard' ), |
|
| 19 | - 'checkout-update' => array( 'checkout/update'), |
|
| 10 | + 'account-index' => array('account/profile', 'account/history', 'account/favorite', 'account/watch', 'basket/mini', 'catalog/session'), |
|
| 11 | + 'basket-index' => array('basket/standard', 'basket/related'), |
|
| 12 | + 'catalog-count' => array('catalog/count'), |
|
| 13 | + 'catalog-detail' => array('basket/mini', 'catalog/stage', 'catalog/detail', 'catalog/session'), |
|
| 14 | + 'catalog-list' => array('basket/mini', 'catalog/filter', 'catalog/stage', 'catalog/lists'), |
|
| 15 | + 'catalog-stock' => array('catalog/stock'), |
|
| 16 | + 'catalog-suggest' => array('catalog/suggest'), |
|
| 17 | + 'checkout-confirm' => array('checkout/confirm'), |
|
| 18 | + 'checkout-index' => array('checkout/standard'), |
|
| 19 | + 'checkout-update' => array('checkout/update'), |
|
| 20 | 20 | ), |
| 21 | 21 | |
| 22 | 22 | 'resource' => array( |
@@ -1,198 +1,198 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -$app->group( $config( 'routes/admin', '/admin' ), function() use ( $config ) { |
|
| 4 | +$app->group($config('routes/admin', '/admin'), function() use ($config) { |
|
| 5 | 5 | |
| 6 | - $this->map(['GET', 'POST'], '', function( $request, $response, $args ) use ( $config ) { |
|
| 7 | - return $response->withHeader( 'Location', $config( 'routes/jqadm', '/admin/default/jqadm' ) . '/search/dashboard' ); |
|
| 8 | - })->setName( 'aimeos_shop_admin' ); |
|
| 6 | + $this->map(['GET', 'POST'], '', function($request, $response, $args) use ($config) { |
|
| 7 | + return $response->withHeader('Location', $config('routes/jqadm', '/admin/default/jqadm').'/search/dashboard'); |
|
| 8 | + })->setName('aimeos_shop_admin'); |
|
| 9 | 9 | |
| 10 | 10 | }); |
| 11 | 11 | |
| 12 | 12 | |
| 13 | -$app->group( $config( 'routes/extadm', '/admin/{site}/extadm' ), function() use ( $config ) { |
|
| 13 | +$app->group($config('routes/extadm', '/admin/{site}/extadm'), function() use ($config) { |
|
| 14 | 14 | |
| 15 | - $this->map(['GET'], '/file', function( $request, $response, $args ) { |
|
| 16 | - return \Aimeos\Slim\Controller\Extadm::fileAction( $this, $request, $response, $args ); |
|
| 17 | - })->setName( 'aimeos_shop_extadm_file' ); |
|
| 15 | + $this->map(['GET'], '/file', function($request, $response, $args) { |
|
| 16 | + return \Aimeos\Slim\Controller\Extadm::fileAction($this, $request, $response, $args); |
|
| 17 | + })->setName('aimeos_shop_extadm_file'); |
|
| 18 | 18 | |
| 19 | - $this->map(['POST'], '/do', function( $request, $response, $args ) { |
|
| 20 | - return \Aimeos\Slim\Controller\Extadm::doAction( $this, $request, $response, $args ); |
|
| 21 | - })->setName( 'aimeos_shop_extadm_json' ); |
|
| 19 | + $this->map(['POST'], '/do', function($request, $response, $args) { |
|
| 20 | + return \Aimeos\Slim\Controller\Extadm::doAction($this, $request, $response, $args); |
|
| 21 | + })->setName('aimeos_shop_extadm_json'); |
|
| 22 | 22 | |
| 23 | - $this->map(['GET'], '[/{lang}[/{tab:[0-9]+}]]', function( $request, $response, $args ) { |
|
| 24 | - return \Aimeos\Slim\Controller\Extadm::indexAction( $this, $request, $response, $args ); |
|
| 25 | - })->setName( 'aimeos_shop_extadm' ); |
|
| 23 | + $this->map(['GET'], '[/{lang}[/{tab:[0-9]+}]]', function($request, $response, $args) { |
|
| 24 | + return \Aimeos\Slim\Controller\Extadm::indexAction($this, $request, $response, $args); |
|
| 25 | + })->setName('aimeos_shop_extadm'); |
|
| 26 | 26 | |
| 27 | 27 | }); |
| 28 | 28 | |
| 29 | 29 | |
| 30 | -$app->group( $config( 'routes/jqadm', '/admin/{site}/jqadm' ), function() use ( $config ) { |
|
| 30 | +$app->group($config('routes/jqadm', '/admin/{site}/jqadm'), function() use ($config) { |
|
| 31 | 31 | |
| 32 | - $this->map(['GET'], '/file/{type}', function( $request, $response, $args ) { |
|
| 33 | - return \Aimeos\Slim\Controller\Jqadm::fileAction( $this, $request, $response, $args ); |
|
| 34 | - })->setName( 'aimeos_shop_jqadm_file' ); |
|
| 32 | + $this->map(['GET'], '/file/{type}', function($request, $response, $args) { |
|
| 33 | + return \Aimeos\Slim\Controller\Jqadm::fileAction($this, $request, $response, $args); |
|
| 34 | + })->setName('aimeos_shop_jqadm_file'); |
|
| 35 | 35 | |
| 36 | - $this->map(['GET', 'POST'], '/copy/{resource}/{id}', function( $request, $response, $args ) { |
|
| 37 | - return \Aimeos\Slim\Controller\Jqadm::copyAction( $this, $request, $response, $args ); |
|
| 38 | - })->setName( 'aimeos_shop_jqadm_copy' ); |
|
| 36 | + $this->map(['GET', 'POST'], '/copy/{resource}/{id}', function($request, $response, $args) { |
|
| 37 | + return \Aimeos\Slim\Controller\Jqadm::copyAction($this, $request, $response, $args); |
|
| 38 | + })->setName('aimeos_shop_jqadm_copy'); |
|
| 39 | 39 | |
| 40 | - $this->map(['GET', 'POST'], '/create/{resource}', function( $request, $response, $args ) { |
|
| 41 | - return \Aimeos\Slim\Controller\Jqadm::createAction( $this, $request, $response, $args ); |
|
| 42 | - })->setName( 'aimeos_shop_jqadm_create' ); |
|
| 40 | + $this->map(['GET', 'POST'], '/create/{resource}', function($request, $response, $args) { |
|
| 41 | + return \Aimeos\Slim\Controller\Jqadm::createAction($this, $request, $response, $args); |
|
| 42 | + })->setName('aimeos_shop_jqadm_create'); |
|
| 43 | 43 | |
| 44 | - $this->map(['GET', 'POST'], '/delete/{resource}/{id}', function( $request, $response, $args ) { |
|
| 45 | - return \Aimeos\Slim\Controller\Jqadm::deleteAction( $this, $request, $response, $args ); |
|
| 46 | - })->setName( 'aimeos_shop_jqadm_delete' ); |
|
| 44 | + $this->map(['GET', 'POST'], '/delete/{resource}/{id}', function($request, $response, $args) { |
|
| 45 | + return \Aimeos\Slim\Controller\Jqadm::deleteAction($this, $request, $response, $args); |
|
| 46 | + })->setName('aimeos_shop_jqadm_delete'); |
|
| 47 | 47 | |
| 48 | - $this->map(['GET'], '/get/{resource}/{id}', function( $request, $response, $args ) { |
|
| 49 | - return \Aimeos\Slim\Controller\Jqadm::getAction( $this, $request, $response, $args ); |
|
| 50 | - })->setName( 'aimeos_shop_jqadm_get' ); |
|
| 48 | + $this->map(['GET'], '/get/{resource}/{id}', function($request, $response, $args) { |
|
| 49 | + return \Aimeos\Slim\Controller\Jqadm::getAction($this, $request, $response, $args); |
|
| 50 | + })->setName('aimeos_shop_jqadm_get'); |
|
| 51 | 51 | |
| 52 | - $this->map(['POST'], '/save/{resource}[/{id}]', function( $request, $response, $args ) { |
|
| 53 | - return \Aimeos\Slim\Controller\Jqadm::saveAction( $this, $request, $response, $args ); |
|
| 54 | - })->setName( 'aimeos_shop_jqadm_save' ); |
|
| 52 | + $this->map(['POST'], '/save/{resource}[/{id}]', function($request, $response, $args) { |
|
| 53 | + return \Aimeos\Slim\Controller\Jqadm::saveAction($this, $request, $response, $args); |
|
| 54 | + })->setName('aimeos_shop_jqadm_save'); |
|
| 55 | 55 | |
| 56 | - $this->map(['GET', 'POST'], '/search/{resource}', function( $request, $response, $args ) { |
|
| 57 | - return \Aimeos\Slim\Controller\Jqadm::searchAction( $this, $request, $response, $args ); |
|
| 58 | - })->setName( 'aimeos_shop_jqadm_search' ); |
|
| 56 | + $this->map(['GET', 'POST'], '/search/{resource}', function($request, $response, $args) { |
|
| 57 | + return \Aimeos\Slim\Controller\Jqadm::searchAction($this, $request, $response, $args); |
|
| 58 | + })->setName('aimeos_shop_jqadm_search'); |
|
| 59 | 59 | |
| 60 | 60 | }); |
| 61 | 61 | |
| 62 | 62 | |
| 63 | -$app->group( $config( 'routes/jsonadm', '/admin/{site}/jsonadm' ), function() use ( $config ) { |
|
| 63 | +$app->group($config('routes/jsonadm', '/admin/{site}/jsonadm'), function() use ($config) { |
|
| 64 | 64 | |
| 65 | - $this->map(['DELETE'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function( $request, $response, $args ) { |
|
| 66 | - return \Aimeos\Slim\Controller\Jsonadm::deleteAction( $this, $request, $response, $args ); |
|
| 67 | - })->setName( 'aimeos_shop_jsonadm_delete' ); |
|
| 65 | + $this->map(['DELETE'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function($request, $response, $args) { |
|
| 66 | + return \Aimeos\Slim\Controller\Jsonadm::deleteAction($this, $request, $response, $args); |
|
| 67 | + })->setName('aimeos_shop_jsonadm_delete'); |
|
| 68 | 68 | |
| 69 | - $this->map(['GET'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function( $request, $response, $args ) { |
|
| 70 | - return \Aimeos\Slim\Controller\Jsonadm::getAction( $this, $request, $response, $args ); |
|
| 71 | - })->setName( 'aimeos_shop_jsonadm_get' ); |
|
| 69 | + $this->map(['GET'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function($request, $response, $args) { |
|
| 70 | + return \Aimeos\Slim\Controller\Jsonadm::getAction($this, $request, $response, $args); |
|
| 71 | + })->setName('aimeos_shop_jsonadm_get'); |
|
| 72 | 72 | |
| 73 | - $this->map(['PATCH'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function( $request, $response, $args ) { |
|
| 74 | - return \Aimeos\Slim\Controller\Jsonadm::patchAction( $this, $request, $response, $args ); |
|
| 75 | - })->setName( 'aimeos_shop_jsonadm_patch' ); |
|
| 73 | + $this->map(['PATCH'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function($request, $response, $args) { |
|
| 74 | + return \Aimeos\Slim\Controller\Jsonadm::patchAction($this, $request, $response, $args); |
|
| 75 | + })->setName('aimeos_shop_jsonadm_patch'); |
|
| 76 | 76 | |
| 77 | - $this->map(['POST'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function( $request, $response, $args ) { |
|
| 78 | - return \Aimeos\Slim\Controller\Jsonadm::postAction( $this, $request, $response, $args ); |
|
| 79 | - })->setName( 'aimeos_shop_jsonadm_post' ); |
|
| 77 | + $this->map(['POST'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function($request, $response, $args) { |
|
| 78 | + return \Aimeos\Slim\Controller\Jsonadm::postAction($this, $request, $response, $args); |
|
| 79 | + })->setName('aimeos_shop_jsonadm_post'); |
|
| 80 | 80 | |
| 81 | - $this->map(['PUT'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function( $request, $response, $args ) { |
|
| 82 | - return \Aimeos\Slim\Controller\Jsonadm::putAction( $this, $request, $response, $args ); |
|
| 83 | - })->setName( 'aimeos_shop_jsonadm_put' ); |
|
| 81 | + $this->map(['PUT'], '/{resource:[^0-9A-Z\-\_]+}[/{id:[0-9A-Z\-\_]*}]', function($request, $response, $args) { |
|
| 82 | + return \Aimeos\Slim\Controller\Jsonadm::putAction($this, $request, $response, $args); |
|
| 83 | + })->setName('aimeos_shop_jsonadm_put'); |
|
| 84 | 84 | |
| 85 | - $this->map(['OPTIONS'], '/[{resource}]', function( $request, $response, $args ) { |
|
| 86 | - return \Aimeos\Slim\Controller\Jsonadm::optionsAction( $this, $request, $response, $args ); |
|
| 87 | - })->setName( 'aimeos_shop_jsonadm_options' ); |
|
| 85 | + $this->map(['OPTIONS'], '/[{resource}]', function($request, $response, $args) { |
|
| 86 | + return \Aimeos\Slim\Controller\Jsonadm::optionsAction($this, $request, $response, $args); |
|
| 87 | + })->setName('aimeos_shop_jsonadm_options'); |
|
| 88 | 88 | |
| 89 | 89 | }); |
| 90 | 90 | |
| 91 | 91 | |
| 92 | -$app->group( $config( 'routes/jsonapi', '/jsonapi' ), function() use ( $config ) { |
|
| 92 | +$app->group($config('routes/jsonapi', '/jsonapi'), function() use ($config) { |
|
| 93 | 93 | |
| 94 | - $this->map(['DELETE'], '/{resource}', function( $request, $response, $args ) { |
|
| 95 | - return \Aimeos\Slim\Controller\Jsonapi::deleteAction( $this, $request, $response, $args ); |
|
| 96 | - })->setName( 'aimeos_shop_jsonapi_delete' ); |
|
| 94 | + $this->map(['DELETE'], '/{resource}', function($request, $response, $args) { |
|
| 95 | + return \Aimeos\Slim\Controller\Jsonapi::deleteAction($this, $request, $response, $args); |
|
| 96 | + })->setName('aimeos_shop_jsonapi_delete'); |
|
| 97 | 97 | |
| 98 | - $this->map(['GET'], '/{resource}', function( $request, $response, $args ) { |
|
| 99 | - return \Aimeos\Slim\Controller\Jsonapi::getAction( $this, $request, $response, $args ); |
|
| 100 | - })->setName( 'aimeos_shop_jsonapi_get' ); |
|
| 98 | + $this->map(['GET'], '/{resource}', function($request, $response, $args) { |
|
| 99 | + return \Aimeos\Slim\Controller\Jsonapi::getAction($this, $request, $response, $args); |
|
| 100 | + })->setName('aimeos_shop_jsonapi_get'); |
|
| 101 | 101 | |
| 102 | - $this->map(['PATCH'], '/{resource}', function( $request, $response, $args ) { |
|
| 103 | - return \Aimeos\Slim\Controller\Jsonapi::patchAction( $this, $request, $response, $args ); |
|
| 104 | - })->setName( 'aimeos_shop_jsonapi_patch' ); |
|
| 102 | + $this->map(['PATCH'], '/{resource}', function($request, $response, $args) { |
|
| 103 | + return \Aimeos\Slim\Controller\Jsonapi::patchAction($this, $request, $response, $args); |
|
| 104 | + })->setName('aimeos_shop_jsonapi_patch'); |
|
| 105 | 105 | |
| 106 | - $this->map(['POST'], '/{resource}', function( $request, $response, $args ) { |
|
| 107 | - return \Aimeos\Slim\Controller\Jsonapi::postAction( $this, $request, $response, $args ); |
|
| 108 | - })->setName( 'aimeos_shop_jsonapi_post' ); |
|
| 106 | + $this->map(['POST'], '/{resource}', function($request, $response, $args) { |
|
| 107 | + return \Aimeos\Slim\Controller\Jsonapi::postAction($this, $request, $response, $args); |
|
| 108 | + })->setName('aimeos_shop_jsonapi_post'); |
|
| 109 | 109 | |
| 110 | - $this->map(['PUT'], '/{resource}', function( $request, $response, $args ) { |
|
| 111 | - return \Aimeos\Slim\Controller\Jsonapi::putAction( $this, $request, $response, $args ); |
|
| 112 | - })->setName( 'aimeos_shop_jsonapi_put' ); |
|
| 110 | + $this->map(['PUT'], '/{resource}', function($request, $response, $args) { |
|
| 111 | + return \Aimeos\Slim\Controller\Jsonapi::putAction($this, $request, $response, $args); |
|
| 112 | + })->setName('aimeos_shop_jsonapi_put'); |
|
| 113 | 113 | |
| 114 | - $this->map(['OPTIONS'], '/[{resource}]', function( $request, $response, $args ) { |
|
| 115 | - return \Aimeos\Slim\Controller\Jsonapi::optionsAction( $this, $request, $response, $args ); |
|
| 116 | - })->setName( 'aimeos_shop_jsonapi_options' ); |
|
| 114 | + $this->map(['OPTIONS'], '/[{resource}]', function($request, $response, $args) { |
|
| 115 | + return \Aimeos\Slim\Controller\Jsonapi::optionsAction($this, $request, $response, $args); |
|
| 116 | + })->setName('aimeos_shop_jsonapi_options'); |
|
| 117 | 117 | |
| 118 | 118 | }); |
| 119 | 119 | |
| 120 | 120 | |
| 121 | -$app->group( $config( 'routes/account', '' ), function() { |
|
| 121 | +$app->group($config('routes/account', ''), function() { |
|
| 122 | 122 | |
| 123 | - $this->map(['GET', 'POST'], '/myaccount', function( $request, $response, $args ) { |
|
| 124 | - return \Aimeos\Slim\Controller\Account::indexAction( $this, $request, $response, $args ); |
|
| 125 | - })->setName( 'aimeos_shop_account' ); |
|
| 123 | + $this->map(['GET', 'POST'], '/myaccount', function($request, $response, $args) { |
|
| 124 | + return \Aimeos\Slim\Controller\Account::indexAction($this, $request, $response, $args); |
|
| 125 | + })->setName('aimeos_shop_account'); |
|
| 126 | 126 | |
| 127 | - $this->map(['GET', 'POST'], '/myaccount/favorite[/{fav_action}/{fav_id:[0-9]+}[/{d_prodid:[0-9]+}[/{d_name}[/{d_pos:[0-9]+}]]]]', function( $request, $response, $args ) { |
|
| 128 | - return \Aimeos\Slim\Controller\Account::indexAction( $this, $request, $response, $args ); |
|
| 129 | - })->setName( 'aimeos_shop_account_favorite' ); |
|
| 127 | + $this->map(['GET', 'POST'], '/myaccount/favorite[/{fav_action}/{fav_id:[0-9]+}[/{d_prodid:[0-9]+}[/{d_name}[/{d_pos:[0-9]+}]]]]', function($request, $response, $args) { |
|
| 128 | + return \Aimeos\Slim\Controller\Account::indexAction($this, $request, $response, $args); |
|
| 129 | + })->setName('aimeos_shop_account_favorite'); |
|
| 130 | 130 | |
| 131 | - $this->map(['GET', 'POST'], '/myaccount/watch[/{wat_action}/{wat_id:[0-9]+}[/{d_prodid:[0-9]+}[/{d_name}[/{d_pos:[0-9]+}]]]]', function( $request, $response, $args ) { |
|
| 132 | - return \Aimeos\Slim\Controller\Account::indexAction( $this, $request, $response, $args ); |
|
| 133 | - })->setName( 'aimeos_shop_account_watch' ); |
|
| 131 | + $this->map(['GET', 'POST'], '/myaccount/watch[/{wat_action}/{wat_id:[0-9]+}[/{d_prodid:[0-9]+}[/{d_name}[/{d_pos:[0-9]+}]]]]', function($request, $response, $args) { |
|
| 132 | + return \Aimeos\Slim\Controller\Account::indexAction($this, $request, $response, $args); |
|
| 133 | + })->setName('aimeos_shop_account_watch'); |
|
| 134 | 134 | |
| 135 | - $this->map(['GET', 'POST'], '/myaccount/download/{dl_id}', function( $request, $response, $args ) { |
|
| 136 | - return \Aimeos\Slim\Controller\Account::downloadAction( $this, $request, $response, $args ); |
|
| 137 | - })->setName( 'aimeos_shop_account_download' ); |
|
| 135 | + $this->map(['GET', 'POST'], '/myaccount/download/{dl_id}', function($request, $response, $args) { |
|
| 136 | + return \Aimeos\Slim\Controller\Account::downloadAction($this, $request, $response, $args); |
|
| 137 | + })->setName('aimeos_shop_account_download'); |
|
| 138 | 138 | |
| 139 | 139 | }); |
| 140 | 140 | |
| 141 | 141 | |
| 142 | -$app->group( $config( 'routes/default', '' ), function() { |
|
| 142 | +$app->group($config('routes/default', ''), function() { |
|
| 143 | 143 | |
| 144 | - $this->map(['GET', 'POST'], '/count', function( $request, $response, $args ) { |
|
| 145 | - return \Aimeos\Slim\Controller\Catalog::countAction( $this, $request, $response, $args ); |
|
| 146 | - })->setName( 'aimeos_shop_count' ); |
|
| 144 | + $this->map(['GET', 'POST'], '/count', function($request, $response, $args) { |
|
| 145 | + return \Aimeos\Slim\Controller\Catalog::countAction($this, $request, $response, $args); |
|
| 146 | + })->setName('aimeos_shop_count'); |
|
| 147 | 147 | |
| 148 | - $this->map(['GET', 'POST'], '/detail/{d_prodid:[0-9]+}[/{d_name}[/{d_pos:[0-9]+}]]', function( $request, $response, $args ) { |
|
| 149 | - return \Aimeos\Slim\Controller\Catalog::detailAction( $this, $request, $response, $args ); |
|
| 150 | - })->setName( 'aimeos_shop_detail' ); |
|
| 148 | + $this->map(['GET', 'POST'], '/detail/{d_prodid:[0-9]+}[/{d_name}[/{d_pos:[0-9]+}]]', function($request, $response, $args) { |
|
| 149 | + return \Aimeos\Slim\Controller\Catalog::detailAction($this, $request, $response, $args); |
|
| 150 | + })->setName('aimeos_shop_detail'); |
|
| 151 | 151 | |
| 152 | - $this->map(['GET', 'POST'], '/detail/pin[/{pin_action}/{pin_id:[0-9]+}[/{d_prodid:[0-9]+}[/{d_name}[/{d_pos:[0-9]+}]]]]', function( $request, $response, $args ) { |
|
| 153 | - return \Aimeos\Slim\Controller\Catalog::detailAction( $this, $request, $response, $args ); |
|
| 154 | - })->setName( 'aimeos_shop_session_pinned' ); |
|
| 152 | + $this->map(['GET', 'POST'], '/detail/pin[/{pin_action}/{pin_id:[0-9]+}[/{d_prodid:[0-9]+}[/{d_name}[/{d_pos:[0-9]+}]]]]', function($request, $response, $args) { |
|
| 153 | + return \Aimeos\Slim\Controller\Catalog::detailAction($this, $request, $response, $args); |
|
| 154 | + })->setName('aimeos_shop_session_pinned'); |
|
| 155 | 155 | |
| 156 | - $this->map(['GET', 'POST'], '/list[/{f_catid:[0-9]+}[/{f_name}]]', function( $request, $response, $args ) { |
|
| 157 | - return \Aimeos\Slim\Controller\Catalog::listAction( $this, $request, $response, $args ); |
|
| 158 | - })->setName( 'aimeos_shop_list' ); |
|
| 156 | + $this->map(['GET', 'POST'], '/list[/{f_catid:[0-9]+}[/{f_name}]]', function($request, $response, $args) { |
|
| 157 | + return \Aimeos\Slim\Controller\Catalog::listAction($this, $request, $response, $args); |
|
| 158 | + })->setName('aimeos_shop_list'); |
|
| 159 | 159 | |
| 160 | - $this->map(['GET', 'POST'], '/suggest', function( $request, $response, $args ) { |
|
| 161 | - return \Aimeos\Slim\Controller\Catalog::suggestAction( $this, $request, $response, $args ); |
|
| 162 | - })->setName( 'aimeos_shop_suggest' ); |
|
| 160 | + $this->map(['GET', 'POST'], '/suggest', function($request, $response, $args) { |
|
| 161 | + return \Aimeos\Slim\Controller\Catalog::suggestAction($this, $request, $response, $args); |
|
| 162 | + })->setName('aimeos_shop_suggest'); |
|
| 163 | 163 | |
| 164 | - $this->map(['GET', 'POST'], '/stock', function( $request, $response, $args ) { |
|
| 165 | - return \Aimeos\Slim\Controller\Catalog::stockAction( $this, $request, $response, $args ); |
|
| 166 | - })->setName( 'aimeos_shop_stock' ); |
|
| 164 | + $this->map(['GET', 'POST'], '/stock', function($request, $response, $args) { |
|
| 165 | + return \Aimeos\Slim\Controller\Catalog::stockAction($this, $request, $response, $args); |
|
| 166 | + })->setName('aimeos_shop_stock'); |
|
| 167 | 167 | |
| 168 | - $this->map(['GET', 'POST'], '/basket', function( $request, $response, $args ) { |
|
| 169 | - return \Aimeos\Slim\Controller\Basket::indexAction( $this, $request, $response, $args ); |
|
| 170 | - })->setName( 'aimeos_shop_basket' ); |
|
| 168 | + $this->map(['GET', 'POST'], '/basket', function($request, $response, $args) { |
|
| 169 | + return \Aimeos\Slim\Controller\Basket::indexAction($this, $request, $response, $args); |
|
| 170 | + })->setName('aimeos_shop_basket'); |
|
| 171 | 171 | |
| 172 | - $this->map(['GET', 'POST'], '/checkout[/{c_step}]', function( $request, $response, $args ) { |
|
| 173 | - return \Aimeos\Slim\Controller\Checkout::indexAction( $this, $request, $response, $args ); |
|
| 174 | - })->setName( 'aimeos_shop_checkout' ); |
|
| 172 | + $this->map(['GET', 'POST'], '/checkout[/{c_step}]', function($request, $response, $args) { |
|
| 173 | + return \Aimeos\Slim\Controller\Checkout::indexAction($this, $request, $response, $args); |
|
| 174 | + })->setName('aimeos_shop_checkout'); |
|
| 175 | 175 | |
| 176 | - $this->map(['GET', 'POST'], '/confirm[/{code}]', function( $request, $response, $args ) { |
|
| 177 | - return \Aimeos\Slim\Controller\Checkout::confirmAction( $this, $request, $response, $args ); |
|
| 178 | - })->setName( 'aimeos_shop_confirm' ); |
|
| 176 | + $this->map(['GET', 'POST'], '/confirm[/{code}]', function($request, $response, $args) { |
|
| 177 | + return \Aimeos\Slim\Controller\Checkout::confirmAction($this, $request, $response, $args); |
|
| 178 | + })->setName('aimeos_shop_confirm'); |
|
| 179 | 179 | |
| 180 | 180 | }); |
| 181 | 181 | |
| 182 | 182 | |
| 183 | -$app->group( $config( 'routes/update', '' ), function() { |
|
| 183 | +$app->group($config('routes/update', ''), function() { |
|
| 184 | 184 | |
| 185 | - $this->map(['GET', 'POST'], '/update', function( $request, $response, $args ) { |
|
| 186 | - return \Aimeos\Slim\Controller\Checkout::updateAction( $this, $request, $response, $args ); |
|
| 187 | - })->setName( 'aimeos_shop_update' ); |
|
| 185 | + $this->map(['GET', 'POST'], '/update', function($request, $response, $args) { |
|
| 186 | + return \Aimeos\Slim\Controller\Checkout::updateAction($this, $request, $response, $args); |
|
| 187 | + })->setName('aimeos_shop_update'); |
|
| 188 | 188 | |
| 189 | 189 | }); |
| 190 | 190 | |
| 191 | 191 | |
| 192 | -$app->map(['GET', 'POST'], '/terms', function( $request, $response, $args ) { |
|
| 192 | +$app->map(['GET', 'POST'], '/terms', function($request, $response, $args) { |
|
| 193 | 193 | return 'terms'; |
| 194 | -})->setName( 'aimeos_shop_terms' ); |
|
| 194 | +})->setName('aimeos_shop_terms'); |
|
| 195 | 195 | |
| 196 | -$app->map(['GET', 'POST'], '/privacy', function( $request, $response, $args ) { |
|
| 196 | +$app->map(['GET', 'POST'], '/privacy', function($request, $response, $args) { |
|
| 197 | 197 | return 'privacy'; |
| 198 | -})->setName( 'aimeos_shop_privacy' ); |
|
| 198 | +})->setName('aimeos_shop_privacy'); |
|