doc.silverstripe.org/app/_config.php

70 lines
2.1 KiB
PHP
Raw Normal View History

<?php
global $project;
$project = 'app';
global $database;
$database = 'SS_ssdoc';
2014-09-19 06:54:23 +02:00
if (defined('SS_DATABASE_NAME')) {
$database = SS_DATABASE_NAME;
}
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');
}
MySQLDatabase::set_connection_charset('utf8');
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);
DocumentationViewer::set_edit_link(
'framework',
'https://github.com/silverstripe/silverstripe-framework/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';
}
DocumentationSearch::set_meta_data(array(
'ShortName' => 'SilverStripe Documentation',
'Description' => 'Documentation for SilverStripe CMS / Framework',
'Tags' => 'silverstripe sapphire php framework cms content management system'
));
// 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(
'/^changelog/' => 0.05
2014-09-20 04:12:39 +02:00
));
// Set shared index (avoid issues with different temp paths between CLI and web users)
if(file_exists(BASE_PATH . '/.lucene-index')) {
Config::inst()->update('DocumentationSearch', 'index_location', BASE_PATH . '/.lucene-index');
}
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 ()
);