@@ -47,11 +47,11 @@ |
||
| 47 | 47 | * Try to load classes from different places. If not found in one place - try in another. |
| 48 | 48 | */ |
| 49 | 49 | if ( |
| 50 | - _require_once($file = DIR."/core/classes/$namespace/$class_name.php", false) || //Core classes |
|
| 50 | + _require_once($file = DIR."/core/classes/$namespace/$class_name.php", false) || //Core classes |
|
| 51 | 51 | _require_once($file = DIR."/core/thirdparty/$namespace/$class_name.php", false) || //Third party classes |
| 52 | - _require_once($file = DIR."/core/traits/$namespace/$class_name.php", false) || //Core traits |
|
| 53 | - _require_once($file = ENGINES."/$namespace/$class_name.php", false) || //Core engines |
|
| 54 | - _require_once($file = MODULES."/../$namespace/$class_name.php", false) || //Classes in modules |
|
| 52 | + _require_once($file = DIR."/core/traits/$namespace/$class_name.php", false) || //Core traits |
|
| 53 | + _require_once($file = ENGINES."/$namespace/$class_name.php", false) || //Core engines |
|
| 54 | + _require_once($file = MODULES."/../$namespace/$class_name.php", false) || //Classes in modules |
|
| 55 | 55 | _require_once($file = PLUGINS."/../$namespace/$class_name.php", false) //Classes in plugins |
| 56 | 56 | ) { |
| 57 | 57 | $cache[$class] = realpath($file); |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | 'storage' => 'json', |
| 66 | 66 | 'components' => 'json' |
| 67 | 67 | ]; |
| 68 | - protected $table = '[prefix]config'; |
|
| 68 | + protected $table = '[prefix]config'; |
|
| 69 | 69 | protected function cdb () { |
| 70 | 70 | return 0; |
| 71 | 71 | } |
@@ -184,40 +184,40 @@ |
||
| 184 | 184 | return; |
| 185 | 185 | } |
| 186 | 186 | switch ($_GET['response_type']) { |
| 187 | - case 'code': |
|
| 188 | - $Response->redirect( |
|
| 189 | - http_build_url( |
|
| 190 | - $redirect_uri, |
|
| 191 | - [ |
|
| 192 | - 'code' => $code, |
|
| 193 | - 'state' => isset($_GET['state']) ? $_GET['state'] : false |
|
| 194 | - ] |
|
| 195 | - ), |
|
| 196 | - 302 |
|
| 197 | - ); |
|
| 198 | - $Page->Content = ''; |
|
| 199 | - return; |
|
| 200 | - case 'token': |
|
| 201 | - $token_data = $OAuth2->get_code($code, $client['id'], $client['secret'], $redirect_uri); |
|
| 202 | - if ($token_data) { |
|
| 203 | - unset($token_data['refresh_token']); |
|
| 204 | - $url = http_build_url( |
|
| 205 | - $redirect_uri, |
|
| 206 | - array_merge( |
|
| 207 | - $token_data, |
|
| 187 | + case 'code': |
|
| 188 | + $Response->redirect( |
|
| 189 | + http_build_url( |
|
| 190 | + $redirect_uri, |
|
| 208 | 191 | [ |
| 192 | + 'code' => $code, |
|
| 209 | 193 | 'state' => isset($_GET['state']) ? $_GET['state'] : false |
| 210 | 194 | ] |
| 211 | - ) |
|
| 195 | + ), |
|
| 196 | + 302 |
|
| 212 | 197 | ); |
| 213 | - $url = implode('#', explode('?', $url, 2)); |
|
| 214 | - $Response->redirect($url, 302); |
|
| 215 | 198 | $Page->Content = ''; |
| 216 | 199 | return; |
| 217 | - } else { |
|
| 218 | - error_redirect('server_error', "Server can't get token data, try later"); |
|
| 219 | - return; |
|
| 220 | - } |
|
| 221 | - default: |
|
| 222 | - error_redirect('unsupported_response_type', 'Specified response_type is not supported, only "token" or "code" types available'); |
|
| 200 | + case 'token': |
|
| 201 | + $token_data = $OAuth2->get_code($code, $client['id'], $client['secret'], $redirect_uri); |
|
| 202 | + if ($token_data) { |
|
| 203 | + unset($token_data['refresh_token']); |
|
| 204 | + $url = http_build_url( |
|
| 205 | + $redirect_uri, |
|
| 206 | + array_merge( |
|
| 207 | + $token_data, |
|
| 208 | + [ |
|
| 209 | + 'state' => isset($_GET['state']) ? $_GET['state'] : false |
|
| 210 | + ] |
|
| 211 | + ) |
|
| 212 | + ); |
|
| 213 | + $url = implode('#', explode('?', $url, 2)); |
|
| 214 | + $Response->redirect($url, 302); |
|
| 215 | + $Page->Content = ''; |
|
| 216 | + return; |
|
| 217 | + } else { |
|
| 218 | + error_redirect('server_error', "Server can't get token data, try later"); |
|
| 219 | + return; |
|
| 220 | + } |
|
| 221 | + default: |
|
| 222 | + error_redirect('unsupported_response_type', 'Specified response_type is not supported, only "token" or "code" types available'); |
|
| 223 | 223 | } |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | 0, |
| 93 | 93 | strpos($table_name, '"') |
| 94 | 94 | ); |
| 95 | - $update = preg_replace_callback( |
|
| 95 | + $update = preg_replace_callback( |
|
| 96 | 96 | '/"([^"]+)"/', |
| 97 | 97 | function ($matches) { |
| 98 | 98 | return "\"$matches[1]\" = EXCLUDED.\"$matches[1]\""; |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | /** |
| 408 | 408 | * Narrow the dependencies to current module only |
| 409 | 409 | */ |
| 410 | - $dependencies = array_unique( |
|
| 410 | + $dependencies = array_unique( |
|
| 411 | 411 | array_merge( |
| 412 | 412 | ['System'], |
| 413 | 413 | $dependencies['System'], |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | * @return string[][] |
| 482 | 482 | */ |
| 483 | 483 | protected function add_versions_hash ($includes) { |
| 484 | - $content = array_reduce( |
|
| 484 | + $content = array_reduce( |
|
| 485 | 485 | get_files_list(DIR.'/components', '/^meta\.json$/', 'f', true, true), |
| 486 | 486 | function ($content, $file) { |
| 487 | 487 | return $content.file_get_contents($file); |
@@ -327,7 +327,7 @@ |
||
| 327 | 327 | /** |
| 328 | 328 | * If content is link to CSS file |
| 329 | 329 | */ |
| 330 | - $css = static::css( |
|
| 330 | + $css = static::css( |
|
| 331 | 331 | file_get_contents("$dir/$url"), |
| 332 | 332 | "$dir/$url", |
| 333 | 333 | $not_embedded_resources |
@@ -146,7 +146,7 @@ |
||
| 146 | 146 | Header set Content-Type application/octet-stream |
| 147 | 147 | </ifModule> |
| 148 | 148 | |
| 149 | -HTACCESS; |
|
| 149 | +htaccess; |
|
| 150 | 150 | if (is_dir(STORAGE.'/Composer/vendor/bower-asset')) { |
| 151 | 151 | file_put_contents(STORAGE.'/Composer/vendor/bower-asset/.htaccess', $htaccess_contents); |
| 152 | 152 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | <FilesMatch "\.(css|js|gif|jpg|jpeg|png|ico|svg|svgz|ttc|ttf|otf|woff|woff2|eot)$"> |
| 17 | 17 | RewriteEngine Off |
| 18 | 18 | </FilesMatch> |
| 19 | -HTACCESS |
|
| 19 | +htaccess |
|
| 20 | 20 | , |
| 21 | 21 | /** @lang ApacheConfig */ |
| 22 | 22 | <<<HTACCESS |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | Header set Cache-Control "max-age=2592000, public" |
| 33 | 33 | </ifModule> |
| 34 | 34 | </FilesMatch> |
| 35 | -HTACCESS |
|
| 35 | +htaccess |
|
| 36 | 36 | , |
| 37 | 37 | file_get_contents(DIR.'/.htaccess') |
| 38 | 38 | ) |
@@ -72,14 +72,14 @@ |
||
| 72 | 72 | if (!file_exists($path_in_filesystem) || is_writable($path_in_filesystem)) { |
| 73 | 73 | return (bool)file_put_contents($path_in_filesystem, $data, LOCK_EX | FILE_BINARY); |
| 74 | 74 | } |
| 75 | - trigger_error("File $path_in_filesystem not available for writing", E_USER_WARNING); |
|
| 75 | + trigger_error("file $path_in_filesystem not available for writing", E_USER_WARNING); |
|
| 76 | 76 | return false; |
| 77 | 77 | } |
| 78 | 78 | /** |
| 79 | 79 | * @inheritdoc |
| 80 | 80 | */ |
| 81 | 81 | function del ($item) { |
| 82 | - file_put_contents(DIR.'/test', "Deleted $item\n".print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), true), FILE_APPEND); |
|
| 82 | + file_put_contents(DIR.'/test', "deleted $item\n".print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), true), FILE_APPEND); |
|
| 83 | 83 | $path_in_filesystem = $this->get_absolute_path($item); |
| 84 | 84 | if (strpos($path_in_filesystem, CACHE) !== 0) { |
| 85 | 85 | return false; |