This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "quickfw".
The branch, master has been updated
via 918448b68383ddb83ce0dd896c89fdff8dfab517 (commit)
via 0592b7de023e179e4a8dad16e0ba3e952d1075f4 (commit)
via fa2424abee5d7ba951f7273e45a41d095c55404b (commit)
via b3d60aa34f6cd8c02a7771d7be82d120f03ae3af (commit)
via 96ab54e3d66e6bf7b403ffbf2daa1ec09f35b170 (commit)
via f3f07bd048e2b68ebfe271c1405742f651c6ead9 (commit)
via 6d8b112233fa8bbfc4c3e243ffe04be1f4b7c436 (commit)
via c379916d66f322799f3ae1bb395ac3a1d0d808b9 (commit)
from 68b2ec429e005a1e7a58d28e5ba33852be511f19 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 918448b68383ddb83ce0dd896c89fdff8dfab517
Author: Ivan Borzenkov <iva...@li...>
Date: Sun Nov 14 19:40:06 2010 +0300
Правки phpdoc в роутере
diff --git a/QFW/QuickFW/Router.php b/QFW/QuickFW/Router.php
index 3124e6f..37425c5 100644
--- a/QFW/QuickFW/Router.php
+++ b/QFW/QuickFW/Router.php
@@ -305,7 +305,7 @@ class QuickFW_Router
protected $rewrite = false;
/** @var array Массив обратных преобразований Uri */
protected $backrewrite = false;
- /** @var array Массив обратных преобразований Urr */
+ /** @var array Массив обратных преобразований Url */
protected $backrewriteUrl = false;
/**
@@ -321,7 +321,7 @@ class QuickFW_Router
}
/**
- * Функция производит фитальные преобразования полного урла
+ * Функция производит финальные преобразования полного урла
*
* @internal
* @param string $url Url для бекреврайта
@@ -348,7 +348,7 @@ class QuickFW_Router
* Реализация преобразования адресов
*
* @internal
- * @param string $url Uri для реврайта
+ * @param string $uri Uri для реврайта
* @param string $type тип преобразования
* @return string преобразованный Uri
*/
commit 0592b7de023e179e4a8dad16e0ba3e952d1075f4
Author: TeXHaPb <st...@in...>
Date: Wed Nov 17 00:49:05 2010 +0300
Правка очепяток + правка подстановки якоря в Url::site
diff --git a/QFW/QuickFW/Url.php b/QFW/QuickFW/Url.php
index bd2ab8c..aef159c 100644
--- a/QFW/QuickFW/Url.php
+++ b/QFW/QuickFW/Url.php
@@ -23,12 +23,12 @@ class Url
*
* @param string|self $url url
* @param string|array $get параметры
- * @param string $ancor якорь
+ * @param string $anchor якорь
* @return self адрес на сайте
*/
- public static function site($url='', $get='', $ancor='')
+ public static function site($url='', $get='', $anchor='')
{
- return new self($url, $get);
+ return new self($url, $get, $anchor);
}
/**
@@ -36,12 +36,12 @@ class Url
*
* @param string|self $CA url
* @param string|array $get параметры
- * @param string $ancor якорь
+ * @param string $anchor якорь
* @return self адрес на сайте
*/
- public static function M($CA='', $get='', $ancor='')
+ public static function M($CA='', $get='', $anchor='')
{
- return new self($CA, $get, $ancor, QFW::$router->cModule.
+ return new self($CA, $get, $anchor, QFW::$router->cModule.
QuickFW_Router::PATH_SEPARATOR);
}
@@ -50,12 +50,12 @@ class Url
*
* @param string|self $action url
* @param string|array $get параметры
- * @param string $ancor якорь
+ * @param string $anchor якорь
* @return self адрес на сайте
*/
- public static function C($action='', $get='', $ancor='')
+ public static function C($action='', $get='', $anchor='')
{
- return new self($action, $get, $ancor, QFW::$router->cModule.
+ return new self($action, $get, $anchor, QFW::$router->cModule.
QuickFW_Router::PATH_SEPARATOR.
QFW::$router->cController.
QuickFW_Router::PATH_SEPARATOR);
@@ -66,12 +66,12 @@ class Url
*
* @param string|self $params url
* @param string|array $get параметры
- * @param string $ancor якорь
+ * @param string $anchor якорь
* @return self адрес на сайте
*/
- public static function A($params='', $get='', $ancor='')
+ public static function A($params='', $get='', $anchor='')
{
- return new self($params, $get, $ancor, QFW::$router->cModule.
+ return new self($params, $get, $anchor, QFW::$router->cModule.
QuickFW_Router::PATH_SEPARATOR.
QFW::$router->cController.
QuickFW_Router::PATH_SEPARATOR.
@@ -98,10 +98,10 @@ class Url
*
* @param string $url внутреннее представление адреса
* @param string|array $get параметры get
- * @param string $ancor якорь
+ * @param string $anchor якорь
* @param string $begin базовый урл от текущего
*/
- private function __construct($url, $get='', $ancor='', $begin='')
+ private function __construct($url, $get='', $anchor='', $begin='')
{
if (is_array($get) && count($get))
$get = http_build_query($get);
@@ -109,7 +109,7 @@ class Url
{
$this->u = $begin.$url->u;
$this->get = $url->get.($get?('&'.$get):'');
- $this->ancor = $ancor ? ltrim($ancor, '#') : $url->ancor;
+ $this->anchor = $anchor ? ltrim($anchor, '#') : $url->anchor;
return;
}
//Заменяем / на QuickFW_Router::PATH_SEPARATOR
@@ -117,7 +117,7 @@ class Url
$url = strtr($url, '/', QuickFW_Router::PATH_SEPARATOR);
$this->u = trim($begin.$url, QuickFW_Router::PATH_SEPARATOR);
$this->get = $get;
- $this->ancor = ltrim($ancor, '#');
+ $this->anchor = ltrim($anchor, '#');
if (self::$config['delDef'])
$this->u = QFW::$router->delDef($this->u);
}
@@ -129,7 +129,7 @@ class Url
private $get;
/** @var string якорь */
- private $ancor;
+ private $anchor;
/**
* урл для вывода, с подстановками
@@ -142,7 +142,7 @@ class Url
self::$config['base'].QFW::$router->backrewrite($this->u).
($this->u!=='' ? self::$config['ext'] : '').
($this->get ? '?' . $this->get : '').
- ($this->ancor ? '#' . $this->ancor : ''));
+ ($this->anchor ? '#' . $this->anchor : ''));
}
commit fa2424abee5d7ba951f7273e45a41d095c55404b
Author: Ivan Borzenkov <iva...@li...>
Date: Fri Nov 12 14:12:53 2010 +0300
Исправил имя класса в phpdoc
diff --git a/QFW/Init.php b/QFW/Init.php
index be198cb..72dfd73 100644
--- a/QFW/Init.php
+++ b/QFW/Init.php
@@ -17,7 +17,7 @@ class QFW
/** @var array Подключенные глобальные библиотеки */
static public $libs = array();
- /** @var DbSimple_Generic_Database|false Подключение к базе данных */
+ /** @var DbSimple_Database|false Подключение к базе данных */
static public $db = false;
/** @var mixed|false Данные о пользователе */
commit b3d60aa34f6cd8c02a7771d7be82d120f03ae3af
Author: Ivan Borzenkov <iva...@li...>
Date: Thu Nov 11 11:21:10 2010 +0300
Вынес имя поля в форме в отдельную функцию
diff --git a/lib/Modules/Scaffold/Fields.php b/lib/Modules/Scaffold/Fields.php
index c2ac617..04ad999 100644
--- a/lib/Modules/Scaffold/Fields.php
+++ b/lib/Modules/Scaffold/Fields.php
@@ -159,13 +159,14 @@ class Scaffold_Field extends Scaffold_Field_Info
/**
* Строит стандартный селект
*
+ * @param string $id первичный ключ
* @param array $data массив ключ=>значение
* @param scalar $cur текущий элемент
* @return string блок селекта
*/
- protected function selectBuild($data, $cur, $null=true)
+ protected function selectBuild($id, $data, $cur, $null=true)
{
- $text = '<select name="data['.$this->name.']">';
+ $text = '<select name="'.$this->editName($id).'">';
if ($null)
$text.= '<option value="0"'.
(!isset($data[$cur]) ? ' selected="selected"' : '').
@@ -178,6 +179,17 @@ class Scaffold_Field extends Scaffold_Field_Info
return $text;
}
+ /**
+ * Имя поля для формы
+ *
+ * @param string $id первичный ключ
+ * @return string Имя поля в name
+ */
+ protected function editName($id)
+ {
+ return 'data['.$this->name.']';
+ }
+
}
//Сервисные классы
@@ -228,7 +240,7 @@ class Scaffold_Foreign extends Scaffold_Field
public function editor($id, $value)
{
- return $this->selectBuild($this->lookup, $value);
+ return $this->selectBuild($id, $this->lookup, $value);
}
public function validator($id, $value)
@@ -282,7 +294,7 @@ class Scaffold_Text extends Scaffold_UserInput
public function editor($id, $value)
{
- return '<textarea name="data['.$this->name.']" '.
+ return '<textarea name="'.$this->editName($id).'" '.
'rows="'.$this->rows.'" cols="'.$this->cols.'">'.
QFW::$view->esc($value).'</textarea>';
}
@@ -343,7 +355,7 @@ class Scaffold_Enum extends Scaffold_Field
public function editor($id, $value)
{
- return $this->selectBuild($this->items, $value, false);
+ return $this->selectBuild($id, $this->items, $value, false);
}
}
@@ -360,8 +372,8 @@ class Scaffold_Checkbox extends Scaffold_Field
public function editor($id, $value)
{
- return '<input type="hidden" name="data['.$this->name.']" value="0" />
- <input type="checkbox" name="data['.$this->name.']" value="1" label="'.$this->title.'"
+ return '<input type="hidden" name="'.$this->editName($id).'" value="0" />
+ <input type="checkbox" name="'.$this->editName($id).'" value="1" label="'.$this->title.'"
default="'.($value?'checked':'').'" />';
}
@@ -404,20 +416,20 @@ class Scaffold_File extends Scaffold_Field
public function editor($id, $value)
{
- return '<input type="file" name="file['.$this->name.']" />
- <input type="hidden" name="data['.$this->name.']" value="0" />
- <input type="checkbox" name="data['.$this->name.']" value="1" label="Удалить" /> '.
+ return '<input type="file" name="f'.$this->editName($id).'" />
+ <input type="hidden" name="'.$this->editName($id).'" value="0" />
+ <input type="checkbox" name="'.$this->editName($id).'" value="1" label="Удалить" /> '.
$this->display($id, $value);
}
public function validator($id, $value)
{
//оставляем старый файл
- if ($_FILES['file']['error'][$this->name] == 4)
+ if ($_FILES['fdata']['error'][$this->name] == 4)
return true;
- if ($_FILES['file']['error'][$this->name] != 0)
+ if ($_FILES['fdata']['error'][$this->name] != 0)
return 'Ошибка при загрузке файла '.$this->title;
- return is_uploaded_file($_FILES['file']['tmp_name'][$this->name]);
+ return is_uploaded_file($_FILES['fdata']['tmp_name'][$this->name]);
}
public function proccess($id, $value)
@@ -428,7 +440,7 @@ class Scaffold_File extends Scaffold_Field
if ($value === false && is_file($this->path.'/'.$old))
unlink($this->path.'/'.$old);
//оставляем старое значение
- if ($_FILES['file']['error'][$this->name] == 4 && !$value)
+ if ($_FILES['fdata']['error'][$this->name] == 4 && !$value)
return $old ? $old : '';
//удяляем старый
if (is_file($this->path.'/'.$old))
@@ -437,11 +449,11 @@ class Scaffold_File extends Scaffold_Field
if ($value)
return '';
//генерим новое имя
- $info = pathinfo($_FILES['file']['name'][$this->name]);
+ $info = pathinfo($_FILES['fdata']['name'][$this->name]);
if ($id == -1)
$id = time();
$new_name = $this->name.'_'.$id.'.'.$info['extension'];
- move_uploaded_file($_FILES['file']['tmp_name'][$this->name], $this->path.'/'.$new_name);
+ move_uploaded_file($_FILES['fdata']['tmp_name'][$this->name], $this->path.'/'.$new_name);
return $new_name;
}
commit 96ab54e3d66e6bf7b403ffbf2daa1ec09f35b170
Author: Ivan Borzenkov <iva...@li...>
Date: Tue Nov 9 14:49:09 2010 +0300
Удален старый файл из XMPP
diff --git a/lib/XMPPHP/XMPP_Old.php b/lib/XMPPHP/XMPP_Old.php
deleted file mode 100644
index 6083dad..0000000
--- a/lib/XMPPHP/XMPP_Old.php
+++ /dev/null
@@ -1,114 +0,0 @@
-<?php
-/**
- * XMPPHP: The PHP XMPP Library
- * Copyright (C) 2008 Nathanael C. Fritz
- * This file is part of SleekXMPP.
- *
- * XMPPHP is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * XMPPHP is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XMPPHP; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category xmpphp
- * @package XMPPHP
- * @author Nathanael C. Fritz <JID: fr...@ne...>
- * @author Stephan Wentz <JID: st...@ja...>
- * @author Michael Garvin <JID: ga...@ne...>
- * @copyright 2008 Nathanael C. Fritz
- */
-
-/** XMPPHP_XMPP
- *
- * This file is unnecessary unless you need to connect to older, non-XMPP-compliant servers like Dreamhost's.
- * In this case, use instead of XMPPHP_XMPP, otherwise feel free to delete it.
- * The old Jabber protocol wasn't standardized, so use at your own risk.
- *
- */
-require_once dirname(__FILE__) . '/XMPP.php';
-
- class XMPPHP_XMPPOld extends XMPPHP_XMPP {
- /**
- *
- * @var string
- */
- protected $session_id;
-
- public function __construct($host, $port, $user, $password, $resource, $server = null, $printlog = false, $loglevel = null) {
- parent::__construct($host, $port, $user, $password, $resource, $server, $printlog, $loglevel);
- if(!$server) $server = $host;
- $this->stream_start = '<stream:stream to="' . $server . '" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">';
- $this->fulljid = "{$user}@{$server}/{$resource}";
- }
-
- /**
- * Override XMLStream's startXML
- *
- * @param parser $parser
- * @param string $name
- * @param array $attr
- */
- public function startXML($parser, $name, $attr) {
- if($this->xml_depth == 0) {
- $this->session_id = $attr['ID'];
- $this->authenticate();
- }
- parent::startXML($parser, $name, $attr);
- }
-
- /**
- * Send Authenticate Info Request
- *
- */
- public function authenticate() {
- $id = $this->getId();
- $this->addidhandler($id, 'authfieldshandler');
- $this->send("<iq type='get' id='$id'><query xmlns='jabber:iq:auth'><username>{$this->user}</username></query></iq>");
- }
-
- /**
- * Retrieve auth fields and send auth attempt
- *
- * @param XMLObj $xml
- */
- public function authFieldsHandler($xml) {
- $id = $this->getId();
- $this->addidhandler($id, 'oldAuthResultHandler');
- if($xml->sub('query')->hasSub('digest')) {
- $hash = sha1($this->session_id . $this->password);
- print "{$this->session_id} {$this->password}\n";
- $out = "<iq type='set' id='$id'><query xmlns='jabber:iq:auth'><username>{$this->user}</username><digest>{$hash}</digest><resource>{$this->resource}</resource></query></iq>";
- } else {
- $out = "<iq type='set' id='$id'><query xmlns='jabber:iq:auth'><username>{$this->user}</username><password>{$this->password}</password><resource>{$this->resource}</resource></query></iq>";
- }
- $this->send($out);
-
- }
-
- /**
- * Determine authenticated or failure
- *
- * @param XMLObj $xml
- */
- public function oldAuthResultHandler($xml) {
- if($xml->attrs['type'] != 'result') {
- $this->log->log("Auth failed!", XMPPHP_Log::LEVEL_ERROR);
- $this->disconnect();
- throw new XMPPHP_Exception('Auth failed!');
- } else {
- $this->log->log("Session started");
- $this->event('session_start');
- }
- }
- }
-
-
-?>
commit f3f07bd048e2b68ebfe271c1405742f651c6ead9
Author: Ivan Borzenkov <iva...@li...>
Date: Fri Nov 12 23:21:29 2010 +0300
Русская дата
diff --git a/lib/utils.php b/lib/utils.php
index c6cc6c4..c950a5f 100644
--- a/lib/utils.php
+++ b/lib/utils.php
@@ -277,7 +277,7 @@ function array2xml($array,$attrName='attr',$arrFlar='array')
/**
* Вывод окончаний русских слов с учетом числительных (например сообщение сообщения сообщений)
*
- * @param intereg $n число
+ * @param integer $n число
* @param string $form1 единственное
* @param string $form2 форма для 2-4
* @param string $form5 форма для 5 и более
@@ -294,6 +294,42 @@ function pluralForm($n, $form1, $form2, $form5)
}
/**
+ * Формирование даты по-русски
+ * <br>так как при выстановке локали неправильно склоняет
+ *
+ * @see date
+ * @param string $format формат аналогичен date
+ * @param integer $time время
+ * @return string дата
+ */
+function russian_date($format, $time=false)
+{
+ static $translation = array(
+ "January" => "Января",
+ "February" => "Февраля",
+ "March" => "Марта",
+ "April" => "Апреля",
+ "May" => "Мая",
+ "June" => "Июня",
+ "July" => "Июля",
+ "August" => "Августа",
+ "September" => "Сентября",
+ "October" => "Октября",
+ "November" => "Ноября",
+ "December" => "Декабря",
+ "Monday" => "Понедельник",
+ "Tuesday" => "Вторник",
+ "Wednesday" => "Среда",
+ "Thursday" => "Четверг",
+ "Friday" => "Пятница",
+ "Saturday" => "Суббота",
+ "Sunday" => "Воскресенье",
+ );
+ return strtr(date($format, $time!==false ? $time : time()), $translation);
+}
+
+
+/**
* Вызывает preg_match(_all) и
* <br>возвращается данные в удобном формате
* <br>с использованием флага PREG_SET_ORDER
commit 6d8b112233fa8bbfc4c3e243ffe04be1f4b7c436
Author: Ivan Borzenkov <iva...@li...>
Date: Wed Nov 3 11:29:32 2010 +0300
Полный бэкреврайт
diff --git a/QFW/QuickFW/Router.php b/QFW/QuickFW/Router.php
index 84e6c78..3124e6f 100644
--- a/QFW/QuickFW/Router.php
+++ b/QFW/QuickFW/Router.php
@@ -305,6 +305,8 @@ class QuickFW_Router
protected $rewrite = false;
/** @var array Массив обратных преобразований Uri */
protected $backrewrite = false;
+ /** @var array Массив обратных преобразований Urr */
+ protected $backrewriteUrl = false;
/**
* Функция производит преобразования урла для вывода на страницу
@@ -319,6 +321,18 @@ class QuickFW_Router
}
/**
+ * Функция производит фитальные преобразования полного урла
+ *
+ * @internal
+ * @param string $url Url для бекреврайта
+ * @return string преобразованный Url
+ */
+ public function backrewriteUrl($url)
+ {
+ return $this->rewr($url, 'backrewriteUrl');
+ }
+
+ /**
* Функция производит преобразования урла при запросе
*
* @internal
@@ -342,17 +356,19 @@ class QuickFW_Router
{
if (!QFW::$config['redirection']['useRewrite'])
return $uri;
- if ($this->$type == false)
+ if ($this->$type === false)
{
- $rewrite = array();
- $backrewrite = array();
+ $rewrite = $backrewrite = $backrewriteUrl = array();
require_once APPPATH . '/rewrite.php';
$this->rewrite = $rewrite;
$this->backrewrite = $backrewrite;
+ $this->backrewriteUrl = $backrewriteUrl;
}
+ if (empty($this->$type))
+ return $uri;
if (is_array($this->$type))
return preg_replace(array_keys($this->$type), array_values($this->$type), $uri);
- elseif (is_callable($this->$type))
+ if (is_callable($this->$type))
{
$f = $this->$type;
return $f($uri);
diff --git a/QFW/QuickFW/Url.php b/QFW/QuickFW/Url.php
index 63c22d5..bd2ab8c 100644
--- a/QFW/QuickFW/Url.php
+++ b/QFW/QuickFW/Url.php
@@ -138,10 +138,11 @@ class Url
*/
public function __toString()
{
- return self::$config['base'].$this->u.
+ return QFW::$router->backrewriteUrl(
+ self::$config['base'].QFW::$router->backrewrite($this->u).
($this->u!=='' ? self::$config['ext'] : '').
($this->get ? '?' . $this->get : '').
- ($this->ancor ? '#' . $this->ancor : '');
+ ($this->ancor ? '#' . $this->ancor : ''));
}
diff --git a/application/rewrite.php b/application/rewrite.php
index 5a8b367..9c7ea74 100644
--- a/application/rewrite.php
+++ b/application/rewrite.php
@@ -4,5 +4,13 @@ $rewrite = array(
);
$backrewrite = array(
);
+$backrewriteUrl = array(
+);
+
+/* пример */
+/*$backrewriteUrl = function($url)
+{
+ return $url.'?from='.QFW::$router->RequestUri ;
+}*/
?>
\ No newline at end of file
commit c379916d66f322799f3ae1bb395ac3a1d0d808b9
Author: Ivan Borzenkov <iva...@li...>
Date: Sun Oct 10 19:39:35 2010 +0400
Добавлена установка пакетов для deb
diff --git a/doc/asciidoc/Makefile b/doc/asciidoc/Makefile
index f676452..ef12398 100644
--- a/doc/asciidoc/Makefile
+++ b/doc/asciidoc/Makefile
@@ -1,8 +1,12 @@
-all: quickfw.pdf quickfw.html
+all: pdf html
FILES = quickfw general quickstart directory mvc blocks templates cache auth autoload helpers features
TEXTS = $(addsuffix .txt, $(FILES) )
+pdf: quickfw.pdf
+
+html: quickfw.html
+
quickfw.pdf: $(TEXTS)
a2x -v quickfw.txt --dblatex-opts='--backend=xetex -o quickfw.pdf' -a lang=ru
@@ -21,4 +25,7 @@ clean:
rm -rf quickfw.html docbook-xsl.css
rm -rf ../../tmp/doc
-.PHONY: all clean
+install:
+ sudo aptitude install asciidoc texlive-xetex source-highlight
+
+.PHONY: all clean install
-----------------------------------------------------------------------
Summary of changes:
QFW/Init.php | 2 +-
QFW/QuickFW/Router.php | 26 +++++++--
QFW/QuickFW/Url.php | 39 +++++++-------
application/rewrite.php | 8 +++
doc/asciidoc/Makefile | 11 +++-
lib/Modules/Scaffold/Fields.php | 44 ++++++++++------
lib/XMPPHP/XMPP_Old.php | 114 ---------------------------------------
lib/utils.php | 38 +++++++++++++-
8 files changed, 124 insertions(+), 158 deletions(-)
delete mode 100644 lib/XMPPHP/XMPP_Old.php
hooks/post-receive
--
quickfw
|