function __construct()
 {
     if (defined('REDCAT_PUBLIC')) {
         $cwd = REDCAT_PUBLIC;
     } else {
         $cwd = getcwd() . '/';
     }
     $this->dbPath = $cwd . 'langs/hyper-translate.sqlite';
     $this->db = B::selectDatabase('translation', 'sqlite:' . $this->dbPath);
     if (!is_file($this->dbPath)) {
         foreach (explode(';', file_get_contents(__DIR__ . '/install.sql')) as $l) {
             $this->db->execMultiline($l);
         }
     }
 }
Exemple #2
0
    static function setModelClassPrefix($modelClassPrefix = 'Model\\')
    {
        return self::$bases->setModelClassPrefix($modelClassPrefix);
    }
    static function appendModelClassPrefix($modelClassPrefix)
    {
        return self::$bases->appendModelClassPrefix($modelClassPrefix);
    }
    static function prependModelClassPrefix($modelClassPrefix)
    {
        return self::$bases->prependModelClassPrefix($modelClassPrefix);
    }
    static function setEntityClassDefault($entityClassDefault = 'stdClass')
    {
        return self::$bases->setEntityClassDefault($entityClassDefault);
    }
    static function setPrimaryKeyDefault($primaryKeyDefault = 'id')
    {
        return self::$bases->setPrimaryKeyDefault($primaryKeyDefault);
    }
    static function setUniqTextKeyDefault($uniqTextKeyDefault = 'uniq')
    {
        return self::$bases->setUniqTextKeyDefault($uniqTextKeyDefault);
    }
    static function debug()
    {
        return call_user_func_array([self::$currentDataSource, 'debug'], func_get_args());
    }
}
B::_init();
Exemple #3
0
 function __construct(Session $Session = null, $rootLogin = '******', $rootPassword = '******', $rootName = 'Developer', $siteLoginUri = 'Login', $siteActivateUri = 'Signin', $siteResetUri = 'Signin', $tableUsers = 'user', $tableRequests = 'request', $algo = PASSWORD_DEFAULT, $mailSendmail = true, $mailHost = null, $mailUsername = null, $mailPassword = null, $mailPort = 25, $mailSecure = 'tls', DataSource $db = null)
 {
     $this->rootLogin = $rootLogin;
     $this->rootPassword = $rootPassword;
     $this->rootName = $rootName;
     $this->siteLoginUri = $siteLoginUri;
     $this->siteActivateUri = $siteActivateUri;
     $this->siteResetUri = $siteResetUri;
     $this->tableUsers = $tableUsers;
     $this->tableRequests = $tableRequests;
     $this->algo = $algo;
     $this->mailSendmail = $mailSendmail;
     $this->mailHost = $mailHost;
     $this->mailUsername = $mailUsername;
     $this->mailPassword = $mailPassword;
     $this->mailPort = $mailPort;
     $this->mailSecure = $mailSecure;
     if (!$Session) {
         $Session = new Session();
     }
     $this->Session = $Session;
     if (!isset($db) && class_exists('RedCat\\DataMap\\B')) {
         $this->db = B::getDatabase();
     }
     $this->siteUrl = $this->getBaseHref();
     $this->siteUrl = rtrim($this->siteUrl, '/') . '/';
 }