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
|
|
|
|
2014-09-19 06:54:23 +02:00
|
|
|
if (defined('SS_DATABASE_NAME')) {
|
2014-09-19 06:49:05 +02:00
|
|
|
$database = SS_DATABASE_NAME;
|
|
|
|
}
|
2010-08-02 12:06:21 +02:00
|
|
|
|
2014-09-20 04:38:04 +02:00
|
|
|
if(isset($_ENV['CLEARDB_DATABASE_URL'])) {
|
|
|
|
global $databaseConfig;
|
|
|
|
|
|
|
|
$parts = parse_url($_ENV['CLEARDB_DATABASE_URL']);
|
|
|
|
|
|
|
|
$databaseConfig['type'] = 'MySQLDatabase';
|
|
|
|
$databaseConfig['server'] = $parts['host'];
|
|
|
|
$databaseConfig['username'] = $parts['user'];
|
|
|
|
$databaseConfig['password'] = $parts['pass'];
|
|
|
|
$databaseConfig['database'] = trim($parts['path'], '/');
|
|
|
|
} else {
|
|
|
|
require_once('conf/ConfigureFromEnv.php');
|
|
|
|
}
|
2014-09-19 07:03:04 +02:00
|
|
|
|
2014-09-19 06:49:05 +02:00
|
|
|
MySQLDatabase::set_connection_charset('utf8');
|
2012-09-05 11:43:50 +02:00
|
|
|
|
2010-08-02 12:06:21 +02:00
|
|
|
SSViewer::set_theme('docs');
|
|
|
|
|
2015-06-19 07:22:44 +02:00
|
|
|
Config::inst()->update('DocumentationManifest', 'automatic_registration', false);
|
2014-09-20 04:12:39 +02:00
|
|
|
Config::inst()->update('DocumentationViewer', 'link_base', '');
|
|
|
|
Config::inst()->update('DocumentationViewer', 'check_permission', false);
|
2010-09-03 03:37:55 +02:00
|
|
|
|
2012-09-05 11:43:50 +02:00
|
|
|
DocumentationViewer::set_edit_link(
|
|
|
|
'framework',
|
2014-11-14 23:50:54 +01:00
|
|
|
'https://github.com/silverstripe/silverstripe-framework/edit/%version%/docs/%lang%/%path%',
|
2012-09-05 11:43:50 +02:00
|
|
|
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
|
|
|
|
2014-11-14 23:50:54 +01:00
|
|
|
// Changelogs have heaps of phrases, but are rarely relevant for content searches
|
2014-09-20 04:12:39 +02:00
|
|
|
Config::inst()->update('DocumentationSearch', 'boost_by_path', array(
|
2011-04-10 22:52:09 +02:00
|
|
|
'/^changelog/' => 0.05
|
2014-09-20 04:12:39 +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')) {
|
2014-11-25 07:21:44 +01:00
|
|
|
Config::inst()->update('DocumentationSearch', 'index_location', BASE_PATH . '/.lucene-index');
|
2014-09-19 06:49:05 +02:00
|
|
|
}
|
2014-09-20 04:38:04 +02:00
|
|
|
|
2015-06-19 07:22:44 +02:00
|
|
|
// Fix invalid character in iconv
|
|
|
|
// see http://stackoverflow.com/questions/4723135/invalid-characters-for-lucene-text-search
|
|
|
|
Zend_Search_Lucene_Search_QueryParser::setDefaultEncoding('utf-8');
|
|
|
|
Zend_Search_Lucene_Analysis_Analyzer::setDefault(
|
|
|
|
new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8_CaseInsensitive ()
|
|
|
|
);
|
2014-11-14 23:50:54 +01:00
|
|
|
|