-
Notifications
You must be signed in to change notification settings - Fork 33
/
okapi_settings.php
67 lines (55 loc) · 3.16 KB
/
okapi_settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
namespace okapi;
use src\Models\OcConfig\OcConfig;
function get_okapi_settings()
{
# This comment is here for all international OC developers. This
# file serves as an example of how to implement it on other sites.
# These settings are for OCPL site, but they should work with most
# others too.
# Note, that this file should be located outside of OKAPI directory,
# directly in your root path.
# OKAPI needs this file present. Every OC site has to provide it.
# Since OC sites differ (they don't even have a common-structured
# settings file), all sites have to provide a valid mapping from
# *their* settings to OKAPI settings.
# Note, that this function needs to execute FAST. If your default
# settings file is not a simple $variable="value" mapping, then you
# *should* *hardcode* the settings below, instead of including your
# slow settings file!
# OKAPI defines only *one* global variable, named 'rootpath'.
# You may access it to get a proper path to your own settings file.
require(__DIR__.'/lib/settingsGlue.inc.php'); # (into the *local* scope)
# prepare settings for OKAPI
return [
# These first section of settings is OKAPI-specific, OCPL's
# settings.inc.php file does not provide them. For more
# OKAPI-specific settings, see okapi/settings.php file.
'OC_BRANCH' => 'oc.pl',
'EXTERNAL_AUTOLOADER' => __DIR__.'/lib/ClassPathDictionary.php',
# Copy the rest from settings.inc.php:
'DATA_LICENSE_URL' => $config['okapi']['data_license_url'],
'ADMINS' => ($config['okapi']['admin_emails'] ? $config['okapi']['admin_emails'] :
array('techNotify@opencaching.pl','rygielski@mimuw.edu.pl')),
'FROM_FIELD' => OcConfig::getEmailAddrNoReply(),
'DEBUG' => OcConfig::debugModeEnabled(),
'DB_SERVER' => OcConfig::instance()->getDbHost(), //$dbserver,
'DB_NAME' => OcConfig::instance()->getDbName(), //$dbname,
'DB_USERNAME' => OcConfig::instance()->getDbUser(), //$dbusername,
'DB_PASSWORD' => OcConfig::instance()->getDbPass(), //$dbpasswd,
'SITELANG' => OcConfig::getI18nDefaultLang(),
'SITE_URL' => isset($OKAPI_server_URI) ? $OKAPI_server_URI : $absolute_server_URI,
'VAR_DIR' => OcConfig::getDynFilesPath(TRUE),
'TILEMAP_FONT_PATH' => $config['okapi']['tilemap_font_path'],
'IMAGES_DIR' => rtrim(OcConfig::getPicUploadFolder(), '/'),
'IMAGES_URL' => rtrim((isset($OKAPI_server_URI) ? $OKAPI_server_URI : $absolute_server_URI) . OcConfig::getPicBaseUrl(), '/').'/',
'IMAGE_MAX_UPLOAD_SIZE' => OcConfig::getPicMaxSize() * 1024 * 1024,
'IMAGE_MAX_PIXEL_COUNT' => $config['limits']['image']['height'] * $config['limits']['image']['width'],
'OC_NODE_ID' => OcConfig::getSiteNodeId(),
'OC_COOKIE_NAME' => $config['cookie']['name'].'_auth',
'OCPL_ENABLE_GEOCACHE_ACCESS_LOGS' => false,
'REGISTRATION_URL' => (isset($OKAPI_server_URI) ? $OKAPI_server_URI : $absolute_server_URI) . 'UserRegistration',
'USE_SQL_SUBQUERIES' => true,
'CRON_JOBS_BLACKLIST' => OcConfig::getOkapiCronJobBlacklist(),
];
}