@@ -14,7 +14,7 @@ |
||
| 14 | 14 | { |
| 15 | 15 | public static function call() |
| 16 | 16 | { |
| 17 | - require_once($GLOBALS['rootpath'].'okapi/views/changelog_helper.inc.php'); |
|
| 17 | + require_once($GLOBALS['rootpath'] . 'okapi/views/changelog_helper.inc.php'); |
|
| 18 | 18 | |
| 19 | 19 | $changelog = new Changelog(); |
| 20 | 20 | $changes = array_merge($changelog->unavailable_changes, $changelog->available_changes); |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | use okapi\OkapiLock; |
| 21 | 21 | use okapi\OkapiExceptionHandler; |
| 22 | 22 | |
| 23 | -require_once($GLOBALS['rootpath']."okapi/service_runner.php"); |
|
| 23 | +require_once($GLOBALS['rootpath'] . "okapi/service_runner.php"); |
|
| 24 | 24 | |
| 25 | 25 | class View |
| 26 | 26 | { |
@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $tiles = array(); |
| 69 | - for ($xx=$x; $xx<$x+4; $xx++) |
|
| 70 | - for ($yy=$y; $yy<$y+4; $yy++) |
|
| 69 | + for ($xx = $x; $xx < $x + 4; $xx++) |
|
| 70 | + for ($yy = $y; $yy < $y + 4; $yy++) |
|
| 71 | 71 | $tiles[] = array($xx, $yy); |
| 72 | 72 | srand(); |
| 73 | 73 | shuffle($tiles); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | foreach ($tiles as $tile) |
| 76 | 76 | { |
| 77 | 77 | list($x, $y) = $tile; |
| 78 | - self::out("Loading ".str_pad("($z, $x, $y)... ", 30)); |
|
| 78 | + self::out("Loading " . str_pad("($z, $x, $y)... ", 30)); |
|
| 79 | 79 | $time_started = microtime(true); |
| 80 | 80 | try { |
| 81 | 81 | $response = OkapiServiceRunner::call('services/caches/map/tile', new OkapiInternalRequest( |
@@ -83,11 +83,11 @@ discard block |
||
| 83 | 83 | array('z' => "$z", 'x' => "$x", 'y' => "$y"))); |
| 84 | 84 | $runtime = microtime(true) - $time_started; |
| 85 | 85 | $ds = floor($runtime * 100); |
| 86 | - self::out(str_repeat("#", $ds)." "); |
|
| 86 | + self::out(str_repeat("#", $ds) . " "); |
|
| 87 | 87 | $b = floor(strlen($response->get_body()) / 256); |
| 88 | - self::out(str_repeat("@", $b)."\n"); |
|
| 88 | + self::out(str_repeat("@", $b) . "\n"); |
|
| 89 | 89 | } catch (Exception $e) { |
| 90 | - self::out("\n\n".OkapiExceptionHandler::get_exception_info($e)); |
|
| 90 | + self::out("\n\n" . OkapiExceptionHandler::get_exception_info($e)); |
|
| 91 | 91 | die(); |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -9,14 +9,14 @@ discard block |
||
| 9 | 9 | use okapi\OkapiInternalConsumer; |
| 10 | 10 | use okapi\Settings; |
| 11 | 11 | |
| 12 | -require_once($GLOBALS['rootpath'].'okapi/service_runner.php'); |
|
| 12 | +require_once($GLOBALS['rootpath'] . 'okapi/service_runner.php'); |
|
| 13 | 13 | |
| 14 | 14 | class OkapiMenu |
| 15 | 15 | { |
| 16 | 16 | private static function link($current_path, $link_path, $link_name) |
| 17 | 17 | { |
| 18 | - return "<a href='".Settings::get('SITE_URL')."okapi/$link_path'".(($current_path == $link_path) |
|
| 19 | - ? " class='selected'" : "").">$link_name</a><br>"; |
|
| 18 | + return "<a href='" . Settings::get('SITE_URL') . "okapi/$link_path'" . (($current_path == $link_path) |
|
| 19 | + ? " class='selected'" : "") . ">$link_name</a><br>"; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** Get HTML-formatted side menu representation. */ |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | $chunks = array(); |
| 26 | 26 | if (Okapi::$version_number) |
| 27 | - $chunks[] = "<div class='revision'>ver. ".Okapi::$version_number. |
|
| 28 | - " (".substr(Okapi::$git_revision, 0, 7).")</div>"; |
|
| 27 | + $chunks[] = "<div class='revision'>ver. " . Okapi::$version_number . |
|
| 28 | + " (" . substr(Okapi::$git_revision, 0, 7) . ")</div>"; |
|
| 29 | 29 | $chunks[] = "<div class='main'>"; |
| 30 | 30 | $chunks[] = self::link($current_path, "introduction.html", "Introduction"); |
| 31 | 31 | $chunks[] = self::link($current_path, "signup.html", "Sign up"); |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | require_once('menu.inc.php'); |
| 16 | 16 | |
| 17 | 17 | $vars = array( |
| 18 | - 'okapi_base_url' => Settings::get('SITE_URL')."okapi/", |
|
| 18 | + 'okapi_base_url' => Settings::get('SITE_URL') . "okapi/", |
|
| 19 | 19 | 'menu' => OkapiMenu::get_menu_html(), |
| 20 | 20 | 'installations' => OkapiMenu::get_installations(), |
| 21 | 21 | 'okapi_rev' => Okapi::$version_number, |
@@ -13,14 +13,14 @@ |
||
| 13 | 13 | { |
| 14 | 14 | public static function call() |
| 15 | 15 | { |
| 16 | - require_once($GLOBALS['rootpath'].'okapi/views/menu.inc.php'); |
|
| 17 | - require_once($GLOBALS['rootpath'].'okapi/views/changelog_helper.inc.php'); |
|
| 16 | + require_once($GLOBALS['rootpath'] . 'okapi/views/menu.inc.php'); |
|
| 17 | + require_once($GLOBALS['rootpath'] . 'okapi/views/changelog_helper.inc.php'); |
|
| 18 | 18 | |
| 19 | 19 | $changelog = new Changelog(); |
| 20 | 20 | |
| 21 | 21 | $vars = array( |
| 22 | 22 | 'menu' => OkapiMenu::get_menu_html("changelog.html"), |
| 23 | - 'okapi_base_url' => Settings::get('SITE_URL')."okapi/", |
|
| 23 | + 'okapi_base_url' => Settings::get('SITE_URL') . "okapi/", |
|
| 24 | 24 | 'site_url' => Settings::get('SITE_URL'), |
| 25 | 25 | 'installations' => OkapiMenu::get_installations(), |
| 26 | 26 | 'okapi_rev' => Okapi::$version_number, |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | public static function call($methodname) |
| 21 | 21 | { |
| 22 | - require_once($GLOBALS['rootpath'].'okapi/service_runner.php'); |
|
| 23 | - require_once($GLOBALS['rootpath'].'okapi/views/menu.inc.php'); |
|
| 22 | + require_once($GLOBALS['rootpath'] . 'okapi/service_runner.php'); |
|
| 23 | + require_once($GLOBALS['rootpath'] . 'okapi/views/menu.inc.php'); |
|
| 24 | 24 | |
| 25 | 25 | try |
| 26 | 26 | { |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | $vars = array( |
| 35 | 35 | 'method' => $method, |
| 36 | - 'menu' => OkapiMenu::get_menu_html($methodname.".html"), |
|
| 37 | - 'okapi_base_url' => Settings::get('SITE_URL')."okapi/", |
|
| 36 | + 'menu' => OkapiMenu::get_menu_html($methodname . ".html"), |
|
| 37 | + 'okapi_base_url' => Settings::get('SITE_URL') . "okapi/", |
|
| 38 | 38 | 'installations' => OkapiMenu::get_installations(), |
| 39 | 39 | 'okapi_rev' => Okapi::$version_number, |
| 40 | 40 | ); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | { |
| 18 | 18 | # Determine which user is logged in to OC. |
| 19 | 19 | |
| 20 | - require_once($GLOBALS['rootpath']."okapi/lib/oc_session.php"); |
|
| 20 | + require_once($GLOBALS['rootpath'] . "okapi/lib/oc_session.php"); |
|
| 21 | 21 | $OC_user_id = OCSession::get_user_id(); |
| 22 | 22 | |
| 23 | 23 | # Ensure a user is logged in. |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | if ($OC_user_id == null) |
| 26 | 26 | { |
| 27 | 27 | $after_login = "okapi/apps/"; # it is correct, if you're wondering |
| 28 | - $login_url = Settings::get('SITE_URL')."login.php?target=".urlencode($after_login); |
|
| 28 | + $login_url = Settings::get('SITE_URL') . "login.php?target=" . urlencode($after_login); |
|
| 29 | 29 | return new OkapiRedirectResponse($login_url); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -36,18 +36,18 @@ discard block |
||
| 36 | 36 | Db::execute(" |
| 37 | 37 | delete from okapi_tokens |
| 38 | 38 | where |
| 39 | - user_id = '".Db::escape_string($OC_user_id)."' |
|
| 40 | - and consumer_key = '".Db::escape_string($consumer_key)."' |
|
| 39 | + user_id = '".Db::escape_string($OC_user_id) . "' |
|
| 40 | + and consumer_key = '".Db::escape_string($consumer_key) . "' |
|
| 41 | 41 | "); |
| 42 | 42 | Db::execute(" |
| 43 | 43 | delete from okapi_authorizations |
| 44 | 44 | where |
| 45 | - user_id = '".Db::escape_string($OC_user_id)."' |
|
| 46 | - and consumer_key = '".Db::escape_string($consumer_key)."' |
|
| 45 | + user_id = '".Db::escape_string($OC_user_id) . "' |
|
| 46 | + and consumer_key = '".Db::escape_string($consumer_key) . "' |
|
| 47 | 47 | "); |
| 48 | 48 | |
| 49 | 49 | # Redirect back to the apps page. |
| 50 | 50 | |
| 51 | - return new OkapiRedirectResponse(Settings::get('SITE_URL')."okapi/apps/"); |
|
| 51 | + return new OkapiRedirectResponse(Settings::get('SITE_URL') . "okapi/apps/"); |
|
| 52 | 52 | } |
| 53 | 53 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | okapi_consumers c, |
| 30 | 30 | okapi_tokens t |
| 31 | 31 | where |
| 32 | - t.`key` = '".Db::escape_string($token_key)."' |
|
| 32 | + t.`key` = '".Db::escape_string($token_key) . "' |
|
| 33 | 33 | and t.consumer_key = c.`key` |
| 34 | 34 | "); |
| 35 | 35 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | $vars = array( |
| 44 | - 'okapi_base_url' => Settings::get('SITE_URL')."okapi/", |
|
| 44 | + 'okapi_base_url' => Settings::get('SITE_URL') . "okapi/", |
|
| 45 | 45 | 'token' => $token, |
| 46 | 46 | 'verifier' => $verifier, |
| 47 | 47 | 'site_name' => Okapi::get_normalized_site_name(), |
@@ -20,13 +20,13 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | # Determine which user is logged in to OC. |
| 22 | 22 | |
| 23 | - require_once($GLOBALS['rootpath']."okapi/lib/oc_session.php"); |
|
| 23 | + require_once($GLOBALS['rootpath'] . "okapi/lib/oc_session.php"); |
|
| 24 | 24 | $OC_user_id = OCSession::get_user_id(); |
| 25 | 25 | |
| 26 | 26 | if ($OC_user_id == null) |
| 27 | 27 | { |
| 28 | - $after_login = "okapi/apps/".(($langpref != Settings::get('SITELANG'))?"?langpref=".$langpref:""); |
|
| 29 | - $login_url = Settings::get('SITE_URL')."login.php?target=".urlencode($after_login); |
|
| 28 | + $after_login = "okapi/apps/" . (($langpref != Settings::get('SITELANG')) ? "?langpref=" . $langpref : ""); |
|
| 29 | + $login_url = Settings::get('SITE_URL') . "login.php?target=" . urlencode($after_login); |
|
| 30 | 30 | return new OkapiRedirectResponse($login_url); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -38,12 +38,12 @@ discard block |
||
| 38 | 38 | okapi_consumers c, |
| 39 | 39 | okapi_authorizations a |
| 40 | 40 | where |
| 41 | - a.user_id = '".Db::escape_string($OC_user_id)."' |
|
| 41 | + a.user_id = '".Db::escape_string($OC_user_id) . "' |
|
| 42 | 42 | and c.`key` = a.consumer_key |
| 43 | 43 | order by c.name |
| 44 | 44 | "); |
| 45 | 45 | $vars = array(); |
| 46 | - $vars['okapi_base_url'] = Settings::get('SITE_URL')."okapi/"; |
|
| 46 | + $vars['okapi_base_url'] = Settings::get('SITE_URL') . "okapi/"; |
|
| 47 | 47 | $vars['site_url'] = Settings::get('SITE_URL'); |
| 48 | 48 | $vars['site_name'] = Okapi::get_normalized_site_name(); |
| 49 | 49 | $vars['site_logo'] = Settings::get('SITE_LOGO'); |