Merge branch 'autoload' of http://gitlab.edu.yar.ru/phedor/PHP_Library into autoload
This commit is contained in:
commit
1b5852cc43
18 changed files with 61 additions and 81 deletions
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* Фильтр действий
|
||||
*/
|
||||
class ActionAccess
|
||||
class Filter_ActionAccess
|
||||
{
|
||||
public $access = array();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
class ActionLogger
|
||||
class Filter_ActionLogger
|
||||
{
|
||||
public $before = array ();
|
||||
public $file;
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class TUpload extends TField
|
|||
* Форма для ввода
|
||||
* @package core
|
||||
*/
|
||||
class TForm
|
||||
class Form_Form
|
||||
{
|
||||
public $field = array ();
|
||||
public $action = "";
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* Генерация файлов Grpahviz dot
|
||||
*/
|
||||
class Dot
|
||||
class Formats_Dot
|
||||
{
|
||||
static function getHeader ()
|
||||
{
|
||||
|
|
@ -48,5 +48,3 @@ class Dot
|
|||
return implode("", $result);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
class Point
|
||||
class Geometry_Point
|
||||
{
|
||||
public $left, $top;
|
||||
function __construct ($left = 0, $top = 0)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once "core/geometry/point.php";
|
||||
|
||||
class Rectangle
|
||||
class Geometry_Rectangle
|
||||
{
|
||||
public $left, $top, $width, $height;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
|
||||
require_once 'core/primitive.php';
|
||||
|
||||
/**
|
||||
* Использовать интерфейсы чтобы определить какие действия можно совершать с обьектом и таким образом
|
||||
* Строить набор действий Action и отображений View для обьекта
|
||||
|
|
|
|||
|
|
@ -25,9 +25,6 @@ class PathMapper
|
|||
|
||||
function findAll (Collection $request, $id = null)
|
||||
{
|
||||
require_once "core/settings.php";
|
||||
require_once "core/path.php";
|
||||
|
||||
$this->reference = $id;
|
||||
|
||||
$base = $this->basePath ();
|
||||
|
|
@ -75,4 +72,3 @@ class PathMapper
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
<?php
|
||||
|
||||
require_once 'table.php';
|
||||
require_once 'meta.php';
|
||||
|
||||
/**
|
||||
* Класс для составления запроса
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
<?php
|
||||
|
||||
require_once 'core/search/htmlhelper.php';
|
||||
require_once 'core/search/stemmer.php';
|
||||
require_once 'core/path.php';
|
||||
|
||||
/**
|
||||
* Индексирование файлов
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once 'core/search/lexer.php';
|
||||
require_once 'core/functions.php';
|
||||
require_once __DIR__ '/../functions.php';
|
||||
|
||||
/**
|
||||
* Поиск в индексе
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
<?php
|
||||
|
||||
require_once 'core/search/search.php';
|
||||
require_once 'core/search/htmlhelper.php';
|
||||
require_once 'core/search/stemmer.php';
|
||||
|
||||
class Searcher {
|
||||
/* protected */ public $index;
|
||||
protected $text;
|
||||
|
|
|
|||
|
|
@ -1,37 +1,53 @@
|
|||
<?php
|
||||
|
||||
// from creole
|
||||
function strToArray($str)
|
||||
{
|
||||
$str = substr($str, 1, -1); // remove { }
|
||||
$res = array();
|
||||
|
||||
$subarr = array();
|
||||
$in_subarr = 0;
|
||||
|
||||
$toks = explode(',', $str);
|
||||
foreach($toks as $tok) {
|
||||
if ($in_subarr > 0) { // already in sub-array?
|
||||
$subarr[$in_subarr][] = $tok;
|
||||
if ('}' === substr($tok, -1, 1)) { // check to see if we just added last component
|
||||
$res[] = $this->strToArray(implode(',', $subarr[$in_subarr]));
|
||||
$in_subarr--;
|
||||
}
|
||||
} elseif ($tok{0} === '{') { // we're inside a new sub-array
|
||||
if ('}' !== substr($tok, -1, 1)) {
|
||||
$in_subarr++;
|
||||
// if sub-array has more than one element
|
||||
$subarr[$in_subarr] = array();
|
||||
$subarr[$in_subarr][] = $tok;
|
||||
} else {
|
||||
$res[] = $this->strToArray($tok);
|
||||
}
|
||||
} else { // not sub-array
|
||||
$val = trim($tok, '"'); // remove " (surrounding strings)
|
||||
// perform type castng here?
|
||||
$res[] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
class Tools_String {
|
||||
// from creole
|
||||
static function strToArray($str)
|
||||
{
|
||||
$str = substr($str, 1, -1); // remove { }
|
||||
$res = array();
|
||||
|
||||
$subarr = array();
|
||||
$in_subarr = 0;
|
||||
|
||||
$toks = explode(',', $str);
|
||||
foreach($toks as $tok) {
|
||||
if ($in_subarr > 0) { // already in sub-array?
|
||||
$subarr[$in_subarr][] = $tok;
|
||||
if ('}' === substr($tok, -1, 1)) { // check to see if we just added last component
|
||||
$res[] = $this->strToArray(implode(',', $subarr[$in_subarr]));
|
||||
$in_subarr--;
|
||||
}
|
||||
} elseif ($tok{0} === '{') { // we're inside a new sub-array
|
||||
if ('}' !== substr($tok, -1, 1)) {
|
||||
$in_subarr++;
|
||||
// if sub-array has more than one element
|
||||
$subarr[$in_subarr] = array();
|
||||
$subarr[$in_subarr][] = $tok;
|
||||
} else {
|
||||
$res[] = $this->strToArray($tok);
|
||||
}
|
||||
} else { // not sub-array
|
||||
$val = trim($tok, '"'); // remove " (surrounding strings)
|
||||
// perform type castng here?
|
||||
$res[] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
static function translit($st) {
|
||||
$st = strtr($st,"абвгдеёзийклмнопрстуфхъыэ !№", "abvgdeeziyklmnoprstufh_ie__#");
|
||||
$st = strtr($st,"АБВГДЕЁЗИЙКЛМНОПРСТУФХЪЫЭ", "ABVGDEEZIYKLMNOPRSTUFH_IE");
|
||||
$st = strtr($st, array(
|
||||
"ж"=>"zh", "ц"=>"ts", "ч"=>"ch", "ш"=>"sh",
|
||||
"щ"=>"shch","ь"=>"", "ю"=>"yu", "я"=>"ya",
|
||||
"Ж"=>"ZH", "Ц"=>"TS", "Ч"=>"CH", "Ш"=>"SH",
|
||||
"Щ"=>"SHCH","Ь"=>"", "Ю"=>"YU", "Я"=>"YA",
|
||||
"ї"=>"i", "Ї"=>"Yi", "є"=>"ie", "Є"=>"Ye"
|
||||
));
|
||||
return $st;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* Формат для композиции изображений
|
||||
*/
|
||||
class TemplateImage
|
||||
class Tools_TemplateImage
|
||||
{
|
||||
static $listfiles = array('jpg' => 'jpeg', 'gif' => 'gif', 'png' => 'png', 'bmp' => 'wbmp');
|
||||
static $listfonts = array(
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
<?php
|
||||
|
||||
function translit($st) {
|
||||
$st = strtr($st,"абвгдеёзийклмнопрстуфхъыэ !№", "abvgdeeziyklmnoprstufh_ie__#");
|
||||
$st = strtr($st,"АБВГДЕЁЗИЙКЛМНОПРСТУФХЪЫЭ", "ABVGDEEZIYKLMNOPRSTUFH_IE");
|
||||
$st = strtr($st, array(
|
||||
"ж"=>"zh", "ц"=>"ts", "ч"=>"ch", "ш"=>"sh",
|
||||
"щ"=>"shch","ь"=>"", "ю"=>"yu", "я"=>"ya",
|
||||
"Ж"=>"ZH", "Ц"=>"TS", "Ч"=>"CH", "Ш"=>"SH",
|
||||
"Щ"=>"SHCH","Ь"=>"", "Ю"=>"YU", "Я"=>"YA",
|
||||
"ї"=>"i", "Ї"=>"Yi", "є"=>"ie", "Є"=>"Ye"
|
||||
));
|
||||
return $st;
|
||||
}
|
||||
|
|
@ -86,7 +86,7 @@ function _inside($a, $x, $y) {
|
|||
return " " . $a . " > " . $x . " AND " . $a . " < " . $y;
|
||||
}
|
||||
|
||||
class CDBTree
|
||||
class Tree_DBTree
|
||||
{
|
||||
var $db; // CDatabase class to plug to
|
||||
var $table; // Table with Nested Sets implemented
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
// Note: For best viewing of the code Tab size 4 is recommended
|
||||
//****************************************************************************
|
||||
|
||||
class CDatabase
|
||||
class Tree_Database
|
||||
{
|
||||
var $link;
|
||||
var $db;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
* $sort = new NestedSetSort();
|
||||
* $data = $sort->sortBy($data, 'name');
|
||||
*/
|
||||
class NestedSetSort {
|
||||
class Tree_Sort {
|
||||
private $data = array();
|
||||
private $result = array();
|
||||
private $sortBy = '';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue