Поправил название классов
This commit is contained in:
parent
f041488554
commit
0b66a72484
3 changed files with 20 additions and 14 deletions
|
|
@ -1,7 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
///<reference path="Database/PDOStatement.php" />
|
///<reference path="Database/PDOStatement.php" />
|
||||||
|
|
||||||
namespace ctiso;
|
namespace {
|
||||||
|
if(!function_exists('sqliteLower')){
|
||||||
|
function sqliteLower($str) {
|
||||||
|
return mb_strtolower($str, 'UTF-8');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace ctiso {
|
||||||
use PDO,
|
use PDO,
|
||||||
ctiso\Database\Statement,
|
ctiso\Database\Statement,
|
||||||
ctiso\Database\IdGenerator;
|
ctiso\Database\IdGenerator;
|
||||||
|
|
@ -45,13 +53,7 @@ class Database extends PDO
|
||||||
$connection->setAttribute(PDO::ATTR_TIMEOUT, 5);
|
$connection->setAttribute(PDO::ATTR_TIMEOUT, 5);
|
||||||
$mode = defined('SQLITE_JOURNAL_MODE') ? SQLITE_JOURNAL_MODE : 'WAL';
|
$mode = defined('SQLITE_JOURNAL_MODE') ? SQLITE_JOURNAL_MODE : 'WAL';
|
||||||
$connection->query("PRAGMA journal_mode=$mode");
|
$connection->query("PRAGMA journal_mode=$mode");
|
||||||
|
$connection->sqliteCreateFunction('LOWER', 'sqliteLower', 1);
|
||||||
if(!function_exists('sqliteLower')){
|
|
||||||
function sqliteLower($str) {
|
|
||||||
return mb_strtolower($str, 'UTF-8');
|
|
||||||
}
|
|
||||||
$connection->sqliteCreateFunction('LOWER', 'sqliteLower', 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$connection->dsn = $dsn;
|
$connection->dsn = $dsn;
|
||||||
return $connection;
|
return $connection;
|
||||||
|
|
@ -183,3 +185,4 @@ class Database extends PDO
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace ctiso;
|
namespace ctiso\Role;
|
||||||
use ctiso\Database,
|
use ctiso\Database,
|
||||||
ctiso\Database\Statement;
|
ctiso\Database\Statement;
|
||||||
|
|
||||||
|
|
@ -17,7 +17,9 @@ class User
|
||||||
public $db;
|
public $db;
|
||||||
public $groups;
|
public $groups;
|
||||||
|
|
||||||
protected function __construct($db, $groups) {
|
function __construct($db, $groups) {
|
||||||
|
$this->db = $db;
|
||||||
|
$this->groups = $groups;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDB(Database $db) {
|
public function setDB(Database $db) {
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,10 @@ use PHPTAL_Php_TalesInternal,
|
||||||
ctiso\Controller\Site,
|
ctiso\Controller\Site,
|
||||||
ctiso\Controller\Component,
|
ctiso\Controller\Component,
|
||||||
ctiso\HttpRequest,
|
ctiso\HttpRequest,
|
||||||
|
PHPTAL_Tales,
|
||||||
PHPTAL_TalesRegistry;
|
PHPTAL_TalesRegistry;
|
||||||
|
|
||||||
class Tales_DateTime_ implements PHPTAL_Tales
|
class Tales_DateTime implements PHPTAL_Tales
|
||||||
{
|
{
|
||||||
static public function date($expression, $nothrow = false) {
|
static public function date($expression, $nothrow = false) {
|
||||||
return "ctiso\\Tales::phptal_date(".PHPTAL_Php_TalesInternal::path ($expression).")";
|
return "ctiso\\Tales::phptal_date(".PHPTAL_Php_TalesInternal::path ($expression).")";
|
||||||
|
|
@ -68,8 +69,8 @@ class Tales {
|
||||||
|
|
||||||
/* Регистрация нового префикса для подключения компонента */
|
/* Регистрация нового префикса для подключения компонента */
|
||||||
$tales = PHPTAL_TalesRegistry::getInstance();
|
$tales = PHPTAL_TalesRegistry::getInstance();
|
||||||
$tales->registerPrefix('component', array('ctiso\\Component_Tales', 'component'));
|
$tales->registerPrefix('component', array('ctiso\\Tales_Component', 'component'));
|
||||||
$tales->registerPrefix('date', array('ctiso\\DateTime_Tales', 'date'));
|
$tales->registerPrefix('date', array('ctiso\\Tales_DateTime', 'date'));
|
||||||
$tales->registerPrefix('time', array('ctiso\\DateTime_Tales', 'time'));
|
$tales->registerPrefix('time', array('ctiso\\Tales_DateTime', 'time'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue