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 7fca8066db3977af062c22a09b07835bd87ef229 (commit)
via 7d80c3dd8b2e3538d0f28edd70a98d028c95c593 (commit)
from 53922c5a78859feef3b94595404d00af323c506c (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 7fca8066db3977af062c22a09b07835bd87ef229
Author: Ivan1986 <iva...@li...>
Date: Wed Mar 31 13:04:33 2010 +0400
PhpDOC и форматирование Curl
diff --git a/lib/Curl.php b/lib/Curl.php
index 7aa57f0..45c219a 100644
--- a/lib/Curl.php
+++ b/lib/Curl.php
@@ -35,13 +35,19 @@ class Curl
unlink($this->cookie_file);
}
+ /**
+ * Добавляет новую куку
+ *
+ * @param string $name имя
+ * @param string $value значение
+ */
public function addCookie($name,$value)
{
$this->cookies[$name] = $name.'='.$value.'; path=/';
}
/**
- * POST запрос по адресу
+ * Очистка печенек
*/
public function clearCookeis()
{
@@ -49,6 +55,11 @@ class Curl
$this->cookies = array();
}
+ /**
+ * Возвращает последнюю ошибку
+ *
+ * @return string строка ошибки
+ */
public function error()
{
return $this->error;
@@ -108,7 +119,6 @@ class Curl
CURLOPT_REFERER => $this->referer,
CURLOPT_URL => $url,
-
));
curl_setopt($handle, CURLOPT_COOKIEFILE, $this->cookie_file);
curl_setopt($handle, CURLOPT_COOKIEJAR, $this->cookie_file);
@@ -140,9 +150,8 @@ class Curl
//Set any custom CURL options
foreach ( $this->options as $option => $value )
- {
- curl_setopt($handle, constant('CURLOPT_' . str_replace('CURLOPT_', '', strtoupper($option))), $value);
- }
+ curl_setopt($handle, constant('CURLOPT_' .
+ str_replace('CURLOPT_', '', strtoupper($option))), $value);
$response = curl_exec($handle);
$header_size = curl_getinfo($handle,CURLINFO_HEADER_SIZE);
@@ -170,19 +179,13 @@ class Curl
*/
class CurlResponse
{
- /**
- * тело ответа
- *
- * @var string
- */
+ /** @var string тело ответа */
public $body = '';
- /**
- * заголовки ответа
- *
- * @var array
- */
+ /** @var array заголовки ответа */
public $headers = array ();
+
+ /** @var boolean Флаг для перекодировки */
private $win=false;
public function __construct($response)
@@ -209,7 +212,7 @@ class CurlResponse
/**
* Преобразовывает запрос из Win1251 в UTF-8
*
- * Очень часто требуется, так как виндузятников развелось немеряно
+ * <br>Очень часто требуется, так как виндузятников развелось немеряно
*
* @return string преобразованная строка
*/
@@ -224,7 +227,7 @@ class CurlResponse
/**
* Просто тело запроса
*
- * @return string
+ * @return string результат запроса
*/
public function __toString()
{
@@ -265,12 +268,18 @@ class CurlResponse
return $num===false ? $forms : $forms[$num];
}
+ /**
+ * Извлекает параметры из тега
+ *
+ * @param string $str тег
+ * @return array массив параметров
+ */
protected function parceTagParams($str)
{
$t = $x = array();
- preg_match_all('|([a-z]+)=([\'"]?)(.*?)\2|si',$str,$t);
- for($i=0;$i<count($t[1]);$i++)
- $x[$t[1][$i]] = $t[3][$i];
+ preg_match_all('|([a-z]+)=([\'"]?)(.*?)\2|si', $str, $t);
+ for($i=0; $i<count($t[1]); $i++)
+ $x[$t[1][$i]] = $t[3][$i];
return $x;
}
commit 7d80c3dd8b2e3538d0f28edd70a98d028c95c593
Author: Ivan1986 <iva...@li...>
Date: Wed Mar 31 12:58:06 2010 +0400
Исправлена ошибка с блокировкой двойного вызова
diff --git a/lib/Lock.php b/lib/Lock.php
index cf210f2..a50b7cb 100644
--- a/lib/Lock.php
+++ b/lib/Lock.php
@@ -15,10 +15,10 @@ class Lock
static public function doubleRun($name, $message='')
{
static $lockfiles;
- if (!isset($lockfiles['name']))
- $lockfiles['name'] = fopen(TMPPATH.'/'.$name.'.run', 'w');
- if (!$lockfiles['name'] ||
- !flock($lockfiles['name'], LOCK_EX | LOCK_NB)
+ if (!isset($lockfiles[$name]))
+ $lockfiles[$name] = fopen(TMPPATH.'/'.$name.'.run', 'w');
+ if (!$lockfiles[$name] ||
+ !flock($lockfiles[$name], LOCK_EX | LOCK_NB)
)
die($message);
}
-----------------------------------------------------------------------
Summary of changes:
lib/Curl.php | 49 +++++++++++++++++++++++++++++--------------------
lib/Lock.php | 8 ++++----
2 files changed, 33 insertions(+), 24 deletions(-)
hooks/post-receive
--
quickfw
|