@@ -29,25 +29,25 @@ |
||
29 | 29 | public function getConfigTreeBuilder() |
30 | 30 | { |
31 | 31 | $treeBuilder = new TreeBuilder(); |
32 | - $rootNode = $treeBuilder->root( 'aimeos_shop' ); |
|
32 | + $rootNode = $treeBuilder->root('aimeos_shop'); |
|
33 | 33 | |
34 | 34 | $rootNode |
35 | 35 | ->children() |
36 | - ->booleanNode('disable_sites')->defaultValue( true )->end() |
|
37 | - ->booleanNode('apc_enable')->defaultValue( false )->end() |
|
38 | - ->scalarNode('apc_prefix')->defaultValue( 'sf2:' )->end() |
|
36 | + ->booleanNode('disable_sites')->defaultValue(true)->end() |
|
37 | + ->booleanNode('apc_enable')->defaultValue(false)->end() |
|
38 | + ->scalarNode('apc_prefix')->defaultValue('sf2:')->end() |
|
39 | 39 | ->scalarNode('extdir')->end() |
40 | 40 | ->scalarNode('uploaddir')->end() |
41 | - ->variableNode('admin')->defaultValue( array() )->end() |
|
42 | - ->variableNode('client')->defaultValue( array() )->end() |
|
43 | - ->variableNode('controller')->defaultValue( array() )->end() |
|
44 | - ->variableNode('i18n')->defaultValue( array() )->end() |
|
45 | - ->variableNode('madmin')->defaultValue( array() )->end() |
|
46 | - ->variableNode('mshop')->defaultValue( array() )->end() |
|
47 | - ->variableNode('resource')->defaultValue( array() )->end() |
|
48 | - ->variableNode('page')->defaultValue( array() )->end() |
|
49 | - ->variableNode('backend')->defaultValue( array() )->end() |
|
50 | - ->variableNode('frontend')->defaultValue( array() )->end() |
|
41 | + ->variableNode('admin')->defaultValue(array())->end() |
|
42 | + ->variableNode('client')->defaultValue(array())->end() |
|
43 | + ->variableNode('controller')->defaultValue(array())->end() |
|
44 | + ->variableNode('i18n')->defaultValue(array())->end() |
|
45 | + ->variableNode('madmin')->defaultValue(array())->end() |
|
46 | + ->variableNode('mshop')->defaultValue(array())->end() |
|
47 | + ->variableNode('resource')->defaultValue(array())->end() |
|
48 | + ->variableNode('page')->defaultValue(array())->end() |
|
49 | + ->variableNode('backend')->defaultValue(array())->end() |
|
50 | + ->variableNode('frontend')->defaultValue(array())->end() |
|
51 | 51 | ->end() |
52 | 52 | ; |
53 | 53 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @param Container $container Container object to access parameters |
30 | 30 | */ |
31 | - public function __construct( Container $container ) |
|
31 | + public function __construct(Container $container) |
|
32 | 32 | { |
33 | 33 | $this->container = $container; |
34 | 34 | } |
@@ -40,33 +40,33 @@ discard block |
||
40 | 40 | * @param string $type Configuration type ("frontend" or "backend") |
41 | 41 | * @return \Aimeos\MW\Config\Iface Config object |
42 | 42 | */ |
43 | - public function get( $type = 'frontend' ) |
|
43 | + public function get($type = 'frontend') |
|
44 | 44 | { |
45 | 45 | $configPaths = $this->container->get('aimeos')->get()->getConfigPaths(); |
46 | 46 | |
47 | - $conf = new \Aimeos\MW\Config\PHPArray( array(), $configPaths ); |
|
47 | + $conf = new \Aimeos\MW\Config\PHPArray(array(), $configPaths); |
|
48 | 48 | |
49 | - $apc = (bool) $this->container->getParameter( 'aimeos_shop.apc_enable' ); |
|
50 | - $prefix = $this->container->getParameter( 'aimeos_shop.apc_prefix' ); |
|
49 | + $apc = (bool) $this->container->getParameter('aimeos_shop.apc_enable'); |
|
50 | + $prefix = $this->container->getParameter('aimeos_shop.apc_prefix'); |
|
51 | 51 | |
52 | - if( function_exists( 'apc_store' ) === true && $apc === true ) { |
|
53 | - $conf = new \Aimeos\MW\Config\Decorator\APC( $conf, $prefix ); |
|
52 | + if (function_exists('apc_store') === true && $apc === true) { |
|
53 | + $conf = new \Aimeos\MW\Config\Decorator\APC($conf, $prefix); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | $local = array( |
57 | - 'admin' => $this->container->getParameter( 'aimeos_shop.admin' ), |
|
58 | - 'client' => $this->container->getParameter( 'aimeos_shop.client' ), |
|
59 | - 'controller' => $this->container->getParameter( 'aimeos_shop.controller' ), |
|
60 | - 'madmin' => $this->container->getParameter( 'aimeos_shop.madmin' ), |
|
61 | - 'mshop' => $this->container->getParameter( 'aimeos_shop.mshop' ), |
|
62 | - 'resource' => $this->container->getParameter( 'aimeos_shop.resource' ), |
|
57 | + 'admin' => $this->container->getParameter('aimeos_shop.admin'), |
|
58 | + 'client' => $this->container->getParameter('aimeos_shop.client'), |
|
59 | + 'controller' => $this->container->getParameter('aimeos_shop.controller'), |
|
60 | + 'madmin' => $this->container->getParameter('aimeos_shop.madmin'), |
|
61 | + 'mshop' => $this->container->getParameter('aimeos_shop.mshop'), |
|
62 | + 'resource' => $this->container->getParameter('aimeos_shop.resource'), |
|
63 | 63 | ); |
64 | 64 | |
65 | - $config = new \Aimeos\MW\Config\Decorator\Memory( $conf, $local ); |
|
66 | - $settings = $this->container->getParameter( 'aimeos_shop.' . $type ); |
|
65 | + $config = new \Aimeos\MW\Config\Decorator\Memory($conf, $local); |
|
66 | + $settings = $this->container->getParameter('aimeos_shop.'.$type); |
|
67 | 67 | |
68 | - if( $settings !== array() ) { |
|
69 | - $config = new \Aimeos\MW\Config\Decorator\Memory( $config, $settings ); |
|
68 | + if ($settings !== array()) { |
|
69 | + $config = new \Aimeos\MW\Config\Decorator\Memory($config, $settings); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | return $config; |
@@ -29,19 +29,19 @@ discard block |
||
29 | 29 | protected function configure() |
30 | 30 | { |
31 | 31 | $names = ''; |
32 | - $aimeos = new \Aimeos\Bootstrap( array() ); |
|
33 | - $cntlPaths = $aimeos->getCustomPaths( 'controller/jobs' ); |
|
34 | - $controllers = \Aimeos\Controller\Jobs\Factory::getControllers( $this->getBareContext(), $aimeos, $cntlPaths ); |
|
32 | + $aimeos = new \Aimeos\Bootstrap(array()); |
|
33 | + $cntlPaths = $aimeos->getCustomPaths('controller/jobs'); |
|
34 | + $controllers = \Aimeos\Controller\Jobs\Factory::getControllers($this->getBareContext(), $aimeos, $cntlPaths); |
|
35 | 35 | |
36 | - foreach( $controllers as $key => $controller ) { |
|
37 | - $names .= str_pad( $key, 30 ) . $controller->getName() . PHP_EOL; |
|
36 | + foreach ($controllers as $key => $controller) { |
|
37 | + $names .= str_pad($key, 30).$controller->getName().PHP_EOL; |
|
38 | 38 | } |
39 | 39 | |
40 | - $this->setName( 'aimeos:jobs' ); |
|
41 | - $this->setDescription( 'Executes the job controllers' ); |
|
42 | - $this->addArgument( 'jobs', InputArgument::REQUIRED, 'One or more job controller names like "admin/job customer/email/watch"' ); |
|
43 | - $this->addArgument( 'site', InputArgument::OPTIONAL, 'Site codes to execute the jobs for like "default unittest" (none for all)' ); |
|
44 | - $this->setHelp( "Available jobs are:\n" . $names ); |
|
40 | + $this->setName('aimeos:jobs'); |
|
41 | + $this->setDescription('Executes the job controllers'); |
|
42 | + $this->addArgument('jobs', InputArgument::REQUIRED, 'One or more job controller names like "admin/job customer/email/watch"'); |
|
43 | + $this->addArgument('site', InputArgument::OPTIONAL, 'Site codes to execute the jobs for like "default unittest" (none for all)'); |
|
44 | + $this->setHelp("Available jobs are:\n".$names); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -51,23 +51,23 @@ discard block |
||
51 | 51 | * @param InputInterface $input Input object |
52 | 52 | * @param OutputInterface $output Output object |
53 | 53 | */ |
54 | - protected function execute( InputInterface $input, OutputInterface $output ) |
|
54 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
55 | 55 | { |
56 | 56 | $context = $this->getContext(); |
57 | - $aimeos = $this->getContainer()->get( 'aimeos' )->get(); |
|
57 | + $aimeos = $this->getContainer()->get('aimeos')->get(); |
|
58 | 58 | |
59 | - $jobs = explode( ' ', $input->getArgument( 'jobs' ) ); |
|
60 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
59 | + $jobs = explode(' ', $input->getArgument('jobs')); |
|
60 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
61 | 61 | |
62 | - foreach( $this->getSiteItems( $context, $input ) as $siteItem ) |
|
62 | + foreach ($this->getSiteItems($context, $input) as $siteItem) |
|
63 | 63 | { |
64 | - $localeItem = $localeManager->bootstrap( $siteItem->getCode(), 'en', '', false ); |
|
65 | - $context->setLocale( $localeItem ); |
|
64 | + $localeItem = $localeManager->bootstrap($siteItem->getCode(), 'en', '', false); |
|
65 | + $context->setLocale($localeItem); |
|
66 | 66 | |
67 | - $output->writeln( sprintf( 'Executing the Aimeos jobs for "<info>%s</info>"', $siteItem->getCode() ) ); |
|
67 | + $output->writeln(sprintf('Executing the Aimeos jobs for "<info>%s</info>"', $siteItem->getCode())); |
|
68 | 68 | |
69 | - foreach( $jobs as $jobname ) { |
|
70 | - \Aimeos\Controller\Jobs\Factory::createController( $context, $aimeos, $jobname )->run(); |
|
69 | + foreach ($jobs as $jobname) { |
|
70 | + \Aimeos\Controller\Jobs\Factory::createController($context, $aimeos, $jobname)->run(); |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | } |
@@ -82,15 +82,15 @@ discard block |
||
82 | 82 | { |
83 | 83 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
84 | 84 | |
85 | - $conf = new \Aimeos\MW\Config\PHPArray( array(), array() ); |
|
86 | - $ctx->setConfig( $conf ); |
|
85 | + $conf = new \Aimeos\MW\Config\PHPArray(array(), array()); |
|
86 | + $ctx->setConfig($conf); |
|
87 | 87 | |
88 | - $locale = \Aimeos\MShop\Factory::createManager( $ctx, 'locale' )->createItem(); |
|
89 | - $locale->setLanguageId( 'en' ); |
|
90 | - $ctx->setLocale( $locale ); |
|
88 | + $locale = \Aimeos\MShop\Factory::createManager($ctx, 'locale')->createItem(); |
|
89 | + $locale->setLanguageId('en'); |
|
90 | + $ctx->setLocale($locale); |
|
91 | 91 | |
92 | - $i18n = new \Aimeos\MW\Translation\None( 'en' ); |
|
93 | - $ctx->setI18n( array( 'en' => $i18n ) ); |
|
92 | + $i18n = new \Aimeos\MW\Translation\None('en'); |
|
93 | + $ctx->setI18n(array('en' => $i18n)); |
|
94 | 94 | |
95 | 95 | return $ctx; |
96 | 96 | } |
@@ -105,19 +105,19 @@ discard block |
||
105 | 105 | { |
106 | 106 | $container = $this->getContainer(); |
107 | 107 | $aimeos = $container->get('aimeos')->get(); |
108 | - $context = $container->get( 'aimeos_context' )->get( false, 'backend' ); |
|
108 | + $context = $container->get('aimeos_context')->get(false, 'backend'); |
|
109 | 109 | |
110 | - $tmplPaths = $aimeos->getCustomPaths( 'controller/jobs/templates' ); |
|
111 | - $tmplPaths = array_merge( $tmplPaths, $aimeos->getCustomPaths( 'client/html/templates' ) ); |
|
112 | - $view = $container->get('aimeos_view')->create( $context, $tmplPaths ); |
|
110 | + $tmplPaths = $aimeos->getCustomPaths('controller/jobs/templates'); |
|
111 | + $tmplPaths = array_merge($tmplPaths, $aimeos->getCustomPaths('client/html/templates')); |
|
112 | + $view = $container->get('aimeos_view')->create($context, $tmplPaths); |
|
113 | 113 | |
114 | - $langManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context )->getSubManager( 'language' ); |
|
115 | - $langids = array_keys( $langManager->searchItems( $langManager->createSearch( true ) ) ); |
|
116 | - $i18n = $this->getContainer()->get( 'aimeos_i18n' )->get( $langids ); |
|
114 | + $langManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context)->getSubManager('language'); |
|
115 | + $langids = array_keys($langManager->searchItems($langManager->createSearch(true))); |
|
116 | + $i18n = $this->getContainer()->get('aimeos_i18n')->get($langids); |
|
117 | 117 | |
118 | - $context->setEditor( 'aimeos:jobs' ); |
|
119 | - $context->setView( $view ); |
|
120 | - $context->setI18n( $i18n ); |
|
118 | + $context->setEditor('aimeos:jobs'); |
|
119 | + $context->setView($view); |
|
120 | + $context->setI18n($i18n); |
|
121 | 121 | |
122 | 122 | return $context; |
123 | 123 | } |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | */ |
29 | 29 | protected function configure() |
30 | 30 | { |
31 | - $this->setName( 'aimeos:cache' ); |
|
32 | - $this->setDescription( 'Clears the content cache' ); |
|
33 | - $this->addArgument( 'site', InputArgument::OPTIONAL, 'Site codes to clear the cache like "default unittest" (none for all)' ); |
|
31 | + $this->setName('aimeos:cache'); |
|
32 | + $this->setDescription('Clears the content cache'); |
|
33 | + $this->addArgument('site', InputArgument::OPTIONAL, 'Site codes to clear the cache like "default unittest" (none for all)'); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -40,26 +40,26 @@ discard block |
||
40 | 40 | * @param InputInterface $input Input object |
41 | 41 | * @param OutputInterface $output Output object |
42 | 42 | */ |
43 | - protected function execute( InputInterface $input, OutputInterface $output ) |
|
43 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
44 | 44 | { |
45 | - $context = $this->getContainer()->get( 'aimeos_context' )->get( false, 'backend' ); |
|
46 | - $context->setEditor( 'aimeos:cache' ); |
|
45 | + $context = $this->getContainer()->get('aimeos_context')->get(false, 'backend'); |
|
46 | + $context->setEditor('aimeos:cache'); |
|
47 | 47 | |
48 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
48 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
49 | 49 | |
50 | - foreach( $this->getSiteItems( $context, $input ) as $siteItem ) |
|
50 | + foreach ($this->getSiteItems($context, $input) as $siteItem) |
|
51 | 51 | { |
52 | - $localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false ); |
|
52 | + $localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false); |
|
53 | 53 | |
54 | 54 | $lcontext = clone $context; |
55 | - $lcontext->setLocale( $localeItem ); |
|
55 | + $lcontext->setLocale($localeItem); |
|
56 | 56 | |
57 | - $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $lcontext ); |
|
58 | - $lcontext->setCache( $cache ); |
|
57 | + $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($lcontext); |
|
58 | + $lcontext->setCache($cache); |
|
59 | 59 | |
60 | - $output->writeln( sprintf( 'Clearing the Aimeos cache for site <info>%1$s</info>', $siteItem->getCode() ) ); |
|
60 | + $output->writeln(sprintf('Clearing the Aimeos cache for site <info>%1$s</info>', $siteItem->getCode())); |
|
61 | 61 | |
62 | - \Aimeos\MAdmin\Cache\Manager\Factory::createManager( $lcontext )->getCache()->flush(); |
|
62 | + \Aimeos\MAdmin\Cache\Manager\Factory::createManager($lcontext)->getCache()->flush(); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | } |
@@ -30,18 +30,18 @@ discard block |
||
30 | 30 | * @param string $classname Name of the setup task class |
31 | 31 | * @return boolean True if class is found, false if not |
32 | 32 | */ |
33 | - public static function autoload( $classname ) |
|
33 | + public static function autoload($classname) |
|
34 | 34 | { |
35 | - if( strncmp( $classname, 'Aimeos\\MW\\Setup\\Task\\', 21 ) === 0 ) |
|
35 | + if (strncmp($classname, 'Aimeos\\MW\\Setup\\Task\\', 21) === 0) |
|
36 | 36 | { |
37 | - $fileName = substr( $classname, 21 ) . '.php'; |
|
38 | - $paths = explode( PATH_SEPARATOR, get_include_path() ); |
|
37 | + $fileName = substr($classname, 21).'.php'; |
|
38 | + $paths = explode(PATH_SEPARATOR, get_include_path()); |
|
39 | 39 | |
40 | - foreach( $paths as $path ) |
|
40 | + foreach ($paths as $path) |
|
41 | 41 | { |
42 | - $file = $path . DIRECTORY_SEPARATOR . $fileName; |
|
42 | + $file = $path.DIRECTORY_SEPARATOR.$fileName; |
|
43 | 43 | |
44 | - if( file_exists( $file ) === true && ( include_once $file ) !== false ) { |
|
44 | + if (file_exists($file) === true && (include_once $file) !== false) { |
|
45 | 45 | return true; |
46 | 46 | } |
47 | 47 | } |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | */ |
57 | 57 | protected function configure() |
58 | 58 | { |
59 | - $this->setName( 'aimeos:setup'); |
|
60 | - $this->setDescription( 'Initialize or update the Aimeos database tables' ); |
|
61 | - $this->addArgument( 'site', InputArgument::OPTIONAL, 'Site for updating database entries', 'default' ); |
|
62 | - $this->addArgument( 'tplsite', InputArgument::OPTIONAL, 'Template site for creating or updating database entries', 'default' ); |
|
63 | - $this->addOption( 'option', null, InputOption::VALUE_REQUIRED, 'Optional setup configuration, name and value are separated by ":" like "setup/default/demo:1"', array() ); |
|
64 | - $this->addOption( 'action', null, InputOption::VALUE_REQUIRED, 'Action name that should be executed, i.e. "migrate", "rollback", "clean"', 'migrate' ); |
|
65 | - $this->addOption( 'task', null, InputOption::VALUE_REQUIRED, 'Name of the setup task that should be executed', null ); |
|
59 | + $this->setName('aimeos:setup'); |
|
60 | + $this->setDescription('Initialize or update the Aimeos database tables'); |
|
61 | + $this->addArgument('site', InputArgument::OPTIONAL, 'Site for updating database entries', 'default'); |
|
62 | + $this->addArgument('tplsite', InputArgument::OPTIONAL, 'Template site for creating or updating database entries', 'default'); |
|
63 | + $this->addOption('option', null, InputOption::VALUE_REQUIRED, 'Optional setup configuration, name and value are separated by ":" like "setup/default/demo:1"', array()); |
|
64 | + $this->addOption('action', null, InputOption::VALUE_REQUIRED, 'Action name that should be executed, i.e. "migrate", "rollback", "clean"', 'migrate'); |
|
65 | + $this->addOption('task', null, InputOption::VALUE_REQUIRED, 'Name of the setup task that should be executed', null); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | |
@@ -72,51 +72,51 @@ discard block |
||
72 | 72 | * @param InputInterface $input Input object |
73 | 73 | * @param OutputInterface $output Output object |
74 | 74 | */ |
75 | - protected function execute( InputInterface $input, OutputInterface $output ) |
|
75 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
76 | 76 | { |
77 | - $ctx = $this->getContainer()->get( 'aimeos_context' )->get( false, 'backend' ); |
|
78 | - $ctx->setEditor( 'aimeos:setup' ); |
|
77 | + $ctx = $this->getContainer()->get('aimeos_context')->get(false, 'backend'); |
|
78 | + $ctx->setEditor('aimeos:setup'); |
|
79 | 79 | |
80 | 80 | $config = $ctx->getConfig(); |
81 | - $site = $input->getArgument( 'site' ); |
|
82 | - $tplsite = $input->getArgument( 'tplsite' ); |
|
81 | + $site = $input->getArgument('site'); |
|
82 | + $tplsite = $input->getArgument('tplsite'); |
|
83 | 83 | |
84 | - $config->set( 'setup/site', $site ); |
|
85 | - $dbconfig = $this->getDbConfig( $config ); |
|
86 | - $this->setOptions( $config, $input ); |
|
84 | + $config->set('setup/site', $site); |
|
85 | + $dbconfig = $this->getDbConfig($config); |
|
86 | + $this->setOptions($config, $input); |
|
87 | 87 | |
88 | - $taskPaths = $this->getContainer()->get( 'aimeos' )->get()->getSetupPaths( $tplsite ); |
|
88 | + $taskPaths = $this->getContainer()->get('aimeos')->get()->getSetupPaths($tplsite); |
|
89 | 89 | |
90 | 90 | $includePaths = $taskPaths; |
91 | 91 | $includePaths[] = get_include_path(); |
92 | 92 | |
93 | - if( set_include_path( implode( PATH_SEPARATOR, $includePaths ) ) === false ) { |
|
94 | - throw new \Exception( 'Unable to extend include path' ); |
|
93 | + if (set_include_path(implode(PATH_SEPARATOR, $includePaths)) === false) { |
|
94 | + throw new \Exception('Unable to extend include path'); |
|
95 | 95 | } |
96 | 96 | |
97 | - spl_autoload_register( '\Aimeos\ShopBundle\Command\SetupCommand::autoload', true ); |
|
97 | + spl_autoload_register('\Aimeos\ShopBundle\Command\SetupCommand::autoload', true); |
|
98 | 98 | |
99 | - $manager = new \Aimeos\MW\Setup\Manager\Multiple( $ctx->getDatabaseManager(), $dbconfig, $taskPaths, $ctx ); |
|
99 | + $manager = new \Aimeos\MW\Setup\Manager\Multiple($ctx->getDatabaseManager(), $dbconfig, $taskPaths, $ctx); |
|
100 | 100 | |
101 | - $output->writeln( sprintf( 'Initializing or updating the Aimeos database tables for site <info>%1$s</info>', $site ) ); |
|
101 | + $output->writeln(sprintf('Initializing or updating the Aimeos database tables for site <info>%1$s</info>', $site)); |
|
102 | 102 | |
103 | - if( ( $task = $input->getOption( 'task' ) ) && is_array( $task ) ) { |
|
104 | - $task = reset( $task ); |
|
103 | + if (($task = $input->getOption('task')) && is_array($task)) { |
|
104 | + $task = reset($task); |
|
105 | 105 | } |
106 | 106 | |
107 | - switch( $input->getOption( 'action' ) ) |
|
107 | + switch ($input->getOption('action')) |
|
108 | 108 | { |
109 | 109 | case 'migrate': |
110 | - $manager->migrate( $task ); |
|
110 | + $manager->migrate($task); |
|
111 | 111 | break; |
112 | 112 | case 'rollback': |
113 | - $manager->rollback( $task ); |
|
113 | + $manager->rollback($task); |
|
114 | 114 | break; |
115 | 115 | case 'clean': |
116 | - $manager->clean( $task ); |
|
116 | + $manager->clean($task); |
|
117 | 117 | break; |
118 | 118 | default: |
119 | - throw new \Exception( sprintf( 'Invalid setup action "%1$s"', $input->getOption( 'action' ) ) ); |
|
119 | + throw new \Exception(sprintf('Invalid setup action "%1$s"', $input->getOption('action'))); |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 | |
@@ -127,14 +127,14 @@ discard block |
||
127 | 127 | * @param \Aimeos\MW\Config\Iface $conf Config object |
128 | 128 | * @return array Multi-dimensional associative list of database configuration parameters |
129 | 129 | */ |
130 | - protected function getDbConfig( \Aimeos\MW\Config\Iface $conf ) |
|
130 | + protected function getDbConfig(\Aimeos\MW\Config\Iface $conf) |
|
131 | 131 | { |
132 | - $dbconfig = $conf->get( 'resource', array() ); |
|
132 | + $dbconfig = $conf->get('resource', array()); |
|
133 | 133 | |
134 | - foreach( $dbconfig as $rname => $dbconf ) |
|
134 | + foreach ($dbconfig as $rname => $dbconf) |
|
135 | 135 | { |
136 | - if( strncmp( $rname, 'db', 2 ) !== 0 ) { |
|
137 | - unset( $dbconfig[$rname] ); |
|
136 | + if (strncmp($rname, 'db', 2) !== 0) { |
|
137 | + unset($dbconfig[$rname]); |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
@@ -150,12 +150,12 @@ discard block |
||
150 | 150 | * @param array Associative list of database configurations |
151 | 151 | * @throws \RuntimeException If the format of the options is invalid |
152 | 152 | */ |
153 | - protected function setOptions( \Aimeos\MW\Config\Iface $conf, InputInterface $input ) |
|
153 | + protected function setOptions(\Aimeos\MW\Config\Iface $conf, InputInterface $input) |
|
154 | 154 | { |
155 | - foreach( (array) $input->getOption( 'option' ) as $option ) |
|
155 | + foreach ((array) $input->getOption('option') as $option) |
|
156 | 156 | { |
157 | - list( $name, $value ) = explode( ':', $option ); |
|
158 | - $conf->set( $name, $value ); |
|
157 | + list($name, $value) = explode(':', $option); |
|
158 | + $conf->set($name, $value); |
|
159 | 159 | } |
160 | 160 | } |
161 | 161 | } |