2010-08-02 12:06:21 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
global $project;
|
2012-09-05 11:43:50 +02:00
|
|
|
$project = 'app';
|
2010-08-02 12:06:21 +02:00
|
|
|
|
|
|
|
global $database;
|
2014-07-05 05:05:32 +02:00
|
|
|
$database = 'SS_ssdoc';
|
2010-08-02 12:06:21 +02:00
|
|
|
|
|
|
|
require_once('conf/ConfigureFromEnv.php');
|
|
|
|
|
|
|
|
MySQLDatabase::set_connection_charset('utf8');
|
|
|
|
|
2012-09-05 11:43:50 +02:00
|
|
|
error_reporting(E_ALL);
|
|
|
|
|
2010-08-02 12:06:21 +02:00
|
|
|
// This line set's the current theme. More themes can be
|
|
|
|
// downloaded from http://www.silverstripe.org/themes/
|
|
|
|
SSViewer::set_theme('docs');
|
|
|
|
|
2014-01-14 09:22:33 +01:00
|
|
|
if(Director::isDev() && @$_GET['db'] == "sqlite3") {
|
2011-07-01 02:54:59 +02:00
|
|
|
global $databaseConfig;
|
|
|
|
$databaseConfig['type'] = 'SQLite3Database';
|
|
|
|
}
|
|
|
|
|
2010-08-02 12:06:21 +02:00
|
|
|
DocumentationViewer::set_link_base('');
|
|
|
|
DocumentationViewer::$check_permission = false;
|
2010-09-03 01:26:13 +02:00
|
|
|
|
2010-08-02 12:06:21 +02:00
|
|
|
DocumentationService::set_automatic_registration(false);
|
2010-12-23 02:09:31 +01:00
|
|
|
DocumentationSearch::enable();
|
|
|
|
|
2012-09-09 08:19:41 +02:00
|
|
|
try {
|
2013-01-22 12:16:11 +01:00
|
|
|
DocumentationService::register("framework", BASE_PATH ."/src/framework_master/docs/", 'trunk');
|
2013-10-01 03:00:19 +02:00
|
|
|
DocumentationService::register("framework", BASE_PATH ."/src/framework_3.1/docs/", '3.1', false, true);
|
|
|
|
DocumentationService::register("framework", BASE_PATH ."/src/framework_3.0/docs/", '3.0');
|
2012-06-20 17:57:11 +02:00
|
|
|
DocumentationService::register("framework", BASE_PATH ."/src/framework_2.4/docs/", '2.4');
|
|
|
|
DocumentationService::register("framework", BASE_PATH ."/src/framework_2.3/docs/", '2.3');
|
2010-12-23 02:09:31 +01:00
|
|
|
} catch(InvalidArgumentException $e) {
|
2012-09-05 11:43:50 +02:00
|
|
|
|
2010-12-23 02:09:31 +01:00
|
|
|
} // Silence if path is not found (for CI environment)
|
2010-09-03 03:37:55 +02:00
|
|
|
|
2012-09-05 11:43:50 +02:00
|
|
|
DocumentationViewer::set_edit_link(
|
|
|
|
'framework',
|
|
|
|
'https://github.com/silverstripe/sapphire/edit/%version%/docs/%lang%/%path%',
|
|
|
|
array(
|
|
|
|
'rewritetrunktomaster' => true
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2012-09-09 08:19:41 +02:00
|
|
|
if(Director::isLive()) {
|
|
|
|
ControllerExtension::$google_analytics_code = 'UA-84547-8';
|
|
|
|
}
|
|
|
|
|
2011-04-19 11:46:38 +02:00
|
|
|
DocumentationSearch::set_meta_data(array(
|
|
|
|
'ShortName' => 'SilverStripe Documentation',
|
2012-04-16 08:05:06 +02:00
|
|
|
'Description' => 'Documentation for SilverStripe CMS / Framework',
|
2011-04-29 01:54:32 +02:00
|
|
|
'Tags' => 'silverstripe sapphire php framework cms content management system'
|
2011-04-19 11:46:38 +02:00
|
|
|
));
|
2011-04-10 22:52:09 +02:00
|
|
|
|
|
|
|
DocumentationSearch::$boost_by_path = array(
|
|
|
|
// Changelogs have heaps of phrases, but are rarely relevant for content searches
|
|
|
|
'/^changelog/' => 0.05
|
2011-04-19 11:46:38 +02:00
|
|
|
);
|
2014-07-05 05:33:05 +02:00
|
|
|
|
|
|
|
// Set shared index (avoid issues with different temp paths between CLI and web users)
|
|
|
|
if(file_exists(BASE_PATH . '/.lucene-index')) {
|
|
|
|
DocumentationSearch::set_index(BASE_PATH . '/.lucene-index');
|
|
|
|
}
|