diff --git a/src/Filter/ActionAccess.php b/src/Filter/ActionAccess.php index a44721b..7504a86 100644 --- a/src/Filter/ActionAccess.php +++ b/src/Filter/ActionAccess.php @@ -3,7 +3,7 @@ /** * Фильтр действий */ -class ActionAccess +class Filter_ActionAccess { public $access = array(); diff --git a/src/Filter/ActionLogger.php b/src/Filter/ActionLogger.php index c92d37c..2d6c395 100644 --- a/src/Filter/ActionLogger.php +++ b/src/Filter/ActionLogger.php @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/src/Geometry/Point.php b/src/Geometry/Point.php index 61254e6..0e11934 100644 --- a/src/Geometry/Point.php +++ b/src/Geometry/Point.php @@ -1,6 +1,6 @@ reference = $id; $base = $this->basePath (); @@ -75,4 +72,3 @@ class PathMapper } } -?> \ No newline at end of file diff --git a/src/Query/query.php b/src/Query/query.php index 3e4b395..e93e7e5 100644 --- a/src/Query/query.php +++ b/src/Query/query.php @@ -1,8 +1,5 @@ 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; + } } diff --git a/src/Tools/TemplateImage.php b/src/Tools/TemplateImage.php index 8b03b4c..31bdfcc 100644 --- a/src/Tools/TemplateImage.php +++ b/src/Tools/TemplateImage.php @@ -3,7 +3,7 @@ /** * Формат для композиции изображений */ -class TemplateImage +class Tools_TemplateImage { static $listfiles = array('jpg' => 'jpeg', 'gif' => 'gif', 'png' => 'png', 'bmp' => 'wbmp'); static $listfonts = array( diff --git a/src/Tools/Translit.php b/src/Tools/Translit.php deleted file mode 100644 index 1ca001c..0000000 --- a/src/Tools/Translit.php +++ /dev/null @@ -1,14 +0,0 @@ -"zh", "ц"=>"ts", "ч"=>"ch", "ш"=>"sh", - "щ"=>"shch","ь"=>"", "ю"=>"yu", "я"=>"ya", - "Ж"=>"ZH", "Ц"=>"TS", "Ч"=>"CH", "Ш"=>"SH", - "Щ"=>"SHCH","Ь"=>"", "Ю"=>"YU", "Я"=>"YA", - "ї"=>"i", "Ї"=>"Yi", "є"=>"ie", "Є"=>"Ye" - )); - return $st; -} diff --git a/src/Tree/DBtree.php b/src/Tree/DBtree.php index ad83ab3..1a5792f 100644 --- a/src/Tree/DBtree.php +++ b/src/Tree/DBtree.php @@ -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 diff --git a/src/Tree/Database.php b/src/Tree/Database.php index c9c8133..9c29f18 100644 --- a/src/Tree/Database.php +++ b/src/Tree/Database.php @@ -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; diff --git a/src/Tree/Sort.php b/src/Tree/Sort.php index cefd3e3..7cf4477 100644 --- a/src/Tree/Sort.php +++ b/src/Tree/Sort.php @@ -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 = '';