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 4256b20b..4cc36a27 100644 Binary files a/htdocs/okapi/locale/pl_PL/LC_MESSAGES/okapi_messages.mo and b/htdocs/okapi/locale/pl_PL/LC_MESSAGES/okapi_messages.mo differ diff --git a/htdocs/okapi/locale/pl_PL/LC_MESSAGES/okapi_messages.po b/htdocs/okapi/locale/pl_PL/LC_MESSAGES/okapi_messages.po index 8facb5da..2f767aa2 100644 --- a/htdocs/okapi/locale/pl_PL/LC_MESSAGES/okapi_messages.po +++ b/htdocs/okapi/locale/pl_PL/LC_MESSAGES/okapi_messages.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: OKAPI\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-04-10 01:12+0100\n" -"PO-Revision-Date: 2013-04-10 01:14+0100\n" +"POT-Creation-Date: 2013-05-08 15:17+0100\n" +"PO-Revision-Date: 2013-05-08 15:25+0100\n" "Last-Translator: Wojciech Rygielski \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 @@