@@ -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 | } |
@@ -33,14 +33,14 @@ |
||
33 | 33 | public function __invoke( $resource ) |
34 | 34 | { |
35 | 35 | /** |
36 | - * @var Zend\Permissions\Acl\Acl $acl |
|
36 | + * @var Zend\Permissions\Acl\Acl $acl |
|
37 | 37 | **/ |
38 | 38 | $acl = $this->view->navigation()->getAcl(); |
39 | 39 | if (empty($resource) || !$acl->hasResource($resource) ) { |
40 | 40 | return true; |
41 | 41 | } |
42 | 42 | /** |
43 | - * @var \Admin\Entity\User $user |
|
43 | + * @var \Admin\Entity\User $user |
|
44 | 44 | **/ |
45 | 45 | $user = $this->view->zfcUserIdentity(); // ->getIdentity(); |
46 | 46 | if ($user) { // ($this->getAuthService()->hasIdentity()) { |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | * @access public |
31 | 31 | * @return \ZfcUser\Entity\UserInterface |
32 | 32 | */ |
33 | - public function __invoke( $resource ) |
|
33 | + public function __invoke($resource) |
|
34 | 34 | { |
35 | 35 | /** |
36 | 36 | * @var Zend\Permissions\Acl\Acl $acl |
37 | 37 | **/ |
38 | 38 | $acl = $this->view->navigation()->getAcl(); |
39 | - if (empty($resource) || !$acl->hasResource($resource) ) { |
|
39 | + if (empty($resource) || !$acl->hasResource($resource)) { |
|
40 | 40 | return true; |
41 | 41 | } |
42 | 42 | /** |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } else { |
50 | 50 | $role = 'public'; |
51 | 51 | } |
52 | - return ( $acl->isAllowed($role, $resource) ); |
|
52 | + return ($acl->isAllowed($role, $resource)); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -33,14 +33,14 @@ |
||
33 | 33 | public function __invoke( $resource ) |
34 | 34 | { |
35 | 35 | /** |
36 | - * @var \Zend\Permissions\Acl\Acl $acl |
|
36 | + * @var \Zend\Permissions\Acl\Acl $acl |
|
37 | 37 | **/ |
38 | 38 | $acl = $this->view->navigation()->getAcl(); |
39 | 39 | if (empty($resource) || !$acl->hasResource($resource) ) { |
40 | 40 | return true; |
41 | 41 | } |
42 | 42 | /** |
43 | - * @var \Admin\Entity\User $user |
|
43 | + * @var \Admin\Entity\User $user |
|
44 | 44 | **/ |
45 | 45 | $user = $this->view->zfcUserIdentity(); // ->getIdentity(); |
46 | 46 | if ($user) { // ($this->getAuthService()->hasIdentity()) { |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | * @access public |
31 | 31 | * @return \ZfcUser\Entity\UserInterface |
32 | 32 | */ |
33 | - public function __invoke( $resource ) |
|
33 | + public function __invoke($resource) |
|
34 | 34 | { |
35 | 35 | /** |
36 | 36 | * @var \Zend\Permissions\Acl\Acl $acl |
37 | 37 | **/ |
38 | 38 | $acl = $this->view->navigation()->getAcl(); |
39 | - if (empty($resource) || !$acl->hasResource($resource) ) { |
|
39 | + if (empty($resource) || !$acl->hasResource($resource)) { |
|
40 | 40 | return true; |
41 | 41 | } |
42 | 42 | /** |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } else { |
50 | 50 | $role = 'public'; |
51 | 51 | } |
52 | - return ( !$acl->isAllowed($role, $resource) ); |
|
52 | + return (!$acl->isAllowed($role, $resource)); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -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 | /** |
@@ -22,7 +22,7 @@ |
||
22 | 22 | */ |
23 | 23 | public function getToolbarItems() |
24 | 24 | { |
25 | - return $this->toolbarItems ; |
|
25 | + return $this->toolbarItems; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -22,7 +22,7 @@ |
||
22 | 22 | */ |
23 | 23 | trait ControllerTranslatorTrait { |
24 | 24 | |
25 | - /** |
|
25 | + /** |
|
26 | 26 | * |
27 | 27 | * @var \Zend\I18n\Translator\Translator |
28 | 28 | */ |
@@ -64,7 +64,7 @@ |
||
64 | 64 | */ |
65 | 65 | public function translate($message, $textdomain = 'default', $locale = null) |
66 | 66 | { |
67 | - return ( $this->getTranslator()->translate($message, $textdomain, $locale) ); |
|
67 | + return ($this->getTranslator()->translate($message, $textdomain, $locale)); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | } |