Diese Anleitung beschreibt, wie man im Opencaching.de-Entwicklersystem auch den polnischen OC-Code einrichtet. Dies ist z.B. hilfreich für die Mitarbeit am OKAPI-Projekt, oder um polnische Features zu testen die in den deutschen Code übernommen werden könnten.

Die folgende Anleitung setzt ein funktionierendes OC.de-Entwicklersystem voraus (auf Basis CentOS 7). Für die Datenbank-Benutzer werden die Einstellungen aus dem Vagrant-System angenommen: Rootpassswort "root", OC-Benutzer "opencaching" mit Passwort "opencaching".

PHP-Setup

PDO und Tidy

Die PHP-Erweiterungen "pdo" und "tidy" sollten bereits installiert sein. Um ganz sicherzugehen:

  • yum install php-tidy
  • yum install php-pdo

In /etc/php.ini muss bei den "Extensions" eingetragen sein:

extension=php_tidy.dll
  • service httpd restart

Code einrichten

Code auschecken

Die weitere Vorgehensweise hier hängt davon ab, wo/wie die OC-Quelltexte in der Entwickler-VM abgelegt sind. Wenn man sie direkt in der VM ablegen und verwalten möchte:

  • yum install git
  • cd /var/www/html
  • git clone https://github.com/<meinaccount>/opencaching-pl ocpl

Wenn sie auf dem Host liegen sollen: ocpl-Source auf analoge Weise einbinden wie den ocde-Source, gemountet unter /var/www/html/ocpl.

Abschließend:

fehlende Verzeichnisse und Dateien anlegen

ocpl/docs/ocpl-data.tar irgendwo entpacken und alle darin enthaltenen Verzeichnisse und Dateien, die im ocpl-Codebaum fehlen (außer 'mp3'), dort reinkopieren (also keine vorhandenen Dateien überschreiben). Außerdem:

  • ln -s /var/www/html/ocpl/var/mp3 /var/www/html/ocpl/mp3
  • ln -s /var/www/html/ocpl/images/uploads /var/www/html/ocpl/upload
  • mkdir /var/www/html/ocpl/var
  • mkdir /var/log/ocpl
  • chown apache:apache /var/log/ocpl
  • mkdir /var/www/html/ocpl/var/download
  • mkdir /var/www/html/ocpl/var/download/zip
  • mkdir /var/www/html/ocpl/var/download/zip/ocxml11
  • mkdir /var/www/html/ocpl/var/download/zip/ocxml12

In ocpl/Utils/Email die provisorische Datei OcSpamDomain.php mit folgendem Inhalt anlegen:

<?php

namespace Utils\Email;

class OcSpamDomain
{
    const DB_ERRORS = 0;
    const GENERIC_ERRORS = 0;
    
    public function isEmailAllowed($spamDomain)
    {
        return false;
    }
}

lokale Dateien im Git ignorieren

Folgendes in ocpl/.git/info/exclude hinzufügen:

images/uploads
mp3
tpl/stdstyle/html
upload
var

Konfigurationsdateien einrichten

ocpl/lib/settings.inc.php:

<?php
// Unicode Reminder メモ

	require __DIR__ . '/settingsDefault.inc.php';
 
	//Replace localhost to you own domain site	

 	//relative path to the root directory
	if (!isset($rootpath)) $rootpath = './';

	//default used language
	if (!isset($lang)) $lang = 'en';
	
	//default used style
	if (!isset($style)) $style = 'stdstyle';

	//pagetitle
	if (!isset($pagetitle)) $pagetitle = 'Geocaching Opencaching Polska';

	//site name
	$site_name = 'local5.opencaching.pl';

	//id of the node 4 for local development
	$oc_nodeid = 4;
	
	//OC Waypoint for your site for example OX 
	$GLOBALS['oc_waypoint'] = 'OP';
	
	//name of the cookie 
	$opt['cookie']['name'] = 'ocpl';
	$opt['cookie']['path'] = '/';
	$opt['cookie']['domain'] = '.opencaching.pl';
                                
	//name of the cookie
	if (!isset($cookiename)) $cookiename = 'ocpl';
	if (!isset($cookiepath)) $cookiepath = '/';
	if (!isset($cookiedomain)) $cookiedomain = '.opencaching.pl';

	// Coordinates hidden for not-logged-ins?
	global $hide_coords;
	$hide_coords = false;
	
	// scores range
	$MIN_SCORE = 0;
	$MAX_SCORE = 4;
		
	// display online users on footer pages off=0 on=1
	$onlineusers=1;
        // wlaczenie blokady liczby max zakladanych skrzynek typu owncache (by Marcin stryker)
	$GLOBALS['owncache_limit'] = '1';
	    
	
	//block register new cache before first find xx nuber caches value -1 off this feature
	$NEED_FIND_LIMIT=0;
	
	$NEED_APPROVE_LIMIT = 0;
	
	//Debug?
	if (!isset($debug_page)) $debug_page = true;
	$develwarning = 'DEVELSITE';
	
	//site in service? Set to false when doing bigger work on the database to prevent error's
	if (!isset($site_in_service)) $site_in_service = true;
	
	//if you are running this site on a other domain than staging.opencaching.de, you can set
	//this in private_db.inc.php, but don't forget the ending /
	$absolute_server_URI = 'http://local.opencaching.pl/';
	
	// EMail address of the sender
	if (!isset($emailaddr)) $emailaddr = 'noreply@local.opencaching.pl';
	
	// location for dynamically generated files
	$dynbasepath = '/var/www/html/ocpl/var/';
	$dynstylepath = '/var/www/html/ocpl/tpl/stdstyle/html/';

	// location of cache images
	if (!isset($picdir)) $picdir = $dynbasepath . '../images/uploads';
	if (!isset($picurl)) $picurl = $absolute_server_URI . 'images/uploads';

	// Thumbsize
	$thumb_max_width = 175;
	$thumb_max_height = 175;
	// Small thumbsize
	$thumb2_max_width = 64;
	$thumb2_max_height = 64;

	// location of cache mp3 files
	if (!isset($mp3dir)) $mp3dir = $dynbasepath . 'mp3';
	if (!isset($mp3url)) $mp3url = $absolute_server_URI . 'mp3';

	// maximal size of mp3 for PodCache 5 Mb ?
	if (!isset($maxmp3size)) $maxmp3size = 5000000;
	
	// allowed extensions of images
	if (!isset($mp3extensions)) $mp3extensions = ';mp3;';	
	
	// default coordinates for cachemap, set to your country's center of gravity
	$country_coordinates = "52.5,19.2";
	// zoom at which your whole country/region is visible
	$default_country_zoom = 6;

	// Main page map parameters (customize as needed)
	$main_page_map_center_lat = 52.13;
	$main_page_map_center_lon = 19.20;
	$main_page_map_zoom = 5;
	$main_page_map_width = 250;
	$main_page_map_height = 260;

	// maximal size of images
	if (!isset($maxpicsize)) $maxpicsize = 152400;
	
	// allowed extensions of images
	if (!isset($picextensions)) $picextensions = ';jpg;jpeg;gif;png;';
	
	// news settings
	$use_news_approving = true;
	$news_approver_email = 'root@localhost';
	
	//local database settings
	$dbpconnect = false;
	$dbserver = 'localhost';
	$dbname = 'ocpl';
	$dbusername = 'opencaching';
	$dbpasswd = 'opencaching';
	$opt['db']['server'] = 'localhost';
	$opt['db']['name'] = 'ocpl';
	$opt['db']['username'] = 'opencaching';
	$opt['db']['password'] = 'opencaching';

	$tmpdbname = 'octmp';

	// warnlevel for sql-execution
	$sql_errormail = 'root@localhost';
	$sql_warntime = 1;

	// replacements for sql()
	$sql_replacements['db'] = $dbname;
	$sql_replacements['tmpdb'] = 'octmp';

	// safemode_zip-binary
	$safemode_zip = '/var/www/bin/phpzip-pl.php';
	$zip_basedir = $dynbasepath . 'download/zip/';
	$zip_wwwdir = '/download/zip/';

	// Your own Google map API key
	$googlemap_key = "";
	$googlemap_type = "G_MAP_TYPE"; // alternativ: _HYBRID_TYPE

	$dberrormail = 'root@localhost';

	// user_id of admin who have more options than COG users to remove all logs or other more options in admin_users.php 
	$super_admin_id = '';

	$cachemap_mapper = "lib/mapper_okapi.php";

	//Links to blog page on oc site
	$blogsite_url = 'http://blog.opencaching.pl';

	//links to forum page on oc site
	$forum_url = 'http://forum.opencaching.pl';

	$wiki_url  = 'http://wiki.opencaching.pl';
	$wikiLinks = array(
    'main'  => $wiki_url,
    'rules' => $wiki_url.'/index.php/Regulamin_OC_PL',
    'rules_en' => $wiki_url.'/index.php/OC_PL_Conditions_of_Use',
    'cacheParams' => $wiki_url.'/index.php/Parametry_skrzynki',
    'cacheParams_en' => $wiki_url.'/index.php/Cache_parameters',
    'ratingDesc' => $wiki_url.'/index.php/Oceny_skrzynek',
    'ratingDesc_en' => $wiki_url.'/index.php/Cache_rating',
    'forBeginers' => $wiki_url.'/index.php/Dla_pocz%C4%85tkuj%C4%85cych',
    'placingCache' => $wiki_url.'/index.php/Zak%C5%82adanie_skrzynki',
    'cacheQuality' => $wiki_url.'/index.php/Jako%C5%9B%C4%87_skrzynki',
    'myRoutes' => $wiki_url.'/index.php/Moje_trasy',
    'cacheNotes' => $wiki_url.'/index.php/Notatki_skrzynki',
    'additionalWaypoints' => $wiki_url.'/index.php/Dodatkowe_waypointy_w_skrzynce',
    'cachingCode' => $wiki_url.'/index.php/Kodeks_geocachera',
    'usefulFiles' => $wiki_url.'/index.php/U%C5%BCyteczne_pliki_zwi%C4%85zane_z_OC_PL',
    'ocSiteRules' => $wiki_url.'/index.php/Zasady_funkcjonowania_Serwisu_OC_PL',
    'cacheTypes' => $wiki_url.'/index.php/Typ_skrzynki',
    'cacheAttrib' => $wiki_url.'/index.php/Parametry_skrzynki#Atrybuty_skrzynki',
    'cacheAttrib_en' => $wiki_url.'/index.php/Cache_parameters#Attributes',
    'cacheLogPass' => $wiki_url.'/index.php/Parametry_skrzynki#Has.C5.82o_do_wpisu_do_Logu',
    'cacheLogPass_en' => $wiki_url.'/index.php/Cache_parameters#Log_password',
    // optional item
    'downloads' => $wiki_url.'/index.php/U%C5%BCyteczne_pliki_zwi%C4%85zane_z_OC_PL',
);

	$rules_url = 'http://wiki.opencaching.pl/index.php/Regulamin_OC_PL';
	$cache_params_url = 'http://wiki.opencaching.pl/index.php/Parametry_skrzynki';
	$rating_desc_url = 'http://wiki.opencaching.pl/index.php/Oceny_skrzynek';
	$wikiLinks = array(
	    'forBeginers' => 'http://wiki.opencaching.pl/index.php/Dla_początkujących',
	    'placingCache' => 'http://wiki.opencaching.pl/index.php/Zakładanie_skrzynki',
	    'makingCaches' => 'http://wiki.opencaching.pl/index.php/Jakość_skrzynki',
	    'makingRoutes' => 'http://wiki.opencaching.pl/index.php/Moje_trasy',
	    'cacheNotes' => 'http://wiki.opencaching.pl/index.php/Notatki_skrzynki',
	    'extraWaypoints' => 'http://wiki.opencaching.pl/index.php/Dodatkowe_waypointy_w_skrzynce',
	    'cachingCode' => 'http://wiki.opencaching.pl/index.php/Kodeks_geocachera',
	);

	$contact_mail = 'root (at) localhost';
	// E-mail address group of people from OC Team who solve problems, verify cache
	$octeam_email = 'root@localhost';
	
	// signature of e-mails send by system
	$octeamEmailsSignature = "Pozdrawiamy, Zespół www.opencaching.pl";
  
	// watchlist config:
	$watchlistMailfrom = 'watch@local.opencaching.pl';
  
	// email of GeoKrety developer (used in GeoKretyApi.php for error notifications)
	$geoKretyDeveloperEmailAddress = 'stefaniak@gmail.com';

	// New caches outside country where server is: 
	$SiteOutsideCountryString = 'poland_outside';
	$countryParamNewcacherestPhp = " 'PL' ";


/* power Trail module switch and settings */

// true - swithed on; false - swithed off
$powerTrailModuleSwitchOn = true;

// minimum cache count for power trail to be public displayed
// (PT having less than $powerTrailMinimumCacheCount ) are visible only to owners.
$powerTrailMinimumCacheCount = array(
    'current' => 25,
    'old' => array(
        1 => array(
            'dateFrom' => '1970-01-01 01:00',
            'dateTo' => '2013-10-29 23:59:59',
            'limit' => 5,
        ),
// if limit change in future, just uncomment and place here current limit and period of time
//              2 => array (
//                  'dateFrom' => '2013-10-30 00:00:00',
//                  'dateTo' => '20??-??-?? 23:59:59',
//                  'limit' => 25,
//              ),
    ),
);


// minimum cahes Found count of user, to alow user set new Power Trail
// user who found less than $powerTrailUserMinimumCacheFoundToSetNewPowerTrail can't create new PT
$powerTrailUserMinimumCacheFoundToSetNewPowerTrail = 500;

// link to FAQ/info of power trail module
$powerTrailFaqLink = 'http://info.opencaching.pl/node/13';

/* end of power Trail module switch and settings */

// enables/disables linkage to blog in index.php
$BlogSwitchOn = true;

// enable detailed cache access logging
//$enable_cache_access_logs = true;
// OC specific email addresses for international use.
$mail_cog = 'root@localhost';
$mail_rt = 'root@localhost';
$mail_rr = 'root@localhost';
$mail_oc = 'root@localhost';


//Short sitename for international use.
$short_sitename = 'OC PL';

// Contact data definition START
/*
  Possible array entries are listed below. All the entries are optional.
  + groupName
  HTML header with a group name. Group name can be either raw, html code;
  or a reference to the translation file.
  + emailAddress
  E-mail address, which will be printed just below the groupName.
  + groupDescription
  Group description is an actual text of the group, which is placed under the groupName
  and e-mail. This entry can be in one of the following types/formats:
  - an array - if so, each array entry is processed as one of those two types below;
  - raw, html code;
  - reference to the translation file.
  + subgroup
  A nested array of the same structure. HTML headers for nested groups
  are one level lower.
  + other_keys
  They are used to substitute {other_keys} references in both groupName and
  groupDescription. Those keys do not propagate to subgroups.

 */

// Configuration for OC.PL contact page
// Translated to Polish and English only :/
$contactDataPL = array(
    array(
        'groupName' => 'contact_pl_about_title',
        'groupDescription' => array(
            'contact_pl_about_description_1',
            'contact_pl_about_description_2'
        )
    ),
    array(
        'groupName' => 'OpenCaching PL Team',
        'subgroup' => array(
            array(
                'groupName' => 'Rada Rejsu',
                'groupDescription' => 'contact_pl_rr_description',
                'emailAddress' => 'rr at opencaching.pl',
                'link' => 'http://forum.opencaching.pl/viewtopic.php?f=19&t=6297'
            ),
            array(
                'groupName' => 'Rada Techniczna',
                'groupDescription' => 'contact_pl_rt_description',
                'emailAddress' => 'rt at opencaching.pl',
                'link' => 'https://code.google.com/p/opencaching-pl/people/list'  # No longer valid!
            ),
            array(
                'groupName' => 'Centrum Obsługi Geocachera',
                'groupDescription' => 'contact_pl_cog_description',
                'emailAddress' => 'cog at opencaching.pl',
                'link' => 'http://forum.opencaching.pl/viewtopic.php?f=19&t=6297'
            ),
        ),
    ),
    array(
        'groupName' => 'contact_pl_other_title',
        'groupDescription' => 'contact_pl_other_description'
    ),
    array(
        'groupName' => 'contact_ocpl_title',
        'groupDescription' => array(
            'contact_ocpl_description_1',
            'contact_ocpl_description_2',
            'contact_ocpl_description_3',
        )
    )
);

// Configuration from OC.DE contact page
// This is only a template, to be translated/updated for OC.NL
$contactDataDE = array(
    array(
        'groupName' => 'Allgemeine Fragen zu Opencaching.de und zum Thema Geocaching',
        'groupDescription' => array(
            'Für Fragen rund um Opencaching und zum Thema Geocaching ist das <a href="http://wiki.opencaching.de/">Opencaching-Wiki</a> eine gute Anlaufstelle. Weitere Informationen zum Geocaching gibt es auf <a href="http://www.geocaching.de">www.geocaching.de</a>.',
            'Wenn du ein spezielles Problem hast und darauf keine Antwort findest, kannst du dir unter <a href="http://forum.opencaching-network.org">forum.opencaching-network.org</a> ein passendes Forum raussuchen und dich dort erkundigen.'
        )
    ),
    array(
        'groupName' => 'Bedienung der Website, Anregungen und Kritik',
        'groupDescription' => 'Hierfür gibt es ein eigenes Unterforum auf <a href="http://forum.opencaching-network.org/index.php?board=33.0">forum.opencaching-network.org</a>. Dort findest du auch weitere Informationen, falls du in unserem Team mitmachen möchtest.'
    ),
    array(
        'groupName' => 'Sonstiges',
        'groupDescription' => array(
            'Sollten die oben genannten Möglichkeiten nicht ausreichen oder die Betreiber von <i>opencaching.de</i> direkt kontaktiert werden, kannst du auch eine Email an <a href="mailto:contact@opencaching.de">contact@opencaching.de</a> schreiben.',
            'Bitte werde nicht ungeduldig wenn nicht sofort eine Antwort kommt, <i>opencaching.de</i> wird von Freiwilligen betreut, die leider nicht immer und sofort zur Verfügung stehen können.',
        )
    )
);
//
$contactData = $contactDataPL;
// Contact data definition END
// Show date and date/time correct way.
$dateFormat = 'Y-m-d';
$datetimeFormat = 'Y-m-d H:i';

$defaultCountryList = array("AT", "BE", "BY", "BG", "HR", "CZ", "DK", "EE", "FI", "FR", "GR", "ES", "NL", "IE", "LT", "MD", "DE", "NO", "PL", "PT", "SU", "RO", "SK", "SI", "CH", "SE", "TR", "UA", "IT", "HU", "GB",);

/**
 * Configuration for map v3 maps
 *
 * Two dimensional array:
 *
 * * first dimension
 * KEYS - internal names
 *
 * * second dimension
 * KEYS:
 *  - hidden: boolean attribute to hide the map entirerly, without removing it from config
 *  - showOnlyIfMore: show this map item only in large views (like full screen)
 *  - attribution: the HTML snippet that will be shown in bottom-right part of the map
 *  - imageMapTypeJS: the complete JS expression returning instance of google.maps.ImageMapType,
 *      if set, not other properties below will work
 *  - name: the name of the map
 *  - tileUrl: URL to the tile, may contain following substitutions
 *      - {z} - zoom, may include shifts, in form of i.e. {z+1}, {z-3}
 *      - {x}, {y} - point coordinates
 *  - tileUrlJS: the complete JS expression returning function for tileUrl retrieval,
 *      if set, tileUrl property will not work
 *  - tileSize: the tile size, either in form of WIDTHxHEIGHT, i.e. 256x128, or complete
 *      JS expression returning instance of google.maps.Size
 *  - maxZoom: maximum zoom available
 *  - minZoom: minimum zoom available
 *
 * Other keys, will be passed as is, given that
 *  - numerical and boolean values are passed as is to JS
 *  - other types are passed as strings, unless they start with raw: prefix. In that case,
 *      they are passed as JS expressions
 */

