[PHP-CVS] [git] karma.git branch PHP_POST_RECEIVE updated. 8507e88

2012-03-10 Thread irker
The branch PHP_POST_RECEIVE on karma.git has been updated
   via  8507e88c7abde403c9bdf1b385d5d4f2b284d1f3 (commit)
   via  509b56df21c8cd0ee971c9580adadc00379df8b1 (commit)
   via  454db4da98f95049825b3a9018542d709136a7bc (commit)
  from  e41adefbee4ab8758d42a360eeaecd5e22bb7e30 (commit)

http://git.php.net/?p=karma.git;a=log;h=8507e88c7abde403c9bdf1b385d5d4f2b284d1f3;hp=e41adefbee4ab8758d42a360eeaecd5e22bb7e30

Summary of changes:
 hooks/post-receive  |7 +-
 lib/Git/PostReceiveHook.php |  285 +--
 lib/Git/ReceiveHook.php |   10 +-
 lib/Mail.php|  169 +
 4 files changed, 398 insertions(+), 73 deletions(-)
 create mode 100644 lib/Mail.php

-- Log 
commit 8507e88c7abde403c9bdf1b385d5d4f2b284d1f3
Author: Alexander Moskaliov ir...@php.net
Date:   Sat Mar 10 20:38:54 2012 +0400

add Mail class and reformat commit mail

diff --git a/hooks/post-receive b/hooks/post-receive
index b05bd82..12884a4 100755
--- a/hooks/post-receive
+++ b/hooks/post-receive
@@ -10,6 +10,7 @@ namespace Karma;
 // TODO: reformat mails
 // TODO: check mail length
 
+// /git/users.db
 
 error_reporting(E_ALL | E_STRICT);
 date_default_timezone_set('UTC');
@@ -23,6 +24,7 @@ set_include_path('/git/checkout/karma/lib' .
 PATH_SEPARATOR .
 get_include_path());
 
+include 'Mail.php';
 include 'Git.php';
 include 'Git/ReceiveHook.php';
 include 'Git/PostReceiveHook.php';
diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php
index fd8df3f..8250559 100644
--- a/lib/Git/PostReceiveHook.php
+++ b/lib/Git/PostReceiveHook.php
@@ -76,9 +76,9 @@ class PostReceiveHook extends ReceiveHook
 //send mails per ref push
 foreach ($this-refs as $ref) {
 if ($ref['reftype'] == self::REF_TAG) {
-$this-sendTagMail($ref);
+$this-sendTagMail($ref['refname'], $ref['changetype'], 
$ref['old'], $ref['new']);
 } elseif ($ref['reftype'] == self::REF_BRANCH){
-$this-sendBranchMail($ref);
+$this-sendBranchMail($ref['refname'], $ref['changetype'], 
$ref['old'], $ref['new']);
 }
 }
 
@@ -92,44 +92,47 @@ class PostReceiveHook extends ReceiveHook
 }
 
 /**
- * @param array $branch
+ * @param $name string
+ * @param $changeType int
+ * @param $oldrev string
+ * @param $newrev string
  */
