@@ -695,6 +695,7 @@ |
||
695 | 695 | * @param string $path Configuration path to the sub-domains |
696 | 696 | * @param array $default List of sub-domains if no others are configured |
697 | 697 | * @param boolean $withsub Return also the resource type of sub-managers if true |
698 | + * @param string $type |
|
698 | 699 | * @return array Type of the manager and submanagers, subtypes are separated by slashes |
699 | 700 | */ |
700 | 701 | protected function getResourceTypeBase( $type, $path, array $default, $withsub ) |
@@ -668,8 +668,7 @@ |
||
668 | 668 | |
669 | 669 | if( isset( $attributes[$name] ) && $attributes[$name] instanceof $iface ) { |
670 | 670 | return $attributes[$name]->getInternalDeps(); |
671 | - } |
|
672 | - else if( isset( $attributes['id'] ) && $attributes['id'] instanceof $iface ) { |
|
671 | + } else if( isset( $attributes['id'] ) && $attributes['id'] instanceof $iface ) { |
|
673 | 672 | return $attributes['id']->getInternalDeps(); |
674 | 673 | } |
675 | 674 |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $conn = $dbm->acquire( $dbname ); |
274 | 274 | |
275 | 275 | $object = new \Aimeos\MW\Criteria\SQL( $conn ); |
276 | - $object->setConditions( $object->compare( '==', $domain . '.status', 1 ) ); |
|
276 | + $object->setConditions( $object->compare( '==', $domain.'.status', 1 ) ); |
|
277 | 277 | |
278 | 278 | $dbm->release( $conn, $dbname ); |
279 | 279 | |
@@ -376,9 +376,9 @@ discard block |
||
376 | 376 | protected function getSqlConfig( $path ) |
377 | 377 | { |
378 | 378 | $config = $this->getContext()->getConfig(); |
379 | - $adapter = $config->get( 'resource/' . $this->getResourceName() . '/adapter' ); |
|
379 | + $adapter = $config->get( 'resource/'.$this->getResourceName().'/adapter' ); |
|
380 | 380 | |
381 | - return $config->get( $path . '/' . $adapter, $config->get( $path . '/ansi', $path ) ); |
|
381 | + return $config->get( $path.'/'.$adapter, $config->get( $path.'/ansi', $path ) ); |
|
382 | 382 | } |
383 | 383 | |
384 | 384 | |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | { |
395 | 395 | $domain = strtolower( $domain ); |
396 | 396 | $manager = strtolower( $manager ); |
397 | - $key = $domain . $manager . $name; |
|
397 | + $key = $domain.$manager.$name; |
|
398 | 398 | |
399 | 399 | if( !isset( $this->subManagers[$key] ) ) |
400 | 400 | { |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | } |
408 | 408 | |
409 | 409 | if( $name === null ) { |
410 | - $path = 'mshop/' . $domain . '/manager/' . $manager . '/name'; |
|
410 | + $path = 'mshop/'.$domain.'/manager/'.$manager.'/name'; |
|
411 | 411 | $name = $this->context->getConfig()->get( $path, 'Standard' ); |
412 | 412 | } |
413 | 413 | |
@@ -418,8 +418,8 @@ discard block |
||
418 | 418 | $domainname = ucfirst( $domain ); |
419 | 419 | $subnames = $this->createSubNames( $manager ); |
420 | 420 | |
421 | - $classname = '\\Aimeos\\MShop\\' . $domainname . '\\Manager\\' . $subnames . '\\' . $name; |
|
422 | - $interface = '\\Aimeos\\MShop\\' . $domainname . '\\Manager\\' . $subnames . '\\Iface'; |
|
421 | + $classname = '\\Aimeos\\MShop\\'.$domainname.'\\Manager\\'.$subnames.'\\'.$name; |
|
422 | + $interface = '\\Aimeos\\MShop\\'.$domainname.'\\Manager\\'.$subnames.'\\Iface'; |
|
423 | 423 | |
424 | 424 | if( class_exists( $classname ) === false ) { |
425 | 425 | throw new \Aimeos\MShop\Exception( sprintf( 'Class "%1$s" not available', $classname ) ); |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | throw new \Aimeos\MShop\Exception( sprintf( 'Invalid characters in class name "%1$s"', $name ) ); |
459 | 459 | } |
460 | 460 | |
461 | - $classname = $classprefix . $name; |
|
461 | + $classname = $classprefix.$name; |
|
462 | 462 | |
463 | 463 | if( class_exists( $classname ) === false ) { |
464 | 464 | throw new \Aimeos\MShop\Exception( sprintf( 'Class "%1$s" not available', $classname ) ); |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | $config = $this->context->getConfig(); |
488 | 488 | |
489 | 489 | $decorators = $config->get( 'mshop/common/manager/decorators/default', [] ); |
490 | - $excludes = $config->get( 'mshop/' . $domain . '/manager/' . $managerpath . '/decorators/excludes', [] ); |
|
490 | + $excludes = $config->get( 'mshop/'.$domain.'/manager/'.$managerpath.'/decorators/excludes', [] ); |
|
491 | 491 | |
492 | 492 | foreach( $decorators as $key => $name ) |
493 | 493 | { |
@@ -500,12 +500,12 @@ discard block |
||
500 | 500 | $manager = $this->addDecorators( $this->context, $manager, $decorators, $classprefix ); |
501 | 501 | |
502 | 502 | $classprefix = '\\Aimeos\\MShop\\Common\\Manager\\Decorator\\'; |
503 | - $decorators = $config->get( 'mshop/' . $domain . '/manager/' . $managerpath . '/decorators/global', [] ); |
|
503 | + $decorators = $config->get( 'mshop/'.$domain.'/manager/'.$managerpath.'/decorators/global', [] ); |
|
504 | 504 | $manager = $this->addDecorators( $this->context, $manager, $decorators, $classprefix ); |
505 | 505 | |
506 | 506 | $subpath = $this->createSubNames( $managerpath ); |
507 | - $classprefix = 'MShop_' . ucfirst( $domain ) . '_Manager_' . $subpath . '_Decorator_'; |
|
508 | - $decorators = $config->get( 'mshop/' . $domain . '/manager/' . $managerpath . '/decorators/local', [] ); |
|
507 | + $classprefix = 'MShop_'.ucfirst( $domain ).'_Manager_'.$subpath.'_Decorator_'; |
|
508 | + $decorators = $config->get( 'mshop/'.$domain.'/manager/'.$managerpath.'/decorators/local', [] ); |
|
509 | 509 | |
510 | 510 | return $this->addDecorators( $this->context, $manager, $decorators, $classprefix ); |
511 | 511 | } |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | * @return \Aimeos\MShop\Common\Item\Iface Requested item |
544 | 544 | * @throws \Aimeos\MShop\Exception if no item with the given ID found |
545 | 545 | */ |
546 | - protected function findItemBase( array $pairs, array $ref, $default ) |
|
546 | + protected function findItemBase( array $pairs, array $ref, $default ) |
|
547 | 547 | { |
548 | 548 | $expr = []; |
549 | 549 | $criteria = $this->getObject()->createSearch( $default ); |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | { |
633 | 633 | $iface = '\\Aimeos\\MW\\Criteria\\Attribute\\Iface'; |
634 | 634 | $sep = $this->getKeySeparator(); |
635 | - $name = $prefix . $sep . 'id'; |
|
635 | + $name = $prefix.$sep.'id'; |
|
636 | 636 | |
637 | 637 | if( isset( $attributes[$name] ) && $attributes[$name] instanceof $iface ) { |
638 | 638 | return $attributes[$name]->getInternalDeps(); |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | { |
691 | 691 | $config = $this->context->getConfig(); |
692 | 692 | |
693 | - if( $config->get( 'resource/' . $name ) === null ) { |
|
693 | + if( $config->get( 'resource/'.$name ) === null ) { |
|
694 | 694 | $this->resourceName = $config->get( 'resource/default', 'db' ); |
695 | 695 | } else { |
696 | 696 | $this->resourceName = $name; |
@@ -760,7 +760,7 @@ discard block |
||
760 | 760 | |
761 | 761 | foreach( $keys as $key ) |
762 | 762 | { |
763 | - $name = $key . $sep . 'siteid'; |
|
763 | + $name = $key.$sep.'siteid'; |
|
764 | 764 | |
765 | 765 | if( isset( $attributes[$name] ) ) { |
766 | 766 | $cond[] = $search->compare( '==', $name, $siteIds ); |
@@ -848,7 +848,7 @@ discard block |
||
848 | 848 | $row = $results->fetch(); |
849 | 849 | $results->finish(); |
850 | 850 | |
851 | - $msg = get_class( $this ) . ' (' . ( ( microtime( true ) - $time ) * 1000 ) . 'ms): SQL = ' . $stmt; |
|
851 | + $msg = get_class( $this ).' ('.( ( microtime( true ) - $time ) * 1000 ).'ms): SQL = '.$stmt; |
|
852 | 852 | $this->context->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::DEBUG, 'core/sql' ); |
853 | 853 | |
854 | 854 | if( $row === false ) { |
@@ -866,7 +866,7 @@ discard block |
||
866 | 866 | $stmt = $conn->create( $sql->str() ); |
867 | 867 | $results = $stmt->execute(); |
868 | 868 | |
869 | - $msg = get_class( $this ) . ' (' . ( ( microtime( true ) - $time ) * 1000 ) . 'ms): SQL = ' . $stmt; |
|
869 | + $msg = get_class( $this ).' ('.( ( microtime( true ) - $time ) * 1000 ).'ms): SQL = '.$stmt; |
|
870 | 870 | $this->context->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::DEBUG, 'core/sql' ); |
871 | 871 | |
872 | 872 | return $results; |
@@ -892,7 +892,7 @@ discard block |
||
892 | 892 | $search->setConditions( $search->compare( '==', $name, $ids ) ); |
893 | 893 | |
894 | 894 | $types = array( $name => \Aimeos\MW\DB\Statement\Base::PARAM_STR ); |
895 | - $translations = array( $name => '"' . $name . '"' ); |
|
895 | + $translations = array( $name => '"'.$name.'"' ); |
|
896 | 896 | |
897 | 897 | $cond = $search->getConditionString( $types, $translations ); |
898 | 898 | $sql = str_replace( ':cond', $cond, $this->getSqlConfig( $cfgpath ) ); |
@@ -136,8 +136,7 @@ |
||
136 | 136 | $subList = self::createControllers( $it, $context, $aimeos, $pref ); |
137 | 137 | |
138 | 138 | $list = array_merge( $list, $subList ); |
139 | - } |
|
140 | - else if( $prefix !== '' && $entry->getType() === 'file' |
|
139 | + } else if( $prefix !== '' && $entry->getType() === 'file' |
|
141 | 140 | && ( $name = $entry->getBaseName( '.php' ) ) === 'Factory' ) |
142 | 141 | { |
143 | 142 | $list[$prefix] = self::createController( $context, $aimeos, $prefix ); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $parts[$key] = ucwords( $part ); |
57 | 57 | } |
58 | 58 | |
59 | - $factory = '\\Aimeos\\Controller\\Jobs\\' . join( '\\', $parts ) . '\\Factory'; |
|
59 | + $factory = '\\Aimeos\\Controller\\Jobs\\'.join( '\\', $parts ).'\\Factory'; |
|
60 | 60 | |
61 | 61 | if( class_exists( $factory ) === false ) { |
62 | 62 | throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Class "%1$s" not found', $factory ) ); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $cntlList = []; |
87 | 87 | $subFolder = trim( str_replace( '\\', '/', self::$prefix ), '/' ); |
88 | 88 | |
89 | - if( strncmp( $subFolder, 'Aimeos' . '/', 7 ) === 0 ) { |
|
89 | + if( strncmp( $subFolder, 'Aimeos'.'/', 7 ) === 0 ) { |
|
90 | 90 | $subFolder = substr( $subFolder, 7 ); |
91 | 91 | } |
92 | 92 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | { |
95 | 95 | foreach( $list as $relpath ) |
96 | 96 | { |
97 | - $path .= DIRECTORY_SEPARATOR . str_replace( '/', DIRECTORY_SEPARATOR, $relpath . '/' . $subFolder ); |
|
97 | + $path .= DIRECTORY_SEPARATOR.str_replace( '/', DIRECTORY_SEPARATOR, $relpath.'/'.$subFolder ); |
|
98 | 98 | |
99 | 99 | if( is_dir( $path ) ) |
100 | 100 | { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | { |
133 | 133 | $name = strtolower( $entry->getBaseName() ); |
134 | 134 | $it = new \DirectoryIterator( $entry->getPathName() ); |
135 | - $pref = ( $prefix !== '' ? $prefix . '/' : '' ) . $name; |
|
135 | + $pref = ( $prefix !== '' ? $prefix.'/' : '' ).$name; |
|
136 | 136 | $subList = self::createControllers( $it, $context, $aimeos, $pref ); |
137 | 137 | |
138 | 138 | $list = array_merge( $list, $subList ); |
@@ -72,8 +72,7 @@ |
||
72 | 72 | { |
73 | 73 | $this->executeList( $stmts ); |
74 | 74 | $this->status( 'migrated' ); |
75 | - } |
|
76 | - else |
|
75 | + } else |
|
77 | 76 | { |
78 | 77 | $this->status( 'OK' ); |
79 | 78 | } |
@@ -65,8 +65,7 @@ |
||
65 | 65 | { |
66 | 66 | $this->executeList( $stmts ); |
67 | 67 | $this->status( 'added' ); |
68 | - } |
|
69 | - else |
|
68 | + } else |
|
70 | 69 | { |
71 | 70 | $this->status( 'OK' ); |
72 | 71 | } |
@@ -71,8 +71,7 @@ |
||
71 | 71 | { |
72 | 72 | $this->execute( $stmt ); |
73 | 73 | $this->status( 'done' ); |
74 | - } |
|
75 | - else |
|
74 | + } else |
|
76 | 75 | { |
77 | 76 | $this->status( 'OK' ); |
78 | 77 | } |
@@ -172,8 +172,7 @@ |
||
172 | 172 | { |
173 | 173 | $this->executeList( $stmtList ); |
174 | 174 | $this->status( 'migrated' ); |
175 | - } |
|
176 | - else |
|
175 | + } else |
|
177 | 176 | { |
178 | 177 | $this->status( 'OK' ); |
179 | 178 | } |
@@ -90,8 +90,7 @@ |
||
90 | 90 | { |
91 | 91 | $this->executeList( $stmts, 'db-coupon' ); |
92 | 92 | $this->status( 'done' ); |
93 | - } |
|
94 | - else |
|
93 | + } else |
|
95 | 94 | { |
96 | 95 | $this->status( 'OK' ); |
97 | 96 | } |
@@ -109,8 +109,7 @@ |
||
109 | 109 | { |
110 | 110 | $this->executeList( $stmtList ); |
111 | 111 | $this->status( 'added' ); |
112 | - } |
|
113 | - else |
|
112 | + } else |
|
114 | 113 | { |
115 | 114 | $this->status( 'OK' ); |
116 | 115 | } |
@@ -115,10 +115,14 @@ |
||
115 | 115 | $item->setPosition( $dataset['position'] ); |
116 | 116 | } |
117 | 117 | |
118 | - try { |
|
118 | + try |
|
119 | + { |
|
119 | 120 | $pluginManager->saveItem( $item ); |
120 | 121 | $num++; |
121 | - } catch( \Exception $e ) {; } // if plugin configuration was already available |
|
122 | + } |
|
123 | + catch( \Exception $e ) |
|
124 | + { |
|
125 | +; } // if plugin configuration was already available |
|
122 | 126 | } |
123 | 127 | |
124 | 128 | $this->status( $num > 0 ? $num . '/' . $total : 'OK' ); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $pluginManager = \Aimeos\MShop\Plugin\Manager\Factory::createManager( $this->additional, 'Standard' ); |
65 | 65 | |
66 | 66 | |
67 | - $filename = __DIR__ . $ds . 'default' . $ds . 'data' . $ds . 'plugin.php'; |
|
67 | + $filename = __DIR__.$ds.'default'.$ds.'data'.$ds.'plugin.php'; |
|
68 | 68 | |
69 | 69 | if( ( $data = include( $filename ) ) == false ) { |
70 | 70 | throw new \Aimeos\MW\Setup\Exception( sprintf( 'No data file "%1$s" found', $filename ) ); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $manager = $pluginManager->getSubManager( 'type' ); |
91 | 91 | |
92 | 92 | foreach( $manager->searchItems( $manager->createSearch() ) as $item ) { |
93 | - $types['plugin/' . $item->getCode()] = $item; |
|
93 | + $types['plugin/'.$item->getCode()] = $item; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | $num = $total = 0; |
@@ -121,6 +121,6 @@ discard block |
||
121 | 121 | } catch( \Exception $e ) {; } // if plugin configuration was already available |
122 | 122 | } |
123 | 123 | |
124 | - $this->status( $num > 0 ? $num . '/' . $total : 'OK' ); |
|
124 | + $this->status( $num > 0 ? $num.'/'.$total : 'OK' ); |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | \ No newline at end of file |