$mapsConfig = array(
    'OSMapa' => array(
        'attribution' => '© <a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> contributors <a href="http://creativecommons.org/licenses/by-sa/2.0/" target="_blank">CC BY-SA</a> | Hosting:<a href="http://trail.pl/" target="_blank">trail.pl</a> i <a href="http://centuria.pl/" target="_blank">centuria.pl</a>',
        'name' => 'OSMapa',
        'tileUrl' => 'http://tile.openstreetmap.pl/osmapa.pl/{z}/{x}/{y}.png',
        'maxZoom' => 18,
        'tileSize' => '256x256',
    ),
    'OSM' => array(
        'name' => 'OSM',
        'attribution' => '© <a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> contributors <a href="http://creativecommons.org/licenses/by-sa/2.0/" target="_blank">CC BY-SA</a>',
        'tileUrl' => 'http://tile.openstreetmap.org/{z}/{x}/{y}.png',
        'maxZoom' => 18,
        'tileSize' => '256x256',
        'showOnlyIfMore' => true
    ),
    'UMP' => array(
        'name' => 'UMP',
        'attribution' => '© Mapa z <a href="http://ump.waw.pl/" target="_blank">UMP-pcPL</a>',
        'tileUrl' => 'http://tiles.ump.waw.pl/ump_tiles/{z}/{x}/{y}.png',
        'maxZoom' => 18,
        'tileSize' => '256x256',
    ),
    'Topo' => array(
        'attribution' => '© <a href="http://geoportal.gov.pl/" target="_blank">geoportal.gov.pl</a>',
        'showOnlyIfMore' => true,
        'imageMapTypeJS' => 'new google.maps.ImageMapType(new WMSImageMapTypeOptions(
                                        "Topo",
                                        "http://mapy.geoportal.gov.pl:80/wss/service/img/guest/TOPO/MapServer/WmsServer",
                                        "Raster",
                                        "",
                                        "image/jpeg"))',
    ),
    'Orto' => array(
        'attribution' => '© <a href="http://geoportal.gov.pl/" target="_blank">geoportal.gov.pl</a>',
        'showOnlyIfMore' => true,
        'imageMapTypeJS' => 'new google.maps.ImageMapType(new WMSImageMapTypeOptions(
                                        "Orto",
                                        "http://mapy.geoportal.gov.pl:80/wss/service/img/guest/ORTO/MapServer/WmsServer",
                                        "Raster",
                                        "",
                                        "image/jpeg"))',
    ),
);
$config['mapsConfig'] = $mapsConfig;

// map of garmin keys,
// key: domain name, value: garmin key value
// the map may contain only one entry
$config['garmin-key'] = array(
        'http://opencaching.pl' => '0fe1300131fcc0e417bb04de798c5acf',
        'http://www.opencaching.nl' => 'b01f02cba1c000fe034471d2b08044c6',
        'http://local.opencaching.pl' => '9eb4fbbdf63eb75be32f6467fe982f7e',
);

$titled_cache_nr_found=10;
$titled_cache_period_prefix='week';

// local addition
date_default_timezone_set("Europe/Berlin");
$disable_google_translation = true;
$mailfrom = 'local.opencaching.pl';
$mailfrom_noreply = 'noreply@local.opencaching.pl';

?>

Diese Beispielsettings sind Stand 4.3.2016. Aktualisierungen findet man in ocpl/lib/settings-example.inc.php (-> Änderungen).

Damit die Karten funktionieren, muss man sich noch einen Google-Map-Key besorgen ("Browser Key" für die "Google Maps JavaScript API") und in der Variable $googlemap_key eingetragen. Wer bereits einen eigenen Key für local.opencaching.de hat, kann dort in der Google-Konsole die Domain local.opencaching.pl hinzufügen, also einen Key für Beides verwenden.

Ein Key für das Garmin-Plugin ist bereits enthalten.

phpzip einrichten

  • cp /var/www/html/ocpl/bin/phpzip.php /var/www/bin/phpzip-pl.php
  • /var/www/bin/phpzip-pl.php bearbeiten und dort den Download-Pfad korrigieren:
    $basedir = '/var/www/html/ocpl/download/zip/'

Datenbank einrichten, Teil 1

Im phpMyAdmin eine neue Datenbank "ocpl" mit Kollation "utf8_general_ci" anlegen.

Von der phpMyAdmin-Hauptseite aus die Rechte des Benutzers "oc" editieren und ihm für die Datenbank "ocpl" die gleichen Rechte geben wie für die Datenbank "opencaching". Dann die Tabellen und Trigger anlegen lassen:

  • ocpl/docs/sql/tables/ocpl.sql.gz irgendwohin kopieren und auspacken
  • alle DROP-TRIGGER-Zeilen aus ocpl.sql entfernen
  • mysql -uroot -proot ocpl <ocpl.sql

Webserver konfigurieren

Datei /etc/httpd/conf.d/ocpl.conf anlegen:

<VirtualHost *:80>
    ServerName local.opencaching.pl
    DocumentRoot /var/www/html/ocpl
    DirectoryIndex index.php index.html index.htm

    ErrorLog logs/ocpl_error_log
    CustomLog logs/ocpl_access_log combined

    AddDefaultCharset UTF-8

    RewriteEngine On
</VirtualHost>

<Directory /var/www/html/ocpl>
    Options FollowSymLinks
    AllowOverride All
    Require all granted

    php_admin_value display_errors "on"
    php_admin_value error_reporting 22517
      # all except E_WARNING, E_NOTICE, E_STRICT, E_DEPRECATED
    php_admin_value safe_mode "off"
