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;
|
|
|
|
$database = 'SS_ssnewdocstest';
|
|
|
|
|
|
|
|
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');
|
|
|
|
|
2011-07-01 02:54:59 +02:00
|
|
|
if(@$_GET['db'] == "sqlite3") {
|
|
|
|
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');
|
2012-12-17 12:03:03 +01:00
|
|
|
DocumentationService::register("framework", BASE_PATH ."/src/framework_3.1/docs/", '3.1');
|
2012-12-17 14:25:15 +01:00
|
|
|
DocumentationService::register("framework", BASE_PATH ."/src/framework_3.0/docs/", '3.0', false, true);
|
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
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2010-08-02 12:06:21 +02:00
|
|
|
|
2012-09-05 11:43:50 +02:00
|
|
|
Object::add_extension('Controller', 'ControllerExtension');
|
2011-01-13 21:20:04 +01:00
|
|
|
|
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
|
|
|
Validator::set_javascript_validation_handler('none');
|
|
|
|
|
|
|
|
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
|
|
|
);
|