From 2b66c4178b2d0ca7035fe7cc587ea5037f039fd0 Mon Sep 17 00:00:00 2001 From: following Date: Thu, 9 May 2013 13:13:30 +0200 Subject: [PATCH] okapi r796 --- htdocs/okapi/core.php | 2 +- htdocs/okapi/cronjobs.php | 19 ++++- htdocs/okapi/facade.php | 13 +++- .../pl_PL/LC_MESSAGES/okapi_messages.mo | Bin 8267 -> 8897 bytes .../pl_PL/LC_MESSAGES/okapi_messages.po | 72 ++++++++++++------ htdocs/okapi/services/caches/geocache.xml | 14 ++-- htdocs/okapi/services/caches/geocaches.php | 4 +- htdocs/okapi/views/apps/index.php | 1 + htdocs/okapi/views/apps/index.tpl.php | 6 +- htdocs/okapi/views/update.php | 2 +- 10 files changed, 92 insertions(+), 41 deletions(-) diff --git a/htdocs/okapi/core.php b/htdocs/okapi/core.php index c507e805..766b125b 100644 --- a/htdocs/okapi/core.php +++ b/htdocs/okapi/core.php @@ -799,7 +799,7 @@ class Okapi { public static $data_store; public static $server; - public static $revision = 786; # This gets replaced in automatically deployed packages + public static $revision = 796; # This gets replaced in automatically deployed packages private static $okapi_vars = null; /** Get a variable stored in okapi_vars. If variable not found, return $default. */ diff --git a/htdocs/okapi/cronjobs.php b/htdocs/okapi/cronjobs.php index 4c73cd64..27c7e3f2 100644 --- a/htdocs/okapi/cronjobs.php +++ b/htdocs/okapi/cronjobs.php @@ -51,7 +51,8 @@ class CronJobController new FulldumpGeneratorJob(), new TileTreeUpdater(), new SearchSetsCleanerJob(), - new AttrsRefresherJob(), + // WRCLEANIT: new AttrsRefresherJob(), + new TableOptimizerJob(), ); foreach ($cache as $cronjob) if (!in_array($cronjob->get_type(), array('pre-request', 'cron-5'))) @@ -779,7 +780,9 @@ class LocaleChecker extends Cron5Job * Once every hour, update the official cache attributes listing. * * WRTODO: Make it 12 hours later. - */ + * + * WRCLEANIT + * class AttrsRefresherJob extends Cron5Job { public function get_period() { return 3600; } @@ -789,3 +792,15 @@ class AttrsRefresherJob extends Cron5Job AttrHelper::refresh_if_stale(); } } +*/ + +/** Once per day, optimize certain MySQL tables. */ +class TableOptimizerJob extends Cron5Job +{ + public function get_period() { return 86400; } + public function execute() + { + Db::query("optimize table okapi_tile_caches"); + Db::query("optimize table okapi_tile_status"); + } +} diff --git a/htdocs/okapi/facade.php b/htdocs/okapi/facade.php index 1160eddd..ddd2f696 100644 --- a/htdocs/okapi/facade.php +++ b/htdocs/okapi/facade.php @@ -20,7 +20,7 @@ namespace okapi; # exception and error handlers. OKAPI is strict about PHP warnings and # notices, so you might need to temporarily disable the error handler in # order to get it to work with your code. Just call this after you -# include the Facade file: OkapiErrorHandler::disable(). +# include the Facade file: Facade::disable_error_handling(). use Exception; @@ -119,6 +119,17 @@ class Facade "); } + /** + * Run OKAPI database update. + * Will output messages to stdout. + */ + public static function database_update() + { + require_once($GLOBALS['rootpath']."okapi/views/update.php"); + $update = new views\update\View; + $update->call(); + } + /** * You will probably want to call that with FALSE when using Facade * in buggy, legacy OC code. This will disable OKAPI's default behavior diff --git a/htdocs/okapi/locale/pl_PL/LC_MESSAGES/okapi_messages.mo b/htdocs/okapi/locale/pl_PL/LC_MESSAGES/okapi_messages.mo index 4256b20bfb6f286aae136cf84aa57e957332b3a5..4cc36a27e2dc09524f05fb5b9b932c26b7710090 100644 GIT binary patch delta 1720 zcmZ|OUu+ab9Ki8kDNy=PC

=?Q~V>Nw2+Ytw>`O0~mbpP-ub;(YU=^>)rKs>)l@0 zJ0I@Bm?oI$!$qUfkPs7iQDeO5gAj?ay!fYYA|xulsfh}{X{^NWZ|@3%VREyd-I<%6 z-~49w%iW*ttNgHjXp3MU{<4aDY;6&FhyKwuB6s4q zxD}W1W4x_ZED2;d$ zcVP;5<1u^%FQR75CEADaLyY2Icm%hvtGB<1+WrM1`=A*} zU`11Zm>ccz8XZS*oaZVsRu*vpe?|wpi1sNAFu-$2HYL$p-?Ag9TbV^-mI9I_nMW2a zucHQVvX}gGuH*w6G<6^094_JWSh!te41Yxp#Of1y6z|6b9>q8C0#0Jyh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s&LY zw_7G?b@{xZkT(!(Ncx=|J)Sxpjirr7$J0%z@rIoxX3f^_uyL8*K)3O=^%`emz~{64 zVW$cBxuLQwW-@LhR\n" "Language-Team: \n" "Language: pl_PL\n" @@ -19,18 +19,18 @@ msgstr "" "X-Generator: Poedit 1.5.5\n" "X-Poedit-SearchPath-0: .\n" -#: services/caches/geocaches.php:846 +#: services/caches/geocaches.php:911 msgid "Stage" msgstr "Etap" -#: services/caches/geocaches.php:1009 +#: services/caches/geocaches.php:1139 #, php-format msgid "" "This geocache description comes from the %s site." msgstr "Opis skrzynki pochodzi z serwisu %s." -#: services/caches/geocaches.php:1021 +#: services/caches/geocaches.php:1151 #, php-format msgid "" "© %s, %s, CC-BY-NC-ND, w " "dniu %s. Prawa autorskie wpisów do logów należą do ich autorów." -#: services/caches/geocaches.php:1032 +#: services/caches/geocaches.php:1162 #, php-format msgid "" "© %s, %s, Currently available fields:

+
  • +

    gc_code - Geocaching.com code (GC code) of the geocache + or null if the cache is not listed on GC or the GC code is + unknown.

    + +

    Please note that this information is supplied by cache owners + and it is often missing, obsolete or otherwise incorrect.

    +
  • distance - float, the distance to a cache, in meters. This requires my_location parameter to be provided.

    diff --git a/htdocs/okapi/services/caches/geocaches.php b/htdocs/okapi/services/caches/geocaches.php index 9c1bc390..6409f73e 100644 --- a/htdocs/okapi/services/caches/geocaches.php +++ b/htdocs/okapi/services/caches/geocaches.php @@ -832,7 +832,7 @@ class WebService # waypoint types in 'waypoint_type' table. # OCPL also have a special 'status' field to denote a hidden waypoint # (i.e. final location of a multicache). Such hidden waypoints are not - # exposed by OKAPI. A stage fields is used for ordering and naming. + # exposed by OKAPI. $cacheid2waypoints = Db::select_group_by("cache_id", " select @@ -863,7 +863,7 @@ class WebService { # OCDE uses 'coordinates' table (with type=1) to store additional waypoints # and defines waypoint types in 'coordinates_type' table. - # All additional waypoints are are public. + # All additional waypoints are public. $cacheid2waypoints = Db::select_group_by("cache_id", " select diff --git a/htdocs/okapi/views/apps/index.php b/htdocs/okapi/views/apps/index.php index 90b6eea1..37866061 100644 --- a/htdocs/okapi/views/apps/index.php +++ b/htdocs/okapi/views/apps/index.php @@ -44,6 +44,7 @@ class View "); $vars = array(); $vars['okapi_base_url'] = Settings::get('SITE_URL')."okapi/"; + $vars['site_url'] = Settings::get('SITE_URL'); $vars['site_name'] = Okapi::get_normalized_site_name(); $vars['apps'] = array(); while ($row = mysql_fetch_assoc($rs)) diff --git a/htdocs/okapi/views/apps/index.tpl.php b/htdocs/okapi/views/apps/index.tpl.php index a54e444d..962ac894 100644 --- a/htdocs/okapi/views/apps/index.tpl.php +++ b/htdocs/okapi/views/apps/index.tpl.php @@ -6,7 +6,7 @@