@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | OutputStream::start(); |
16 | 16 | |
17 | 17 | if (!file_exists(RESULTS_PATH) || is_file(RESULTS_PATH)) { |
18 | - OutputStream::msg(OutputStream::MSG_ERROR, "Destination directory '".RESULTS_PATH."' doesn't exists."); |
|
18 | + OutputStream::msg(OutputStream::MSG_ERROR, "Destination directory '" . RESULTS_PATH . "' doesn't exists."); |
|
19 | 19 | OutputStream::close(); |
20 | 20 | exit(); |
21 | 21 | } |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | if ($stmt !== false) { |
27 | 27 | $tpl = file_get_contents(CLASS_TPL); |
28 | 28 | while ($resultSet = DBCore::bindResults($stmt)) { |
29 | - $tableName = $resultSet['TABLE_NAMES']['Tables_in_'.conf\Config::getDBConfigParam('DBNAME')]; |
|
29 | + $tableName = $resultSet['TABLE_NAMES']['Tables_in_' . conf\Config::getDBConfigParam('DBNAME')]; |
|
30 | 30 | |
31 | - OutputStream::msg(OutputStream::MSG_INFO, "Reading structure for table '".$tableName."'..."); |
|
31 | + OutputStream::msg(OutputStream::MSG_INFO, "Reading structure for table '" . $tableName . "'..."); |
|
32 | 32 | |
33 | 33 | $idFieldName = 'id'; |
34 | 34 | $fieldsListStr = ''; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | if ($attributes['key'] === 'PRI') { |
39 | 39 | $idFieldName = $field; |
40 | 40 | } |
41 | - $fieldsListStr .= ' '.DBCore::getPrintableFieldString($field, $attributes); |
|
41 | + $fieldsListStr .= ' ' . DBCore::getPrintableFieldString($field, $attributes); |
|
42 | 42 | } |
43 | 43 | $fieldsListStr = substr($fieldsListStr, 0, strlen($fieldsListStr) - 1); |
44 | 44 | |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | date('Y'), AUTHOR, EMAIL, |
53 | 53 | ], $tpl); |
54 | 54 | |
55 | - file_put_contents(RESULTS_PATH.$className.'.php', $content); |
|
55 | + file_put_contents(RESULTS_PATH . $className . '.php', $content); |
|
56 | 56 | |
57 | - OutputStream::msg(OutputStream::MSG_SUCCESS, "Class '".RESULTS_PATH.$className.".php' generated."); |
|
57 | + OutputStream::msg(OutputStream::MSG_SUCCESS, "Class '" . RESULTS_PATH . $className . ".php' generated."); |
|
58 | 58 | } else { |
59 | - OutputStream::msg(OutputStream::MSG_ERROR, "Can't read structure for table '".$tableName."'."); |
|
59 | + OutputStream::msg(OutputStream::MSG_ERROR, "Can't read structure for table '" . $tableName . "'."); |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | { |
71 | 71 | $underlinesReplaced = preg_replace_callback( |
72 | 72 | '/_([a-zA-Z]{1})/', |
73 | - function ($matches) { |
|
73 | + function($matches) { |
|
74 | 74 | return strtoupper($matches[1]); |
75 | 75 | }, |
76 | 76 | $tableName |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | session_start(); |
4 | -header('X-Powered-By: Asymptix PHP Framework, PHP/'.phpversion()); |
|
4 | +header('X-Powered-By: Asymptix PHP Framework, PHP/' . phpversion()); |
|
5 | 5 | |
6 | 6 | require_once 'modules/autoload.php'; |
7 | 7 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * Pagination |
40 | 40 | */ |
41 | 41 | if (isset($_ARGS['pn'])) { |
42 | - $_REQUEST['pn'] = (int) $_ARGS['pn']; |
|
42 | + $_REQUEST['pn'] = (int)$_ARGS['pn']; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | $_ROUTE = new Route($request); |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | if ($_ROUTE->isBackend) { |
71 | - require_once 'controllers/backend/'.$_ROUTE->controller.'.php'; |
|
71 | + require_once 'controllers/backend/' . $_ROUTE->controller . '.php'; |
|
72 | 72 | require_once 'templates/backend/master.tpl.php'; |
73 | 73 | } else { |
74 | - require_once 'controllers/frontend/'.$_ROUTE->controller.'.php'; |
|
74 | + require_once 'controllers/frontend/' . $_ROUTE->controller . '.php'; |
|
75 | 75 | require_once 'templates/frontend/master.tpl.php'; |
76 | 76 | } |
@@ -15,8 +15,8 @@ |
||
15 | 15 | use Asymptix\web\Request; |
16 | 16 | |
17 | 17 | // Set and Reset filter submit fields names may be changed. |
18 | -$setFilter = (bool) Request::getFieldValue('setFilter'); |
|
19 | -$resetFilter = (bool) Request::getFieldValue('resetFilter'); |
|
18 | +$setFilter = (bool)Request::getFieldValue('setFilter'); |
|
19 | +$resetFilter = (bool)Request::getFieldValue('resetFilter'); |
|
20 | 20 | |
21 | 21 | if (isset($_SESSION['_filter'])) { |
22 | 22 | $_FILTER = unserialize($_SESSION['_filter']); |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | Config::getDBConfigParam('USER'), Config::getDBConfigParam('PASSWORD'), |
21 | 21 | Config::getDBConfigParam('DBNAME')); |
22 | 22 | if ($mysqli->connect_error) { |
23 | - die('Connect Error ('.$mysqli->connect_errno.') '.$mysqli->connect_error); |
|
23 | + die('Connect Error (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error); |
|
24 | 24 | } else { |
25 | 25 | if (!$mysqli->set_charset(Config::getDBConfigParam('DB_CHARSET'))) { |
26 | - printf('Error loading character set '.Config::getDBConfigParam('DB_CHARSET').": %s\n", $mysqli->error); |
|
26 | + printf('Error loading character set ' . Config::getDBConfigParam('DB_CHARSET') . ": %s\n", $mysqli->error); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | $manager = DBCore::getInstance(); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | // Register a shutdown function which will close DB connection |
36 | -register_shutdown_function(function () { |
|
36 | +register_shutdown_function(function() { |
|
37 | 37 | global $manager; |
38 | 38 | |
39 | 39 | $conns = $manager->getConnections(); |
@@ -24,16 +24,16 @@ discard block |
||
24 | 24 | { |
25 | 25 | $paramsString = ''; |
26 | 26 | foreach ($params as $key => $value) { |
27 | - $paramsString .= '&'.$key.'='.$value; |
|
27 | + $paramsString .= '&' . $key . '=' . $value; |
|
28 | 28 | } |
29 | 29 | if ($session) { |
30 | - $paramsString .= '&'.session_name().'='.session_id(); |
|
30 | + $paramsString .= '&' . session_name() . '=' . session_id(); |
|
31 | 31 | } |
32 | 32 | $paramsString = substr($paramsString, 1); |
33 | 33 | if ($paramsString) { |
34 | - $paramsString = '?'.$paramsString; |
|
34 | + $paramsString = '?' . $paramsString; |
|
35 | 35 | } |
36 | - header('Location: '.$url.$paramsString); |
|
36 | + header('Location: ' . $url . $paramsString); |
|
37 | 37 | exit(); |
38 | 38 | } |
39 | 39 | } |
@@ -125,13 +125,13 @@ discard block |
||
125 | 125 | case 505: $text = 'HTTP Version not supported'; |
126 | 126 | break; |
127 | 127 | default: |
128 | - exit('Unknown http status code "'.htmlentities($code).'"'); |
|
128 | + exit('Unknown http status code "' . htmlentities($code) . '"'); |
|
129 | 129 | break; |
130 | 130 | } |
131 | 131 | |
132 | 132 | $protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0'); |
133 | 133 | |
134 | - header($protocol.' '.$code.' '.$text); |
|
134 | + header($protocol . ' ' . $code . ' ' . $text); |
|
135 | 135 | |
136 | 136 | $GLOBALS['http_response_code'] = $code; |
137 | 137 | } else { |
@@ -23,4 +23,4 @@ |
||
23 | 23 | $_LANG = Languages::getLanguage($_SESSION['lang']); |
24 | 24 | $_SESSION['lang'] = $_LANG->code; |
25 | 25 | |
26 | -require_once realpath(dirname(__FILE__)).'/../conf/langs/'.$_LANG->code.'.php'; |
|
26 | +require_once realpath(dirname(__FILE__)) . '/../conf/langs/' . $_LANG->code . '.php'; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * |
13 | 13 | * @license http://opensource.org/licenses/MIT |
14 | 14 | */ |
15 | -register_shutdown_function(function () { |
|
15 | +register_shutdown_function(function() { |
|
16 | 16 | $error = error_get_last(); |
17 | 17 | |
18 | 18 | if ($error !== null) { |
@@ -20,13 +20,13 @@ discard block |
||
20 | 20 | $error['type'], |
21 | 21 | $_SERVER['SCRIPT_NAME'], |
22 | 22 | $error['file'], |
23 | - (int) $error['line'], |
|
23 | + (int)$error['line'], |
|
24 | 24 | $error['message'] |
25 | 25 | ); |
26 | 26 | } |
27 | 27 | }); |
28 | 28 | |
29 | -set_error_handler(function ($errno, $msg, $file, $line) { |
|
29 | +set_error_handler(function($errno, $msg, $file, $line) { |
|
30 | 30 | \db\tools\ErrorLog::log( |
31 | 31 | $errno, |
32 | 32 | $_SERVER['SCRIPT_NAME'], |
@@ -16,17 +16,17 @@ |
||
16 | 16 | |
17 | 17 | $_PATH = $deepness > 0 ? implode('', array_fill(0, $deepness, '../')) : './'; |
18 | 18 | |
19 | -require_once $_PATH.'vendor/autoload.php'; |
|
20 | -spl_autoload_register(function ($className) { |
|
19 | +require_once $_PATH . 'vendor/autoload.php'; |
|
20 | +spl_autoload_register(function($className) { |
|
21 | 21 | global $_PATH; |
22 | 22 | |
23 | 23 | $path = explode('\\', $className); |
24 | 24 | if (in_array($path[0], ['conf'])) { |
25 | - $includePath = $_PATH.str_replace('\\', '/', $className.'.php'); |
|
25 | + $includePath = $_PATH . str_replace('\\', '/', $className . '.php'); |
|
26 | 26 | } else { |
27 | - $includePath = $_PATH.'classes/'.str_replace('\\', '/', $className.'.php'); |
|
27 | + $includePath = $_PATH . 'classes/' . str_replace('\\', '/', $className . '.php'); |
|
28 | 28 | } |
29 | 29 | require_once $includePath; |
30 | 30 | }); |
31 | 31 | |
32 | -require_once $_PATH.'modules/error_log.php'; |
|
32 | +require_once $_PATH . 'modules/error_log.php'; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | return $this->sendNotification( |
35 | 35 | Config::EMAIL_ADMIN, |
36 | - "New user signup: '".$user->username."'", |
|
36 | + "New user signup: '" . $user->username . "'", |
|
37 | 37 | $_LANG->code, |
38 | 38 | 'signup_admin_email', |
39 | 39 | [ |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | global $_LANG; |
62 | 62 | |
63 | 63 | if (!Validator::isEmail($user->email)) { |
64 | - throw new \Exception("Invalid email: '".$user->email."'"); |
|
64 | + throw new \Exception("Invalid email: '" . $user->email . "'"); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | return $this->sendNotification( |