-private function sendBranchMail(array $branch)
+private function sendBranchMail($name, $changeType, $oldrev, $newrev)
 {
 
-if ($branch['changetype'] == self::TYPE_UPDATED) {
-$title = Branch  . $branch['refname'] .  was updated;
-} elseif ($branch['changetype'] == self::TYPE_CREATED) {
-$title = Branch  . $branch['refname'] .  was created;
+if ($changeType == self::TYPE_UPDATED) {
+$title = Branch  . $name .  was updated;
+} elseif ($changeType == self::TYPE_CREATED) {
+$title = Branch  . $name .  was created;
 } else {
-$title = Branch  . $branch['refname'] .  was deleted;
+$title = Branch  . $name .  was deleted;
 }
 $message = $title . \n\n;
 
 
-if ($branch['changetype'] != self::TYPE_DELETED) {
+if ($changeType != self::TYPE_DELETED) {
 
-if ($branch['changetype'] == self::TYPE_UPDATED) {
+if ($changeType == self::TYPE_UPDATED) {
 // check if push was with --force option
-if ($replacedRevisions = $this-getRevisions($branch['new'] . 
'..' . $branch['old'])) {
+if ($replacedRevisions = $this-getRevisions($newrev . '..' . 
$oldrev)) {
 $message .= Discarded revisions: \n . implode(\n, 
$replacedRevisions) . \n;
 }
 
 // git rev-list old..new
-$revisions = $this-getRevisions($branch['old'] . '..' . 
$branch['new']);
+$revisions = $this-getRevisions($oldrev . '..' . $newrev);
 
 } else {
 // for new branch we write log about new commits only
-$revisions = $this-getRevisions($branch['new']. ' --not ' . 
implode(' ', array_diff($this-allBranches, $this-newBranches)));
+$revisions = $this-getRevisions($newrev. ' --not ' . 
implode(' ', array_diff($this-allBranches, $this-newBranches)));
 
 foreach ($this-updatedBranches as $refname) {
-if 
($this-isRevExistsInBranches($this-refs[$refname]['old'],[$branch['refname']]))
 {
-$this-cacheRevisions($branch['refname'], 
$this-getRevisions($this-refs[$refname]['old'] . '..' . $branch['new']));
+if 
($this-isRevExistsInBranches($this-refs[$refname]['old'], [$name])) {
+$this-cacheRevisions($name, 
$this-getRevisions($this-refs[$refname]['old'] . '..' . 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/spl/spl_array.c branches/PHP_5_3/ext/spl/tests/bug61326.phpt branches/PHP_5_4/ext/spl/spl_array.c branches/PHP_5_4/ext/spl/tests

2012-03-10 Thread Gustavo André dos Santos Lopes
cataphract   Sat, 10 Mar 2012 17:19:39 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324082

Log:
- Fixed bug #61326 (ArrayObject comparison).

Bug: https://bugs.php.net/61326 (Assigned) ArrayObject comparison
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/spl/spl_array.c
A   php/php-src/branches/PHP_5_3/ext/spl/tests/bug61326.phpt
U   php/php-src/branches/PHP_5_4/ext/spl/spl_array.c
A   php/php-src/branches/PHP_5_4/ext/spl/tests/bug61326.phpt
U   php/php-src/trunk/ext/spl/spl_array.c
A   php/php-src/trunk/ext/spl/tests/bug61326.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS	2012-03-10 16:24:37 UTC (rev 324081)
+++ php/php-src/branches/PHP_5_3/NEWS	2012-03-10 17:19:39 UTC (rev 324082)
@@ -47,6 +47,9 @@
   . Fixed bug #61267 (pdo_pgsql's PDO::exec() returns the number of SELECTed
 rows on postgresql = 9). (ben dot pineau at gmail dot com)

+- PDO_Sqlite extension:
+  . Add createCollation support. (Damien)
+
 - Phar:
   . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL
 bytes). (Nikic)
@@ -60,13 +63,13 @@
 chunksize length line is  10 bytes). (Ilia)
   . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
 User-Agent header). (carloschilazo at gmail dot com)
-
+
+- SPL
+  . Fixed bug #61326 (ArrayObject comparison). (Gustavo)
+
 - SQLite3 extension:
   . Add createCollation() method. (Brad Dewar)

-- PDO_Sqlite extension:
-  . Add createCollation support. (Damien)
-
 - Reflection:
   . Fixed bug #60968 (Late static binding doesn't work with
 ReflectionMethod::invokeArgs()). (Laruence)

Modified: php/php-src/branches/PHP_5_3/ext/spl/spl_array.c
===
--- php/php-src/branches/PHP_5_3/ext/spl/spl_array.c	2012-03-10 16:24:37 UTC (rev 324081)
+++ php/php-src/branches/PHP_5_3/ext/spl/spl_array.c	2012-03-10 17:19:39 UTC (rev 324082)
@@ -836,6 +836,30 @@
 	std_object_handlers.unset_property(object, member TSRMLS_CC);
 } /* }}} */

+static int spl_array_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
+{
+	HashTable			*ht1,
+		*ht2;
+	spl_array_object	*intern1,
+		*intern2;
+	int	result	= 0;
+	zvaltemp_zv;
+
+	intern1	= (spl_array_object*)zend_object_store_get_object(o1 TSRMLS_CC);
+	intern2	= (spl_array_object*)zend_object_store_get_object(o2 TSRMLS_CC);
+	ht1		= spl_array_get_hash_table(intern1, 0 TSRMLS_CC);
+	ht2		= spl_array_get_hash_table(intern2, 0 TSRMLS_CC);
+
+	zend_compare_symbol_tables(temp_zv, ht1, ht2 TSRMLS_CC);
+	result = (int)Z_LVAL(temp_zv);
+	/* if we just compared std.properties, don't do it again */
+	if (result == 0 
+			!(ht1 == intern1-std.properties  ht2 == intern2-std.properties)) {
+		result = std_object_handlers.compare_objects(o1, o2 TSRMLS_CC);
+	}
+	return result;
+} /* }}} */
+
 static int spl_array_skip_protected(spl_array_object *intern, HashTable *aht TSRMLS_DC) /* {{{ */
 {
 	char *string_key;
@@ -2003,6 +2027,8 @@
 	spl_handler_ArrayObject.has_property = spl_array_has_property;
 	spl_handler_ArrayObject.unset_property = spl_array_unset_property;

+	spl_handler_ArrayObject.compare_objects = spl_array_compare_objects;
+
 	REGISTER_SPL_STD_CLASS_EX(ArrayIterator, spl_array_object_new, spl_funcs_ArrayIterator);
 	REGISTER_SPL_IMPLEMENTS(ArrayIterator, Iterator);
 	REGISTER_SPL_IMPLEMENTS(ArrayIterator, ArrayAccess);

Added: php/php-src/branches/PHP_5_3/ext/spl/tests/bug61326.phpt
===
--- php/php-src/branches/PHP_5_3/ext/spl/tests/bug61326.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/spl/tests/bug61326.phpt	2012-03-10 17:19:39 UTC (rev 324082)
@@ -0,0 +1,17 @@
+--TEST--
+Bug #61326: ArrayObject comparison
+--FILE--
+?php
+$aobj1 = new ArrayObject(array(0));
+$aobj2 = new ArrayObject(array(1));
+var_dump($aobj1 == $aobj2);
+
+$aobj3 = new ArrayObject(array(0));
+var_dump($aobj1 == $aobj3);
+
+$aobj3-foo = 'bar';
+var_dump($aobj1 == $aobj3);
+--EXPECT--
+bool(false)
+bool(true)
+bool(false)


Property changes on: php/php-src/branches/PHP_5_3/ext/spl/tests/bug61326.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/branches/PHP_5_4/ext/spl/spl_array.c
===
--- php/php-src/branches/PHP_5_4/ext/spl/spl_array.c	2012-03-10 16:24:37 UTC (rev 324081)
+++ php/php-src/branches/PHP_5_4/ext/spl/spl_array.c	2012-03-10 17:19:39 UTC (rev 324082)
@@ -862,6 +862,30 @@
 	std_object_handlers.unset_property(object, member, key TSRMLS_CC);
 } /* }}} */

+static int spl_array_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
+{
+	HashTable			*ht1,
+		*ht2;