public function tearDown()
 {
     colesoApplication::setEnvironment($this->savedEnvironment);
     colesoToken::testReset();
     if ($this->cachePath) {
         colesoApplication::setConfigVal('/system/cacheDir', $this->savedSystemCachePath);
     }
 }
Example #2
0
 protected function registerTestConn()
 {
     $targetFile = colesoApplication::getConfigVal('/system/cacheDir') . 'test/' . $this->cachePath . $this->sqliteDbFileName;
     colesoApplication::setConfigVal('/system/db/default/dbType', 'Pdo_Sqlite');
     colesoApplication::setConfigVal('/system/db/default/dbHost', 'localhost');
     colesoApplication::setConfigVal('/system/db/default/dbName', $targetFile);
     $this->dbConn = colesoDB::getConnection();
 }
 function __construct()
 {
     $this->cachePath = 'bulldoc/edit_controller/';
     $this->sourceFilesDir = dirname(__FILE__) . '/support/fixture/';
     parent::__construct('Edit controller');
     colesoApplication::setConfigVal('/bulldoc/systemTemplates', dirname(__FILE__) . '/support/templates/system/');
     colesoApplication::setConfigVal('/bulldoc/bookshelfConfig', dirname(__FILE__) . '/support/bookshelf.yml');
     colesoApplication::setConfigVal('/bulldoc/textProcessingClass', 'docTemplateSet');
     colesoApplication::setConfigVal('/bulldoc/rootIndexLevel', 2);
     colesoApplication::setConfigVal('/bulldoc/themeDir', dirname(__FILE__) . '/support/workshop/themes/');
     colesoApplication::setConfigVal('/bulldoc/themeUrl', 'support/workshop/themes/');
     colesoApplication::setConfigVal('/bulldoc/output', dirname(__FILE__) . '/support/workshop/output/');
     colesoApplication::setConfigVal('/bulldoc/source', $this->fullCachePath . 'workshop/source/');
 }
 private function loadLocalBookshelf($bookshelfFile)
 {
     if (is_null($bookshelfFile)) {
         if (file_exists('bookshelf.yml')) {
             $bookshelfFile = 'bookshelf.yml';
         } else {
             return;
         }
     }
     if (!detectAbsolutePath($bookshelfFile)) {
         $bookshelfFile = getcwd() . "/{$bookshelfFile}";
     }
     colesoApplication::setConfigVal('/bulldoc/bookshelfConfig', $bookshelfFile);
     colesoApplication::setConfigVal('/bulldoc/source', dirname($bookshelfFile) . '/');
     colesoApplication::setConfigVal('/bulldoc/output', dirname($bookshelfFile) . '/compiled/');
     colesoApplication::setConfigVal('/bulldoc/rootUrl', rtrim(dirname($_SERVER['SCRIPT_NAME']), '\\/') . '/');
 }
 static function formSetDateOrder($order)
 {
     colesoApplication::setConfigVal('/form/FormDateOrder', $order);
 }
Example #6
0
function colesoForceErrDie()
{
    colesoApplication::setConfigVal('/system/errorReporting/ForceDie', true);
}
<?php

colesoApplication::loadMessages('bulldoc/messages');
require_once 'coleso/toolkit/toolkit.php';
require_once 'coleso/locale_strings/strings.php';
require_once 'bulldoc/exceptions.php';
require_once 'bulldoc/path_builder.php';
require_once 'bulldoc/page_builder.php';
require_once 'bulldoc/book_loader.php';
$configSet = colesoApplication::getConfigVal('/system/localConfig');
colesoApplication::setConfigVal('/bulldoc/themeDir', colesoApplication::getConfigVal('/system/docRoot') . 'workshop/themes/');
colesoApplication::setConfigVal('/bulldoc/themeUrl', colesoApplication::getConfigVal('/system/urlRoot') . 'workshop/themes/');
colesoApplication::setConfigVal('/bulldoc/output', colesoApplication::getConfigVal('/system/docRoot') . 'workshop/output/');
colesoApplication::setConfigVal('/bulldoc/rootUrl', colesoApplication::getConfigVal('/system/urlRoot'));
colesoApplication::setConfigVal('/bulldoc/systemTemplates', colesoApplication::getConfigVal('/system/docRoot') . 'workshop/themes/system/');
colesoApplication::setConfigVal('/bulldoc/rootIndexLevel', 2);
//---------------------------------------------------------------------------------------------------
$customSource = $configSet->get('bulldoc::source', colesoApplication::getConfigVal('/system/docRoot') . 'workshop/source/');
colesoApplication::setConfigVal('/bulldoc/source', rtrim($customSource, '\\/') . '/');
//---------------------------------------------------------------------------------------------------
$customBookShelf = $configSet->get('bulldoc::bookshelf', colesoApplication::getConfigVal('/system/docRoot') . 'workshop/source/bookshelf.yml');
colesoApplication::setConfigVal('/bulldoc/bookshelfConfig', $customBookShelf);
//---------------------------------------------------------------------------------------------------
$customTextProcessingClass = $configSet->get('bulldoc::defaultTextProcessingClass', 'docTemplateSet');
colesoApplication::setConfigVal('/bulldoc/textProcessingClass', $customTextProcessingClass);
//---------------------------------------------------------------------------------------------------
$customDefaultTheme = $configSet->get('bulldoc::defaultTheme', 'blueprint');
colesoApplication::setConfigVal('/bulldoc/defaultTheme', $customDefaultTheme);
//for standalone bulldoc application
colesoApplication::setConfigVal('/system/useStandaloneTheme', true);
 function setUpDB()
 {
     colesoApplication::setConfigVal('/system/db/default/dbHost', $this->CONFIG['dbHost']);
     colesoApplication::setConfigVal('/system/db/default/dbLogin', $this->CONFIG['dbLogin']);
     colesoApplication::setConfigVal('/system/db/default/dbPassword', $this->CONFIG['dbPassword']);
     colesoApplication::setConfigVal('/system/db/default/dbBaseName', $this->CONFIG['dbBaseName']);
     colesoApplication::setConfigVal('/system/db/default/DBType', $this->CONFIG['DBType']);
     colesoApplication::setConfigVal('/system/db/default/Encoding', $this->locale['db_encoding']);
     colesoApplication::setConfigVal('/system/db/default/tablePrefix', $this->CONFIG->get('tablePrefix', 'htp_'));
 }
Example #9
0
<?php

colesoApplication::setConfigVal('/bulldoc/systemTemplates', dirname(__FILE__) . '/support/templates/system/');
colesoApplication::setConfigVal('/bulldoc/bookshelfConfig', dirname(__FILE__) . '/support/workshop/bookshelf.yml');
colesoApplication::setConfigVal('/bulldoc/textProcessingClass', 'docTemplateSet');
colesoApplication::setConfigVal('/bulldoc/rootIndexLevel', 2);
colesoApplication::setConfigVal('/bulldoc/themeDir', dirname(__FILE__) . '/support/workshop/themes/');
colesoApplication::setConfigVal('/bulldoc/themeUrl', 'support/workshop/themes/');
colesoApplication::setConfigVal('/bulldoc/output', dirname(__FILE__) . '/support/workshop/output/');
colesoApplication::setConfigVal('/bulldoc/source', dirname(__FILE__) . '/support/workshop/source/');
 public function tearDown()
 {
     colesoApplication::setConfigVal('/system/cacheDir', $this->saveCachePath);
     parent::tearDown();
 }