Example #1
0
 function colesoToken($fromInstance = '')
 {
     if ($fromInstance == '') {
         colesoErrDie('This is singleton: use getInstance instead of constructor');
     }
     $this->Environment = colesoApplication::getEnvironment();
     $this->tokenKey = colesoApplication::getConfigVal('/system/tokenName', 'colesoToken');
     $this->tokenTimeKey = colesoApplication::getConfigVal('/system/tokenTimeName', 'colesoTokenTime');
 }
 public function __construct($title)
 {
     //$this->cachePath and $sourceFilesDir should be specified inside the child's constructor
     parent::__construct($title);
     $this->fullCachePath = colesoApplication::getConfigVal('/system/cacheDir') . 'test/' . $this->cachePath;
     $this->savedEnvironment = colesoApplication::getEnvironment();
     if (isset($_GET['mode']) && $_GET['mode'] == 'debug') {
         $this->debugMode = 'debug';
         colesoEchoDebugHeader();
     }
 }
 function testShowTocForm()
 {
     $env = colesoApplication::getEnvironment();
     $env->method = 'GET';
     $bookLoader = new bookLoader();
     $parameters = array('bookKey' => 'bulldoc_book', 'bookLoader' => $bookLoader, 'book' => $bookLoader->getBook('bulldoc_book'), 'url' => 'introduction.html');
     $controller = new tocEditController();
     $controller->addParameters($parameters);
     $result = $controller->run();
     $examinator = $this->getContentExaminator($result->content);
     echo $examinator->display();
     $this->assertEqual($examinator->getMD5(), 'd9d5461896709de200ad36613e63f7d0', 'TOC Edit form rendered');
 }
Example #4
0
 private static function obtainCurrentLanguage()
 {
     if (colesoApplication::getConfigVal('/system/language')) {
         return colesoApplication::getConfigVal('/system/language');
     }
     $language = self::$defaultLang;
     $environment = colesoApplication::getEnvironment();
     $url = $environment->getRequestURL();
     foreach (self::$languageList as $language) {
         if (preg_match('/^\\/' . $language . '/', $url)) {
             return $language;
         }
     }
     return $language;
 }
function colesoForvard404()
{
    $myEnv = colesoApplication::getEnvironment();
    $myEnv->generalVarPool->set('/system/not_found', true);
}
 function __construct()
 {
     $this->Environment = colesoApplication::getEnvironment();
     $this->parameters = new colesoDataSet();
 }
Example #7
0
 function colesoControlLoginSession()
 {
     $this->dbConn = colesoDB::getConnection();
     $this->tPrefix = colesoApplication::getConfigVal('/system/db/tablePrefix');
     $this->environment = colesoApplication::getEnvironment();
     //obsolete ref
 }
 function colesoUserLoginManager($authClass)
 {
     $this->Environment = colesoApplication::getEnvironment();
     $this->loginControl = new $authClass();
     $loginDataStructure = array('tablename' => 'pseudo_table', 'fields' => array('id' => array('datatype' => 'int'), 'login' => array('datatype' => 'string'), 'passwd' => array('datatype' => 'string')), 'notEmptyList' => array(), 'idField' => 'id');
     colesoSchemaConfigPool::setConfig('/sys/login', $loginDataStructure);
     $this->loginDataObject = new colesoDomainObject('/sys/login');
     $this->Environment->runtimeObjectPool['sessionHandler'] =& $this->loginControl;
 }