</Directory>
  • service httpd restart
  • Sowohl auf dem Host als auch in der VM muss local.opencaching.pl auf die VM umgeleitet werden (z.B. per hosts-Einträgen).

OKAPI einrichten

Datenbank einrichten, Teil 2

Da ocpl.sql meistens veraltet ist, müssen die Tabellenstrukturen noch mit denen von opencaching.pl abgeglichen werden:

Nun kann man die statischen Daten und Trigger einlesen bzw. aktualisieren:

  • mysql -uroot -proot ocpl <ocpl/docs/sql/static-data/data.sql
  • mysql -uroot -proot ocpl <ocpl/docs/sql/stored-proc/triggers-create.sql
  • mysql -uroot -proot ocpl -e "INSERT IGNORE INTO news_topics (id, name) VALUES (1, 'News')"

Es gibt keine automatische Datenbankversionierung. Einzelne Diffs finden sich in ocpl/sqlAlters/. Falls die unvollständig sein sollten, siehe oben: Compare per okapi/devel/dbstruct und das Ergebnis einpflegen.

Cronjobs einrichten

  • yum install wget
  • In /etc/crontab Folgendes hinzufügen:
# opencaching.pl
*/30 *  *   *   * apache  wget -O - -q http://local.opencaching.pl/tpl/stdstyle/etc/write_newcaches.inc.php
*/55 *  *   *   * apache  wget -O - -q http://local.opencaching.pl/tpl/stdstyle/etc/write_newblogs.inc.php
*/14 *  *   *   * apache  wget -O - -q http://local.opencaching.pl/tpl/stdstyle/etc/write_onlusers.inc.php
*/5 *  *   *   * apache  wget -O - -q http://local.opencaching.pl/tpl/stdstyle/etc/write_totalstats.inc.php

*/15 *  *  *  * apache wget -O - -q http://local.opencaching.pl/util.sec/email_sender/email_sender.php
*/15 *  *  *  * apache wget -O - -q http://local.opencaching.pl/util.sec/notification/run_notify.php
0 *  *  *  * apache wget -O - -q http://local.opencaching.pl/util.sec/publish_caches/run_publish.php
*/15 *  *  *  * apache wget -O - -q http://local.opencaching.pl/util.sec/watchlist/runwatch.php
0    3  *  *  * apache wget -O - -q http://local.opencaching.pl/util.sec/search_index/fill_search_index.php

# 30   4  *  *  * apache wget -O - -q http://local.opencaching.pl/util.sec/auto_arch.php
# 30 *  *  *  * apache wget -O - -q http://local.opencaching.pl/util.sec/geokrety/geokrety.new.php
# */30 *  *  *  * apache wget -O - -q http://local.opencaching.pl/util.sec/cache_locations/cache_location.class.php/
# */45 *  *  *  * apache wget -O - -q http://local.opencaching.pl/util.sec/cron/modules/cache_npa_areas.class.php
# 45 * * * * apache wget -O - -q -t 1 http://local.opencaching.pl/okapi/cron5

Die ersten vier Jobs füllen nach und nach die einzelnen Abschnitte auf der Startseite mit Inhalt.

Zu den deaktivieten Jobs:

  • auto_arch: automatische Cachearchivierung, aktivieren wenn benötigt
  • Geokrety-Diff-Import: braucht zunächst einen Erstimport
  • Cache-Location: hier fehlen noch die statischen geographischen Daten
  • NPA-Areas: hier fehlen noch die statischen geographischen Daten

Bekannte Probleme

  • Die statischen Daten für die regionale Zuordnung von Caches und Naturschutzgebiete fehlen noch.
  • Weitere statische Daten und Trigger fehlen; dadurch funktionieren z.B. die Status-Änderungslogs nicht.
  • Die Caches auf der Cachekarte v2 erscheinen erst, wenn man die Karte scrollt oder zoomt. Das ist ein Fehler in der OC.pl-Software.
  • https://github.com/opencaching/opencaching-pl/issues

Codeänderungen beitragen

Funktioniert (mittlerweile) genauso wie bei Opencaching.de: Featurebranch anlegen, in den eigenen Github-Fork hochladen und Pull Request stellen. Oder bei Kleinkram direkt im eigenen master-Branch arbeiten und darauf Pull Request stellen.