@@ -70,7 +70,7 @@ |
||
70 | 70 | 'state' => $Acl->state, |
71 | 71 | ); |
72 | 72 | |
73 | - $id = (int)$Acl->acl_id; |
|
73 | + $id = (int) $Acl->acl_id; |
|
74 | 74 | if ($id == 0) { |
75 | 75 | $this->tableGateway->insert($data); |
76 | 76 | } else { |
@@ -34,10 +34,10 @@ |
||
34 | 34 | |
35 | 35 | public function exchangeArray($data) |
36 | 36 | { |
37 | - $this->acl_id = (isset($data['acl_id'])) ? $data['acl_id'] : null; |
|
37 | + $this->acl_id = (isset($data['acl_id'])) ? $data['acl_id'] : null; |
|
38 | 38 | $this->aclroles_id = (isset($data['aclroles_id'])) ? $data['aclroles_id'] : null; |
39 | 39 | $this->aclresources_id = (isset($data['aclresources_id'])) ? $data['aclresources_id'] : null; |
40 | - $this->state = (isset($data['state'])) ? $data['state'] : null; |
|
40 | + $this->state = (isset($data['state'])) ? $data['state'] : null; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | public function getArrayCopy() |
@@ -33,7 +33,7 @@ |
||
33 | 33 | |
34 | 34 | public function exchangeArray($data) |
35 | 35 | { |
36 | - $this->aclroles_id = (isset($data['aclroles_id'])) ? $data['aclroles_id'] : null; |
|
36 | + $this->aclroles_id = (isset($data['aclroles_id'])) ? $data['aclroles_id'] : null; |
|
37 | 37 | $this->roleslug = (isset($data['roleslug'])) ? $data['roleslug'] : null; |
38 | 38 | $this->rolename = (isset($data['rolename'])) ? $data['rolename'] : null; |
39 | 39 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | array( |
66 | 66 | 'html' => $htmlOutput, |
67 | 67 | 'jsonVar1' => 'jsonVal2', |
68 | - 'jsonArray' => array(1,2,3,4,5,6) |
|
68 | + 'jsonArray' => array(1, 2, 3, 4, 5, 6) |
|
69 | 69 | ) |
70 | 70 | ); |
71 | 71 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | 'jsonArray' => array(1, 2, 3, 4, 5, 6) |
85 | 85 | ); |
86 | 86 | $isAjax = $this->getRequest()->isXmlHttpRequest(); |
87 | - return isAjax?new JsonModel($data):new ViewModel($data); |
|
87 | + return isAjax ? new JsonModel($data) : new ViewModel($data); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -78,7 +78,7 @@ |
||
78 | 78 | $tableQueries = array(); |
79 | 79 | foreach ($tables as $table) { //while ($table = $tables->current()) { |
80 | 80 | $tableName = $table["Tables_in_".$config["db"]["database"]]; |
81 | - // describe tables |
|
81 | + // describe tables |
|
82 | 82 | $tableSql = $db->query("SHOW CREATE TABLE `" . $tableName . "`;"); |
83 | 83 | $tableCreate = $tableSql->execute(); |
84 | 84 | $tableSpec = $tableCreate->current(); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | public function updatedbAction() |
54 | 54 | { |
55 | 55 | |
56 | - echo 'update database structure...' . PHP_EOL; |
|
56 | + echo 'update database structure...'.PHP_EOL; |
|
57 | 57 | |
58 | 58 | $request = $this->getRequest(); |
59 | 59 | $db = $this->getServiceLocator()->get('Zend\Db\Adapter\Adapter'); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $only_testing = $request->getParam('test', false); |
70 | 70 | $be_verbose = $request->getParam('verbose', false); |
71 | 71 | |
72 | - if ($be_verbose) { echo 'current path: ' . getcwd() . PHP_EOL; |
|
72 | + if ($be_verbose) { echo 'current path: '.getcwd().PHP_EOL; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | // get tables |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | foreach ($tables as $table) { //while ($table = $tables->current()) { |
80 | 80 | $tableName = $table["Tables_in_".$config["db"]["database"]]; |
81 | 81 | // describe tables |
82 | - $tableSql = $db->query("SHOW CREATE TABLE `" . $tableName . "`;"); |
|
82 | + $tableSql = $db->query("SHOW CREATE TABLE `".$tableName."`;"); |
|
83 | 83 | $tableCreate = $tableSql->execute(); |
84 | 84 | $tableSpec = $tableCreate->current(); |
85 | 85 | $tableQueries[] = $tableSpec["Create Table"].";"; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $currentStructure = implode("\n", $tableQueries); |
88 | 88 | |
89 | 89 | // read INSTALL.SQL |
90 | - $filename = getcwd() ."". "/sql/install.sql"; |
|
90 | + $filename = getcwd().""."/sql/install.sql"; |
|
91 | 91 | $installSQL = file_get_contents($filename); |
92 | 92 | //file_put_contents(getcwd() ."". "/sql/current.sql", $currentStructure); |
93 | 93 | |
@@ -97,38 +97,38 @@ discard block |
||
97 | 97 | $compareResult = $structureUpdater->getUpdates($currentStructure, $installSQL); |
98 | 98 | //$compareResult = $structureUpdater->getUpdates($installSQL, $currentStructure); |
99 | 99 | } catch (\Exception $ex) { |
100 | - echo 'ERROR COMPARING DATABASE STRUCTURE! ' . PHP_EOL; |
|
101 | - if ($be_verbose) { echo 'EXCEPTION: ' . PHP_EOL . print_r($ex, true) . PHP_EOL; |
|
100 | + echo 'ERROR COMPARING DATABASE STRUCTURE! '.PHP_EOL; |
|
101 | + if ($be_verbose) { echo 'EXCEPTION: '.PHP_EOL.print_r($ex, true).PHP_EOL; |
|
102 | 102 | } |
103 | 103 | } |
104 | - if (!is_array($compareResult) || (count($compareResult) < 1) ) { |
|
105 | - echo '...database is up-to-date, no actions needed.' . PHP_EOL; |
|
104 | + if (!is_array($compareResult) || (count($compareResult) < 1)) { |
|
105 | + echo '...database is up-to-date, no actions needed.'.PHP_EOL; |
|
106 | 106 | return 0; |
107 | 107 | } |
108 | 108 | |
109 | 109 | // transaction(!): update db |
110 | 110 | |
111 | 111 | if ($only_testing) { |
112 | - echo 'testing mode...' . PHP_EOL; |
|
113 | - echo 'detected sql update statements:' . PHP_EOL; |
|
114 | - echo implode(";\n", $compareResult).";" . PHP_EOL; |
|
112 | + echo 'testing mode...'.PHP_EOL; |
|
113 | + echo 'detected sql update statements:'.PHP_EOL; |
|
114 | + echo implode(";\n", $compareResult).";".PHP_EOL; |
|
115 | 115 | } else { |
116 | 116 | try { |
117 | 117 | $dbConnection = $db->getDriver()->getConnection(); |
118 | 118 | $dbConnection->beginTransaction(); |
119 | 119 | foreach ($compareResult as $updateSql) { |
120 | - if ($be_verbose) { echo 'executing sql: ' . $updateSql . PHP_EOL; |
|
120 | + if ($be_verbose) { echo 'executing sql: '.$updateSql.PHP_EOL; |
|
121 | 121 | } |
122 | 122 | $dbupdate = $db->query($updateSql); |
123 | 123 | $updateResult = $dbupdate->execute(); |
124 | - if ($be_verbose) { echo '...done' . PHP_EOL; |
|
124 | + if ($be_verbose) { echo '...done'.PHP_EOL; |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | $dbConnection->commit(); |
128 | 128 | } catch (\Exception $ex) { |
129 | 129 | $dbConnection->rollback(); |
130 | - echo 'ERROR COMPARING DATABASE STRUCTURE! ' . PHP_EOL; |
|
131 | - if ($be_verbose) { echo 'EXCEPTION: ' . PHP_EOL . print_r($ex, true) . PHP_EOL; |
|
130 | + echo 'ERROR COMPARING DATABASE STRUCTURE! '.PHP_EOL; |
|
131 | + if ($be_verbose) { echo 'EXCEPTION: '.PHP_EOL.print_r($ex, true).PHP_EOL; |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | */ |
23 | 23 | public function getActionTitles() |
24 | 24 | { |
25 | - return $this->actionTitles ; |
|
25 | + return $this->actionTitles; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | */ |
35 | 35 | class BaseActionController extends AbstractActionController implements Dispatchable |
36 | 36 | { |
37 | - //use ServiceLocatorAwareTrait; |
|
38 | - use ControllerTranslatorTrait; |
|
39 | - use ControllerActiontitlesTrait; |
|
40 | - use ControllerToolbarTrait; |
|
37 | + //use ServiceLocatorAwareTrait; |
|
38 | + use ControllerTranslatorTrait; |
|
39 | + use ControllerActiontitlesTrait; |
|
40 | + use ControllerToolbarTrait; |
|
41 | 41 | |
42 | 42 | //protected $serviceLocator; |
43 | 43 | |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function __construct( ServiceLocatorInterface $serviceLocator ) |
50 | 50 | { |
51 | - if ( $serviceLocator ) { |
|
52 | - $this->setServiceLocator($serviceLocator); |
|
53 | - } |
|
51 | + if ( $serviceLocator ) { |
|
52 | + $this->setServiceLocator($serviceLocator); |
|
53 | + } |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -147,17 +147,17 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function isXHR() |
149 | 149 | { |
150 | - /** |
|
151 | - * @var \Zend\Http\PhpEnvironment\Request|\Zend\Http\Request $request |
|
152 | - */ |
|
153 | - $request = $this->getRequest(); |
|
154 | - if ( |
|
155 | - ($request instanceof \Zend\Http\PhpEnvironment\Request) || |
|
156 | - ($request instanceof \Zend\Http\Request) |
|
157 | - ) { |
|
158 | - return ( $request->isXmlHttpRequest() ); |
|
159 | - } |
|
160 | - return (false); |
|
150 | + /** |
|
151 | + * @var \Zend\Http\PhpEnvironment\Request|\Zend\Http\Request $request |
|
152 | + */ |
|
153 | + $request = $this->getRequest(); |
|
154 | + if ( |
|
155 | + ($request instanceof \Zend\Http\PhpEnvironment\Request) || |
|
156 | + ($request instanceof \Zend\Http\Request) |
|
157 | + ) { |
|
158 | + return ( $request->isXmlHttpRequest() ); |
|
159 | + } |
|
160 | + return (false); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | * basic constructor injecting global service manager/locator |
47 | 47 | * @return self |
48 | 48 | */ |
49 | - public function __construct( ServiceLocatorInterface $serviceLocator ) |
|
49 | + public function __construct(ServiceLocatorInterface $serviceLocator) |
|
50 | 50 | { |
51 | - if ( $serviceLocator ) { |
|
51 | + if ($serviceLocator) { |
|
52 | 52 | $this->setServiceLocator($serviceLocator); |
53 | 53 | } |
54 | 54 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | { |
135 | 135 | |
136 | 136 | $oAuth = $this->getServiceLocator()->get('zfcuser_auth_service'); |
137 | - if ($oAuth->hasIdentity() ) { |
|
137 | + if ($oAuth->hasIdentity()) { |
|
138 | 138 | return $oAuth->getIdentity(); |
139 | 139 | } |
140 | 140 | return null; |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | ($request instanceof \Zend\Http\PhpEnvironment\Request) || |
156 | 156 | ($request instanceof \Zend\Http\Request) |
157 | 157 | ) { |
158 | - return ( $request->isXmlHttpRequest() ); |
|
158 | + return ($request->isXmlHttpRequest()); |
|
159 | 159 | } |
160 | 160 | return (false); |
161 | 161 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | * @param array $vars [optional] additional variables |
180 | 180 | * @return array |
181 | 181 | */ |
182 | - public function getTemplateVars( $vars = array() ) |
|
182 | + public function getTemplateVars($vars = array()) |
|
183 | 183 | { |
184 | 184 | $result = (array_merge( |
185 | 185 | $this->params()->fromRoute(), |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * |
13 | 13 | * @param ServiceLocatorInterface $serviceLocator |
14 | 14 | * |
15 | - * @return mixed |
|
15 | + * @return IndexController |
|
16 | 16 | */ |
17 | 17 | public function createService(ServiceLocatorInterface $serviceLocator) |
18 | 18 | { |
@@ -42,7 +42,7 @@ |
||
42 | 42 | */ |
43 | 43 | public function render($container = null) |
44 | 44 | { |
45 | - $config = new \Zend\Config\Config( $this->getServiceLocator()->getServiceLocator()->get('Config') ); |
|
45 | + $config = new \Zend\Config\Config($this->getServiceLocator()->getServiceLocator()->get('Config')); |
|
46 | 46 | return $config; |
47 | 47 | } |
48 | 48 |