[PHP-CVS] Re: svn: /php/php-src/ branches/PHP_5_3/ext/phar/tests/zip/phar_stub.phpt trunk/ext/phar/tests/zip/phar_stub.phpt

2009-09-22 Thread Greg Beaver
Dmitry Stogov wrote:
> dmitry   Mon, 21 Sep 2009 15:23:25 +
> 
> Revision: http://svn.php.net/viewvc?view=revision&revision=288535
> 
> Log:
> Fixed tests (removed irrelevant check which makes test to fail from time to 
> time)
> 
> Changed paths:
> U   php/php-src/branches/PHP_5_3/ext/phar/tests/zip/phar_stub.phpt
> U   php/php-src/trunk/ext/phar/tests/zip/phar_stub.phpt

you forgot pecl.  Also, this is not an "irrelevant check" because a bug
in the past stored the wrong mtime.

Greg

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] Re: svn: /php/php-src/ branches/PHP_5_3/ext/phar/phar.c trunk/ext/phar/phar.c

2009-11-09 Thread Greg Beaver
Rasmus Lerdorf wrote:
> rasmus   Mon, 09 Nov 2009 17:21:15 +
> 
> Revision: http://svn.php.net/viewvc?view=revision&revision=290435
> 
> Log:
> Fix bug #50129
> 
> Bug: http://bugs.php.net/50129 (Open) phpinfo() reports "CVS revision" rather 
> than "SVN revision"
>   
> Changed paths:
> U   php/php-src/branches/PHP_5_3/ext/phar/phar.c
> U   php/php-src/trunk/ext/phar/phar.c

Hi Rasmus,

Thanks for the quick fix.  Do you mind merging this to trunk and
pecl/phar/trunk?

Thanks,
Greg

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: / pear/peardoc/trunk/en/pyrus/extending/registry.xml pecl/phar/trunk/package.php pecl/phar/trunk/php_phar.h pecl/phar/trunk/tar.c pecl/phar/trunk/tests/tar/bug49910.phpt pecl/phar/trunk

2009-11-11 Thread Greg Beaver
cellog   Wed, 11 Nov 2009 21:02:59 +

Revision: http://svn.php.net/viewvc?view=revision&revision=290527

Log:
fix PHP Bug #49910: no support for ././@LongLink for long filenames in phar tar 
support

Bug: http://bugs.php.net/49910 (Open) no support for ././@LongLink for long 
filenames in phar tar support
  
Changed paths:
U   pear/peardoc/trunk/en/pyrus/extending/registry.xml
U   pecl/phar/trunk/package.php
U   pecl/phar/trunk/php_phar.h
U   pecl/phar/trunk/tar.c
A   pecl/phar/trunk/tests/tar/bug49910.phpt
A   pecl/phar/trunk/tests/tar/files/Structures_Graph-1.0.3.tgz
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/phar/php_phar.h
U   php/php-src/branches/PHP_5_3/ext/phar/tar.c
A   
php/php-src/branches/PHP_5_3/ext/phar/tests/tar/files/Structures_Graph-1.0.3.tgz
U   php/php-src/trunk/ext/phar/php_phar.h
U   php/php-src/trunk/ext/phar/tar.c
A   php/php-src/trunk/ext/phar/tests/tar/bug49910.phpt
A   php/php-src/trunk/ext/phar/tests/tar/files/Structures_Graph-1.0.3.tgz

Modified: pear/peardoc/trunk/en/pyrus/extending/registry.xml
===
--- pear/peardoc/trunk/en/pyrus/extending/registry.xml	2009-11-11 21:00:19 UTC (rev 290526)
+++ pear/peardoc/trunk/en/pyrus/extending/registry.xml	2009-11-11 21:02:59 UTC (rev 290527)
@@ -389,7 +389,7 @@
  
   Channel registry
   
-   This document is a work in progress.
+
   
  
 

Modified: pecl/phar/trunk/package.php
===
--- pecl/phar/trunk/package.php	2009-11-11 21:00:19 UTC (rev 290526)
+++ pecl/phar/trunk/package.php	2009-11-11 21:02:59 UTC (rev 290527)
@@ -1,77 +1,9 @@
 compress()/decompress().
- * phar.extract_list and Phar::getExtractList() are removed
-
-Major feature functionality release
- * phar.cache_list allows web-based phar applications to run at equal or faster than
-   their on-disk equivalent [Greg]
- * new default stub allows running of phar-based phars without phar extension [Greg/Steph]
- * add support for tar-based and zip-based phar archives [Greg]
- * add support for OpenSSL-based true signatures [Greg]
- * add support for signatures to tar-based phar archives [Greg]
- * add Phar::isFileFormat() [Greg]
- * add Phar::convertToExecutable(), Phar::convertToData() [Greg]
- * add Phar::compress() [Greg]
- * rename Phar::compressAllFiles() to compressFiles(), uncompressAllFiles() to
-   decompressFiles() [Greg]
- * conversion to compressed or to other file formats automatically copies the archive
-   to a new extension (i.e. ".phar" to ".phar.tar" or ".tar" to ".tar.gz") [Steph]
- * add Phar::webPhar() for running a web-based application unmodified
-   directly from a phar archive [Greg]
- * file functions (fopen-based and stat-based) can be instructed to only look for
-   relative paths within a phar via Phar::interceptFileFuncs()
- * add PharData class to allow manipulation/creation of non-executable tar and zip archives. [Steph]
-   non-executable tar/zip manipulation is allowed even when phar.readonly=1 [Greg]
- * paths with . and .. work (phar://blah.phar/a/../b.php => phar://blah.phar/b.php) [Greg]
- * add support for mkdir()/rmdir() and support for empty directories to phar file format [Greg]
- * add option to compress the entire phar file for phar/tar file format [Greg]
- * implement Phar::isCompressed() returning 0, Phar::GZ or Phar::BZ2 [Greg]
- * implement Phar::copy(string $from, string $to) [Greg]
- * implement Phar::running(), returns path or URL to currently executed phar
- * implement Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg]
- * implement Phar::buildFromDirectory(string $base_directory[, string $regex]) [Steph]
- * implement Phar::mount() for mounting external paths or files to locations inside a phar [Greg]
- * add Phar::delete() [Greg]
- * implement Phar::unlinkArchive() [Greg]
-
-Security addition
- * aliases are validated so that they contain no directory separators as intended
- * on conversion to other formats, user-supplied aliases are validated
-
-Changes since 2.0.0RC2:
- fixed PHP Bug #49021: phar tar signature algorithm reports as Unknown (0) in
- getSignature() call
- fixed PHP Bug #49020: phar misinterprets ustar long filename standard
- fixed PHP Bug #49018: phar tar stores long filenames with prefix/name reversed
- fixed PHP Bug #48791: open office files always reported as corrupted
- fixed PHP Bug #48783: make install will fail saying phar file exists
- fixed PHP Bug #48740: PHAR install fails when INSTALL_ROOT is not the final install location
- fixed PHP Bug #48681: openssl signature verification for tar archives broken
- fixed PHP Bug #48377: error message unclear on converting phar with existing file
- fixed isset() on sub-directories (isset("blah") if file "blah/foo.php" exists)
-
- make phar work in PHP 6
-Changes since 2.0.0RC1:
- security vulne

[PHP-CVS] Re: svn: /php/php-src/trunk/ext/phar/tests/tar/ bug49910.phpt

2009-11-12 Thread Greg Beaver
David Coallier wrote:
> davidc   Thu, 12 Nov 2009 17:45:08 +
> 
> Revision: http://svn.php.net/viewvc?view=revision&revision=290603
> 
> Log:
> - Added an extra skipif for zlib
> 
> Changed paths:
> U   php/php-src/trunk/ext/phar/tests/tar/bug49910.phpt
> 
> Modified: php/php-src/trunk/ext/phar/tests/tar/bug49910.phpt
> ===
> --- php/php-src/trunk/ext/phar/tests/tar/bug49910.phpt2009-11-12 
> 17:44:57 UTC (rev 290602)
> +++ php/php-src/trunk/ext/phar/tests/tar/bug49910.phpt2009-11-12 
> 17:45:08 UTC (rev 290603)
> @@ -2,6 +2,7 @@
>  Bug #49910: no support for ././@LongLink for long filenames in phar tar 
> support
>  --SKIPIF--
>  
> +
>  --FILE--
>$fname = str_replace('\\', '/', dirname(__FILE__) . 
> '/files/Structures_Graph-1.0.3.tgz');
> @@ -46,4 +47,4 @@
>  [27] => phar://*/Structures_Graph-1.0.3/tests/testCase/BasicGraph.php
>  [28] => phar://*/package.xml
>  )
> -===DONE===
> \ No newline at end of file
> +===DONE===

Thanks David.

pecl/phar/trunk/tests/tar/bug49910.phpt is lonely, and wants this patch too.

:)
Greg

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS

2009-11-12 Thread Greg Beaver
cellog   Fri, 13 Nov 2009 00:41:37 +

Revision: http://svn.php.net/viewvc?view=revision&revision=290646

Log:
fix completely random ordering of bugs in NEWS (what happened here?)

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2009-11-13 00:24:43 UTC (rev 290645)
+++ php/php-src/branches/PHP_5_3/NEWS   2009-11-13 00:41:37 UTC (rev 290646)
@@ -29,27 +29,27 @@
 - Fixed bug #50023 (pdo_mysql doesn't use PHP_MYSQL_UNIX_SOCK_ADDR). (Ilia)
 - Fixed bug #50005 (Throwing through Reflection modified Exception object
   makes segmentation fault). (Felipe)
-- Fixed bug #49910 (no support for ././@LongLink for long filenames in phar
-  tar support). (Greg)
-- Fixed bug #49908 (throwing exception in __autoload crashes when interface
-  is not defined). (Felipe)
-- Fixed bug #49719 (ReflectionClass::hasProperty returns true for a private
-  property in base class). (Felipe)
-- Fixed bug #49142 (crash when exception thrown from __tostring()).
-  (David Soria Parra)
 - Fixed bug #49990 (SNMP3 warning message about security level printed twice).
   (Jani)
 - Fixed bug #49985 (pdo_pgsql prepare() re-use previous aborted
   transaction). (ben dot pineau at gmail dot com, Ilia, Matteo)
 - Fixed bug #49921 (Curl post upload functions changed). (Ilia)
+- Fixed bug #49910 (no support for ././@LongLink for long filenames in phar
+  tar support). (Greg)
+- Fixed bug #49908 (throwing exceptions in __autoload crashes when interface
+  is not defined). (Felipe)
 - Fixed bug #49855 (import_request_variables() always returns NULL). (Ilia,
   sjoerd at php dot net)
 - Fixed bug #49800 (SimpleXML allow (un)serialize() calls without warning).
   (Ilia, wmeler at wp-sa dot pl)
+- Fixed bug #49719 (ReflectionClass::hasProperty returns true for a private
+  property in base class). (Felipe)
 - Fixed bug #49647 (DOMUserData does not exist). (Rob)
 - Fixed bug #49244 (Floating point NaN cause garbage characters). (Sjoerd)
 - Fixed bug #49224 (Compile error due to old DNS functions on AIX systems).
   (Scott)
+- Fixed bug #49142 (crash when exception thrown from __tostring()).
+  (David Soria Parra)
 - Fixed bug #49098 (mysqli segfault on error). (Rasmus)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: / pecl/phar/trunk/package.php pecl/phar/trunk/phar_object.c pecl/phar/trunk/tests/phar_begin_setstub_commit.phpt pecl/phar/trunk/tests/phar_begin_setstub_commitU.phpt pecl/phar/trunk/te

2009-11-12 Thread Greg Beaver
cellog   Fri, 13 Nov 2009 00:58:11 +

Revision: http://svn.php.net/viewvc?view=revision&revision=290647

Log:
fix PHP Bug #49938: Phar::isBuffering() returns inverted value

Bug: http://bugs.php.net/49938 (Analyzed) Phar::isBuffering() returns inverted 
value
  
Changed paths:
U   pecl/phar/trunk/package.php
U   pecl/phar/trunk/phar_object.c
U   pecl/phar/trunk/tests/phar_begin_setstub_commit.phpt
U   pecl/phar/trunk/tests/phar_begin_setstub_commitU.phpt
U   pecl/phar/trunk/tests/tar/phar_begin_setstub_commit.phpt
U   pecl/phar/trunk/tests/tar/phar_begin_setstub_commitU.phpt
U   pecl/phar/trunk/tests/zip/phar_begin_setstub_commit.phpt
U   pecl/phar/trunk/tests/zip/phar_begin_setstub_commitU.phpt
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/phar/phar_object.c
U   
php/php-src/branches/PHP_5_3/ext/phar/tests/phar_begin_setstub_commit.phpt
U   
php/php-src/branches/PHP_5_3/ext/phar/tests/phar_begin_setstub_commitU.phpt
U   
php/php-src/branches/PHP_5_3/ext/phar/tests/tar/phar_begin_setstub_commit.phpt
U   
php/php-src/branches/PHP_5_3/ext/phar/tests/tar/phar_begin_setstub_commitU.phpt
U   
php/php-src/branches/PHP_5_3/ext/phar/tests/zip/phar_begin_setstub_commit.phpt
U   
php/php-src/branches/PHP_5_3/ext/phar/tests/zip/phar_begin_setstub_commitU.phpt
U   php/php-src/trunk/ext/phar/phar_object.c
U   php/php-src/trunk/ext/phar/tests/phar_begin_setstub_commit.phpt
U   php/php-src/trunk/ext/phar/tests/phar_begin_setstub_commitU.phpt
U   php/php-src/trunk/ext/phar/tests/tar/phar_begin_setstub_commit.phpt
U   php/php-src/trunk/ext/phar/tests/tar/phar_begin_setstub_commitU.phpt
U   php/php-src/trunk/ext/phar/tests/zip/phar_begin_setstub_commit.phpt
U   php/php-src/trunk/ext/phar/tests/zip/phar_begin_setstub_commitU.phpt

Modified: pecl/phar/trunk/package.php
===
--- pecl/phar/trunk/package.php	2009-11-13 00:41:37 UTC (rev 290646)
+++ pecl/phar/trunk/package.php	2009-11-13 00:58:11 UTC (rev 290647)
@@ -2,6 +2,7 @@

 $notes = '
 Bugfix release
+ * Fix PHP Bug #49938: Phar::isBuffering() returns inverted value
  * Fix PHP Bug #49910: no support for ././@LongLink for long filenames in
phar tar support
 ';

Modified: pecl/phar/trunk/phar_object.c
===
--- pecl/phar/trunk/phar_object.c	2009-11-13 00:41:37 UTC (rev 290646)
+++ pecl/phar/trunk/phar_object.c	2009-11-13 00:58:11 UTC (rev 290647)
@@ -2945,7 +2945,7 @@
 {
 	PHAR_ARCHIVE_OBJECT();

-	RETURN_BOOL(!phar_obj->arc.archive->donotflush);
+	RETURN_BOOL(phar_obj->arc.archive->donotflush);
 }
 /* }}} */


Modified: pecl/phar/trunk/tests/phar_begin_setstub_commit.phpt
===
--- pecl/phar/trunk/tests/phar_begin_setstub_commit.phpt	2009-11-13 00:41:37 UTC (rev 290646)
+++ pecl/phar/trunk/tests/phar_begin_setstub_commit.phpt	2009-11-13 00:58:11 UTC (rev 290647)
@@ -36,8 +36,8 @@
 unlink(dirname(__FILE__) . '/brandnewphar.phar');
 ?>
 --EXPECT--
+bool(false)
 bool(true)
-bool(false)
 string(5) "Hello"
 string(84) "
 "
@@ -45,7 +45,7 @@
 string(85) "
 "
 ===COMMIT===
-bool(true)
+bool(false)
 string(5) "Hello"
 string(5) "World"
 string(85) "

Modified: pecl/phar/trunk/tests/phar_begin_setstub_commitU.phpt
===
--- pecl/phar/trunk/tests/phar_begin_setstub_commitU.phpt	2009-11-13 00:41:37 UTC (rev 290646)
+++ pecl/phar/trunk/tests/phar_begin_setstub_commitU.phpt	2009-11-13 00:58:11 UTC (rev 290647)
@@ -36,8 +36,8 @@
 unlink(dirname(__FILE__) . '/brandnewphar.phar');
 ?>
 --EXPECT--
+bool(false)
 bool(true)
-bool(false)
 unicode(5) "Hello"
 string(84) "
 "
@@ -45,7 +45,7 @@
 string(85) "
 "
 ===COMMIT===
-bool(true)
+bool(false)
 unicode(5) "Hello"
 unicode(5) "World"
 string(85) "

Modified: pecl/phar/trunk/tests/tar/phar_begin_setstub_commit.phpt
===
--- pecl/phar/trunk/tests/tar/phar_begin_setstub_commit.phpt	2009-11-13 00:41:37 UTC (rev 290646)
+++ pecl/phar/trunk/tests/tar/phar_begin_setstub_commit.phpt	2009-11-13 00:58:11 UTC (rev 290647)
@@ -37,8 +37,8 @@
 ?>
 --EXPECT--
 bool(true)
+bool(false)
 bool(true)
-bool(false)
 string(5) "Hello"
 string(84) "
 "
@@ -46,7 +46,7 @@
 string(85) "
 "
 ===COMMIT===
-bool(true)
+bool(false)
 string(5) "Hello"
 string(5) "World"
 string(85) "

Modified: pecl/phar/trunk/tests/tar/phar_begin_setstub_commitU.phpt
===
--- pecl/phar/trunk/tests/tar/phar_begin_setstub_commitU.phpt	2009-11-13 00:41:37 UTC (rev 290646)
+++ pecl/phar/trunk/tests/tar/phar_begin_setstub_commitU.phpt	2009-11-13 00:58:11 UTC (rev 290647)
@@ -37,8 +37,8 @@
 ?>
 --EXPECT--
 bool(true)
+bool(false)
 bool(true)
-bool(false)
 unicode(

[PHP-CVS] Re: svn: /php/php-src/branches/PHP_5_3/ext/phar/tests/ phar_buildfromdirectory6.phpt

2009-11-20 Thread Greg Beaver
Brian Shire wrote:
> shireSat, 21 Nov 2009 05:40:16 +
> 
> Revision: http://svn.php.net/viewvc?view=revision&revision=291108
> 
> Log:
> MFH: Fix phar regex test when '.php' is part of the path, instead be more 
> specific with '.php$' regex.
> 
> Changed paths:
> U   
> php/php-src/branches/PHP_5_3/ext/phar/tests/phar_buildfromdirectory6.phpt
> 
> Modified: 
> php/php-src/branches/PHP_5_3/ext/phar/tests/phar_buildfromdirectory6.phpt
> ===
> --- php/php-src/branches/PHP_5_3/ext/phar/tests/phar_buildfromdirectory6.phpt 
> 2009-11-21 05:38:58 UTC (rev 291107)
> +++ php/php-src/branches/PHP_5_3/ext/phar/tests/phar_buildfromdirectory6.phpt 
> 2009-11-21 05:40:16 UTC (rev 291108)
> @@ -15,7 +15,7 @@
> 
>  try {
>   $phar = new Phar(dirname(__FILE__) . '/buildfromdirectory.phar');
> - var_dump($phar->buildFromDirectory(dirname(__FILE__) . '/testdir', 
> '/\.php/'));
> + var_dump($phar->buildFromDirectory(dirname(__FILE__) . '/testdir', 
> '/\.php$/'));
>  } catch (Exception $e) {
>   var_dump(get_class($e));
>   echo $e->getMessage() . "\n";

Hi,

Thanks for this fix, do  you mind merging to pecl/phar/trunk?

Thanks,
Greg

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) / run-tests.php

2008-01-05 Thread Greg Beaver
cellog  Sat Jan  5 21:05:14 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcrun-tests.php 
  Log:
  implement --FILE_EXTERNAL-- section for using an external file as --FILE--, 
use CGI for --EXPECTHEADERS--, fix --POST_RAW--
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.41&r2=1.226.2.37.2.42&diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.226.2.37.2.41 
php-src/run-tests.php:1.226.2.37.2.42
--- php-src/run-tests.php:1.226.2.37.2.41   Tue Jan  1 06:15:48 2008
+++ php-src/run-tests.php   Sat Jan  5 21:05:14 2008
@@ -24,7 +24,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.226.2.37.2.41 2008/01/01 06:15:48 sebastian Exp $ */
+/* $Id: run-tests.php,v 1.226.2.37.2.42 2008/01/05 21:05:14 cellog Exp $ */
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -403,7 +403,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.226.2.37.2.41 
$'."\n";
+   echo '$Revision: 1.226.2.37.2.42 
$'."\n";
exit(1);
 
case 'u':
@@ -1004,7 +1004,7 @@
if (preg_match('/^--([_A-Z]+)--/', $line, $r)) {
$section = $r[1];
$section_text[$section] = '';
-   $secfile = $section == 'FILE' || $section == 'FILEEOF';
+   $secfile = $section == 'FILE' || $section == 'FILEEOF' 
|| $section == 'FILE_EXTERNAL';
$secdone = false;
continue;
}
@@ -1030,7 +1030,7 @@
$borked = false;
}
} else {
-   if (@count($section_text['FILE']) + 
@count($section_text['FILEEOF']) != 1) {
+   if (@count($section_text['FILE']) + 
@count($section_text['FILEEOF']) + @count($section_text['FILE_EXTERNAL']) != 1) 
{
$bork_info = "missing section --FILE--";
$borked = true;
}
@@ -1038,6 +1038,17 @@
$section_text['FILE'] = preg_replace("/[\r\n]+$/", '', 
$section_text['FILEEOF']);
unset($section_text['FILEEOF']);
}
+   if (@count($section_text['FILE_EXTERNAL']) == 1) {
+   // don't allow tests to retrieve files from anywhere 
but this subdirectory
+   $section_text['FILE_EXTERNAL'] = dirname($file) . '/' . 
trim(str_replace('..', '', $section_text['FILE_EXTERNAL']));
+   if (@file_exists($section_text['FILE_EXTERNAL'])) {
+   $section_text['FILE'] = 
file_get_contents($section_text['FILE_EXTERNAL']);
+   unset($section_text['FILE_EXTERNAL']);
+   } else {
+   $bork_info = "could not load --FILE_EXTERNAL-- 
" . dirname($file) . '/' . trim($section_text['FILE_EXTERNAL']);
+   $borked = true;
+   }
+   }
if ((@count($section_text['EXPECT']) + 
@count($section_text['EXPECTF']) + @count($section_text['EXPECTREGEX'])) != 1) {
$bork_info = "missing section --EXPECT--, --EXPECTF-- 
or --EXPECTREGEX--";
$borked = true;
@@ -1063,7 +1074,7 @@
$tested = trim($section_text['TEST']);
 
/* For GET/POST tests, check if cgi sapi is available and if it is, use 
it. */
-   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['COOKIE'])) {
+   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['COOKIE']) || 
!empty($section_text['EXPECTHEADERS'])) {
if (isset($php_cgi)) {
$old_php = $php;
$php = $php_cgi .' -C ';
@@ -1333,12 +1344,15 @@
$raw_lines = explode("\n", $post);
 
$request = '';
+   $started = false;
foreach ($raw_lines as $line) {
if (empty($env['CONTENT_TYPE']) && 
preg_match('/^Content-Type:(.*)/i', $line, $res)) {
$env['CONTENT_TYPE'] = trim(str_replace("\r", 
'', $res[1]));
continue;
}
-   $request .= $line . "\n";
+   if ($started) $request .= "\n";
+   $started = true;
+   

[PHP-CVS] cvs: php-src(PHP_5_3) / run-tests.php

2008-01-05 Thread Greg Beaver
cellog  Sat Jan  5 21:05:06 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcrun-tests.php 
  Log:
  implement --FILE_EXTERNAL-- section for using an external file as --FILE--, 
use CGI for --EXPECTHEADERS--, fix --POST_RAW--
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.35.2.10&r2=1.226.2.37.2.35.2.11&diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.226.2.37.2.35.2.10 
php-src/run-tests.php:1.226.2.37.2.35.2.11
--- php-src/run-tests.php:1.226.2.37.2.35.2.10  Tue Jan  1 06:15:40 2008
+++ php-src/run-tests.php   Sat Jan  5 21:05:06 2008
@@ -24,7 +24,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.226.2.37.2.35.2.10 2008/01/01 06:15:40 sebastian Exp 
$ */
+/* $Id: run-tests.php,v 1.226.2.37.2.35.2.11 2008/01/05 21:05:06 cellog Exp $ 
*/
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -408,7 +408,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.226.2.37.2.35.2.10 
$'."\n";
+   echo '$Revision: 1.226.2.37.2.35.2.11 
$'."\n";
exit(1);
 
case 'u':
@@ -1034,7 +1034,7 @@
if (preg_match('/^--([_A-Z]+)--/', $line, $r)) {
$section = $r[1];
$section_text[$section] = '';
-   $secfile = $section == 'FILE' || $section == 'FILEEOF';
+   $secfile = $section == 'FILE' || $section == 'FILEEOF' 
|| $section == 'FILE_EXTERNAL';
$secdone = false;
continue;
}
@@ -1060,7 +1060,7 @@
$borked = false;
}
} else {
-   if (@count($section_text['FILE']) + 
@count($section_text['FILEEOF']) != 1) {
+   if (@count($section_text['FILE']) + 
@count($section_text['FILEEOF']) + @count($section_text['FILE_EXTERNAL']) != 1) 
{
$bork_info = "missing section --FILE--";
$borked = true;
}
@@ -1068,6 +1068,17 @@
$section_text['FILE'] = preg_replace("/[\r\n]+$/", '', 
$section_text['FILEEOF']);
unset($section_text['FILEEOF']);
}
+   if (@count($section_text['FILE_EXTERNAL']) == 1) {
+   // don't allow tests to retrieve files from anywhere 
but this subdirectory
+   $section_text['FILE_EXTERNAL'] = dirname($file) . '/' . 
trim(str_replace('..', '', $section_text['FILE_EXTERNAL']));
+   if (@file_exists($section_text['FILE_EXTERNAL'])) {
+   $section_text['FILE'] = 
file_get_contents($section_text['FILE_EXTERNAL']);
+   unset($section_text['FILE_EXTERNAL']);
+   } else {
+   $bork_info = "could not load --FILE_EXTERNAL-- 
" . dirname($file) . '/' . trim($section_text['FILE_EXTERNAL']);
+   $borked = true;
+   }
+   }
if ((@count($section_text['EXPECT']) + 
@count($section_text['EXPECTF']) + @count($section_text['EXPECTREGEX'])) != 1) {
$bork_info = "missing section --EXPECT--, --EXPECTF-- 
or --EXPECTREGEX--";
$borked = true;
@@ -1093,7 +1104,7 @@
$tested = trim($section_text['TEST']);
 
/* For GET/POST tests, check if cgi sapi is available and if it is, use 
it. */
-   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['COOKIE'])) {
+   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['COOKIE']) || 
!empty($section_text['EXPECTHEADERS'])) {
if (isset($php_cgi)) {
$old_php = $php;
$php = $php_cgi .' -C ';
@@ -1355,12 +1366,15 @@
$raw_lines = explode("\n", $post);
 
$request = '';
+   $started = false;
foreach ($raw_lines as $line) {
if (empty($env['CONTENT_TYPE']) && 
preg_match('/^Content-Type:(.*)/i', $line, $res)) {
$env['CONTENT_TYPE'] = trim(str_replace("\r", 
'', $res[1]));
continue;
}
-   $request .= $line . "\n";
+   if ($started) $request .= "\n";
+  

[PHP-CVS] cvs: php-src / run-tests.php

2008-01-05 Thread Greg Beaver
cellog  Sat Jan  5 21:04:55 2008 UTC

  Modified files:  
/php-srcrun-tests.php 
  Log:
  implement --FILE_EXTERNAL-- section for using an external file as --FILE--, 
use CGI for --EXPECTHEADERS--, fix --POST_RAW--
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.337&r2=1.338&diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.337 php-src/run-tests.php:1.338
--- php-src/run-tests.php:1.337 Tue Jan  1 06:22:15 2008
+++ php-src/run-tests.php   Sat Jan  5 21:04:55 2008
@@ -24,7 +24,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.337 2008/01/01 06:22:15 sebastian Exp $ */
+/* $Id: run-tests.php,v 1.338 2008/01/05 21:04:55 cellog Exp $ */
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -415,7 +415,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.337 $'."\n";
+   echo '$Revision: 1.338 $'."\n";
exit(1);
default:
echo "Illegal switch specified!\n";
@@ -1056,7 +1056,7 @@
if (preg_match('/^--([_A-Z]+)--/', $line, $r)) {
$section = $r[1];
$section_text[$section] = '';
-   $secfile = $section == 'FILE' || $section == 'FILEEOF';
+   $secfile = $section == 'FILE' || $section == 'FILEEOF' 
|| $section == 'FILE_EXTERNAL';
$secdone = false;
continue;
}
@@ -1082,7 +1082,7 @@
$borked = false;
}
} else {
-   if (@count($section_text['FILE']) + 
@count($section_text['FILEEOF']) != 1) {
+   if (@count($section_text['FILE']) + 
@count($section_text['FILEEOF']) + @count($section_text['FILE_EXTERNAL']) != 1) 
{
$bork_info = "missing section --FILE--";
$borked = true;
}
@@ -1090,6 +1090,17 @@
$section_text['FILE'] = preg_replace("/[\r\n]+$/", '', 
$section_text['FILEEOF']);
unset($section_text['FILEEOF']);
}
+   if (@count($section_text['FILE_EXTERNAL']) == 1) {
+   // don't allow tests to retrieve files from anywhere 
but this subdirectory
+   $section_text['FILE_EXTERNAL'] = dirname($file) . '/' . 
trim(str_replace('..', '', $section_text['FILE_EXTERNAL']));
+   if (@file_exists($section_text['FILE_EXTERNAL'])) {
+   $section_text['FILE'] = 
file_get_contents($section_text['FILE_EXTERNAL']);
+   unset($section_text['FILE_EXTERNAL']);
+   } else {
+   $bork_info = "could not load --FILE_EXTERNAL-- 
" . dirname($file) . '/' . trim($section_text['FILE_EXTERNAL']);
+   $borked = true;
+   }
+   }
if ((@count($section_text['EXPECT']) + 
@count($section_text['EXPECTF']) + @count($section_text['EXPECTREGEX'])) != 1) {
$bork_info = "missing section --EXPECT--, --EXPECTF-- 
or --EXPECTREGEX--";
$borked = true;
@@ -1120,7 +1131,7 @@
$tested = trim($section_text['TEST']);
 
/* For GET/POST tests, check if cgi sapi is available and if it is, use 
it. */
-   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['COOKIE'])) {
+   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['COOKIE']) || 
!empty($section_text['EXPECTHEADERS'])) {
if (isset($php_cgi)) {
$old_php = $php;
$php = $php_cgi .' -C ';
@@ -1418,12 +1429,15 @@
$raw_lines = explode("\n", $post);
 
$request = '';
+   $started = false;
foreach ($raw_lines as $line) {
if (empty($env['CONTENT_TYPE']) && 
preg_match('/^Content-Type:(.*)/i', $line, $res)) {
$env['CONTENT_TYPE'] = trim(str_replace("\r", 
'', $res[1]));
continue;
}
-   $request .= $line . "\n";
+   if ($started) $request .= "\n";
+   $started = true;
+   $request .= $line;
}
 

[PHP-CVS] cvs: php-src(PHP_5_3) / run-tests.php

2008-01-05 Thread Greg Beaver
cellog  Sat Jan  5 21:39:53 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcrun-tests.php 
  Log:
  remove potential preg warnings if --EXPECTHEADERS-- is combined with 
--EXPECTF-- or --EXPECTRE--
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.35.2.11&r2=1.226.2.37.2.35.2.12&diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.226.2.37.2.35.2.11 
php-src/run-tests.php:1.226.2.37.2.35.2.12
--- php-src/run-tests.php:1.226.2.37.2.35.2.11  Sat Jan  5 21:05:06 2008
+++ php-src/run-tests.php   Sat Jan  5 21:39:53 2008
@@ -24,7 +24,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.226.2.37.2.35.2.11 2008/01/05 21:05:06 cellog Exp $ 
*/
+/* $Id: run-tests.php,v 1.226.2.37.2.35.2.12 2008/01/05 21:39:53 cellog Exp $ 
*/
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -408,7 +408,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.226.2.37.2.35.2.11 
$'."\n";
+   echo '$Revision: 1.226.2.37.2.35.2.12 
$'."\n";
exit(1);
 
case 'u':
@@ -1600,7 +1600,7 @@
$wanted = $wanted_headers . "\n--HEADERS--\n" . $wanted;
$output = $output_headers . "\n--HEADERS--\n" . $output;
if (isset($wanted_re)) {
-   $wanted_re = $wanted_headers . "\n--HEADERS--\n" . 
$wanted_re;
+   $wanted_re = preg_quote($wanted_headers . 
"\n--HEADERS--\n", '/') . $wanted_re;
}
}
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src / run-tests.php

2008-01-05 Thread Greg Beaver
cellog  Sat Jan  5 21:39:39 2008 UTC

  Modified files:  
/php-srcrun-tests.php 
  Log:
  remove potential preg warnings if --EXPECTHEADERS-- is combined with 
--EXPECTF-- or --EXPECTRE--
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.338&r2=1.339&diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.338 php-src/run-tests.php:1.339
--- php-src/run-tests.php:1.338 Sat Jan  5 21:04:55 2008
+++ php-src/run-tests.php   Sat Jan  5 21:39:39 2008
@@ -24,7 +24,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.338 2008/01/05 21:04:55 cellog Exp $ */
+/* $Id: run-tests.php,v 1.339 2008/01/05 21:39:39 cellog Exp $ */
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -415,7 +415,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.338 $'."\n";
+   echo '$Revision: 1.339 $'."\n";
exit(1);
default:
echo "Illegal switch specified!\n";
@@ -1667,7 +1667,7 @@
$wanted = $wanted_headers . "\n--HEADERS--\n" . $wanted;
$output = $output_headers . "\n--HEADERS--\n" . $output;
if (isset($wanted_re)) {
-   $wanted_re = $wanted_headers . "\n--HEADERS--\n" . 
$wanted_re;
+   $wanted_re = preg_quote($wanted_headers . 
"\n--HEADERS--\n", '/') . $wanted_re;
}
}
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) / run-tests.php

2008-01-05 Thread Greg Beaver
cellog  Sat Jan  5 21:39:47 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcrun-tests.php 
  Log:
  remove potential preg warnings if --EXPECTHEADERS-- is combined with 
--EXPECTF-- or --EXPECTRE--
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.42&r2=1.226.2.37.2.43&diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.226.2.37.2.42 
php-src/run-tests.php:1.226.2.37.2.43
--- php-src/run-tests.php:1.226.2.37.2.42   Sat Jan  5 21:05:14 2008
+++ php-src/run-tests.php   Sat Jan  5 21:39:47 2008
@@ -24,7 +24,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.226.2.37.2.42 2008/01/05 21:05:14 cellog Exp $ */
+/* $Id: run-tests.php,v 1.226.2.37.2.43 2008/01/05 21:39:47 cellog Exp $ */
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -403,7 +403,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.226.2.37.2.42 
$'."\n";
+   echo '$Revision: 1.226.2.37.2.43 
$'."\n";
exit(1);
 
case 'u':
@@ -1579,7 +1579,7 @@
$wanted = $wanted_headers . "\n--HEADERS--\n" . $wanted;
$output = $output_headers . "\n--HEADERS--\n" . $output;
if (isset($wanted_re)) {
-   $wanted_re = $wanted_headers . "\n--HEADERS--\n" . 
$wanted_re;
+   $wanted_re = preg_quote($wanted_headers . 
"\n--HEADERS--\n", '/') . $wanted_re;
}
}
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/zlib zlib_filter.c /ext/zlib/tests zlib_filter_inflate2.phpt

2008-01-08 Thread Greg Beaver
cellog  Wed Jan  9 06:42:56 2008 UTC

  Added files: 
/php-src/ext/zlib/tests zlib_filter_inflate2.phpt 

  Modified files:  
/php-src/ext/zlib   zlib_filter.c 
  Log:
  fix Bug #43793: zlib filter is unable to auto-detect gzip/zlib file headers
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.16&r2=1.17&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.16 php-src/ext/zlib/zlib_filter.c:1.17
--- php-src/ext/zlib/zlib_filter.c:1.16 Mon Dec 31 07:12:18 2007
+++ php-src/ext/zlib/zlib_filter.c  Wed Jan  9 06:42:56 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zlib_filter.c,v 1.16 2007/12/31 07:12:18 sebastian Exp $ */
+/* $Id: zlib_filter.c,v 1.17 2008/01/09 06:42:56 cellog Exp $ */
 
 #include "php.h"
 #include "php_zlib.h"
@@ -335,7 +335,7 @@
/* log-2 base of history window (9 - 15) */
SEPARATE_ZVAL(tmpzval);
convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < -MAX_WBITS || 
Z_LVAL_PP(tmpzval) > MAX_WBITS) {
+   if (Z_LVAL_PP(tmpzval) < -MAX_WBITS || 
Z_LVAL_PP(tmpzval) > MAX_WBITS + 32) {
php_error_docref(NULL TSRMLS_CC, 
E_WARNING, "Invalid parameter give for window size. (%ld)", Z_LVAL_PP(tmpzval));
} else {
windowBits = Z_LVAL_PP(tmpzval);

http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/tests/zlib_filter_inflate2.phpt?view=markup&rev=1.1
Index: php-src/ext/zlib/tests/zlib_filter_inflate2.phpt
+++ php-src/ext/zlib/tests/zlib_filter_inflate2.phpt
--TEST--
zlib.inflate of gzip-encoded stream
--SKIPIF--

--FILE--
 
15+16));
echo "2\n";
echo fread($fp, 2000);
fclose($fp);
// auto-detect
$fp = fopen(dirname(__FILE__) . '/test.txt.gz', 'r');
stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ, array('window' => 
15+32));
echo "3\n";
echo fread($fp, 2000);
fclose($fp);

?>
--CLEAN--

--EXPECT--
1
2
This is quite the thing ain't it
3
This is quite the thing ain't it

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/zlib zlib_filter.c /ext/zlib/tests zlib_filter_inflate2.phpt

2008-01-08 Thread Greg Beaver
cellog  Wed Jan  9 06:45:15 2008 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/zlib/tests zlib_filter_inflate2.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/zlib   zlib_filter.c 
  Log:
  fix Bug #43793: zlib filter is unable to auto-detect gzip/zlib file headers
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1048&r2=1.2027.2.547.2.1049&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1048 php-src/NEWS:1.2027.2.547.2.1049
--- php-src/NEWS:1.2027.2.547.2.1048Tue Jan  8 19:10:16 2008
+++ php-src/NEWSWed Jan  9 06:45:15 2008
@@ -5,6 +5,8 @@
 - Fixed a safe_mode bypass in cURL identified by Maksymilian Arciemowicz.
   (Ilia)
 
+- Fixed bug #43793 (zlib filter is unable to auto-detect gzip/zlib file 
headers).
+  (Greg)
 - Fixed bug #43663 (Extending PDO class with a __call() function doesn't 
work). 
   (David Soria Parra)
 - Fixed bug #43647 (Make FindFile use PATH_SEPARATOR instead of ";"). (Ilia)
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.6.2.2.2.5&r2=1.6.2.2.2.6&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.5 
php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.6
--- php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.5  Mon Dec 31 07:20:14 2007
+++ php-src/ext/zlib/zlib_filter.c  Wed Jan  9 06:45:15 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zlib_filter.c,v 1.6.2.2.2.5 2007/12/31 07:20:14 sebastian Exp $ */
+/* $Id: zlib_filter.c,v 1.6.2.2.2.6 2008/01/09 06:45:15 cellog Exp $ */
 
 #include "php.h"
 #include "php_zlib.h"
@@ -323,7 +323,7 @@
/* log-2 base of history window (9 - 15) */
SEPARATE_ZVAL(tmpzval);
convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < -MAX_WBITS || 
Z_LVAL_PP(tmpzval) > MAX_WBITS) {
+   if (Z_LVAL_PP(tmpzval) < -MAX_WBITS || 
Z_LVAL_PP(tmpzval) > MAX_WBITS + 32) {
php_error_docref(NULL TSRMLS_CC, 
E_WARNING, "Invalid parameter give for window size. (%ld)", Z_LVAL_PP(tmpzval));
} else {
windowBits = Z_LVAL_PP(tmpzval);

http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/tests/zlib_filter_inflate2.phpt?view=markup&rev=1.1
Index: php-src/ext/zlib/tests/zlib_filter_inflate2.phpt
+++ php-src/ext/zlib/tests/zlib_filter_inflate2.phpt
--TEST--
zlib.inflate of gzip-encoded stream
--SKIPIF--

--FILE--
 
15+16));
echo "2\n";
echo fread($fp, 2000);
fclose($fp);
// auto-detect
$fp = fopen(dirname(__FILE__) . '/test.txt.gz', 'r');
stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ, array('window' => 
15+32));
echo "3\n";
echo fread($fp, 2000);
fclose($fp);

?>
--CLEAN--

--EXPECT--
1
2
This is quite the thing ain't it
3
This is quite the thing ain't it

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/zlib zlib_filter.c /ext/zlib/tests zlib_filter_inflate2.phpt

2008-01-08 Thread Greg Beaver
cellog  Wed Jan  9 06:45:36 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/zlib/tests zlib_filter_inflate2.phpt 

  Modified files:  
/php-src/ext/zlib   zlib_filter.c 
  Log:
  fix Bug #43793: zlib filter is unable to auto-detect gzip/zlib file headers
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.6.2.2.2.4.2.1&r2=1.6.2.2.2.4.2.2&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.1 
php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.2
--- php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.1  Mon Dec 31 07:17:17 2007
+++ php-src/ext/zlib/zlib_filter.c  Wed Jan  9 06:45:36 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zlib_filter.c,v 1.6.2.2.2.4.2.1 2007/12/31 07:17:17 sebastian Exp $ */
+/* $Id: zlib_filter.c,v 1.6.2.2.2.4.2.2 2008/01/09 06:45:36 cellog Exp $ */
 
 #include "php.h"
 #include "php_zlib.h"
@@ -323,7 +323,7 @@
/* log-2 base of history window (9 - 15) */
SEPARATE_ZVAL(tmpzval);
convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < -MAX_WBITS || 
Z_LVAL_PP(tmpzval) > MAX_WBITS) {
+   if (Z_LVAL_PP(tmpzval) < -MAX_WBITS || 
Z_LVAL_PP(tmpzval) > MAX_WBITS + 32) {
php_error_docref(NULL TSRMLS_CC, 
E_WARNING, "Invalid parameter give for window size. (%ld)", Z_LVAL_PP(tmpzval));
} else {
windowBits = Z_LVAL_PP(tmpzval);

http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/tests/zlib_filter_inflate2.phpt?view=markup&rev=1.1
Index: php-src/ext/zlib/tests/zlib_filter_inflate2.phpt
+++ php-src/ext/zlib/tests/zlib_filter_inflate2.phpt
--TEST--
zlib.inflate of gzip-encoded stream
--SKIPIF--

--FILE--
 
15+16));
echo "2\n";
echo fread($fp, 2000);
fclose($fp);
// auto-detect
$fp = fopen(dirname(__FILE__) . '/test.txt.gz', 'r');
stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ, array('window' => 
15+32));
echo "3\n";
echo fread($fp, 2000);
fclose($fp);

?>
--CLEAN--

--EXPECT--
1
2
This is quite the thing ain't it
3
This is quite the thing ain't it

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/zlib zlib_filter.c

2008-01-08 Thread Greg Beaver
cellog  Wed Jan  9 07:03:28 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/zlib   zlib_filter.c 
  Log:
  apply same fix of bug #43793 to zlib.deflate
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.6.2.2.2.4.2.2&r2=1.6.2.2.2.4.2.3&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.2 
php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.3
--- php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.2  Wed Jan  9 06:45:36 2008
+++ php-src/ext/zlib/zlib_filter.c  Wed Jan  9 07:03:28 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zlib_filter.c,v 1.6.2.2.2.4.2.2 2008/01/09 06:45:36 cellog Exp $ */
+/* $Id: zlib_filter.c,v 1.6.2.2.2.4.2.3 2008/01/09 07:03:28 cellog Exp $ */
 
 #include "php.h"
 #include "php_zlib.h"
@@ -367,7 +367,7 @@
/* log-2 base of history window 
(9 - 15) */
SEPARATE_ZVAL(tmpzval);
convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < 
-MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS) {
+   if (Z_LVAL_PP(tmpzval) < 
-MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS + 32) {
php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%ld)", 
Z_LVAL_PP(tmpzval));
} else {
windowBits = 
Z_LVAL_PP(tmpzval);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/zlib zlib_filter.c

2008-01-08 Thread Greg Beaver
cellog  Wed Jan  9 07:03:41 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/zlib   zlib_filter.c 
  Log:
  apply same fix of bug #43793 to zlib.deflate
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.6.2.2.2.6&r2=1.6.2.2.2.7&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.6 
php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.7
--- php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.6  Wed Jan  9 06:45:15 2008
+++ php-src/ext/zlib/zlib_filter.c  Wed Jan  9 07:03:41 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zlib_filter.c,v 1.6.2.2.2.6 2008/01/09 06:45:15 cellog Exp $ */
+/* $Id: zlib_filter.c,v 1.6.2.2.2.7 2008/01/09 07:03:41 cellog Exp $ */
 
 #include "php.h"
 #include "php_zlib.h"
@@ -367,7 +367,7 @@
/* log-2 base of history window 
(9 - 15) */
SEPARATE_ZVAL(tmpzval);
convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < 
-MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS) {
+   if (Z_LVAL_PP(tmpzval) < 
-MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS + 32) {
php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%ld)", 
Z_LVAL_PP(tmpzval));
} else {
windowBits = 
Z_LVAL_PP(tmpzval);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/zlib zlib_filter.c

2008-01-08 Thread Greg Beaver
cellog  Wed Jan  9 07:03:49 2008 UTC

  Modified files:  
/php-src/ext/zlib   zlib_filter.c 
  Log:
  apply same fix of bug #43793 to zlib.deflate
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.17&r2=1.18&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.17 php-src/ext/zlib/zlib_filter.c:1.18
--- php-src/ext/zlib/zlib_filter.c:1.17 Wed Jan  9 06:42:56 2008
+++ php-src/ext/zlib/zlib_filter.c  Wed Jan  9 07:03:48 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zlib_filter.c,v 1.17 2008/01/09 06:42:56 cellog Exp $ */
+/* $Id: zlib_filter.c,v 1.18 2008/01/09 07:03:48 cellog Exp $ */
 
 #include "php.h"
 #include "php_zlib.h"
@@ -379,7 +379,7 @@
/* log-2 base of history window 
(9 - 15) */
SEPARATE_ZVAL(tmpzval);
convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < 
-MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS) {
+   if (Z_LVAL_PP(tmpzval) < 
-MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS + 32) {
php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%ld)", 
Z_LVAL_PP(tmpzval));
} else {
windowBits = 
Z_LVAL_PP(tmpzval);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/zlib zlib_filter.c

2008-01-09 Thread Greg Beaver
cellog  Wed Jan  9 08:12:15 2008 UTC

  Modified files:  
/php-src/ext/zlib   zlib_filter.c 
  Log:
  apply proper fix of bug #43793 to zlib.deflate (window+16 = gzip)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.18&r2=1.19&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.18 php-src/ext/zlib/zlib_filter.c:1.19
--- php-src/ext/zlib/zlib_filter.c:1.18 Wed Jan  9 07:03:48 2008
+++ php-src/ext/zlib/zlib_filter.c  Wed Jan  9 08:12:15 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zlib_filter.c,v 1.18 2008/01/09 07:03:48 cellog Exp $ */
+/* $Id: zlib_filter.c,v 1.19 2008/01/09 08:12:15 cellog Exp $ */
 
 #include "php.h"
 #include "php_zlib.h"
@@ -379,7 +379,7 @@
/* log-2 base of history window 
(9 - 15) */
SEPARATE_ZVAL(tmpzval);
convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < 
-MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS + 32) {
+   if (Z_LVAL_PP(tmpzval) < 
-MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS + 16) {
php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%ld)", 
Z_LVAL_PP(tmpzval));
} else {
windowBits = 
Z_LVAL_PP(tmpzval);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/zlib zlib_filter.c

2008-01-09 Thread Greg Beaver
cellog  Wed Jan  9 08:12:26 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/zlib   zlib_filter.c 
  Log:
  apply proper fix of bug #43793 to zlib.deflate (window+16 = gzip)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.6.2.2.2.7&r2=1.6.2.2.2.8&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.7 
php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.8
--- php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.7  Wed Jan  9 07:03:41 2008
+++ php-src/ext/zlib/zlib_filter.c  Wed Jan  9 08:12:26 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zlib_filter.c,v 1.6.2.2.2.7 2008/01/09 07:03:41 cellog Exp $ */
+/* $Id: zlib_filter.c,v 1.6.2.2.2.8 2008/01/09 08:12:26 cellog Exp $ */
 
 #include "php.h"
 #include "php_zlib.h"
@@ -367,7 +367,7 @@
/* log-2 base of history window 
(9 - 15) */
SEPARATE_ZVAL(tmpzval);
convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < 
-MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS + 32) {
+   if (Z_LVAL_PP(tmpzval) < 
-MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS + 16) {
php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%ld)", 
Z_LVAL_PP(tmpzval));
} else {
windowBits = 
Z_LVAL_PP(tmpzval);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/zlib zlib_filter.c

2008-01-09 Thread Greg Beaver
cellog  Wed Jan  9 08:12:34 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/zlib   zlib_filter.c 
  Log:
  apply proper fix of bug #43793 to zlib.deflate (window+16 = gzip)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.6.2.2.2.4.2.3&r2=1.6.2.2.2.4.2.4&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.3 
php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.4
--- php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.3  Wed Jan  9 07:03:28 2008
+++ php-src/ext/zlib/zlib_filter.c  Wed Jan  9 08:12:33 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zlib_filter.c,v 1.6.2.2.2.4.2.3 2008/01/09 07:03:28 cellog Exp $ */
+/* $Id: zlib_filter.c,v 1.6.2.2.2.4.2.4 2008/01/09 08:12:33 cellog Exp $ */
 
 #include "php.h"
 #include "php_zlib.h"
@@ -367,7 +367,7 @@
/* log-2 base of history window 
(9 - 15) */
SEPARATE_ZVAL(tmpzval);
convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < 
-MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS + 32) {
+   if (Z_LVAL_PP(tmpzval) < 
-MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS + 16) {
php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%ld)", 
Z_LVAL_PP(tmpzval));
} else {
windowBits = 
Z_LVAL_PP(tmpzval);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/zip config.w32 /ext/zip/lib zip.h zip_add.c zip_add_dir.c zip_close.c zip_delete.c zip_dirent.c zip_entry_free.c zip_entry_new.c zip_error.c zip_error_clear.c zip_error_ge

2008-01-11 Thread Greg Beaver
cellog  Sat Jan 12 03:42:42 2008 UTC

  Modified files:  
/php-src/ext/zipconfig.w32 
/php-src/ext/zip/libzip.h zip_add.c zip_add_dir.c zip_close.c 
zip_delete.c zip_dirent.c zip_entry_free.c 
zip_entry_new.c zip_error.c zip_error_clear.c 
zip_error_get.c zip_error_get_sys_type.c 
zip_error_strerror.c zip_error_to_str.c 
zip_fclose.c zip_file_error_clear.c 
zip_file_error_get.c zip_file_get_offset.c 
zip_file_strerror.c zip_fopen.c 
zip_fopen_index.c zip_fread.c zip_free.c 
zip_get_archive_comment.c 
zip_get_file_comment.c zip_get_name.c 
zip_get_num_files.c zip_memdup.c 
zip_name_locate.c zip_new.c zip_open.c 
zip_rename.c zip_replace.c 
zip_set_archive_comment.c 
zip_set_file_comment.c zip_set_name.c 
zip_source_buffer.c zip_source_file.c 
zip_source_filep.c zip_source_free.c 
zip_source_function.c zip_source_zip.c 
zip_stat.c zip_stat_index.c zip_stat_init.c 
zip_strerror.c zip_unchange.c 
zip_unchange_all.c zip_unchange_archive.c 
zip_unchange_data.c zip_win32.h zipint.h 
  Log:
  export symbols for use by other extensions like phar
  http://cvs.php.net/viewvc.cgi/php-src/ext/zip/config.w32?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/zip/config.w32
diff -u php-src/ext/zip/config.w32:1.2 php-src/ext/zip/config.w32:1.3
--- php-src/ext/zip/config.w32:1.2  Wed Nov  1 00:53:32 2006
+++ php-src/ext/zip/config.w32  Sat Jan 12 03:42:41 2008
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.2 2006/11/01 00:53:32 pajoye Exp $
+// $Id: config.w32,v 1.3 2008/01/12 03:42:41 cellog Exp $
 // vim:ft=javascript
 
 ARG_ENABLE("zip", "ZIP support", "no");
@@ -31,6 +31,9 @@
 
AC_DEFINE('HAVE_ZLIB', 1);
AC_DEFINE('HAVE_ZIP', 1);
+   if (PHP_ZIP_SHARED) {
+   ADD_FLAG("CFLAGS_ZIP", "/D PHP_ZIP_EXPORTS ");
+   }
} else {
WARNING("zip not enabled; libraries and headers not found");
}
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/zip.h?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/zip/lib/zip.h
diff -u php-src/ext/zip/lib/zip.h:1.5 php-src/ext/zip/lib/zip.h:1.6
--- php-src/ext/zip/lib/zip.h:1.5   Mon Dec 31 07:12:17 2007
+++ php-src/ext/zip/lib/zip.h   Sat Jan 12 03:42:41 2008
@@ -37,16 +37,22 @@
 */
 
 
-
-#ifdef __cplusplus
-extern "C" {
+#include "main/php.h"
+#ifdef PHP_WIN32
+#include "zip_win32.h"
+# ifdef PHP_ZIP_EXPORTS
+#  define PHPZIPAPI __declspec(dllexport)
+# elif defined(COMPILE_DL_ZIP)
+#  define PHPZIPAPI __declspec(dllimport)
+# endif
+#else
+#define PHPZIPAPI
 #endif
-
+BEGIN_EXTERN_C()
 #include 
 #include 
 #include 
 
-#include "zip_win32.h"
 
 /* flags for zip_open */
 
@@ -162,49 +168,46 @@
 
 
 
-int zip_add(struct zip *, const char *, struct zip_source *);
-int zip_add_dir(struct zip *, const char *);
-int zip_close(struct zip *);
-int zip_delete(struct zip *, int);
-void zip_error_clear(struct zip *);
-void zip_error_get(struct zip *, int *, int *);
-int zip_error_get_sys_type(int);
-int zip_error_to_str(char *, size_t, int, int);
-int zip_fclose(struct zip_file *);
-void zip_file_error_clear(struct zip_file *);
-void zip_file_error_get(struct zip_file *, int *, int *);
-const char *zip_file_strerror(struct zip_file *);
-struct zip_file *zip_fopen(struct zip *, const char *, int);
-struct zip_file *zip_fopen_index(struct zip *, int, int);
-ssize_t zip_fread(struct zip_file *, void *, size_t);
-const char *zip_get_archive_comment(struct zip *, int *, int);
-const char *zip_get_file_comment(struct zip *, int, int *, int);
-const char *zip_get_name(struct zip *, int, int);
-int zip_get_num_files(struct zip *);
-int zip_name_locate(struct zip *, const char *, int);
-struct zip *zip_open(const char *, int, int *);
-int zip_rename(struct zip *, int, const char *);
-int zip_replace(struct zip *, int, struct zip_source *);
-int zip_set_archive_comment(struct zip *, const char *, int);
-int zip_set_file_comment(struct zip *, int, const char *, int);
-struct zip_source *zip_source_buffer(struct zip *, const void *, off_t, int);
-struct zip_source *zip_source_file(struct zip *, const char *, off_t, off_t);
-struct zip_source *zip_source_filep(struct zip *, FILE *, off_t, off_t);
-void zip_source_free(struct zip_source *);
-struct zip_source *zip_source_function(struc

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/zip config.w32 /ext/zip/lib zip.h zip_add.c zip_add_dir.c zip_close.c zip_delete.c zip_dirent.c zip_entry_free.c zip_entry_new.c zip_error.c zip_error_clear.c zip

2008-01-11 Thread Greg Beaver
cellog  Sat Jan 12 03:43:06 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/zipconfig.w32 
/php-src/ext/zip/libzip.h zip_add.c zip_add_dir.c zip_close.c 
zip_delete.c zip_dirent.c zip_entry_free.c 
zip_entry_new.c zip_error.c zip_error_clear.c 
zip_error_get.c zip_error_get_sys_type.c 
zip_error_strerror.c zip_error_to_str.c 
zip_fclose.c zip_file_error_clear.c 
zip_file_error_get.c zip_file_get_offset.c 
zip_file_strerror.c zip_fopen.c 
zip_fopen_index.c zip_fread.c zip_free.c 
zip_get_archive_comment.c 
zip_get_file_comment.c zip_get_name.c 
zip_get_num_files.c zip_memdup.c 
zip_name_locate.c zip_new.c zip_open.c 
zip_rename.c zip_replace.c 
zip_set_archive_comment.c 
zip_set_file_comment.c zip_set_name.c 
zip_source_buffer.c zip_source_file.c 
zip_source_filep.c zip_source_free.c 
zip_source_function.c zip_source_zip.c 
zip_stat.c zip_stat_index.c zip_stat_init.c 
zip_strerror.c zip_unchange.c 
zip_unchange_all.c zip_unchange_archive.c 
zip_unchange_data.c zip_win32.h zipint.h 
  Log:
  MFH: export symbols for use by other extensions like phar
  http://cvs.php.net/viewvc.cgi/php-src/ext/zip/config.w32?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/zip/config.w32
diff -u php-src/ext/zip/config.w32:1.1.2.1 php-src/ext/zip/config.w32:1.1.2.2
--- php-src/ext/zip/config.w32:1.1.2.1  Fri Nov  3 16:46:18 2006
+++ php-src/ext/zip/config.w32  Sat Jan 12 03:43:05 2008
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.1.2.1 2006/11/03 16:46:18 pajoye Exp $
+// $Id: config.w32,v 1.1.2.2 2008/01/12 03:43:05 cellog Exp $
 // vim:ft=javascript
 
 ARG_ENABLE("zip", "ZIP support", "no");
@@ -31,6 +31,9 @@
 
AC_DEFINE('HAVE_ZLIB', 1);
AC_DEFINE('HAVE_ZIP', 1);
+   if (PHP_ZIP_SHARED) {
+   ADD_FLAG("CFLAGS_ZIP", "/D PHP_ZIP_EXPORTS ");
+   }
} else {
WARNING("zip not enabled; libraries and headers not found");
}
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/zip.h?r1=1.1.2.4&r2=1.1.2.5&diff_format=u
Index: php-src/ext/zip/lib/zip.h
diff -u php-src/ext/zip/lib/zip.h:1.1.2.4 php-src/ext/zip/lib/zip.h:1.1.2.5
--- php-src/ext/zip/lib/zip.h:1.1.2.4   Mon Dec 31 07:20:14 2007
+++ php-src/ext/zip/lib/zip.h   Sat Jan 12 03:43:05 2008
@@ -37,16 +37,22 @@
 */
 
 
-
-#ifdef __cplusplus
-extern "C" {
+#include "main/php.h"
+#ifdef PHP_WIN32
+#include "zip_win32.h"
+# ifdef PHP_ZIP_EXPORTS
+#  define PHPZIPAPI __declspec(dllexport)
+# elif defined(COMPILE_DL_ZIP)
+#  define PHPZIPAPI __declspec(dllimport)
+# endif
+#else
+#define PHPZIPAPI
 #endif
-
+BEGIN_EXTERN_C()
 #include 
 #include 
 #include 
 
-#include "zip_win32.h"
 
 /* flags for zip_open */
 
@@ -162,49 +168,46 @@
 
 
 
-int zip_add(struct zip *, const char *, struct zip_source *);
-int zip_add_dir(struct zip *, const char *);
-int zip_close(struct zip *);
-int zip_delete(struct zip *, int);
-void zip_error_clear(struct zip *);
-void zip_error_get(struct zip *, int *, int *);
-int zip_error_get_sys_type(int);
-int zip_error_to_str(char *, size_t, int, int);
-int zip_fclose(struct zip_file *);
-void zip_file_error_clear(struct zip_file *);
-void zip_file_error_get(struct zip_file *, int *, int *);
-const char *zip_file_strerror(struct zip_file *);
-struct zip_file *zip_fopen(struct zip *, const char *, int);
-struct zip_file *zip_fopen_index(struct zip *, int, int);
-ssize_t zip_fread(struct zip_file *, void *, size_t);
-const char *zip_get_archive_comment(struct zip *, int *, int);
-const char *zip_get_file_comment(struct zip *, int, int *, int);
-const char *zip_get_name(struct zip *, int, int);
-int zip_get_num_files(struct zip *);
-int zip_name_locate(struct zip *, const char *, int);
-struct zip *zip_open(const char *, int, int *);
-int zip_rename(struct zip *, int, const char *);
-int zip_replace(struct zip *, int, struct zip_source *);
-int zip_set_archive_comment(struct zip *, const char *, int);
-int zip_set_file_comment(struct zip *, int, const char *, int);
-struct zip_source *zip_source_buffer(struct zip *, const void *, off_t, int);
-struct zip_source *zip_source_file(struct zip *, const char *, off_t, off_t);
-struct zip_source *zip_source_filep(struct zip *, FILE *, off_t, off_t);
-void zip_source_free(struc

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/zip config.w32 /ext/zip/lib zip.h zip_add.c zip_add_dir.c zip_close.c zip_delete.c zip_dirent.c zip_entry_free.c zip_entry_new.c zip_error.c zip_error_clear.c zip

2008-01-11 Thread Greg Beaver
cellog  Sat Jan 12 03:46:48 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/zipconfig.w32 
/php-src/ext/zip/libzip.h zip_add.c zip_add_dir.c zip_close.c 
zip_delete.c zip_dirent.c zip_entry_free.c 
zip_entry_new.c zip_error.c zip_error_clear.c 
zip_error_get.c zip_error_get_sys_type.c 
zip_error_strerror.c zip_error_to_str.c 
zip_fclose.c zip_file_error_clear.c 
zip_file_error_get.c zip_file_get_offset.c 
zip_file_strerror.c zip_fopen.c 
zip_fopen_index.c zip_fread.c zip_free.c 
zip_get_archive_comment.c 
zip_get_file_comment.c zip_get_name.c 
zip_get_num_files.c zip_memdup.c 
zip_name_locate.c zip_new.c zip_open.c 
zip_rename.c zip_replace.c 
zip_set_archive_comment.c 
zip_set_file_comment.c zip_set_name.c 
zip_source_buffer.c zip_source_file.c 
zip_source_filep.c zip_source_free.c 
zip_source_function.c zip_source_zip.c 
zip_stat.c zip_stat_index.c zip_stat_init.c 
zip_strerror.c zip_unchange.c 
zip_unchange_all.c zip_unchange_archive.c 
zip_unchange_data.c zip_win32.h zipint.h 
  Log:
  revert last commit, was to wrong branch
  http://cvs.php.net/viewvc.cgi/php-src/ext/zip/config.w32?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/zip/config.w32
diff -u php-src/ext/zip/config.w32:1.1.2.2 php-src/ext/zip/config.w32:1.1.2.3
--- php-src/ext/zip/config.w32:1.1.2.2  Sat Jan 12 03:43:05 2008
+++ php-src/ext/zip/config.w32  Sat Jan 12 03:46:47 2008
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.1.2.2 2008/01/12 03:43:05 cellog Exp $
+// $Id: config.w32,v 1.1.2.3 2008/01/12 03:46:47 cellog Exp $
 // vim:ft=javascript
 
 ARG_ENABLE("zip", "ZIP support", "no");
@@ -31,9 +31,6 @@
 
AC_DEFINE('HAVE_ZLIB', 1);
AC_DEFINE('HAVE_ZIP', 1);
-   if (PHP_ZIP_SHARED) {
-   ADD_FLAG("CFLAGS_ZIP", "/D PHP_ZIP_EXPORTS ");
-   }
} else {
WARNING("zip not enabled; libraries and headers not found");
}
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/zip.h?r1=1.1.2.5&r2=1.1.2.6&diff_format=u
Index: php-src/ext/zip/lib/zip.h
diff -u php-src/ext/zip/lib/zip.h:1.1.2.5 php-src/ext/zip/lib/zip.h:1.1.2.6
--- php-src/ext/zip/lib/zip.h:1.1.2.5   Sat Jan 12 03:43:05 2008
+++ php-src/ext/zip/lib/zip.h   Sat Jan 12 03:46:47 2008
@@ -37,22 +37,16 @@
 */
 
 
-#include "main/php.h"
-#ifdef PHP_WIN32
-#include "zip_win32.h"
-# ifdef PHP_ZIP_EXPORTS
-#  define PHPZIPAPI __declspec(dllexport)
-# elif defined(COMPILE_DL_ZIP)
-#  define PHPZIPAPI __declspec(dllimport)
-# endif
-#else
-#define PHPZIPAPI
+
+#ifdef __cplusplus
+extern "C" {
 #endif
-BEGIN_EXTERN_C()
+
 #include 
 #include 
 #include 
 
+#include "zip_win32.h"
 
 /* flags for zip_open */
 
@@ -168,46 +162,49 @@
 
 
 
-PHPZIPAPI int zip_add(struct zip *, const char *, struct zip_source *);
-PHPZIPAPI int zip_add_dir(struct zip *, const char *);
-PHPZIPAPI int zip_close(struct zip *);
-PHPZIPAPI int zip_delete(struct zip *, int);
-PHPZIPAPI void zip_error_clear(struct zip *);
-PHPZIPAPI void zip_error_get(struct zip *, int *, int *);
-PHPZIPAPI int zip_error_get_sys_type(int);
-PHPZIPAPI int zip_error_to_str(char *, size_t, int, int);
-PHPZIPAPI int zip_fclose(struct zip_file *);
-PHPZIPAPI void zip_file_error_clear(struct zip_file *);
-PHPZIPAPI void zip_file_error_get(struct zip_file *, int *, int *);
-PHPZIPAPI const char *zip_file_strerror(struct zip_file *);
-PHPZIPAPI struct zip_file *zip_fopen(struct zip *, const char *, int);
-PHPZIPAPI struct zip_file *zip_fopen_index(struct zip *, int, int);
-PHPZIPAPI ssize_t zip_fread(struct zip_file *, void *, size_t);
-PHPZIPAPI const char *zip_get_archive_comment(struct zip *, int *, int);
-PHPZIPAPI const char *zip_get_file_comment(struct zip *, int, int *, int);
-PHPZIPAPI const char *zip_get_name(struct zip *, int, int);
-PHPZIPAPI int zip_get_num_files(struct zip *);
-PHPZIPAPI int zip_name_locate(struct zip *, const char *, int);
-PHPZIPAPI struct zip *zip_open(const char *, int, int *);
-PHPZIPAPI int zip_rename(struct zip *, int, const char *);
-PHPZIPAPI int zip_replace(struct zip *, int, struct zip_source *);
-PHPZIPAPI int zip_set_archive_comment(struct zip *, const char *, int);
-PHPZIPAPI int zip_set_file_comment(struct zip *, int, const char *, int);
-PHPZIPAPI struct zip_sourc

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/zip config.w32 /ext/zip/lib zip.h zip_add.c zip_add_dir.c zip_close.c zip_delete.c zip_dirent.c zip_entry_free.c zip_entry_new.c zip_error.c zip_error_clear.c zip

2008-01-11 Thread Greg Beaver
cellog  Sat Jan 12 03:48:39 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/zipconfig.w32 
/php-src/ext/zip/libzip.h zip_add.c zip_add_dir.c zip_close.c 
zip_delete.c zip_dirent.c zip_entry_free.c 
zip_entry_new.c zip_error.c zip_error_clear.c 
zip_error_get.c zip_error_get_sys_type.c 
zip_error_strerror.c zip_error_to_str.c 
zip_fclose.c zip_file_error_clear.c 
zip_file_error_get.c zip_file_get_offset.c 
zip_file_strerror.c zip_fopen.c 
zip_fopen_index.c zip_fread.c zip_free.c 
zip_get_archive_comment.c 
zip_get_file_comment.c zip_get_name.c 
zip_get_num_files.c zip_memdup.c 
zip_name_locate.c zip_new.c zip_open.c 
zip_rename.c zip_replace.c 
zip_set_archive_comment.c 
zip_set_file_comment.c zip_set_name.c 
zip_source_buffer.c zip_source_file.c 
zip_source_filep.c zip_source_free.c 
zip_source_function.c zip_source_zip.c 
zip_stat.c zip_stat_index.c zip_stat_init.c 
zip_strerror.c zip_unchange.c 
zip_unchange_all.c zip_unchange_archive.c 
zip_unchange_data.c zip_win32.h zipint.h 
  Log:
  MFH: export symbols for use by other extensions like phar
  http://cvs.php.net/viewvc.cgi/php-src/ext/zip/config.w32?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u
Index: php-src/ext/zip/config.w32
diff -u php-src/ext/zip/config.w32:1.1.2.1 
php-src/ext/zip/config.w32:1.1.2.1.2.1
--- php-src/ext/zip/config.w32:1.1.2.1  Fri Nov  3 16:46:18 2006
+++ php-src/ext/zip/config.w32  Sat Jan 12 03:48:38 2008
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.1.2.1 2006/11/03 16:46:18 pajoye Exp $
+// $Id: config.w32,v 1.1.2.1.2.1 2008/01/12 03:48:38 cellog Exp $
 // vim:ft=javascript
 
 ARG_ENABLE("zip", "ZIP support", "no");
@@ -31,6 +31,9 @@
 
AC_DEFINE('HAVE_ZLIB', 1);
AC_DEFINE('HAVE_ZIP', 1);
+   if (PHP_ZIP_SHARED) {
+   ADD_FLAG("CFLAGS_ZIP", "/D PHP_ZIP_EXPORTS ");
+   }
} else {
WARNING("zip not enabled; libraries and headers not found");
}
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/zip.h?r1=1.1.2.3.2.1&r2=1.1.2.3.2.2&diff_format=u
Index: php-src/ext/zip/lib/zip.h
diff -u php-src/ext/zip/lib/zip.h:1.1.2.3.2.1 
php-src/ext/zip/lib/zip.h:1.1.2.3.2.2
--- php-src/ext/zip/lib/zip.h:1.1.2.3.2.1   Mon Dec 31 07:17:16 2007
+++ php-src/ext/zip/lib/zip.h   Sat Jan 12 03:48:38 2008
@@ -37,16 +37,22 @@
 */
 
 
-
-#ifdef __cplusplus
-extern "C" {
+#include "main/php.h"
+#ifdef PHP_WIN32
+#include "zip_win32.h"
+# ifdef PHP_ZIP_EXPORTS
+#  define PHPZIPAPI __declspec(dllexport)
+# elif defined(COMPILE_DL_ZIP)
+#  define PHPZIPAPI __declspec(dllimport)
+# endif
+#else
+#define PHPZIPAPI
 #endif
-
+BEGIN_EXTERN_C()
 #include 
 #include 
 #include 
 
-#include "zip_win32.h"
 
 /* flags for zip_open */
 
@@ -162,49 +168,46 @@
 
 
 
-int zip_add(struct zip *, const char *, struct zip_source *);
-int zip_add_dir(struct zip *, const char *);
-int zip_close(struct zip *);
-int zip_delete(struct zip *, int);
-void zip_error_clear(struct zip *);
-void zip_error_get(struct zip *, int *, int *);
-int zip_error_get_sys_type(int);
-int zip_error_to_str(char *, size_t, int, int);
-int zip_fclose(struct zip_file *);
-void zip_file_error_clear(struct zip_file *);
-void zip_file_error_get(struct zip_file *, int *, int *);
-const char *zip_file_strerror(struct zip_file *);
-struct zip_file *zip_fopen(struct zip *, const char *, int);
-struct zip_file *zip_fopen_index(struct zip *, int, int);
-ssize_t zip_fread(struct zip_file *, void *, size_t);
-const char *zip_get_archive_comment(struct zip *, int *, int);
-const char *zip_get_file_comment(struct zip *, int, int *, int);
-const char *zip_get_name(struct zip *, int, int);
-int zip_get_num_files(struct zip *);
-int zip_name_locate(struct zip *, const char *, int);
-struct zip *zip_open(const char *, int, int *);
-int zip_rename(struct zip *, int, const char *);
-int zip_replace(struct zip *, int, struct zip_source *);
-int zip_set_archive_comment(struct zip *, const char *, int);
-int zip_set_file_comment(struct zip *, int, const char *, int);
-struct zip_source *zip_source_buffer(struct zip *, const void *, off_t, int);
-struct zip_source *zip_source_file(struct zip *, const char *, off_t, off_t);
-struct zip_source *zip_source_filep(struct zip *, FILE *, off_

[PHP-CVS] cvs: php-src /ext/standard/tests/file include_userstream_002.phpt include_userstream_003.phpt /main/streams streams.c

2008-01-12 Thread Greg Beaver
cellog  Sat Jan 12 15:50:17 2008 UTC

  Added files: 
/php-src/ext/standard/tests/fileinclude_userstream_003.phpt 

  Modified files:  
/php-src/main/streams   streams.c 
/php-src/ext/standard/tests/fileinclude_userstream_002.phpt 
  Log:
  clarify error message on why opening a stream wrapper failed for 
allow_url_include/allow_url_fopen, add test for allow_url_fopen
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.157&r2=1.158&diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.157 
php-src/main/streams/streams.c:1.158
--- php-src/main/streams/streams.c:1.157Mon Dec 31 07:12:19 2007
+++ php-src/main/streams/streams.c  Sat Jan 12 15:50:16 2008
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.157 2007/12/31 07:12:19 sebastian Exp $ */
+/* $Id: streams.c,v 1.158 2008/01/12 15:50:16 cellog Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -2184,7 +2184,11 @@
if (options & REPORT_ERRORS) {
/* protocol[n] probably isn't '\0' */
char *protocol_dup = estrndup(protocol, n);
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s:// 
wrapper is disabled in the server configuration", protocol_dup);
+   if (!PG(allow_url_fopen)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"%s:// wrapper is disabled in the server configuration by allow_url_fopen=0", 
protocol_dup);
+   } else {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"%s:// wrapper is disabled in the server configuration by allow_url_include=0", 
protocol_dup);
+   }
efree(protocol_dup);
}
return NULL;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/include_userstream_002.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/file/include_userstream_002.phpt
diff -u php-src/ext/standard/tests/file/include_userstream_002.phpt:1.1 
php-src/ext/standard/tests/file/include_userstream_002.phpt:1.2
--- php-src/ext/standard/tests/file/include_userstream_002.phpt:1.1 Tue Jul 
 3 10:22:55 2007
+++ php-src/ext/standard/tests/file/include_userstream_002.phpt Sat Jan 12 
15:50:17 2008
@@ -97,7 +97,7 @@
 
 
 
-Warning: fopen(): test1:// wrapper is disabled in the server configuration in 
%sinclude_userstream_002.php on line 10
+Warning: fopen(): test1:// wrapper is disabled in the server configuration by 
allow_url_include=0 in %sinclude_userstream_002.php on line 10
 
 Warning: fopen(test1://hello): failed to open stream: no suitable wrapper 
could be found in %sinclude_userstream_002.php on line 10
 

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/include_userstream_003.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/file/include_userstream_003.phpt
+++ php-src/ext/standard/tests/file/include_userstream_003.phpt
--TEST--
allow_url_fopen disabled
--INI--
allow_url_fopen=0
allow_url_include=1
--FILE--
';
private $pos;
private $stream = null;

function stream_open($path, $mode, $options, &$opened_path)
{
if (strpos($path, "test2://") === 0) {
$this->stream = fopen("test1://".substr($path, 8), 
$mode);
return !empty($this->stream);
}
if (strchr($mode, 'a'))
$this->pos = strlen($this->data);
else
$this->po = 0;

return true;
}

function stream_read($count)
{
if (!empty($this->stream)) {
return fread($this->stream, $count);
}
$ret = substr($this->data, $this->pos, $count);
$this->pos += strlen($ret);
return $ret;
}

function stream_tell()
{
if (!empty($this->stream)) {
return ftell($this->stream);
}
return $this->pos;
}

function stream_eof()
{
if (!empty($this->stream)) {
return feof($this->stream);
}
return $this->pos >= strlen($this->data);
}

function stream_seek($offset, $whence)
{
if (!empty($this->stream)) {
return fseek($this->stream, $offset, $whence);
}
switch($whence) {
case SEEK_SET:
if ($offset < $this->data && $offset >= 0) {
$this->pos = $offset;
return true;
   

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/file include_userstream_002.phpt include_userstream_003.phpt /main/streams streams.c

2008-01-12 Thread Greg Beaver
cellog  Sat Jan 12 15:50:57 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/fileinclude_userstream_003.phpt 

  Modified files:  
/php-src/ext/standard/tests/fileinclude_userstream_002.phpt 
/php-src/main/streams   streams.c 
  Log:
  MFH: clarify error message on why opening a stream wrapper failed for 
allow_url_include/allow_url_fopen, add test for allow_url_fopen
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/include_userstream_002.phpt?r1=1.1.2.2.2.1&r2=1.1.2.2.2.2&diff_format=u
Index: php-src/ext/standard/tests/file/include_userstream_002.phpt
diff -u php-src/ext/standard/tests/file/include_userstream_002.phpt:1.1.2.2.2.1 
php-src/ext/standard/tests/file/include_userstream_002.phpt:1.1.2.2.2.2
--- php-src/ext/standard/tests/file/include_userstream_002.phpt:1.1.2.2.2.1 
Tue Nov  6 11:02:36 2007
+++ php-src/ext/standard/tests/file/include_userstream_002.phpt Sat Jan 12 
15:50:56 2008
@@ -97,7 +97,7 @@
 
 
 
-Warning: fopen(): test1:// wrapper is disabled in the server configuration in 
%sinclude_userstream_002.php on line 10
+Warning: fopen(): test1:// wrapper is disabled in the server configuration by 
allow_url_include=0 in %sinclude_userstream_002.php on line 10
 
 Warning: fopen(test1://hello): failed to open stream: no suitable wrapper 
could be found in %sinclude_userstream_002.php on line 10
 
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.18.2.4&r2=1.82.2.6.2.18.2.5&diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.82.2.6.2.18.2.4 
php-src/main/streams/streams.c:1.82.2.6.2.18.2.5
--- php-src/main/streams/streams.c:1.82.2.6.2.18.2.4Mon Dec 31 07:17:17 2007
+++ php-src/main/streams/streams.c  Sat Jan 12 15:50:57 2008
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.82.2.6.2.18.2.4 2007/12/31 07:17:17 sebastian Exp $ */
+/* $Id: streams.c,v 1.82.2.6.2.18.2.5 2008/01/12 15:50:57 cellog Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -1628,7 +1628,11 @@
if (options & REPORT_ERRORS) {
/* protocol[n] probably isn't '\0' */
char *protocol_dup = estrndup(protocol, n);
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s:// 
wrapper is disabled in the server configuration", protocol_dup);
+   if (!PG(allow_url_fopen)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"%s:// wrapper is disabled in the server configuration by allow_url_fopen=0", 
protocol_dup);
+   } else {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"%s:// wrapper is disabled in the server configuration by allow_url_include=0", 
protocol_dup);
+   }
efree(protocol_dup);
}
return NULL;

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/include_userstream_003.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/file/include_userstream_003.phpt
+++ php-src/ext/standard/tests/file/include_userstream_003.phpt
--TEST--
allow_url_fopen disabled
--INI--
allow_url_fopen=0
allow_url_include=1
--FILE--
';
private $pos;
private $stream = null;

function stream_open($path, $mode, $options, &$opened_path)
{
if (strpos($path, "test2://") === 0) {
$this->stream = fopen("test1://".substr($path, 8), 
$mode);
return !empty($this->stream);
}
if (strchr($mode, 'a'))
$this->pos = strlen($this->data);
else
$this->po = 0;

return true;
}

function stream_read($count)
{
if (!empty($this->stream)) {
return fread($this->stream, $count);
}
$ret = substr($this->data, $this->pos, $count);
$this->pos += strlen($ret);
return $ret;
}

function stream_tell()
{
if (!empty($this->stream)) {
return ftell($this->stream);
}
return $this->pos;
}

function stream_eof()
{
if (!empty($this->stream)) {
return feof($this->stream);
}
return $this->pos >= strlen($this->data);
}

function stream_seek($offset, $whence)
{
if (!empty($this->stream)) {
return fseek($this->stream, $offset, $whence);
}
switch($whence) {
case SEEK_SET:
if ($offset < $this->data && $offset >= 0

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/bz2 bz2_filter.c /ext/zlib zlib_filter.c

2008-01-12 Thread Greg Beaver
cellog  Sat Jan 12 22:03:32 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/zlib   zlib_filter.c 
/php-src/ext/bz2bz2_filter.c 
  Log:
  far better fix for bug #40189
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.6.2.2.2.4.2.5&r2=1.6.2.2.2.4.2.6&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.5 
php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.6
--- php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.5  Sat Jan 12 21:28:47 2008
+++ php-src/ext/zlib/zlib_filter.c  Sat Jan 12 22:03:32 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zlib_filter.c,v 1.6.2.2.2.4.2.5 2008/01/12 21:28:47 cellog Exp $ */
+/* $Id: zlib_filter.c,v 1.6.2.2.2.4.2.6 2008/01/12 22:03:32 cellog Exp $ */
 
 #include "php.h"
 #include "php_zlib.h"
@@ -100,7 +100,7 @@
consumed += desired;
bin += desired;
 
-   if (status == Z_STREAM_END || data->strm.avail_out < 
data->outbuf_len) {
+   if (data->strm.avail_out < data->outbuf_len) {
php_stream_bucket *out_bucket;
size_t bucketlen = data->outbuf_len - 
data->strm.avail_out;
out_bucket = php_stream_bucket_new(stream, 
estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
@@ -108,13 +108,10 @@
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
-   if (status == Z_STREAM_END) {
-   /* no more data to decompress, and 
nothing was spat out */
-   if (data->strm.avail_out >= 
data->outbuf_len) {
-   php_stream_bucket_delref(bucket 
TSRMLS_CC);
-   }
-   return PSFS_PASS_ON;
-   }
+   } else if (status == Z_STREAM_END && 
data->strm.avail_out >= data->outbuf_len) {
+   /* no more data to decompress, and nothing was 
spat out */
+   php_stream_bucket_delref(bucket TSRMLS_CC);
+   return PSFS_PASS_ON;
}
}
php_stream_bucket_delref(bucket TSRMLS_CC);
http://cvs.php.net/viewvc.cgi/php-src/ext/bz2/bz2_filter.c?r1=1.3.2.2.2.5.2.3&r2=1.3.2.2.2.5.2.4&diff_format=u
Index: php-src/ext/bz2/bz2_filter.c
diff -u php-src/ext/bz2/bz2_filter.c:1.3.2.2.2.5.2.3 
php-src/ext/bz2/bz2_filter.c:1.3.2.2.2.5.2.4
--- php-src/ext/bz2/bz2_filter.c:1.3.2.2.2.5.2.3Sat Jan 12 21:28:48 2008
+++ php-src/ext/bz2/bz2_filter.cSat Jan 12 22:03:32 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: bz2_filter.c,v 1.3.2.2.2.5.2.3 2008/01/12 21:28:48 cellog Exp $ */
+/* $Id: bz2_filter.c,v 1.3.2.2.2.5.2.4 2008/01/12 22:03:32 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -101,7 +101,7 @@
consumed += desired;
bin += desired;
 
-   if (status == BZ_STREAM_END || data->strm.avail_out < 
data->outbuf_len) {
+   if (data->strm.avail_out < data->outbuf_len) {
php_stream_bucket *out_bucket;
size_t bucketlen = data->outbuf_len - 
data->strm.avail_out;
out_bucket = php_stream_bucket_new(stream, 
estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
@@ -109,13 +109,10 @@
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
-   if (status == BZ_STREAM_END) {
-   /* no more data to decompress, and 
nothing was spat out */
-   if (data->strm.avail_out >= 
data->outbuf_len) {
-   php_stream_bucket_delref(bucket 
TSRMLS_CC);
-   }
-   return PSFS_PASS_ON;
-   }
+   } else if (status == BZ_STREAM_END && 
data->strm.avail_out >= data->outbuf_len) {
+   /* no more data to decompress, and nothing was 
spat out */
+   php_stream_bucket_delref(bucket TSRMLS_CC);
+   return PSFS_PASS_ON;
}
}
php_stream_bucket_delref(b

[PHP-CVS] cvs: php-src /ext/bz2 bz2_filter.c /ext/zlib zlib_filter.c

2008-01-12 Thread Greg Beaver
cellog  Sat Jan 12 22:03:44 2008 UTC

  Modified files:  
/php-src/ext/zlib   zlib_filter.c 
/php-src/ext/bz2bz2_filter.c 
  Log:
  MFB: far better fix for bug #40189
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.20&r2=1.21&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.20 php-src/ext/zlib/zlib_filter.c:1.21
--- php-src/ext/zlib/zlib_filter.c:1.20 Sat Jan 12 21:25:43 2008
+++ php-src/ext/zlib/zlib_filter.c  Sat Jan 12 22:03:44 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zlib_filter.c,v 1.20 2008/01/12 21:25:43 cellog Exp $ */
+/* $Id: zlib_filter.c,v 1.21 2008/01/12 22:03:44 cellog Exp $ */
 
 #include "php.h"
 #include "php_zlib.h"
@@ -114,11 +114,9 @@
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
-   if (status == Z_STREAM_END) {
+   if (status == Z_STREAM_END && 
data->strm.avail_out >= data->outbuf_len) {
/* no more data to decompress, and 
nothing was spat out */
-   if (data->strm.avail_out >= 
data->outbuf_len) {
-   php_stream_bucket_delref(bucket 
TSRMLS_CC);
-   }
+   php_stream_bucket_delref(bucket 
TSRMLS_CC);
return PSFS_PASS_ON;
}
}
http://cvs.php.net/viewvc.cgi/php-src/ext/bz2/bz2_filter.c?r1=1.16&r2=1.17&diff_format=u
Index: php-src/ext/bz2/bz2_filter.c
diff -u php-src/ext/bz2/bz2_filter.c:1.16 php-src/ext/bz2/bz2_filter.c:1.17
--- php-src/ext/bz2/bz2_filter.c:1.16   Sat Jan 12 21:25:42 2008
+++ php-src/ext/bz2/bz2_filter.cSat Jan 12 22:03:44 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: bz2_filter.c,v 1.16 2008/01/12 21:25:42 cellog Exp $ */
+/* $Id: bz2_filter.c,v 1.17 2008/01/12 22:03:44 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -108,7 +108,7 @@
consumed += desired;
bin += desired;
 
-   if (status == BZ_STREAM_END || data->strm.avail_out < 
data->outbuf_len) {
+   if (data->strm.avail_out < data->outbuf_len) {
php_stream_bucket *out_bucket;
size_t bucketlen = data->outbuf_len - 
data->strm.avail_out;
out_bucket = php_stream_bucket_new(stream, 
estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
@@ -116,13 +116,10 @@
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
-   if (status == BZ_STREAM_END) {
-   /* no more data to decompress, and 
nothing was spat out */
-   if (data->strm.avail_out >= 
data->outbuf_len) {
-   php_stream_bucket_delref(bucket 
TSRMLS_CC);
-   }
-   return PSFS_PASS_ON;
-   }
+   } else if (status == BZ_STREAM_END && 
data->strm.avail_out >= data->outbuf_len) {
+   /* no more data to decompress, and nothing was 
spat out */
+   php_stream_bucket_delref(bucket TSRMLS_CC);
+   return PSFS_PASS_ON;
}
}
php_stream_bucket_delref(bucket TSRMLS_CC);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/bz2 bz2_filter.c /ext/zlib zlib_filter.c

2008-01-12 Thread Greg Beaver
cellog  Sat Jan 12 22:04:03 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/zlib   zlib_filter.c 
/php-src/ext/bz2bz2_filter.c 
  Log:
  MFH: far better fix for bug #40189
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.6.2.2.2.9&r2=1.6.2.2.2.10&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.9 
php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.10
--- php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.9  Sat Jan 12 21:35:43 2008
+++ php-src/ext/zlib/zlib_filter.c  Sat Jan 12 22:04:02 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zlib_filter.c,v 1.6.2.2.2.9 2008/01/12 21:35:43 cellog Exp $ */
+/* $Id: zlib_filter.c,v 1.6.2.2.2.10 2008/01/12 22:04:02 cellog Exp $ */
 
 #include "php.h"
 #include "php_zlib.h"
@@ -100,7 +100,7 @@
consumed += desired;
bin += desired;
 
-   if (status == Z_STREAM_END || data->strm.avail_out < 
data->outbuf_len) {
+   if (data->strm.avail_out < data->outbuf_len) {
php_stream_bucket *out_bucket;
size_t bucketlen = data->outbuf_len - 
data->strm.avail_out;
out_bucket = php_stream_bucket_new(stream, 
estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
@@ -108,14 +108,12 @@
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
-   if (status == Z_STREAM_END) {
-   /* no more data to decompress, and 
nothing was spat out */
-   if (data->strm.avail_out >= 
data->outbuf_len) {
-   php_stream_bucket_delref(bucket 
TSRMLS_CC);
-   }
-   return PSFS_PASS_ON;
-   }
+   } else if (status == Z_STREAM_END && 
data->strm.avail_out >= data->outbuf_len) {
+   /* no more data to decompress, and nothing was 
spat out */
+   php_stream_bucket_delref(bucket TSRMLS_CC);
+   return PSFS_PASS_ON;
}
+
}
php_stream_bucket_delref(bucket TSRMLS_CC);
}
http://cvs.php.net/viewvc.cgi/php-src/ext/bz2/bz2_filter.c?r1=1.3.2.2.2.8&r2=1.3.2.2.2.9&diff_format=u
Index: php-src/ext/bz2/bz2_filter.c
diff -u php-src/ext/bz2/bz2_filter.c:1.3.2.2.2.8 
php-src/ext/bz2/bz2_filter.c:1.3.2.2.2.9
--- php-src/ext/bz2/bz2_filter.c:1.3.2.2.2.8Sat Jan 12 21:35:44 2008
+++ php-src/ext/bz2/bz2_filter.cSat Jan 12 22:04:03 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: bz2_filter.c,v 1.3.2.2.2.8 2008/01/12 21:35:44 cellog Exp $ */
+/* $Id: bz2_filter.c,v 1.3.2.2.2.9 2008/01/12 22:04:03 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -101,7 +101,7 @@
consumed += desired;
bin += desired;
 
-   if (status == BZ_STREAM_END || data->strm.avail_out < 
data->outbuf_len) {
+   if (data->strm.avail_out < data->outbuf_len) {
php_stream_bucket *out_bucket;
size_t bucketlen = data->outbuf_len - 
data->strm.avail_out;
out_bucket = php_stream_bucket_new(stream, 
estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
@@ -109,13 +109,10 @@
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
-   if (status == BZ_STREAM_END) {
-   /* no more data to decompress, and 
nothing was spat out */
-   if (data->strm.avail_out >= 
data->outbuf_len) {
-   php_stream_bucket_delref(bucket 
TSRMLS_CC);
-   }
-   return PSFS_PASS_ON;
-   }
+   } else if (status == BZ_STREAM_END && 
data->strm.avail_out >= data->outbuf_len) {
+   /* no more data to decompress, and nothing was 
spat out */
+   php_stream_bucket_delref(bucket TSRMLS_CC);
+   return PSFS_PASS_ON;
}
}
php_stream_bucket_delref(bucket TSRMLS_CC);

-- 
PHP CVS Mailing List 

[PHP-CVS] cvs: php-src /ext/zlib zlib_filter.c

2008-01-12 Thread Greg Beaver
cellog  Sat Jan 12 22:28:04 2008 UTC

  Modified files:  
/php-src/ext/zlib   zlib_filter.c 
  Log:
  wrong file version merged in fix for Bug #40189, here is the correct fix
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.21&r2=1.22&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.21 php-src/ext/zlib/zlib_filter.c:1.22
--- php-src/ext/zlib/zlib_filter.c:1.21 Sat Jan 12 22:03:44 2008
+++ php-src/ext/zlib/zlib_filter.c  Sat Jan 12 22:28:04 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zlib_filter.c,v 1.21 2008/01/12 22:03:44 cellog Exp $ */
+/* $Id: zlib_filter.c,v 1.22 2008/01/12 22:28:04 cellog Exp $ */
 
 #include "php.h"
 #include "php_zlib.h"
@@ -106,7 +106,7 @@
data->strm.avail_in = 0;
bin += desired;
 
-   if (status == Z_STREAM_END || data->strm.avail_out < 
data->outbuf_len) {
+   if (data->strm.avail_out < data->outbuf_len) {
php_stream_bucket *out_bucket;
size_t bucketlen = data->outbuf_len - 
data->strm.avail_out;
out_bucket = php_stream_bucket_new(stream, 
estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
@@ -114,12 +114,12 @@
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
-   if (status == Z_STREAM_END && 
data->strm.avail_out >= data->outbuf_len) {
-   /* no more data to decompress, and 
nothing was spat out */
-   php_stream_bucket_delref(bucket 
TSRMLS_CC);
-   return PSFS_PASS_ON;
-   }
+   } else if (status == Z_STREAM_END && 
data->strm.avail_out >= data->outbuf_len) {
+   /* no more data to decompress, and nothing was 
spat out */
+   php_stream_bucket_delref(bucket TSRMLS_CC);
+   return PSFS_PASS_ON;
}
+
}
consumed += bucket->buflen;
php_stream_bucket_delref(bucket TSRMLS_CC);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/zip php_zip.c /ext/zip/lib zip.h zip_alias.h zipint.h zipint_alias.h

2008-01-12 Thread Greg Beaver
cellog  Sun Jan 13 06:01:59 2008 UTC

  Added files: 
/php-src/ext/zip/libzip_alias.h zipint_alias.h 

  Modified files:  
/php-src/ext/zipphp_zip.c 
/php-src/ext/zip/libzip.h zipint.h 
  Log:
  MFPECL: alias all zip identifiers to avoid potential name conflicts with 
other apache libs that may export zip symbols
  http://cvs.php.net/viewvc.cgi/php-src/ext/zip/php_zip.c?r1=1.52&r2=1.53&diff_format=u
Index: php-src/ext/zip/php_zip.c
diff -u php-src/ext/zip/php_zip.c:1.52 php-src/ext/zip/php_zip.c:1.53
--- php-src/ext/zip/php_zip.c:1.52  Mon Dec 31 07:12:17 2007
+++ php-src/ext/zip/php_zip.c   Sun Jan 13 06:01:58 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_zip.c,v 1.52 2007/12/31 07:12:17 sebastian Exp $ */
+/* $Id: php_zip.c,v 1.53 2008/01/13 06:01:58 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -31,16 +31,17 @@
 #include "lib/zip.h"
 #include "lib/zipint.h"
 
-static PHP_FUNCTION(zip_open);
-static PHP_FUNCTION(zip_read);
-static PHP_FUNCTION(zip_close);
-static PHP_FUNCTION(zip_entry_read);
-static PHP_FUNCTION(zip_entry_filesize);
-static PHP_FUNCTION(zip_entry_name);
-static PHP_FUNCTION(zip_entry_compressedsize);
-static PHP_FUNCTION(zip_entry_compressionmethod);
-static PHP_FUNCTION(zip_entry_open);
-static PHP_FUNCTION(zip_entry_close);
+/* zip_open is a macro for renaming libzip zipopen, so we need to use 
PHP_NAMED_FUNCTION */
+static PHP_NAMED_FUNCTION(zif_zip_open);
+static PHP_NAMED_FUNCTION(zif_zip_read);
+static PHP_NAMED_FUNCTION(zif_zip_close);
+static PHP_NAMED_FUNCTION(zif_zip_entry_read);
+static PHP_NAMED_FUNCTION(zif_zip_entry_filesize);
+static PHP_NAMED_FUNCTION(zif_zip_entry_name);
+static PHP_NAMED_FUNCTION(zif_zip_entry_compressedsize);
+static PHP_NAMED_FUNCTION(zif_zip_entry_compressionmethod);
+static PHP_NAMED_FUNCTION(zif_zip_entry_open);
+static PHP_NAMED_FUNCTION(zif_zip_entry_close);
 
 /* {{{ Resource le */
 static int le_zip_dir;
@@ -273,9 +274,9 @@
 
 /* {{{ zend_function_entry */
 static const zend_function_entry zip_functions[] = {
-   PHP_FE(zip_open,NULL)
-   PHP_FE(zip_close,   NULL)
-   PHP_FE(zip_read,NULL)
+   PHP_RAW_NAMED_FE("zip_open", zif_zip_open, NULL)
+   PHP_RAW_NAMED_FE("zip_close", zif_zip_close, NULL)
+   PHP_RAW_NAMED_FE("zip_read", zif_zip_read, NULL)
PHP_FE(zip_entry_open,  NULL)
PHP_FE(zip_entry_close, NULL)
PHP_FE(zip_entry_read,  NULL)
@@ -634,6 +635,8 @@
 
 /* }}}*/
 
+/* reset macro */
+#undef zip
 /* {{{ function prototypes */
 static PHP_MINIT_FUNCTION(zip);
 static PHP_MSHUTDOWN_FUNCTION(zip);
@@ -659,10 +662,12 @@
 #ifdef COMPILE_DL_ZIP
 ZEND_GET_MODULE(zip)
 #endif
+/* set macro */
+#define zip php_ziplib__zip
 
 /* {{{ proto resource zip_open(string filename) U
 Create new zip using source uri for output */
-static PHP_FUNCTION(zip_open)
+static PHP_NAMED_FUNCTION(zif_zip_open)
 {
zval **filename_zval;
char *filename;
@@ -708,7 +713,7 @@
 
 /* {{{ proto void zip_close(resource zip) U 
Close a Zip archive */
-static PHP_FUNCTION(zip_close)
+static PHP_NAMED_FUNCTION(zif_zip_close)
 {
zval * zip;
zip_rsrc *z_rsrc = NULL;
@@ -725,7 +730,7 @@
 
 /* {{{ proto resource zip_read(resource zip) U
Returns the next file in the archive */
-static PHP_FUNCTION(zip_read)
+static PHP_NAMED_FUNCTION(zif_zip_read)
 {
zval *zip_dp;
zip_read_rsrc *zr_rsrc;
@@ -769,7 +774,7 @@
 /* {{{ proto bool zip_entry_open(resource zip_dp, resource zip_entry [, string 
mode]) U
Open a Zip File, pointed by the resource entry */
 /* Dummy function to follow the old API */
-static PHP_FUNCTION(zip_entry_open)
+static PHP_NAMED_FUNCTION(zif_zip_entry_open)
 {
zval * zip;
zval * zip_entry;
@@ -797,7 +802,7 @@
 /* {{{ proto void zip_entry_close(resource zip_ent) U
Close a zip entry */
 /* another dummy function to fit in the old api*/
-static PHP_FUNCTION(zip_entry_close)
+static PHP_NAMED_FUNCTION(zif_zip_entry_close)
 {
zval * zip_entry;
zip_read_rsrc * zr_rsrc;
@@ -814,7 +819,7 @@
 
 /* {{{ proto mixed zip_entry_read(resource zip_entry [, int len]) U
Read from an open directory entry */
-static PHP_FUNCTION(zip_entry_read)
+static PHP_NAMED_FUNCTION(zif_zip_entry_read)
 {
zval * zip_entry;
long len = 0;
@@ -914,7 +919,7 @@
 
 /* {{{ proto string zip_entry_name(resource zip_entry) U
Return the name given a ZZip entry */
-static PHP_FUNCTION(zip_entry_name)
+static PHP_NAMED_FUNCTION(zif_zip_entry_name)
 {
php_zip_entry_get_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
 }
@@ -922,7 +927,7 @@
 
 /* {{{ proto int zip_entry_compressedsize(resource zip_entry) U
Return the compressed size of a ZZip entry */
-static PHP_FUNCTION(zip_entry_compressedsiz

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/zip php_zip.c /ext/zip/lib zip.h zip_alias.h zipint.h zipint_alias.h

2008-01-12 Thread Greg Beaver
cellog  Sun Jan 13 06:02:30 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/zip/libzip_alias.h zipint_alias.h 

  Modified files:  
/php-src/ext/zipphp_zip.c 
/php-src/ext/zip/libzip.h zipint.h 
  Log:
  MFH: alias all zip identifiers to avoid potential name conflicts with other 
apache libs that may export zip symbols
  http://cvs.php.net/viewvc.cgi/php-src/ext/zip/php_zip.c?r1=1.1.2.38.2.4&r2=1.1.2.38.2.5&diff_format=u
Index: php-src/ext/zip/php_zip.c
diff -u php-src/ext/zip/php_zip.c:1.1.2.38.2.4 
php-src/ext/zip/php_zip.c:1.1.2.38.2.5
--- php-src/ext/zip/php_zip.c:1.1.2.38.2.4  Mon Dec 31 07:17:16 2007
+++ php-src/ext/zip/php_zip.c   Sun Jan 13 06:02:30 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_zip.c,v 1.1.2.38.2.4 2007/12/31 07:17:16 sebastian Exp $ */
+/* $Id: php_zip.c,v 1.1.2.38.2.5 2008/01/13 06:02:30 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -31,16 +31,17 @@
 #include "lib/zip.h"
 #include "lib/zipint.h"
 
-static PHP_FUNCTION(zip_open);
-static PHP_FUNCTION(zip_read);
-static PHP_FUNCTION(zip_close);
-static PHP_FUNCTION(zip_entry_read);
-static PHP_FUNCTION(zip_entry_filesize);
-static PHP_FUNCTION(zip_entry_name);
-static PHP_FUNCTION(zip_entry_compressedsize);
-static PHP_FUNCTION(zip_entry_compressionmethod);
-static PHP_FUNCTION(zip_entry_open);
-static PHP_FUNCTION(zip_entry_close);
+/* zip_open is a macro for renaming libzip zipopen, so we need to use 
PHP_NAMED_FUNCTION */
+static PHP_NAMED_FUNCTION(zif_zip_open);
+static PHP_NAMED_FUNCTION(zif_zip_read);
+static PHP_NAMED_FUNCTION(zif_zip_close);
+static PHP_NAMED_FUNCTION(zif_zip_entry_read);
+static PHP_NAMED_FUNCTION(zif_zip_entry_filesize);
+static PHP_NAMED_FUNCTION(zif_zip_entry_name);
+static PHP_NAMED_FUNCTION(zif_zip_entry_compressedsize);
+static PHP_NAMED_FUNCTION(zif_zip_entry_compressionmethod);
+static PHP_NAMED_FUNCTION(zif_zip_entry_open);
+static PHP_NAMED_FUNCTION(zif_zip_entry_close);
 
 /* {{{ Resource le */
 static int le_zip_dir;
@@ -273,9 +274,9 @@
 
 /* {{{ zend_function_entry */
 static const zend_function_entry zip_functions[] = {
-   PHP_FE(zip_open,NULL)
-   PHP_FE(zip_close,   NULL)
-   PHP_FE(zip_read,NULL)
+   PHP_RAW_NAMED_FE("zip_open", zif_zip_open, NULL)
+   PHP_RAW_NAMED_FE("zip_close", zif_zip_close, NULL)
+   PHP_RAW_NAMED_FE("zip_read", zif_zip_read, NULL)
PHP_FE(zip_entry_open,  NULL)
PHP_FE(zip_entry_close, NULL)
PHP_FE(zip_entry_read,  NULL)
@@ -634,6 +635,8 @@
 
 /* }}}*/
 
+/* reset macro */
+#undef zip
 /* {{{ function prototypes */
 static PHP_MINIT_FUNCTION(zip);
 static PHP_MSHUTDOWN_FUNCTION(zip);
@@ -659,10 +662,12 @@
 #ifdef COMPILE_DL_ZIP
 ZEND_GET_MODULE(zip)
 #endif
+/* set macro */
+#define zip php_ziplib__zip
 
 /* {{{ proto resource zip_open(string filename)
 Create new zip using source uri for output */
-static PHP_FUNCTION(zip_open)
+static PHP_NAMED_FUNCTION(zif_zip_open)
 {
char *filename;
int   filename_len;
@@ -704,7 +709,7 @@
 
 /* {{{ proto void zip_close(resource zip)
Close a Zip archive */
-static PHP_FUNCTION(zip_close)
+static PHP_NAMED_FUNCTION(zif_zip_close)
 {
zval * zip;
zip_rsrc *z_rsrc = NULL;
@@ -721,7 +726,7 @@
 
 /* {{{ proto resource zip_read(resource zip)
Returns the next file in the archive */
-static PHP_FUNCTION(zip_read)
+static PHP_NAMED_FUNCTION(zif_zip_read)
 {
zval *zip_dp;
zip_read_rsrc *zr_rsrc;
@@ -765,7 +770,7 @@
 /* {{{ proto bool zip_entry_open(resource zip_dp, resource zip_entry [, string 
mode])
Open a Zip File, pointed by the resource entry */
 /* Dummy function to follow the old API */
-static PHP_FUNCTION(zip_entry_open)
+static PHP_NAMED_FUNCTION(zif_zip_entry_open)
 {
zval * zip;
zval * zip_entry;
@@ -792,7 +797,7 @@
 /* {{{ proto void zip_entry_close(resource zip_ent)
Close a zip entry */
 /* another dummy function to fit in the old api*/
-static PHP_FUNCTION(zip_entry_close)
+static PHP_NAMED_FUNCTION(zif_zip_entry_close)
 {
zval * zip_entry;
zip_read_rsrc * zr_rsrc;
@@ -809,7 +814,7 @@
 
 /* {{{ proto mixed zip_entry_read(resource zip_entry [, int len])
Read from an open directory entry */
-static PHP_FUNCTION(zip_entry_read)
+static PHP_NAMED_FUNCTION(zif_zip_entry_read)
 {
zval * zip_entry;
long len = 0;
@@ -909,7 +914,7 @@
 
 /* {{{ proto string zip_entry_name(resource zip_entry)
Return the name given a ZZip entry */
-static PHP_FUNCTION(zip_entry_name)
+static PHP_NAMED_FUNCTION(zif_zip_entry_name)
 {
php_zip_entry_get_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
 }
@@ -917,7 +922,7 @@
 
 /* {{{ proto int zip_entry_compressedsize(resource zip_entry)
Return the compressed size of a ZZ

[PHP-CVS] cvs: php-src /ext/zip php_zip.c /ext/zip/lib zipint_alias.h

2008-01-12 Thread Greg Beaver
cellog  Sun Jan 13 06:24:27 2008 UTC

  Modified files:  
/php-src/ext/zipphp_zip.c 
/php-src/ext/zip/libzipint_alias.h 
  Log:
  MFB: a few fixes: overwrote all my careful work in zipint_alias.h with 
zipint.h, so had to restore that.
  PHP_RAW_NAMED_FE() won't work, have to use ZEND_RAW_FENTRY
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/php_zip.c?r1=1.53&r2=1.54&diff_format=u
Index: php-src/ext/zip/php_zip.c
diff -u php-src/ext/zip/php_zip.c:1.53 php-src/ext/zip/php_zip.c:1.54
--- php-src/ext/zip/php_zip.c:1.53  Sun Jan 13 06:01:58 2008
+++ php-src/ext/zip/php_zip.c   Sun Jan 13 06:24:27 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_zip.c,v 1.53 2008/01/13 06:01:58 cellog Exp $ */
+/* $Id: php_zip.c,v 1.54 2008/01/13 06:24:27 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -274,9 +274,9 @@
 
 /* {{{ zend_function_entry */
 static const zend_function_entry zip_functions[] = {
-   PHP_RAW_NAMED_FE("zip_open", zif_zip_open, NULL)
-   PHP_RAW_NAMED_FE("zip_close", zif_zip_close, NULL)
-   PHP_RAW_NAMED_FE("zip_read", zif_zip_read, NULL)
+   ZEND_RAW_FENTRY("zip_open", zif_zip_open, NULL, 0)
+   ZEND_RAW_FENTRY("zip_close", zif_zip_close, NULL, 0)
+   ZEND_RAW_FENTRY("zip_read", zif_zip_read, NULL, 0)
PHP_FE(zip_entry_open,  NULL)
PHP_FE(zip_entry_close, NULL)
PHP_FE(zip_entry_read,  NULL)
@@ -2205,7 +2205,7 @@
php_info_print_table_start();
 
php_info_print_table_row(2, "Zip", "enabled");
-   php_info_print_table_row(2, "Extension Version","$Id: php_zip.c,v 1.53 
2008/01/13 06:01:58 cellog Exp $");
+   php_info_print_table_row(2, "Extension Version","$Id: php_zip.c,v 1.54 
2008/01/13 06:24:27 cellog Exp $");
php_info_print_table_row(2, "Zip version", "2.0.0");
php_info_print_table_row(2, "Libzip version", "0.7.1");
 
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/zipint_alias.h?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/zip/lib/zipint_alias.h
diff -u php-src/ext/zip/lib/zipint_alias.h:1.1 
php-src/ext/zip/lib/zipint_alias.h:1.2
--- php-src/ext/zip/lib/zipint_alias.h:1.1  Sun Jan 13 06:01:59 2008
+++ php-src/ext/zip/lib/zipint_alias.h  Sun Jan 13 06:24:27 2008
@@ -1,45 +1,49 @@
 
-#define zip_source_cmd php_ziplib__zip_source_cmd
-#define zip_source_callback php_ziplib__zip_source_callback
-#define zip_stat php_ziplib__zip_stat
-#define zip php_ziplib__zip
-#define zip_file php_ziplib__zip_file
+/* state of change of a file in zip archive */
+#define zip_state php_ziplib__zip_state
+#define zip_error php_ziplib__zip_error
+#define zip_dirent php_ziplib__zip_dirent
+#define zip_cdir php_ziplib__zip_cdir
 #define zip_source php_ziplib__zip_source
-#define zip_add php_ziplib__zip_add
-#define zip_add_dir php_ziplib__zip_add_dir
-#define zip_close php_ziplib__zip_close
-#define zip_delete php_ziplib__zip_delete
-#define zip_error_clear php_ziplib__zip_error_clear
-#define zip_error_get php_ziplib__zip_error_get
-#define zip_error_get_sys_type php_ziplib__zip_error_get_sys_type
-#define zip_error_to_str php_ziplib__zip_error_to_str
-#define zip_fclose php_ziplib__zip_fclose
-#define zip_file_error_clear php_ziplib__zip_fille_error_clear
-#define zip_file_error_get php_ziplib__zip_file_error_get
-#define zip_file_strerror php_ziplib__zip_file_strerror
-#define zip_fopen php_ziplib__zip_fopen
-#define zip_fopen_index php_ziplib__zip_fopen_index
-#define zip_fread php_ziplib__zip_fread
-#define zip_get_archive_comment php_ziplib__zip_get_archive_comment
-#define zip_get_file_comment php_ziplib__zip_get_file_comment
-#define zip_get_name php_ziplib__zip_get_name
-#define zip_get_num_files php_ziplib__zip_get_num_files
-#define zip_name_locate php_ziplib__zip_name_locate
-#define zip_open php_ziplib__zip_open
-#define zip_rename php_ziplib__zip_rename
-#define zip_replace php_ziplib__zip_replace
-#define zip_set_archive_comment php_ziplib__zip_set_archive_comment
-#define zip_set_file_comment php_ziplib__zip_set_file_comment
-#define zip_source_buffer php_ziplib__zip_source_buffer
-#define zip_source_file php_ziplib__zip_source_file
-#define zip_source_filep php_ziplib__zip_source_filep
-#define zip_source_free php_ziplib__zip_source_free
-#define zip_source_function php_ziplib__zip_source_function
-#define zip_source_zip php_ziplib__zip_source_zip
-#define zip_stat php_ziplib__zip_stat
-#define zip_stat_index php_ziplib__zip_stat_index
-#define zip_stat_init php_ziplib__zip_stat_init
-#define zip_strerror php_ziplib__zip_strerror
-#define zip_unchange php_ziplib__zip_unchange
-#define zip_unchange_all php_ziplib__zip_unchange_all
-#define zip_unchange_archive php_ziplib__zip_unchange_archive
+#define zip_entry php_ziplib__zip_entry
+
+#define _zip_err_str php_ziplib___zip_err_str
+#define _zip_nerr_str php_ziplib___zip_nerr_str
+#define _zip_err_type php_ziplib___

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/zip php_zip.c /ext/zip/lib zipint_alias.h

2008-01-12 Thread Greg Beaver
cellog  Sun Jan 13 06:22:27 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/zipphp_zip.c 
/php-src/ext/zip/libzipint_alias.h 
  Log:
  a few fixes: overwrite all my careful work in zipint_alias.h with zipint.h, 
so had to restore that.
  PHP_RAW_NAMED_FE() won't work, have to use ZEND_RAW_FENTRY
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/php_zip.c?r1=1.1.2.38.2.5&r2=1.1.2.38.2.6&diff_format=u
Index: php-src/ext/zip/php_zip.c
diff -u php-src/ext/zip/php_zip.c:1.1.2.38.2.5 
php-src/ext/zip/php_zip.c:1.1.2.38.2.6
--- php-src/ext/zip/php_zip.c:1.1.2.38.2.5  Sun Jan 13 06:02:30 2008
+++ php-src/ext/zip/php_zip.c   Sun Jan 13 06:22:27 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_zip.c,v 1.1.2.38.2.5 2008/01/13 06:02:30 cellog Exp $ */
+/* $Id: php_zip.c,v 1.1.2.38.2.6 2008/01/13 06:22:27 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -274,9 +274,9 @@
 
 /* {{{ zend_function_entry */
 static const zend_function_entry zip_functions[] = {
-   PHP_RAW_NAMED_FE("zip_open", zif_zip_open, NULL)
-   PHP_RAW_NAMED_FE("zip_close", zif_zip_close, NULL)
-   PHP_RAW_NAMED_FE("zip_read", zif_zip_read, NULL)
+   ZEND_RAW_FENTRY("zip_open", zif_zip_open, NULL, 0)
+   ZEND_RAW_FENTRY("zip_close", zif_zip_close, NULL, 0)
+   ZEND_RAW_FENTRY("zip_read", zif_zip_read, NULL, 0)
PHP_FE(zip_entry_open,  NULL)
PHP_FE(zip_entry_close, NULL)
PHP_FE(zip_entry_read,  NULL)
@@ -2111,7 +2111,7 @@
php_info_print_table_start();
 
php_info_print_table_row(2, "Zip", "enabled");
-   php_info_print_table_row(2, "Extension Version","$Id: php_zip.c,v 
1.1.2.38.2.5 2008/01/13 06:02:30 cellog Exp $");
+   php_info_print_table_row(2, "Extension Version","$Id: php_zip.c,v 
1.1.2.38.2.6 2008/01/13 06:22:27 cellog Exp $");
php_info_print_table_row(2, "Zip version", "2.0.0");
php_info_print_table_row(2, "Libzip version", "0.7.1");
 
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/zipint_alias.h?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/zip/lib/zipint_alias.h
diff -u php-src/ext/zip/lib/zipint_alias.h:1.1.2.2 
php-src/ext/zip/lib/zipint_alias.h:1.1.2.3
--- php-src/ext/zip/lib/zipint_alias.h:1.1.2.2  Sun Jan 13 06:02:30 2008
+++ php-src/ext/zip/lib/zipint_alias.h  Sun Jan 13 06:22:27 2008
@@ -1,45 +1,49 @@
 
-#define zip_source_cmd php_ziplib__zip_source_cmd
-#define zip_source_callback php_ziplib__zip_source_callback
-#define zip_stat php_ziplib__zip_stat
-#define zip php_ziplib__zip
-#define zip_file php_ziplib__zip_file
+/* state of change of a file in zip archive */
+#define zip_state php_ziplib__zip_state
+#define zip_error php_ziplib__zip_error
+#define zip_dirent php_ziplib__zip_dirent
+#define zip_cdir php_ziplib__zip_cdir
 #define zip_source php_ziplib__zip_source
-#define zip_add php_ziplib__zip_add
-#define zip_add_dir php_ziplib__zip_add_dir
-#define zip_close php_ziplib__zip_close
-#define zip_delete php_ziplib__zip_delete
-#define zip_error_clear php_ziplib__zip_error_clear
-#define zip_error_get php_ziplib__zip_error_get
-#define zip_error_get_sys_type php_ziplib__zip_error_get_sys_type
-#define zip_error_to_str php_ziplib__zip_error_to_str
-#define zip_fclose php_ziplib__zip_fclose
-#define zip_file_error_clear php_ziplib__zip_fille_error_clear
-#define zip_file_error_get php_ziplib__zip_file_error_get
-#define zip_file_strerror php_ziplib__zip_file_strerror
-#define zip_fopen php_ziplib__zip_fopen
-#define zip_fopen_index php_ziplib__zip_fopen_index
-#define zip_fread php_ziplib__zip_fread
-#define zip_get_archive_comment php_ziplib__zip_get_archive_comment
-#define zip_get_file_comment php_ziplib__zip_get_file_comment
-#define zip_get_name php_ziplib__zip_get_name
-#define zip_get_num_files php_ziplib__zip_get_num_files
-#define zip_name_locate php_ziplib__zip_name_locate
-#define zip_open php_ziplib__zip_open
-#define zip_rename php_ziplib__zip_rename
-#define zip_replace php_ziplib__zip_replace
-#define zip_set_archive_comment php_ziplib__zip_set_archive_comment
-#define zip_set_file_comment php_ziplib__zip_set_file_comment
-#define zip_source_buffer php_ziplib__zip_source_buffer
-#define zip_source_file php_ziplib__zip_source_file
-#define zip_source_filep php_ziplib__zip_source_filep
-#define zip_source_free php_ziplib__zip_source_free
-#define zip_source_function php_ziplib__zip_source_function
-#define zip_source_zip php_ziplib__zip_source_zip
-#define zip_stat php_ziplib__zip_stat
-#define zip_stat_index php_ziplib__zip_stat_index
-#define zip_stat_init php_ziplib__zip_stat_init
-#define zip_strerror php_ziplib__zip_strerror
-#define zip_unchange php_ziplib__zip_unchange
-#define zip_unchange_all php_ziplib__zip_unchange_all
-#define zip_unchange_archive php_ziplib__zip_unchange_archive
+#define zip_entry php_ziplib__zip_entry
+
+#define _zip_err_str php_zipli

[PHP-CVS] cvs: php-src /main/streams streams.c

2008-01-13 Thread Greg Beaver
cellog  Sun Jan 13 22:55:02 2008 UTC

  Modified files:  
/php-src/main/streams   streams.c 
  Log:
  use correct macro
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.158&r2=1.159&diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.158 
php-src/main/streams/streams.c:1.159
--- php-src/main/streams/streams.c:1.158Sat Jan 12 15:50:16 2008
+++ php-src/main/streams/streams.c  Sun Jan 13 22:55:02 2008
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.158 2008/01/12 15:50:16 cellog Exp $ */
+/* $Id: streams.c,v 1.159 2008/01/13 22:55:02 cellog Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -2184,7 +2184,7 @@
if (options & REPORT_ERRORS) {
/* protocol[n] probably isn't '\0' */
char *protocol_dup = estrndup(protocol, n);
-   if (!PG(allow_url_fopen)) {
+   if (!php_stream_allow_url_fopen(protocol, n)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"%s:// wrapper is disabled in the server configuration by allow_url_fopen=0", 
protocol_dup);
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"%s:// wrapper is disabled in the server configuration by allow_url_include=0", 
protocol_dup);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/zip/lib zip.h

2008-01-13 Thread Greg Beaver
cellog  Sun Jan 13 23:37:27 2008 UTC

  Modified files:  
/php-src/ext/zip/libzip.h 
  Log:
  add missing define for statically-built zip ext
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/zip.h?r1=1.7&r2=1.8&diff_format=u
Index: php-src/ext/zip/lib/zip.h
diff -u php-src/ext/zip/lib/zip.h:1.7 php-src/ext/zip/lib/zip.h:1.8
--- php-src/ext/zip/lib/zip.h:1.7   Sun Jan 13 06:01:59 2008
+++ php-src/ext/zip/lib/zip.h   Sun Jan 13 23:37:27 2008
@@ -46,6 +46,8 @@
 #  define PHPZIPAPI __declspec(dllexport)
 # elif defined(COMPILE_DL_ZIP)
 #  define PHPZIPAPI __declspec(dllimport)
+# else
+#  define PHPZIPAPI
 # endif
 #else
 #define PHPZIPAPI

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/zip/lib zip.h

2008-01-13 Thread Greg Beaver
cellog  Sun Jan 13 23:37:41 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/zip/libzip.h 
  Log:
  MFH: add missing define for statically-built zip ext
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/zip.h?r1=1.1.2.3.2.3&r2=1.1.2.3.2.4&diff_format=u
Index: php-src/ext/zip/lib/zip.h
diff -u php-src/ext/zip/lib/zip.h:1.1.2.3.2.3 
php-src/ext/zip/lib/zip.h:1.1.2.3.2.4
--- php-src/ext/zip/lib/zip.h:1.1.2.3.2.3   Sun Jan 13 06:02:30 2008
+++ php-src/ext/zip/lib/zip.h   Sun Jan 13 23:37:41 2008
@@ -46,6 +46,8 @@
 #  define PHPZIPAPI __declspec(dllexport)
 # elif defined(COMPILE_DL_ZIP)
 #  define PHPZIPAPI __declspec(dllimport)
+# else
+#  define PHPZIPAPI
 # endif
 #else
 #define PHPZIPAPI

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/zip config.w32 /ext/zip/lib zip.h

2008-01-13 Thread Greg Beaver
cellog  Mon Jan 14 03:15:50 2008 UTC

  Modified files:  
/php-src/ext/zipconfig.w32 
/php-src/ext/zip/libzip.h 
  Log:
  MFPECL: fix windows build for all cases, and always export symbols (Steph Fox)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/config.w32?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/zip/config.w32
diff -u php-src/ext/zip/config.w32:1.3 php-src/ext/zip/config.w32:1.4
--- php-src/ext/zip/config.w32:1.3  Sat Jan 12 03:42:41 2008
+++ php-src/ext/zip/config.w32  Mon Jan 14 03:15:50 2008
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.3 2008/01/12 03:42:41 cellog Exp $
+// $Id: config.w32,v 1.4 2008/01/14 03:15:50 cellog Exp $
 // vim:ft=javascript
 
 ARG_ENABLE("zip", "ZIP support", "no");
@@ -31,9 +31,7 @@
 
AC_DEFINE('HAVE_ZLIB', 1);
AC_DEFINE('HAVE_ZIP', 1);
-   if (PHP_ZIP_SHARED) {
-   ADD_FLAG("CFLAGS_ZIP", "/D PHP_ZIP_EXPORTS ");
-   }
+   ADD_FLAG("CFLAGS_ZIP", "/D PHP_ZIP_EXPORTS ");
} else {
WARNING("zip not enabled; libraries and headers not found");
}
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/zip.h?r1=1.8&r2=1.9&diff_format=u
Index: php-src/ext/zip/lib/zip.h
diff -u php-src/ext/zip/lib/zip.h:1.8 php-src/ext/zip/lib/zip.h:1.9
--- php-src/ext/zip/lib/zip.h:1.8   Sun Jan 13 23:37:27 2008
+++ php-src/ext/zip/lib/zip.h   Mon Jan 14 03:15:50 2008
@@ -44,8 +44,6 @@
 #include "zip_win32.h"
 # ifdef PHP_ZIP_EXPORTS
 #  define PHPZIPAPI __declspec(dllexport)
-# elif defined(COMPILE_DL_ZIP)
-#  define PHPZIPAPI __declspec(dllimport)
 # else
 #  define PHPZIPAPI
 # endif

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/zip config.w32 /ext/zip/lib zip.h

2008-01-13 Thread Greg Beaver
cellog  Mon Jan 14 03:16:08 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/zipconfig.w32 
/php-src/ext/zip/libzip.h 
  Log:
  MFH: fix windows build for all cases, and always export symbols (Steph Fox)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/config.w32?r1=1.1.2.1.2.1&r2=1.1.2.1.2.2&diff_format=u
Index: php-src/ext/zip/config.w32
diff -u php-src/ext/zip/config.w32:1.1.2.1.2.1 
php-src/ext/zip/config.w32:1.1.2.1.2.2
--- php-src/ext/zip/config.w32:1.1.2.1.2.1  Sat Jan 12 03:48:38 2008
+++ php-src/ext/zip/config.w32  Mon Jan 14 03:16:08 2008
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.1.2.1.2.1 2008/01/12 03:48:38 cellog Exp $
+// $Id: config.w32,v 1.1.2.1.2.2 2008/01/14 03:16:08 cellog Exp $
 // vim:ft=javascript
 
 ARG_ENABLE("zip", "ZIP support", "no");
@@ -31,9 +31,7 @@
 
AC_DEFINE('HAVE_ZLIB', 1);
AC_DEFINE('HAVE_ZIP', 1);
-   if (PHP_ZIP_SHARED) {
-   ADD_FLAG("CFLAGS_ZIP", "/D PHP_ZIP_EXPORTS ");
-   }
+   ADD_FLAG("CFLAGS_ZIP", "/D PHP_ZIP_EXPORTS ");
} else {
WARNING("zip not enabled; libraries and headers not found");
}
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/zip.h?r1=1.1.2.3.2.4&r2=1.1.2.3.2.5&diff_format=u
Index: php-src/ext/zip/lib/zip.h
diff -u php-src/ext/zip/lib/zip.h:1.1.2.3.2.4 
php-src/ext/zip/lib/zip.h:1.1.2.3.2.5
--- php-src/ext/zip/lib/zip.h:1.1.2.3.2.4   Sun Jan 13 23:37:41 2008
+++ php-src/ext/zip/lib/zip.h   Mon Jan 14 03:16:08 2008
@@ -44,8 +44,6 @@
 #include "zip_win32.h"
 # ifdef PHP_ZIP_EXPORTS
 #  define PHPZIPAPI __declspec(dllexport)
-# elif defined(COMPILE_DL_ZIP)
-#  define PHPZIPAPI __declspec(dllimport)
 # else
 #  define PHPZIPAPI
 # endif

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/zip config.w32 php_zip.c /ext/zip/lib zip.h zip_add.c zip_add_dir.c zip_close.c zip_delete.c zip_dirent.c zip_entry_free.c zip_entry_new.c zip_error.c zip_error_c

2008-01-13 Thread Greg Beaver
cellog  Mon Jan 14 03:19:42 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/zipconfig.w32 php_zip.c 
/php-src/ext/zip/libzip.h zip_add.c zip_add_dir.c zip_close.c 
zip_delete.c zip_dirent.c zip_entry_free.c 
zip_entry_new.c zip_error.c zip_error_clear.c 
zip_error_get.c zip_error_get_sys_type.c 
zip_error_strerror.c zip_error_to_str.c 
zip_fclose.c zip_file_error_clear.c 
zip_file_error_get.c zip_file_get_offset.c 
zip_file_strerror.c zip_fopen.c 
zip_fopen_index.c zip_fread.c zip_free.c 
zip_get_archive_comment.c 
zip_get_file_comment.c zip_get_name.c 
zip_get_num_files.c zip_memdup.c 
zip_name_locate.c zip_new.c zip_open.c 
zip_rename.c zip_replace.c 
zip_set_archive_comment.c 
zip_set_file_comment.c zip_set_name.c 
zip_source_buffer.c zip_source_file.c 
zip_source_filep.c zip_source_free.c 
zip_source_function.c zip_source_zip.c 
zip_stat.c zip_stat_index.c zip_stat_init.c 
zip_strerror.c zip_unchange.c 
zip_unchange_all.c zip_unchange_archive.c 
zip_unchange_data.c zip_win32.h zipint.h 
  Log:
  MFH: export libzip symbols
  http://cvs.php.net/viewvc.cgi/php-src/ext/zip/config.w32?r1=1.1.2.3&r2=1.1.2.4&diff_format=u
Index: php-src/ext/zip/config.w32
diff -u php-src/ext/zip/config.w32:1.1.2.3 php-src/ext/zip/config.w32:1.1.2.4
--- php-src/ext/zip/config.w32:1.1.2.3  Sat Jan 12 03:46:47 2008
+++ php-src/ext/zip/config.w32  Mon Jan 14 03:19:41 2008
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.1.2.3 2008/01/12 03:46:47 cellog Exp $
+// $Id: config.w32,v 1.1.2.4 2008/01/14 03:19:41 cellog Exp $
 // vim:ft=javascript
 
 ARG_ENABLE("zip", "ZIP support", "no");
@@ -31,6 +31,7 @@
 
AC_DEFINE('HAVE_ZLIB', 1);
AC_DEFINE('HAVE_ZIP', 1);
+   ADD_FLAG("CFLAGS_ZIP", "/D PHP_ZIP_EXPORTS ");
} else {
WARNING("zip not enabled; libraries and headers not found");
}
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/php_zip.c?r1=1.1.2.40&r2=1.1.2.41&diff_format=u
Index: php-src/ext/zip/php_zip.c
diff -u php-src/ext/zip/php_zip.c:1.1.2.40 php-src/ext/zip/php_zip.c:1.1.2.41
--- php-src/ext/zip/php_zip.c:1.1.2.40  Mon Dec 31 07:20:14 2007
+++ php-src/ext/zip/php_zip.c   Mon Jan 14 03:19:41 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_zip.c,v 1.1.2.40 2007/12/31 07:20:14 sebastian Exp $ */
+/* $Id: php_zip.c,v 1.1.2.41 2008/01/14 03:19:41 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -31,16 +31,17 @@
 #include "lib/zip.h"
 #include "lib/zipint.h"
 
-static PHP_FUNCTION(zip_open);
-static PHP_FUNCTION(zip_read);
-static PHP_FUNCTION(zip_close);
-static PHP_FUNCTION(zip_entry_read);
-static PHP_FUNCTION(zip_entry_filesize);
-static PHP_FUNCTION(zip_entry_name);
-static PHP_FUNCTION(zip_entry_compressedsize);
-static PHP_FUNCTION(zip_entry_compressionmethod);
-static PHP_FUNCTION(zip_entry_open);
-static PHP_FUNCTION(zip_entry_close);
+/* zip_open is a macro for renaming libzip zipopen, so we need to use 
PHP_NAMED_FUNCTION */
+static PHP_NAMED_FUNCTION(zif_zip_open);
+static PHP_NAMED_FUNCTION(zif_zip_read);
+static PHP_NAMED_FUNCTION(zif_zip_close);
+static PHP_NAMED_FUNCTION(zif_zip_entry_read);
+static PHP_NAMED_FUNCTION(zif_zip_entry_filesize);
+static PHP_NAMED_FUNCTION(zif_zip_entry_name);
+static PHP_NAMED_FUNCTION(zif_zip_entry_compressedsize);
+static PHP_NAMED_FUNCTION(zif_zip_entry_compressionmethod);
+static PHP_NAMED_FUNCTION(zif_zip_entry_open);
+static PHP_NAMED_FUNCTION(zif_zip_entry_close);
 
 /* {{{ Resource le */
 static int le_zip_dir;
@@ -273,9 +274,9 @@
 
 /* {{{ zend_function_entry */
 static zend_function_entry zip_functions[] = {
-   PHP_FE(zip_open,NULL)
-   PHP_FE(zip_close,   NULL)
-   PHP_FE(zip_read,NULL)
+   ZEND_RAW_FENTRY("zip_open", zif_zip_open, NULL, 0)
+   ZEND_RAW_FENTRY("zip_close", zif_zip_close, NULL, 0)
+   ZEND_RAW_FENTRY("zip_read", zif_zip_read, NULL, 0)
PHP_FE(zip_entry_open,  NULL)
PHP_FE(zip_entry_close, NULL)
PHP_FE(zip_entry_read,  NULL)
@@ -634,6 +635,8 @@
 
 /* }}}*/
 
+/* reset macro */
+#undef zip
 /* {{{ function prototypes */
 static PHP_MINI

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/zip/lib zip_alias.h zipint_alias.h

2008-01-13 Thread Greg Beaver
cellog  Mon Jan 14 03:58:03 2008 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/zip/libzip_alias.h zipint_alias.h 
  Log:
  add missing alias .h files
  

http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/zip_alias.h?view=markup&rev=1.1
Index: php-src/ext/zip/lib/zip_alias.h
+++ php-src/ext/zip/lib/zip_alias.h

#define zip_source_cmd php_ziplib__zip_source_cmd
#define zip_source_callback php_ziplib__zip_source_callback
#define zip_stat php_ziplib__zip_stat
#define zip php_ziplib__zip
#define zip_file php_ziplib__zip_file
#define zip_source php_ziplib__zip_source
#define zip_add php_ziplib__zip_add
#define zip_add_dir php_ziplib__zip_add_dir
#define zip_close php_ziplib__zip_close
#define zip_delete php_ziplib__zip_delete
#define zip_error_clear php_ziplib__zip_error_clear
#define zip_error_get php_ziplib__zip_error_get
#define zip_error_get_sys_type php_ziplib__zip_error_get_sys_type
#define zip_error_to_str php_ziplib__zip_error_to_str
#define zip_fclose php_ziplib__zip_fclose
#define zip_file_error_clear php_ziplib__zip_fille_error_clear
#define zip_file_error_get php_ziplib__zip_file_error_get
#define zip_file_strerror php_ziplib__zip_file_strerror
#define zip_fopen php_ziplib__zip_fopen
#define zip_fopen_index php_ziplib__zip_fopen_index
#define zip_fread php_ziplib__zip_fread
#define zip_get_archive_comment php_ziplib__zip_get_archive_comment
#define zip_get_file_comment php_ziplib__zip_get_file_comment
#define zip_get_name php_ziplib__zip_get_name
#define zip_get_num_files php_ziplib__zip_get_num_files
#define zip_name_locate php_ziplib__zip_name_locate
#define zip_open php_ziplib__zip_open
#define zip_rename php_ziplib__zip_rename
#define zip_replace php_ziplib__zip_replace
#define zip_set_archive_comment php_ziplib__zip_set_archive_comment
#define zip_set_file_comment php_ziplib__zip_set_file_comment
#define zip_source_buffer php_ziplib__zip_source_buffer
#define zip_source_file php_ziplib__zip_source_file
#define zip_source_filep php_ziplib__zip_source_filep
#define zip_source_free php_ziplib__zip_source_free
#define zip_source_function php_ziplib__zip_source_function
#define zip_source_zip php_ziplib__zip_source_zip
#define zip_stat php_ziplib__zip_stat
#define zip_stat_index php_ziplib__zip_stat_index
#define zip_stat_init php_ziplib__zip_stat_init
#define zip_strerror php_ziplib__zip_strerror
#define zip_unchange php_ziplib__zip_unchange
#define zip_unchange_all php_ziplib__zip_unchange_all
#define zip_unchange_archive php_ziplib__zip_unchange_archive

http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/zipint_alias.h?view=markup&rev=1.1
Index: php-src/ext/zip/lib/zipint_alias.h
+++ php-src/ext/zip/lib/zipint_alias.h

#define zip_source_cmd php_ziplib__zip_source_cmd
#define zip_source_callback php_ziplib__zip_source_callback
#define zip_stat php_ziplib__zip_stat
#define zip php_ziplib__zip
#define zip_file php_ziplib__zip_file
#define zip_source php_ziplib__zip_source
#define zip_add php_ziplib__zip_add
#define zip_add_dir php_ziplib__zip_add_dir
#define zip_close php_ziplib__zip_close
#define zip_delete php_ziplib__zip_delete
#define zip_error_clear php_ziplib__zip_error_clear
#define zip_error_get php_ziplib__zip_error_get
#define zip_error_get_sys_type php_ziplib__zip_error_get_sys_type
#define zip_error_to_str php_ziplib__zip_error_to_str
#define zip_fclose php_ziplib__zip_fclose
#define zip_file_error_clear php_ziplib__zip_fille_error_clear
#define zip_file_error_get php_ziplib__zip_file_error_get
#define zip_file_strerror php_ziplib__zip_file_strerror
#define zip_fopen php_ziplib__zip_fopen
#define zip_fopen_index php_ziplib__zip_fopen_index
#define zip_fread php_ziplib__zip_fread
#define zip_get_archive_comment php_ziplib__zip_get_archive_comment
#define zip_get_file_comment php_ziplib__zip_get_file_comment
#define zip_get_name php_ziplib__zip_get_name
#define zip_get_num_files php_ziplib__zip_get_num_files
#define zip_name_locate php_ziplib__zip_name_locate
#define zip_open php_ziplib__zip_open
#define zip_rename php_ziplib__zip_rename
#define zip_replace php_ziplib__zip_replace
#define zip_set_archive_comment php_ziplib__zip_set_archive_comment
#define zip_set_file_comment php_ziplib__zip_set_file_comment
#define zip_source_buffer php_ziplib__zip_source_buffer
#define zip_source_file php_ziplib__zip_source_file
#define zip_source_filep php_ziplib__zip_source_filep
#define zip_source_free php_ziplib__zip_source_free
#define zip_source_function php_ziplib__zip_source_function
#define zip_source_zip php_ziplib__zip_source_zip
#define zip_stat php_ziplib__zip_stat
#define zip_stat_index php_ziplib__zip_stat_index
#define zip_stat_init php_ziplib__zip_stat_init
#define zip_strerror php_ziplib__zip_strerror
#define zip_unchange php_ziplib__zip_unchange
#define zip_unchange_all php_ziplib__zip_unchange_all
#define zip_unchange_archive php_ziplib__zip_unchange_archive

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.ne

[PHP-CVS] cvs: php-src(PHP_5_2) / run-tests.php

2008-01-13 Thread Greg Beaver
cellog  Mon Jan 14 04:34:18 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcrun-tests.php 
  Log:
  merge in cgi fixes from PHP_5_3
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.43&r2=1.226.2.37.2.44&diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.226.2.37.2.43 
php-src/run-tests.php:1.226.2.37.2.44
--- php-src/run-tests.php:1.226.2.37.2.43   Sat Jan  5 21:39:47 2008
+++ php-src/run-tests.php   Mon Jan 14 04:34:17 2008
@@ -24,7 +24,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.226.2.37.2.43 2008/01/05 21:39:47 cellog Exp $ */
+/* $Id: run-tests.php,v 1.226.2.37.2.44 2008/01/14 04:34:17 cellog Exp $ */
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -106,11 +106,22 @@
 // Require the explicit specification.
 // Otherwise we could end up testing the wrong file!
 
+$php = NULL;
+$php_cgi = NULL;
+
 if (getenv('TEST_PHP_EXECUTABLE')) {
$php = getenv('TEST_PHP_EXECUTABLE');
if ($php=='auto') {
$php = $cwd.'/sapi/cli/php';
putenv("TEST_PHP_EXECUTABLE=$php");
+   if (!getenv('TEST_PHP_CGI_EXECUTABLE')) {
+   $php_cgi = $cwd.'/sapi/cgi/php-cgi';
+   if (file_exists($php_cgi)) {
+   putenv("TEST_PHP_CGI_EXECUTABLE=$php_cgi");
+   } else {
+   $php_cgi = NULL;
+   }
+   }
}
$environment['TEST_PHP_EXECUTABLE'] = $php;
 }
@@ -181,7 +192,7 @@
 
 function write_information($show_html)
 {
-   global $cwd, $php, $php_info, $user_tests, $ini_overwrites, 
$pass_options, $exts_to_test;
+   global $cwd, $php, $php_cgi, $php_info, $user_tests, $ini_overwrites, 
$pass_options, $exts_to_test;
 
// Get info from php
$info_file = realpath(dirname(__FILE__)) . '/run-test-info.php';
@@ -198,6 +209,13 @@
settings2array($ini_overwrites,$info_params);
settings2params($info_params);
$php_info = `$php $pass_options $info_params "$info_file"`;
+   if ($php_cgi && $php != $php_cgi) {
+   $php_info_cgi = `$php_cgi $pass_options $info_params -q 
"$info_file"`;
+   $php_info_sep = 
"\n-";
+   $php_cgi_info = "$php_info_sep\nPHP : $php_cgi 
$php_info_cgi$php_info_sep";
+   } else {
+   $php_cgi_info = '';
+   }
@unlink($info_file);
define('TESTED_PHP_VERSION', `$php -r "echo PHP_VERSION;"`);
 
@@ -221,8 +239,8 @@
// Write test context information.
echo "
 =
+PHP : $php $php_info $php_cgi_info
 CWD : $cwd
-PHP : $php $php_info
 Extra dirs  : ";
foreach ($user_tests as $test_dir) {
echo "{$test_dir}\n  ";
@@ -403,7 +421,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.226.2.37.2.43 
$'."\n";
+   echo '$Revision: 1.226.2.37.2.44 
$'."\n";
exit(1);
 
case 'u':

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /win32/build confutils.js

2008-01-17 Thread Greg Beaver
cellog  Thu Jan 17 21:17:30 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/win32/buildconfutils.js 
  Log:
  MFH: add errors when missing dependencies (Steph)
  
http://cvs.php.net/viewvc.cgi/php-src/win32/build/confutils.js?r1=1.60.2.1.2.9&r2=1.60.2.1.2.10&diff_format=u
Index: php-src/win32/build/confutils.js
diff -u php-src/win32/build/confutils.js:1.60.2.1.2.9 
php-src/win32/build/confutils.js:1.60.2.1.2.10
--- php-src/win32/build/confutils.js:1.60.2.1.2.9   Wed Nov 14 19:48:57 2007
+++ php-src/win32/build/confutils.jsThu Jan 17 21:17:29 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-// $Id: confutils.js,v 1.60.2.1.2.9 2007/11/14 19:48:57 auroraeosrose Exp $
+// $Id: confutils.js,v 1.60.2.1.2.10 2008/01/17 21:17:29 cellog Exp $
 
 var STDOUT = WScript.StdOut;
 var STDERR = WScript.StdErr;
@@ -1009,6 +1009,14 @@
ADD_FLAG("LDFLAGS_" + EXT, "/libpath:$(BUILD_DIR)");
ADD_FLAG("LIBS_" + EXT, "php_" + dependson + ".lib");
ADD_FLAG("DEPS_" + EXT, "$(BUILD_DIR)\\php_" + dependson + 
".lib");
+   } else {
+   if (dep_present == "no") {
+   if (ext_shared) {
+   WARNING(extname + " has a missing dependency: " 
+ dependson);
+   } else {
+   ERROR("Cannot build " + extname + "; " + 
dependson + " not enabled");
+   }
+   }
}
 }
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/zip php_zip.c

2008-01-17 Thread Greg Beaver
cellog  Fri Jan 18 00:20:56 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/zipphp_zip.c 
  Log:
  update module version number
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/php_zip.c?r1=1.1.2.38.2.6&r2=1.1.2.38.2.7&diff_format=u
Index: php-src/ext/zip/php_zip.c
diff -u php-src/ext/zip/php_zip.c:1.1.2.38.2.6 
php-src/ext/zip/php_zip.c:1.1.2.38.2.7
--- php-src/ext/zip/php_zip.c:1.1.2.38.2.6  Sun Jan 13 06:22:27 2008
+++ php-src/ext/zip/php_zip.c   Fri Jan 18 00:20:56 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_zip.c,v 1.1.2.38.2.6 2008/01/13 06:22:27 cellog Exp $ */
+/* $Id: php_zip.c,v 1.1.2.38.2.7 2008/01/18 00:20:56 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -654,7 +654,7 @@
NULL,
NULL,
PHP_MINFO(zip),
-   "1.4.0",
+   "2.0.0",
STANDARD_MODULE_PROPERTIES
 };
 /* }}} */
@@ -2111,7 +2111,7 @@
php_info_print_table_start();
 
php_info_print_table_row(2, "Zip", "enabled");
-   php_info_print_table_row(2, "Extension Version","$Id: php_zip.c,v 
1.1.2.38.2.6 2008/01/13 06:22:27 cellog Exp $");
+   php_info_print_table_row(2, "Extension Version","$Id: php_zip.c,v 
1.1.2.38.2.7 2008/01/18 00:20:56 cellog Exp $");
php_info_print_table_row(2, "Zip version", "2.0.0");
php_info_print_table_row(2, "Libzip version", "0.7.1");
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/zip Makefile.frag config.m4

2008-01-17 Thread Greg Beaver
cellog  Fri Jan 18 00:30:10 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/zipMakefile.frag 

  Modified files:  
/php-src/ext/zipconfig.m4 
  Log:
  MFPECL: install headers
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/config.m4?r1=1.8.2.3&r2=1.8.2.3.2.1&diff_format=u
Index: php-src/ext/zip/config.m4
diff -u php-src/ext/zip/config.m4:1.8.2.3 php-src/ext/zip/config.m4:1.8.2.3.2.1
--- php-src/ext/zip/config.m4:1.8.2.3   Tue Jul  3 17:25:35 2007
+++ php-src/ext/zip/config.m4   Fri Jan 18 00:30:10 2008
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.8.2.3 2007/07/03 17:25:35 sniper Exp $
+dnl $Id: config.m4,v 1.8.2.3.2.1 2008/01/18 00:30:10 cellog Exp $
 dnl
 
 PHP_ARG_ENABLE(zip, for zip archive read/writesupport,
@@ -66,4 +66,12 @@
PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, 
$ext_shared)
PHP_ADD_BUILD_DIR($ext_builddir/lib, 1)
PHP_SUBST(ZIP_SHARED_LIBADD)
+   ifdef([PHP_INSTALL_HEADERS],
+   [
+ dnl Sadly, this is a complete NOP for pecl extensions
+ PHP_INSTALL_HEADERS(ext/zip/lib, [lib/zip.h lib/zipint.h 
lib/zip_alias.h lib/zipint_alias.h])
+   ])
+   
+   dnl so we always include the known-good working hack.
+   PHP_ADD_MAKEFILE_FRAGMENT
 fi

http://cvs.php.net/viewvc.cgi/php-src/ext/zip/Makefile.frag?view=markup&rev=1.1
Index: php-src/ext/zip/Makefile.frag
+++ php-src/ext/zip/Makefile.frag

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/zip Makefile.frag config.m4 php_zip.c

2008-01-17 Thread Greg Beaver
cellog  Fri Jan 18 00:31:23 2008 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/zipMakefile.frag 

  Modified files:  
/php-src/ext/zipconfig.m4 php_zip.c 
  Log:
  MF5.3: install headers, use correct zip version
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/config.m4?r1=1.8.2.3&r2=1.8.2.4&diff_format=u
Index: php-src/ext/zip/config.m4
diff -u php-src/ext/zip/config.m4:1.8.2.3 php-src/ext/zip/config.m4:1.8.2.4
--- php-src/ext/zip/config.m4:1.8.2.3   Tue Jul  3 17:25:35 2007
+++ php-src/ext/zip/config.m4   Fri Jan 18 00:31:23 2008
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.8.2.3 2007/07/03 17:25:35 sniper Exp $
+dnl $Id: config.m4,v 1.8.2.4 2008/01/18 00:31:23 cellog Exp $
 dnl
 
 PHP_ARG_ENABLE(zip, for zip archive read/writesupport,
@@ -66,4 +66,12 @@
PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, 
$ext_shared)
PHP_ADD_BUILD_DIR($ext_builddir/lib, 1)
PHP_SUBST(ZIP_SHARED_LIBADD)
+   ifdef([PHP_INSTALL_HEADERS],
+   [
+ dnl Sadly, this is a complete NOP for pecl extensions
+ PHP_INSTALL_HEADERS(ext/zip/lib, [lib/zip.h lib/zipint.h 
lib/zip_alias.h lib/zipint_alias.h])
+   ])
+   
+   dnl so we always include the known-good working hack.
+   PHP_ADD_MAKEFILE_FRAGMENT
 fi
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/php_zip.c?r1=1.1.2.41&r2=1.1.2.42&diff_format=u
Index: php-src/ext/zip/php_zip.c
diff -u php-src/ext/zip/php_zip.c:1.1.2.41 php-src/ext/zip/php_zip.c:1.1.2.42
--- php-src/ext/zip/php_zip.c:1.1.2.41  Mon Jan 14 03:19:41 2008
+++ php-src/ext/zip/php_zip.c   Fri Jan 18 00:31:23 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_zip.c,v 1.1.2.41 2008/01/14 03:19:41 cellog Exp $ */
+/* $Id: php_zip.c,v 1.1.2.42 2008/01/18 00:31:23 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -654,7 +654,7 @@
NULL,
NULL,
PHP_MINFO(zip),
-   "1.4.0",
+   "2.0.0",
STANDARD_MODULE_PROPERTIES
 };
 /* }}} */
@@ -2111,7 +2111,7 @@
php_info_print_table_start();
 
php_info_print_table_row(2, "Zip", "enabled");
-   php_info_print_table_row(2, "Extension Version","$Id: php_zip.c,v 
1.1.2.41 2008/01/14 03:19:41 cellog Exp $");
+   php_info_print_table_row(2, "Extension Version","$Id: php_zip.c,v 
1.1.2.42 2008/01/18 00:31:23 cellog Exp $");
php_info_print_table_row(2, "Zip version", "2.0.0");
php_info_print_table_row(2, "Libzip version", "0.7.1");
 

http://cvs.php.net/viewvc.cgi/php-src/ext/zip/Makefile.frag?view=markup&rev=1.1
Index: php-src/ext/zip/Makefile.frag
+++ php-src/ext/zip/Makefile.frag

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/zip Makefile.frag config.m4 php_zip.c

2008-01-17 Thread Greg Beaver
cellog  Fri Jan 18 00:33:15 2008 UTC

  Modified files:  
/php-src/ext/zipMakefile.frag config.m4 php_zip.c 
  Log:
  MF5.3: install headers, use correct zip version
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/Makefile.frag?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/zip/Makefile.frag
diff -u /dev/null php-src/ext/zip/Makefile.frag:1.2
--- /dev/null   Fri Jan 18 00:33:15 2008
+++ php-src/ext/zip/Makefile.frag   Fri Jan 18 00:33:15 2008
@@ -0,0 +1,28 @@
+phpincludedir=$(prefix)/include/php
+
+ZIP_HEADER_FILES= \
+   zip.h \
+   zipint.h \
+   zip_alias.h \
+   zipint_alias.h
+
+install-zip-headers:
+   @echo "Installing ZIP headers:  
$(INSTALL_ROOT)$(phpincludedir)/ext/zip/lib"
+   @$(mkinstalldirs) $(INSTALL_ROOT)$(phpincludedir)/ext/zip/lib
+   @for f in $(ZIP_HEADER_FILES); do \
+   if test -f "$(top_srcdir)/lib/$$f"; then \
+   $(INSTALL_DATA) $(top_srcdir)/lib/$$f 
$(INSTALL_ROOT)$(phpincludedir)/ext/zip/lib; \
+   elif test -f "$(top_builddir)/lib/$$f"; then \
+   $(INSTALL_DATA) $(top_builddir)/lib/$$f 
$(INSTALL_ROOT)$(phpincludedir)/ext/zip/lib; \
+   elif test -f "$(top_srcdir)/ext/zip/lib/$$f"; then \
+   $(INSTALL_DATA) $(top_srcdir)/ext/zip/lib/$$f 
$(INSTALL_ROOT)$(phpincludedir)/ext/zip/lib; \
+   elif test -f "$(top_builddir)/ext/zip/lib/$$f"; then \
+   $(INSTALL_DATA) $(top_builddir)/ext/zip/lib/$$f 
$(INSTALL_ROOT)$(phpincludedir)/ext/zip/lib; \
+   else \
+   echo "hmmm"; \
+   fi \
+   done;
+
+# mini hack
+install: $(all_targets) $(install_targets) install-zip-headers
+
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/config.m4?r1=1.11&r2=1.12&diff_format=u
Index: php-src/ext/zip/config.m4
diff -u php-src/ext/zip/config.m4:1.11 php-src/ext/zip/config.m4:1.12
--- php-src/ext/zip/config.m4:1.11  Tue Jul  3 17:24:37 2007
+++ php-src/ext/zip/config.m4   Fri Jan 18 00:33:15 2008
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.11 2007/07/03 17:24:37 sniper Exp $
+dnl $Id: config.m4,v 1.12 2008/01/18 00:33:15 cellog Exp $
 dnl
 
 PHP_ARG_ENABLE(zip, for zip archive read/writesupport,
@@ -66,4 +66,12 @@
PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, 
$ext_shared)
PHP_ADD_BUILD_DIR($ext_builddir/lib, 1)
PHP_SUBST(ZIP_SHARED_LIBADD)
+   ifdef([PHP_INSTALL_HEADERS],
+   [
+ dnl Sadly, this is a complete NOP for pecl extensions
+ PHP_INSTALL_HEADERS(ext/zip/lib, [lib/zip.h lib/zipint.h 
lib/zip_alias.h lib/zipint_alias.h])
+   ])
+   
+   dnl so we always include the known-good working hack.
+   PHP_ADD_MAKEFILE_FRAGMENT
 fi
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/php_zip.c?r1=1.55&r2=1.56&diff_format=u
Index: php-src/ext/zip/php_zip.c
diff -u php-src/ext/zip/php_zip.c:1.55 php-src/ext/zip/php_zip.c:1.56
--- php-src/ext/zip/php_zip.c:1.55  Mon Jan 14 08:17:55 2008
+++ php-src/ext/zip/php_zip.c   Fri Jan 18 00:33:15 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_zip.c,v 1.55 2008/01/14 08:17:55 tony2001 Exp $ */
+/* $Id: php_zip.c,v 1.56 2008/01/18 00:33:15 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -654,7 +654,7 @@
NULL,
NULL,
PHP_MINFO(zip),
-   "1.4.0",
+   "2.0.0",
STANDARD_MODULE_PROPERTIES
 };
 /* }}} */
@@ -2205,7 +2205,7 @@
php_info_print_table_start();
 
php_info_print_table_row(2, "Zip", "enabled");
-   php_info_print_table_row(2, "Extension Version","$Id: php_zip.c,v 1.55 
2008/01/14 08:17:55 tony2001 Exp $");
+   php_info_print_table_row(2, "Extension Version","$Id: php_zip.c,v 1.56 
2008/01/18 00:33:15 cellog Exp $");
php_info_print_table_row(2, "Zip version", "2.0.0");
php_info_print_table_row(2, "Libzip version", "0.7.1");
 


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/zlib zlib_filter.c

2008-02-12 Thread Greg Beaver
cellog  Tue Feb 12 23:29:18 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/zlib   zlib_filter.c 
/php-srcNEWS 
  Log:
  MFH: fix potential memleak due to destruction of filterparams zval
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.6.2.2.2.10&r2=1.6.2.2.2.11&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.10 
php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.11
--- php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.10 Sat Jan 12 22:04:02 2008
+++ php-src/ext/zlib/zlib_filter.c  Tue Feb 12 23:29:18 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zlib_filter.c,v 1.6.2.2.2.10 2008/01/12 22:04:02 cellog Exp $ */
+/* $Id: zlib_filter.c,v 1.6.2.2.2.11 2008/02/12 23:29:18 cellog Exp $ */
 
 #include "php.h"
 #include "php_zlib.h"
@@ -315,15 +315,17 @@
 
if ((Z_TYPE_P(filterparams) == IS_ARRAY || 
Z_TYPE_P(filterparams) == IS_OBJECT) &&
zend_hash_find(HASH_OF(filterparams), "window", 
sizeof("window"), (void **) &tmpzval) == SUCCESS) {
+   zval tmp;
+
/* log-2 base of history window (9 - 15) */
-   SEPARATE_ZVAL(tmpzval);
-   convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < -MAX_WBITS || 
Z_LVAL_PP(tmpzval) > MAX_WBITS + 32) {
-   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, "Invalid parameter give for window size. (%ld)", Z_LVAL_PP(tmpzval));
+   tmp = **tmpzval;
+   zval_copy_ctor(&tmp);
+   convert_to_long(&tmp);
+   if (Z_LVAL(tmp) < -MAX_WBITS || Z_LVAL(tmp) > 
MAX_WBITS + 32) {
+   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, "Invalid parameter give for window size. (%ld)", Z_LVAL(tmp));
} else {
-   windowBits = Z_LVAL_PP(tmpzval);
+   windowBits = Z_LVAL(tmp);
}
-   zval_ptr_dtor(tmpzval);
}
}
 
@@ -347,27 +349,33 @@
case IS_ARRAY:
case IS_OBJECT:
if 
(zend_hash_find(HASH_OF(filterparams), "memory", sizeof("memory"), (void**) 
&tmpzval) == SUCCESS) {
+   zval tmp;
+   
+   tmp = **tmpzval;
+   zval_copy_ctor(&tmp);
+   convert_to_long(&tmp);
+
/* Memory Level (1 - 9) */
-   SEPARATE_ZVAL(tmpzval);
-   convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < 1 || 
Z_LVAL_PP(tmpzval) > MAX_MEM_LEVEL) {
-   php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "Invalid parameter give for memory level. (%ld)", 
Z_LVAL_PP(tmpzval));
+   if (Z_LVAL(tmp) < 1 || 
Z_LVAL(tmp) > MAX_MEM_LEVEL) {
+   php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "Invalid parameter give for memory level. (%ld)", 
Z_LVAL(tmp));
} else {
-   memLevel = 
Z_LVAL_PP(tmpzval);
+   memLevel = Z_LVAL(tmp);
}
-   zval_ptr_dtor(tmpzval);
}
 
if 
(zend_hash_find(HASH_OF(filterparams), "window", sizeof("window"), (void**) 
&tmpzval) == SUCCESS) {
+   zval tmp;
+   
+   tmp = **tmpzval;
+   zval_copy_ctor(&tmp);
+   convert_to_long(&tmp);
+
/* log-2 base of history window 
(9 - 15) */
-   SEPARATE_ZVAL(tmpzval);
-   convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < 
-MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS + 16) {
-   php_error_docref(NULL 
TSRMLS_CC,

[PHP-CVS] cvs: php-src /ext/zlib zlib_filter.c

2008-02-12 Thread Greg Beaver
cellog  Tue Feb 12 23:27:46 2008 UTC

  Modified files:  
/php-src/ext/zlib   zlib_filter.c 
  Log:
  fix potential memleak due to destruction of filterparams zval
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.22&r2=1.23&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.22 php-src/ext/zlib/zlib_filter.c:1.23
--- php-src/ext/zlib/zlib_filter.c:1.22 Sat Jan 12 22:28:04 2008
+++ php-src/ext/zlib/zlib_filter.c  Tue Feb 12 23:27:46 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zlib_filter.c,v 1.22 2008/01/12 22:28:04 cellog Exp $ */
+/* $Id: zlib_filter.c,v 1.23 2008/02/12 23:27:46 cellog Exp $ */
 
 #include "php.h"
 #include "php_zlib.h"
@@ -332,15 +332,17 @@
 
if ((Z_TYPE_P(filterparams) == IS_ARRAY || 
Z_TYPE_P(filterparams) == IS_OBJECT) &&
zend_hash_find(HASH_OF(filterparams), "window", 
sizeof("window"), (void **) &tmpzval) == SUCCESS) {
+   zval tmp;
+
/* log-2 base of history window (9 - 15) */
-   SEPARATE_ZVAL(tmpzval);
-   convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < -MAX_WBITS || 
Z_LVAL_PP(tmpzval) > MAX_WBITS + 32) {
-   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, "Invalid parameter give for window size. (%ld)", Z_LVAL_PP(tmpzval));
+   tmp = **tmpzval;
+   zval_copy_ctor(&tmp);
+   convert_to_long(&tmp);
+   if (Z_LVAL(tmp) < -MAX_WBITS || Z_LVAL(tmp) > 
MAX_WBITS + 32) {
+   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, "Invalid parameter give for window size. (%ld)", Z_LVAL(tmp));
} else {
-   windowBits = Z_LVAL_PP(tmpzval);
+   windowBits = Z_LVAL(tmp);
}
-   zval_ptr_dtor(tmpzval);
}
}
 
@@ -364,27 +366,33 @@
case IS_ARRAY:
case IS_OBJECT:
if 
(zend_hash_find(HASH_OF(filterparams), "memory", sizeof("memory"), (void**) 
&tmpzval) == SUCCESS) {
+   zval tmp;
+   
+   tmp = **tmpzval;
+   zval_copy_ctor(&tmp);
+   convert_to_long(&tmp);
+
/* Memory Level (1 - 9) */
-   SEPARATE_ZVAL(tmpzval);
-   convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < 1 || 
Z_LVAL_PP(tmpzval) > MAX_MEM_LEVEL) {
-   php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "Invalid parameter give for memory level. (%ld)", 
Z_LVAL_PP(tmpzval));
+   if (Z_LVAL(tmp) < 1 || 
Z_LVAL(tmp) > MAX_MEM_LEVEL) {
+   php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "Invalid parameter give for memory level. (%ld)", 
Z_LVAL(tmp));
} else {
-   memLevel = 
Z_LVAL_PP(tmpzval);
+   memLevel = Z_LVAL(tmp);
}
-   zval_ptr_dtor(tmpzval);
}
 
if 
(zend_hash_find(HASH_OF(filterparams), "window", sizeof("window"), (void**) 
&tmpzval) == SUCCESS) {
+   zval tmp;
+   
+   tmp = **tmpzval;
+   zval_copy_ctor(&tmp);
+   convert_to_long(&tmp);
+
/* log-2 base of history window 
(9 - 15) */
-   SEPARATE_ZVAL(tmpzval);
-   convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < 
-MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS + 16) {
-   php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%ld)", 
Z_LVAL_PP(tmpzval));
+ 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/zlib zlib_filter.c

2008-02-12 Thread Greg Beaver
cellog  Tue Feb 12 23:28:05 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/zlib   zlib_filter.c 
  Log:
  MFH: fix potential memleak due to destruction of filterparams zval
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.6.2.2.2.4.2.6&r2=1.6.2.2.2.4.2.7&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.6 
php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.7
--- php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.6  Sat Jan 12 22:03:32 2008
+++ php-src/ext/zlib/zlib_filter.c  Tue Feb 12 23:28:05 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: zlib_filter.c,v 1.6.2.2.2.4.2.6 2008/01/12 22:03:32 cellog Exp $ */
+/* $Id: zlib_filter.c,v 1.6.2.2.2.4.2.7 2008/02/12 23:28:05 cellog Exp $ */
 
 #include "php.h"
 #include "php_zlib.h"
@@ -314,15 +314,17 @@
 
if ((Z_TYPE_P(filterparams) == IS_ARRAY || 
Z_TYPE_P(filterparams) == IS_OBJECT) &&
zend_hash_find(HASH_OF(filterparams), "window", 
sizeof("window"), (void **) &tmpzval) == SUCCESS) {
+   zval tmp;
+
/* log-2 base of history window (9 - 15) */
-   SEPARATE_ZVAL(tmpzval);
-   convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < -MAX_WBITS || 
Z_LVAL_PP(tmpzval) > MAX_WBITS + 32) {
-   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, "Invalid parameter give for window size. (%ld)", Z_LVAL_PP(tmpzval));
+   tmp = **tmpzval;
+   zval_copy_ctor(&tmp);
+   convert_to_long(&tmp);
+   if (Z_LVAL(tmp) < -MAX_WBITS || Z_LVAL(tmp) > 
MAX_WBITS + 32) {
+   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, "Invalid parameter give for window size. (%ld)", Z_LVAL(tmp));
} else {
-   windowBits = Z_LVAL_PP(tmpzval);
+   windowBits = Z_LVAL(tmp);
}
-   zval_ptr_dtor(tmpzval);
}
}
 
@@ -346,27 +348,33 @@
case IS_ARRAY:
case IS_OBJECT:
if 
(zend_hash_find(HASH_OF(filterparams), "memory", sizeof("memory"), (void**) 
&tmpzval) == SUCCESS) {
+   zval tmp;
+   
+   tmp = **tmpzval;
+   zval_copy_ctor(&tmp);
+   convert_to_long(&tmp);
+
/* Memory Level (1 - 9) */
-   SEPARATE_ZVAL(tmpzval);
-   convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < 1 || 
Z_LVAL_PP(tmpzval) > MAX_MEM_LEVEL) {
-   php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "Invalid parameter give for memory level. (%ld)", 
Z_LVAL_PP(tmpzval));
+   if (Z_LVAL(tmp) < 1 || 
Z_LVAL(tmp) > MAX_MEM_LEVEL) {
+   php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "Invalid parameter give for memory level. (%ld)", 
Z_LVAL(tmp));
} else {
-   memLevel = 
Z_LVAL_PP(tmpzval);
+   memLevel = Z_LVAL(tmp);
}
-   zval_ptr_dtor(tmpzval);
}
 
if 
(zend_hash_find(HASH_OF(filterparams), "window", sizeof("window"), (void**) 
&tmpzval) == SUCCESS) {
+   zval tmp;
+   
+   tmp = **tmpzval;
+   zval_copy_ctor(&tmp);
+   convert_to_long(&tmp);
+
/* log-2 base of history window 
(9 - 15) */
-   SEPARATE_ZVAL(tmpzval);
-   convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval) < 
-MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS + 16) {
-   php_error_docref(NULL 
TSRMLS

[PHP-CVS] cvs: php-src(PHP_4_4) /pear Makefile.frag

2006-02-07 Thread Greg Beaver
cellog  Wed Feb  8 01:11:59 2006 UTC

  Modified files:  (Branch: PHP_4_4)
/php-src/pear   Makefile.frag 
  Log:
  fix Bug #36001: make install fails when --enable-memory-limit used
  
http://cvs.php.net/viewcvs.cgi/php-src/pear/Makefile.frag?r1=1.28.2.7.4.1&r2=1.28.2.7.4.2&diff_format=u
Index: php-src/pear/Makefile.frag
diff -u php-src/pear/Makefile.frag:1.28.2.7.4.1 
php-src/pear/Makefile.frag:1.28.2.7.4.2
--- php-src/pear/Makefile.frag:1.28.2.7.4.1 Sat Nov  5 18:19:23 2005
+++ php-src/pear/Makefile.frag  Wed Feb  8 01:11:59 2006
@@ -3,7 +3,7 @@
 peardir=$(PEAR_INSTALLDIR)
 
 # Skip all php.ini files altogether
-PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dsafe_mode=0
+PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dsafe_mode=0 -dmemory_limit=-1
 
 install-pear-packages: $(top_builddir)/sapi/cli/php
@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) 
$(srcdir)/install-pear.php -d "$(peardir)" -b "$(bindir)" 
$(srcdir)/packages/*.tar

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_1) /pear Makefile.frag

2006-02-07 Thread Greg Beaver
cellog  Wed Feb  8 01:12:13 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-src/pear   Makefile.frag 
  Log:
  MFB fix Bug #36001: make install fails when --enable-memory-limit used
  
http://cvs.php.net/viewcvs.cgi/php-src/pear/Makefile.frag?r1=1.35.6.9&r2=1.35.6.10&diff_format=u
Index: php-src/pear/Makefile.frag
diff -u php-src/pear/Makefile.frag:1.35.6.9 php-src/pear/Makefile.frag:1.35.6.10
--- php-src/pear/Makefile.frag:1.35.6.9 Mon Dec 12 12:39:50 2005
+++ php-src/pear/Makefile.frag  Wed Feb  8 01:12:12 2006
@@ -3,7 +3,7 @@
 peardir=$(PEAR_INSTALLDIR)
 
 # Skip all php.ini files altogether
-PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dsafe_mode=0 
-derror_reporting=E_ALL -ddetect_unicode=0
+PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dsafe_mode=0 
-derror_reporting=E_ALL -dmemory_limit=-1 -ddetect_unicode=0
 
 install-pear-installer: $(SAPI_CLI_PATH)
@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) 
$(builddir)/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)"

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_4_4) /pear install-pear.php /pear/PEAR Downloader.php REST.php /pear/PEAR/PackageFile/v2 Validator.php

2006-05-22 Thread Greg Beaver
cellog  Mon May 22 11:17:02 2006 UTC

  Modified files:  (Branch: PHP_4_4)
/php-src/pear   install-pear.php 
/php-src/pear/PEAR  Downloader.php REST.php 
/php-src/pear/PEAR/PackageFile/v2   Validator.php 
  Log:
  fix PEAR build
  
http://cvs.php.net/viewcvs.cgi/php-src/pear/install-pear.php?r1=1.6.2.14.4.8&r2=1.6.2.14.4.9&diff_format=u
Index: php-src/pear/install-pear.php
diff -u php-src/pear/install-pear.php:1.6.2.14.4.8 
php-src/pear/install-pear.php:1.6.2.14.4.9
--- php-src/pear/install-pear.php:1.6.2.14.4.8  Mon May 22 10:19:33 2006
+++ php-src/pear/install-pear.php   Mon May 22 11:17:01 2006
@@ -1,10 +1,10 @@
  $instfile) {
 $info = &$pkg->fromAnyFile($instfile, PEAR_VALIDATE_INSTALLING);
 if (PEAR::isError($info)) {
+if (is_array($info->getUserInfo())) {
+   foreach ($info->getUserInfo() as $err) {
+   $ui->outputData(sprintf("[PEAR] %s: %s", $err['level'],
+   $err['message']));
+   }
+   }
 $ui->outputData(sprintf("[PEAR] %s: %s", $package,
 $info->getMessage()));
 continue;
@@ -134,6 +140,12 @@
 $downloaderpackage = &new PEAR_Downloader_Package($installer);
 $err = $downloaderpackage->initialize($instfile);
 if (PEAR::isError($err)) {
+if (is_array($err->getUserInfo())) {
+   foreach ($err->getUserInfo() as $error) {
+   $ui->outputData(sprintf("[PEAR] %s: %s", $error['level'],
+   $error['message']));
+   }
+   }
 $ui->outputData(sprintf("[PEAR] %s: %s", $package, 
$err->getMessage()));
 continue;
 }
http://cvs.php.net/viewcvs.cgi/php-src/pear/PEAR/Downloader.php?r1=1.9.2.8.2.2&r2=1.9.2.8.2.3&diff_format=u
Index: php-src/pear/PEAR/Downloader.php
diff -u php-src/pear/PEAR/Downloader.php:1.9.2.8.2.2 
php-src/pear/PEAR/Downloader.php:1.9.2.8.2.3
--- php-src/pear/PEAR/Downloader.php:1.9.2.8.2.2Mon May 22 10:19:33 2006
+++ php-src/pear/PEAR/Downloader.phpMon May 22 11:17:01 2006
@@ -18,7 +18,7 @@
  * @author Martin Jansen <[EMAIL PROTECTED]>
  * @copyright  1997-2005 The PHP Group
  * @licensehttp://www.php.net/license/3_0.txt  PHP License 3.0
- * @versionCVS: $Id: Downloader.php,v 1.9.2.8.2.2 2006/05/22 10:19:33 
cellog Exp $
+ * @versionCVS: $Id: Downloader.php,v 1.9.2.8.2.3 2006/05/22 11:17:01 
cellog Exp $
  * @link   http://pear.php.net/package/PEAR
  * @since  File available since Release 1.3.0
  */
@@ -1395,7 +1395,7 @@
 $ifmodifiedsince = ($lastmodified ? "If-Modified-Since: 
$lastmodified\r\n" : '');
 }
 $request .= "Host: $host:$port\r\n" . $ifmodifiedsince .
-"User-Agent: PEAR/@package_version@/PHP/" . PHP_VERSION . "\r\n";
+"User-Agent: PEAR/1.4.9/PHP/" . PHP_VERSION . "\r\n";
 if (isset($this)) { // only pass in authentication for non-static calls
 $username = $config->get('username');
 $password = $config->get('password');
@@ -1507,4 +1507,4 @@
 }
 // }}}
 
-?>
\ No newline at end of file
+?>
http://cvs.php.net/viewcvs.cgi/php-src/pear/PEAR/REST.php?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/pear/PEAR/REST.php
diff -u php-src/pear/PEAR/REST.php:1.1.2.2 php-src/pear/PEAR/REST.php:1.1.2.3
--- php-src/pear/PEAR/REST.php:1.1.2.2  Mon May 22 10:19:33 2006
+++ php-src/pear/PEAR/REST.php  Mon May 22 11:17:01 2006
@@ -15,7 +15,7 @@
  * @author Greg Beaver <[EMAIL PROTECTED]>
  * @copyright  1997-2005 The PHP Group
  * @licensehttp://www.php.net/license/3_0.txt  PHP License 3.0
- * @versionCVS: $Id: REST.php,v 1.1.2.2 2006/05/22 10:19:33 cellog Exp $
+ * @versionCVS: $Id: REST.php,v 1.1.2.3 2006/05/22 11:17:01 cellog Exp $
  * @link   http://pear.php.net/package/PEAR
  * @since  File available since Release 1.4.0a1
  */
@@ -323,7 +323,7 @@
 $ifmodifiedsince = ($lastmodified ? "If-Modified-Since: 
$lastmodified\r\n" : '');
 }
 $request .= "Host: $host:$port\r\n" . $ifmodifiedsince .
-"User-Agent: PEAR/@package_version@/PHP/" . PHP_VERSION . "\r\n";
+"User-Agent: PEAR/1.4.9/PHP/" . PHP_VERSION . "\r\n";
 $username = $this->config->get('username');
 $password = $this->config->get('password');
 if ($username && $password) {
@@ -394,4 +394,4 @@
 return $data;
 }
 }
-?>
\ No newline at end of file
+?>
http://cvs.php.net/viewcvs.cgi/php-src/pear/PEAR/PackageFile/v2/Validator.php?r1=1.1.2.4&r

Re: [PHP-CVS] cvs: phpruntests /phpt-tests hw.phpsample_expectheaders.phpt sample_fileexternal.phpt

2009-04-22 Thread Greg Beaver
Johannes Schlüter wrote:
> Hi,
> 
> On Wed, 2009-04-22 at 16:14 +, Zoe Slattery wrote:
> 
>> --EXPECTHEADERS--
>> Status: 404 Not Found
>> X-Powered-By: PHP/5.3.0RC2-dev
>> Content-type: text/html
>>
>> --EXPECT--
> 
> shouldn't that support %s modifiers? I'm quite sure the X-Powered-By
> header will change quite often and it will be painful to change them all
> the time :-)

Probably better is to remove the X-Powered-By in this test, since its
point is only to verify that EXPECTHEADERS is working?

Greg

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: phpruntests /phpt-tests hw.phpsample_expectheaders.phpt sample_fileexternal.phpt

2009-04-22 Thread Greg Beaver
Johannes Schlüter wrote:
> On Wed, 2009-04-22 at 17:37 -0500, Greg Beaver wrote:
>   
>> Johannes Schlüter wrote:
>> 
>>> Hi,
>>>
>>> On Wed, 2009-04-22 at 16:14 +, Zoe Slattery wrote:
>>>
>>>   
>>>> --EXPECTHEADERS--
>>>> Status: 404 Not Found
>>>> X-Powered-By: PHP/5.3.0RC2-dev
>>>> Content-type: text/html
>>>>
>>>> --EXPECT--
>>>> 
>>> shouldn't that support %s modifiers? I'm quite sure the X-Powered-By
>>> header will change quite often and it will be painful to change them all
>>> the time :-)
>>>   
>> Probably better is to remove the X-Powered-By in this test, since its
>> point is only to verify that EXPECTHEADERS is working?
>> 
>
> Wasn't sure whether it means "expecting all of them" or just "at least
> them (in a random order?)"
it means "all of these headers must be present, but others may be as well"

Greg


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] Re: cvs: php-src(PHP_5_3) /ext/sqlite3 php_sqlite3_structs.h sqlite3.c

2009-04-27 Thread Greg Beaver
Scott MacVicar wrote:
> scottmac  Mon Apr 27 18:16:46 2009 UTC
> 
>   Modified files:  (Branch: PHP_5_3)
> /php-src/ext/sqlite3  php_sqlite3_structs.h sqlite3.c 
>   Log:
>   MFH Add the ability to enable exceptions rather than warnings for sqlite3, 
> needed for pyrus. 

Muchas Gracias :)

Greg

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar/tests fatal_error_webphar.phpt /ext/phar/tests/files pear2coverage.phar.php

2009-04-28 Thread Greg Beaver
cellog  Tue Apr 28 19:28:52 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/phar/tests fatal_error_webphar.phpt 
/php-src/ext/phar/tests/files   pear2coverage.phar.php 
  Log:
  new test - test passes here, but the pear2coverage.phar.php segfaults in 
apache 2.2 sapi
  

http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/fatal_error_webphar.phpt?view=markup&rev=1.1
Index: php-src/ext/phar/tests/fatal_error_webphar.phpt
+++ php-src/ext/phar/tests/fatal_error_webphar.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/files/pear2coverage.phar.php?view=markup&rev=1.1
Index: php-src/ext/phar/tests/files/pear2coverage.phar.php
+++ php-src/ext/phar/tests/files/pear2coverage.phar.php



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/phar phar.c phar_internal.h phar_object.c tar.c util.c zip.c

2009-04-28 Thread Greg Beaver
cellog  Wed Apr 29 03:24:09 2009 UTC

  Modified files:  
/php-src/ext/phar   phar.c phar_internal.h phar_object.c tar.c util.c 
zip.c 
  Log:
  MFPECL: fix PECL bug #16338, php_stream_copy_to_stream{,_ex}()
  http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar.c?r1=1.396&r2=1.397&diff_format=u
Index: php-src/ext/phar/phar.c
diff -u php-src/ext/phar/phar.c:1.396 php-src/ext/phar/phar.c:1.397
--- php-src/ext/phar/phar.c:1.396   Fri Feb 20 05:06:52 2009
+++ php-src/ext/phar/phar.c Wed Apr 29 03:24:08 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: phar.c,v 1.396 2009/02/20 05:06:52 cellog Exp $ */
+/* $Id: phar.c,v 1.397 2009/04/29 03:24:08 cellog Exp $ */
 
 #define PHAR_MAIN 1
 #include "phar_internal.h"
@@ -1635,7 +1635,7 @@
 
php_stream_filter_append(&temp->writefilters, 
filter);
 
-   if (0 == php_stream_copy_to_stream(fp, temp, 
PHP_STREAM_COPY_ALL)) {
+   if (SUCCESS != phar_stream_copy_to_stream(fp, 
temp, PHP_STREAM_COPY_ALL, NULL)) {
if (err) {
php_stream_close(temp);
MAPPHAR_ALLOC_FAIL("unable to 
decompress gzipped phar archive \"%s\", ext/zlib is buggy in PHP versions older 
than 5.2.6")
@@ -1677,7 +1677,7 @@
 
php_stream_filter_append(&temp->writefilters, 
filter);
 
-   if (0 == php_stream_copy_to_stream(fp, temp, 
PHP_STREAM_COPY_ALL)) {
+   if (SUCCESS != phar_stream_copy_to_stream(fp, 
temp, PHP_STREAM_COPY_ALL, NULL)) {
php_stream_close(temp);
MAPPHAR_ALLOC_FAIL("unable to 
decompress bzipped phar archive \"%s\" to temporary file")
}
@@ -2661,7 +2661,7 @@
size_t written;
 
if (!user_stub && phar->halt_offset && oldfile && 
!phar->is_brandnew) {
-   written = php_stream_copy_to_stream(oldfile, newfile, 
phar->halt_offset);
+   phar_stream_copy_to_stream(oldfile, newfile, 
phar->halt_offset, &written);
newstub = NULL;
} else {
/* this is either a brand new phar or a default stub 
overwrite */
@@ -2849,7 +2849,7 @@
return EOF;
}
php_stream_filter_append((&entry->cfp->writefilters), filter);
-   if (entry->uncompressed_filesize != 
php_stream_copy_to_stream(file, entry->cfp, entry->uncompressed_filesize)) {
+   if (SUCCESS != phar_stream_copy_to_stream(file, entry->cfp, 
entry->uncompressed_filesize, NULL)) {
if (closeoldfile) {
php_stream_close(oldfile);
}
@@ -3059,7 +3059,7 @@
/* this will have changed for all files that have either 
changed compression or been modified */
entry->offset = entry->offset_abs = offset;
offset += entry->compressed_filesize;
-   wrote = php_stream_copy_to_stream(file, newfile, 
entry->compressed_filesize);
+   phar_stream_copy_to_stream(file, newfile, 
entry->compressed_filesize, &wrote);
 
if (entry->compressed_filesize != wrote) {
if (closeoldfile) {
@@ -3207,7 +3207,7 @@
}
 
php_stream_filter_append(&phar->fp->writefilters, 
filter);
-   php_stream_copy_to_stream(newfile, phar->fp, 
PHP_STREAM_COPY_ALL);
+   phar_stream_copy_to_stream(newfile, phar->fp, 
PHP_STREAM_COPY_ALL, NULL);
php_stream_filter_flush(filter, 1);
php_stream_filter_remove(filter, 1 TSRMLS_CC);
php_stream_close(phar->fp);
@@ -3216,14 +3216,14 @@
} else if (phar->flags & PHAR_FILE_COMPRESSED_BZ2) {
filter = php_stream_filter_create("bzip2.compress", 
NULL, php_stream_is_persistent(phar->fp) TSRMLS_CC);
php_stream_filter_append(&phar->fp->writefilters, 
filter);
-   php_stream_copy_to_stream(newfile, phar->fp, 
PHP_STREAM_COPY_ALL);
+   phar_stream_copy_to_stream(newfile, phar->fp, 
PHP_STREAM_COPY_ALL, NULL);
php_stream_filter_flush(filter, 1);
php_stream_filter_remove(filter, 1 TSRMLS_CC);
php_stream_close(phar->fp);
/* use the temp stream as our base */
phar->fp = newfile;
} else {
-   php_stream_copy_to_stream(newfile, phar->fp, 
PHP_STREAM_

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar phar.c phar_internal.h phar_object.c tar.c util.c zip.c

2009-04-28 Thread Greg Beaver
cellog  Wed Apr 29 03:24:27 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/phar   phar.c phar_internal.h phar_object.c tar.c util.c 
zip.c 
  Log:
  MFPECL: fix PECL bug #16338, php_stream_copy_to_stream{,_ex}()
  http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar.c?r1=1.370.2.58&r2=1.370.2.59&diff_format=u
Index: php-src/ext/phar/phar.c
diff -u php-src/ext/phar/phar.c:1.370.2.58 php-src/ext/phar/phar.c:1.370.2.59
--- php-src/ext/phar/phar.c:1.370.2.58  Fri Feb 20 05:06:37 2009
+++ php-src/ext/phar/phar.c Wed Apr 29 03:24:26 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: phar.c,v 1.370.2.58 2009/02/20 05:06:37 cellog Exp $ */
+/* $Id: phar.c,v 1.370.2.59 2009/04/29 03:24:26 cellog Exp $ */
 
 #define PHAR_MAIN 1
 #include "phar_internal.h"
@@ -1635,7 +1635,7 @@
 
php_stream_filter_append(&temp->writefilters, 
filter);
 
-   if (0 == php_stream_copy_to_stream(fp, temp, 
PHP_STREAM_COPY_ALL)) {
+   if (SUCCESS != phar_stream_copy_to_stream(fp, 
temp, PHP_STREAM_COPY_ALL, NULL)) {
if (err) {
php_stream_close(temp);
MAPPHAR_ALLOC_FAIL("unable to 
decompress gzipped phar archive \"%s\", ext/zlib is buggy in PHP versions older 
than 5.2.6")
@@ -1677,7 +1677,7 @@
 
php_stream_filter_append(&temp->writefilters, 
filter);
 
-   if (0 == php_stream_copy_to_stream(fp, temp, 
PHP_STREAM_COPY_ALL)) {
+   if (SUCCESS != phar_stream_copy_to_stream(fp, 
temp, PHP_STREAM_COPY_ALL, NULL)) {
php_stream_close(temp);
MAPPHAR_ALLOC_FAIL("unable to 
decompress bzipped phar archive \"%s\" to temporary file")
}
@@ -2661,7 +2661,7 @@
size_t written;
 
if (!user_stub && phar->halt_offset && oldfile && 
!phar->is_brandnew) {
-   written = php_stream_copy_to_stream(oldfile, newfile, 
phar->halt_offset);
+   phar_stream_copy_to_stream(oldfile, newfile, 
phar->halt_offset, &written);
newstub = NULL;
} else {
/* this is either a brand new phar or a default stub 
overwrite */
@@ -2849,7 +2849,7 @@
return EOF;
}
php_stream_filter_append((&entry->cfp->writefilters), filter);
-   if (entry->uncompressed_filesize != 
php_stream_copy_to_stream(file, entry->cfp, entry->uncompressed_filesize)) {
+   if (SUCCESS != phar_stream_copy_to_stream(file, entry->cfp, 
entry->uncompressed_filesize, NULL)) {
if (closeoldfile) {
php_stream_close(oldfile);
}
@@ -3059,7 +3059,7 @@
/* this will have changed for all files that have either 
changed compression or been modified */
entry->offset = entry->offset_abs = offset;
offset += entry->compressed_filesize;
-   wrote = php_stream_copy_to_stream(file, newfile, 
entry->compressed_filesize);
+   phar_stream_copy_to_stream(file, newfile, 
entry->compressed_filesize, &wrote);
 
if (entry->compressed_filesize != wrote) {
if (closeoldfile) {
@@ -3207,7 +3207,7 @@
}
 
php_stream_filter_append(&phar->fp->writefilters, 
filter);
-   php_stream_copy_to_stream(newfile, phar->fp, 
PHP_STREAM_COPY_ALL);
+   phar_stream_copy_to_stream(newfile, phar->fp, 
PHP_STREAM_COPY_ALL, NULL);
php_stream_filter_flush(filter, 1);
php_stream_filter_remove(filter, 1 TSRMLS_CC);
php_stream_close(phar->fp);
@@ -3216,14 +3216,14 @@
} else if (phar->flags & PHAR_FILE_COMPRESSED_BZ2) {
filter = php_stream_filter_create("bzip2.compress", 
NULL, php_stream_is_persistent(phar->fp) TSRMLS_CC);
php_stream_filter_append(&phar->fp->writefilters, 
filter);
-   php_stream_copy_to_stream(newfile, phar->fp, 
PHP_STREAM_COPY_ALL);
+   phar_stream_copy_to_stream(newfile, phar->fp, 
PHP_STREAM_COPY_ALL, NULL);
php_stream_filter_flush(filter, 1);
php_stream_filter_remove(filter, 1 TSRMLS_CC);
php_stream_close(phar->fp);
/* use the temp stream as our base */
phar->fp = newfile;
} else {
-   php_stream

Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar phar.c phar_internal.h phar_object.c tar.c util.c zip.c

2009-04-29 Thread Greg Beaver
Antony Dovgal wrote:
> On 29.04.2009 07:24, Greg Beaver wrote:
>   
>> cellog   Wed Apr 29 03:24:27 2009 UTC
>>
>>   Modified files:  (Branch: PHP_5_3)
>> /php-src/ext/pharphar.c phar_internal.h phar_object.c tar.c 
>> util.c 
>>  zip.c 
>>   Log:
>>   MFPECL: fix PECL bug #16338, php_stream_copy_to_stream{,_ex}()
>>   
>>
>> 
>
> ext/phar/tests/fatal_error_webphar.mem
>
> ==29591== Invalid read of size 8
> ==29591==at 0x693B8A: phar_file_action (phar_object.c:315)
> ==29591==by 0x6956D1: zim_Phar_webPhar (phar_object.c:878)
> ==29591==by 0x9203BE: zend_do_fcall_common_helper_SPEC 
> (zend_vm_execute.h:313)
> ==29591==by 0x921103: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
> (zend_vm_execute.h:422)
> ==29591==by 0x91F64E: execute (zend_vm_execute.h:104)
> ==29591==by 0x8F08C2: zend_execute_scripts (zend.c:1188)
> ==29591==by 0x87BD7B: php_execute_script (main.c:2166)
> ==29591==by 0x9D691F: main (cgi_main.c:2015)
>
>   
Oh good - you can reproduce it!  The segfault is not related to the
commit, as you can see from the line in question (line 315 of
phar_file_action is a zval_ptr_dtor of EG(return_value_ptr_ptr), which
has nothing to do with streams).

I found this segfault on my system using apache 2.2 with the test script
and added the fatal_error_webphar test to attempt to reproduce it, but
the test in question passes using cgi on my system.  Would you be able
to forward bt + valgrind errors to Dmitry?  This is a ZE2 problem that
phar's cleanup triggers, and so I need to know how to rewrite the
cleanup so it doesn't trigger the segfault (or ZE2 needs to be fixed,
whichever is the real problem).

Thanks Tony,
Greg

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar phar.c phar_internal.h phar_object.c tar.c util.c zip.c

2009-04-29 Thread Greg Beaver
Antony Dovgal wrote:
> On 29.04.2009 17:50, Greg Beaver wrote:
>   
>> Oh good - you can reproduce it!  The segfault is not related to the
>> commit, as you can see from the line in question (line 315 of
>> phar_file_action is a zval_ptr_dtor of EG(return_value_ptr_ptr), which
>> has nothing to do with streams).
>> 
>
> Well, I don't remember seeing it before.
>   
Hi,

This could be because the fatal_error_webphar.phpt test was committed
only 1 day before the commit you did see?
>> I found this segfault on my system using apache 2.2 with the test script
>> and added the fatal_error_webphar test to attempt to reproduce it, but
>> the test in question passes using cgi on my system. 
>> 
>
> It segfaults with CGI here (but no with CLI?).
>   
It is a web-based test, which means it only runs with the CGI sapi.
>> Would you be able
>> to forward bt + valgrind errors to Dmitry?  This is a ZE2 problem that
>> phar's cleanup triggers, and so I need to know how to rewrite the
>> cleanup so it doesn't trigger the segfault (or ZE2 needs to be fixed,
>> whichever is the real problem).
>> 
>
> Ok, I'll ping him.
>   

thanks very much.  I can get a backtrace using gdb, but no valgrind for
the apache crash, although I haven't tried running the server via
valgrind.  Does anyone know if this is even possible to do with a
forking server?

Thanks,
Greg

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/phar phar.c /ext/phar/tests phar_construct_invalidurl.phpt

2009-04-29 Thread Greg Beaver
cellog  Thu Apr 30 04:40:31 2009 UTC

  Added files: 
/php-src/ext/phar/tests phar_construct_invalidurl.phpt 

  Modified files:  
/php-src/ext/phar   phar.c 
  Log:
  MFPECL: fixed PECL Bug #14646: phar error message unclear with php stream 
wrappers
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar.c?r1=1.397&r2=1.398&diff_format=u
Index: php-src/ext/phar/phar.c
diff -u php-src/ext/phar/phar.c:1.397 php-src/ext/phar/phar.c:1.398
--- php-src/ext/phar/phar.c:1.397   Wed Apr 29 03:24:08 2009
+++ php-src/ext/phar/phar.c Thu Apr 30 04:40:31 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: phar.c,v 1.397 2009/04/29 03:24:08 cellog Exp $ */
+/* $Id: phar.c,v 1.398 2009/04/30 04:40:31 cellog Exp $ */
 
 #define PHAR_MAIN 1
 #include "phar_internal.h"
@@ -1262,7 +1262,11 @@
/* next try to create a new file */
if (FAILURE == phar_detect_phar_fname_ext(fname, fname_len, &ext_str, 
&ext_len, !is_data, 1, 1 TSRMLS_CC)) {
if (error) {
-   spprintf(error, 0, "Cannot create phar '%s', file 
extension (or combination) not recognised", fname);
+   if (ext_len == -2) {
+   spprintf(error, 0, "Cannot create a phar 
archive from a URL like \"%s\".  Phar objects can only be created from local 
files", fname);
+   } else {
+   spprintf(error, 0, "Cannot create phar '%s', 
file extension (or combination) not recognised", fname);
+   }
}
return FAILURE;
}
@@ -1903,6 +1907,12 @@
pos = memchr(filename, '/', filename_len);
 
if (pos && pos != filename) {
+   /* check for url like http:// or phar:// */
+   if (*(pos - 1) == ':' && (pos - filename) < filename_len - 1 && 
*(pos + 1) == '/') {
+   *ext_len = -2;
+   *ext_str = NULL;
+   return FAILURE;
+   }
if (zend_hash_exists(&(PHAR_GLOBALS->phar_alias_map), (char *) 
filename, pos - filename)) {
*ext_str = pos;
*ext_len = -1;
@@ -3624,7 +3634,7 @@
php_info_print_table_header(2, "Phar: PHP Archive support", "enabled");
php_info_print_table_row(2, "Phar EXT version", PHP_PHAR_VERSION);
php_info_print_table_row(2, "Phar API version", PHP_PHAR_API_VERSION);
-   php_info_print_table_row(2, "CVS revision", "$Revision: 1.397 $");
+   php_info_print_table_row(2, "CVS revision", "$Revision: 1.398 $");
php_info_print_table_row(2, "Phar-based phar archives", "enabled");
php_info_print_table_row(2, "Tar-based phar archives", "enabled");
php_info_print_table_row(2, "ZIP-based phar archives", "enabled");

http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/phar_construct_invalidurl.phpt?view=markup&rev=1.1
Index: php-src/ext/phar/tests/phar_construct_invalidurl.phpt
+++ php-src/ext/phar/tests/phar_construct_invalidurl.phpt
--TEST--
Phar object passed URL
--INI--
default_charset=UTF-8
--SKIPIF--

--FILE--
http://should.fail.com');
} catch (UnexpectedValueException $e) {
echo $e->getMessage(),"\n";
}
try {
$a = new Phar('http://');
} catch (UnexpectedValueException $e) {
echo $e->getMessage(),"\n";
}
try {
$a = new Phar('http:/');
} catch (UnexpectedValueException $e) {
echo $e->getMessage(),"\n";
}
?>
===DONE===
--EXPECT--
Cannot create a phar archive from a URL like "http://should.fail.com";.  Phar 
objects can only be created from local files
Cannot create a phar archive from a URL like "http://";.  Phar objects can only 
be created from local files
Cannot create phar 'http:/', file extension (or combination) not recognised
===DONE===


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/phar phar.c /ext/phar/tests phar_construct_invalidurl.phpt

2009-04-29 Thread Greg Beaver
cellog  Thu Apr 30 04:43:10 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/phar/tests phar_construct_invalidurl.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/phar   phar.c 
  Log:
  MFPECL fix PECL Bug #14646: phar error message unclear with php stream 
wrappers (note: is there a standard way to list PECL bugs in NEWS?)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.571&r2=1.2027.2.547.2.965.2.572&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.571 
php-src/NEWS:1.2027.2.547.2.965.2.572
--- php-src/NEWS:1.2027.2.547.2.965.2.571   Tue Apr 28 07:13:30 2009
+++ php-src/NEWSThu Apr 30 04:43:09 2009
@@ -53,6 +53,8 @@
   update). (Matteo)
 - Fixed bug #42362 (HTTP status codes 204 and 304 should not be gzipped).
   (Scott, Edward Z. Yang)
+- Fixed PECL bug #16338 (phar extension uses php_stream_copy_to_stream). (Greg)
+- Fixed PECL bug #14646 (phar error message unclear with php stream wrappers). 
(Greg)
 - Fixed an issue with ReflectionProperty::setAccessible().
   (Sebastian, Roman Borschel)
 
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar.c?r1=1.370.2.59&r2=1.370.2.60&diff_format=u
Index: php-src/ext/phar/phar.c
diff -u php-src/ext/phar/phar.c:1.370.2.59 php-src/ext/phar/phar.c:1.370.2.60
--- php-src/ext/phar/phar.c:1.370.2.59  Wed Apr 29 03:24:26 2009
+++ php-src/ext/phar/phar.c Thu Apr 30 04:43:10 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: phar.c,v 1.370.2.59 2009/04/29 03:24:26 cellog Exp $ */
+/* $Id: phar.c,v 1.370.2.60 2009/04/30 04:43:10 cellog Exp $ */
 
 #define PHAR_MAIN 1
 #include "phar_internal.h"
@@ -1262,7 +1262,11 @@
/* next try to create a new file */
if (FAILURE == phar_detect_phar_fname_ext(fname, fname_len, &ext_str, 
&ext_len, !is_data, 1, 1 TSRMLS_CC)) {
if (error) {
-   spprintf(error, 0, "Cannot create phar '%s', file 
extension (or combination) not recognised", fname);
+   if (ext_len == -2) {
+   spprintf(error, 0, "Cannot create a phar 
archive from a URL like \"%s\".  Phar objects can only be created from local 
files", fname);
+   } else {
+   spprintf(error, 0, "Cannot create phar '%s', 
file extension (or combination) not recognised", fname);
+   }
}
return FAILURE;
}
@@ -1903,6 +1907,12 @@
pos = memchr(filename, '/', filename_len);
 
if (pos && pos != filename) {
+   /* check for url like http:// or phar:// */
+   if (*(pos - 1) == ':' && (pos - filename) < filename_len - 1 && 
*(pos + 1) == '/') {
+   *ext_len = -2;
+   *ext_str = NULL;
+   return FAILURE;
+   }
if (zend_hash_exists(&(PHAR_GLOBALS->phar_alias_map), (char *) 
filename, pos - filename)) {
*ext_str = pos;
*ext_len = -1;
@@ -3624,7 +3634,7 @@
php_info_print_table_header(2, "Phar: PHP Archive support", "enabled");
php_info_print_table_row(2, "Phar EXT version", PHP_PHAR_VERSION);
php_info_print_table_row(2, "Phar API version", PHP_PHAR_API_VERSION);
-   php_info_print_table_row(2, "CVS revision", "$Revision: 1.370.2.59 $");
+   php_info_print_table_row(2, "CVS revision", "$Revision: 1.370.2.60 $");
php_info_print_table_row(2, "Phar-based phar archives", "enabled");
php_info_print_table_row(2, "Tar-based phar archives", "enabled");
php_info_print_table_row(2, "ZIP-based phar archives", "enabled");

http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/phar_construct_invalidurl.phpt?view=markup&rev=1.1
Index: php-src/ext/phar/tests/phar_construct_invalidurl.phpt
+++ php-src/ext/phar/tests/phar_construct_invalidurl.phpt
--TEST--
Phar object passed URL
--INI--
default_charset=UTF-8
--SKIPIF--

--FILE--
http://should.fail.com');
} catch (UnexpectedValueException $e) {
echo $e->getMessage(),"\n";
}
try {
$a = new Phar('http://');
} catch (UnexpectedValueException $e) {
echo $e->getMessage(),"\n";
}
try {
$a = new Phar('http:/');
} catch (UnexpectedValueException $e) {
echo $e->getMessage(),"\n";
}
?>
===DONE===
--EXPECT--
Cannot create a phar archive from a URL like "http://should.fail.com";.  Phar 
objects can only be created from local files
Cannot create a phar archive from a URL like "http://";.  Phar objects can only 
be created from local files
Cannot create phar 'http:/', file extension (or combination) not recognised
===DONE===


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar phar_object.c

2009-05-03 Thread Greg Beaver
cellog  Mon May  4 04:29:26 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/phar   phar_object.c 
  Log:
  disable cause of mysterious segfault in PHP 5.3 only (5.2 is fine)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar_object.c?r1=1.266.2.59&r2=1.266.2.60&diff_format=u
Index: php-src/ext/phar/phar_object.c
diff -u php-src/ext/phar/phar_object.c:1.266.2.59 
php-src/ext/phar/phar_object.c:1.266.2.60
--- php-src/ext/phar/phar_object.c:1.266.2.59   Wed Apr 29 03:24:26 2009
+++ php-src/ext/phar/phar_object.c  Mon May  4 04:29:25 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: phar_object.c,v 1.266.2.59 2009/04/29 03:24:26 cellog Exp $ */
+/* $Id: phar_object.c,v 1.266.2.60 2009/05/04 04:29:25 cellog Exp $ */
 
 #include "phar_internal.h"
 #include "func_interceptors.h"
@@ -310,9 +310,11 @@
efree(new_op_array);
 
 
+#if PHP_VERSION_ID < 50300
if (EG(return_value_ptr_ptr) && 
*EG(return_value_ptr_ptr)) {

zval_ptr_dtor(EG(return_value_ptr_ptr));
}
+#endif
} zend_catch {
if (PHAR_G(cwd)) {
efree(PHAR_G(cwd));



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/phar phar_object.c

2009-05-03 Thread Greg Beaver
cellog  Mon May  4 04:30:50 2009 UTC

  Modified files:  
/php-src/ext/phar   phar_object.c 
  Log:
  MFB: disable mysterious segfault on PHP 5.3 (5.2 not affected)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar_object.c?r1=1.295&r2=1.296&diff_format=u
Index: php-src/ext/phar/phar_object.c
diff -u php-src/ext/phar/phar_object.c:1.295 
php-src/ext/phar/phar_object.c:1.296
--- php-src/ext/phar/phar_object.c:1.295Wed Apr 29 03:24:09 2009
+++ php-src/ext/phar/phar_object.c  Mon May  4 04:30:50 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: phar_object.c,v 1.295 2009/04/29 03:24:09 cellog Exp $ */
+/* $Id: phar_object.c,v 1.296 2009/05/04 04:30:50 cellog Exp $ */
 
 #include "phar_internal.h"
 #include "func_interceptors.h"
@@ -310,9 +310,11 @@
efree(new_op_array);
 
 
+#if PHP_VERSION_ID < 50300
if (EG(return_value_ptr_ptr) && 
*EG(return_value_ptr_ptr)) {

zval_ptr_dtor(EG(return_value_ptr_ptr));
}
+#endif
} zend_catch {
if (PHAR_G(cwd)) {
efree(PHAR_G(cwd));



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar phar_object.c

2009-05-04 Thread Greg Beaver
cellog  Tue May  5 01:41:52 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/phar   phar_object.c 
  Log:
  remove precautionary #ifdef - the problem was fixed by moving the efree 
inside the zend_try block
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar_object.c?r1=1.266.2.60&r2=1.266.2.61&diff_format=u
Index: php-src/ext/phar/phar_object.c
diff -u php-src/ext/phar/phar_object.c:1.266.2.60 
php-src/ext/phar/phar_object.c:1.266.2.61
--- php-src/ext/phar/phar_object.c:1.266.2.60   Mon May  4 04:29:25 2009
+++ php-src/ext/phar/phar_object.c  Tue May  5 01:41:51 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: phar_object.c,v 1.266.2.60 2009/05/04 04:29:25 cellog Exp $ */
+/* $Id: phar_object.c,v 1.266.2.61 2009/05/05 01:41:51 cellog Exp $ */
 
 #include "phar_internal.h"
 #include "func_interceptors.h"
@@ -310,11 +310,9 @@
efree(new_op_array);
 
 
-#if PHP_VERSION_ID < 50300
if (EG(return_value_ptr_ptr) && 
*EG(return_value_ptr_ptr)) {

zval_ptr_dtor(EG(return_value_ptr_ptr));
}
-#endif
} zend_catch {
if (PHAR_G(cwd)) {
efree(PHAR_G(cwd));



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/phar phar_object.c

2009-05-04 Thread Greg Beaver
cellog  Tue May  5 01:42:06 2009 UTC

  Modified files:  
/php-src/ext/phar   phar_object.c 
  Log:
  MFB: remove precautionary #ifdef - the problem was fixed by moving the efree 
inside the zend_try block
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar_object.c?r1=1.296&r2=1.297&diff_format=u
Index: php-src/ext/phar/phar_object.c
diff -u php-src/ext/phar/phar_object.c:1.296 
php-src/ext/phar/phar_object.c:1.297
--- php-src/ext/phar/phar_object.c:1.296Mon May  4 04:30:50 2009
+++ php-src/ext/phar/phar_object.c  Tue May  5 01:42:06 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: phar_object.c,v 1.296 2009/05/04 04:30:50 cellog Exp $ */
+/* $Id: phar_object.c,v 1.297 2009/05/05 01:42:06 cellog Exp $ */
 
 #include "phar_internal.h"
 #include "func_interceptors.h"
@@ -310,11 +310,9 @@
efree(new_op_array);
 
 
-#if PHP_VERSION_ID < 50300
if (EG(return_value_ptr_ptr) && 
*EG(return_value_ptr_ptr)) {

zval_ptr_dtor(EG(return_value_ptr_ptr));
}
-#endif
} zend_catch {
if (PHAR_G(cwd)) {
efree(PHAR_G(cwd));



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] Re: cvs: php-src(PHP_5_3) / UPGRADING

2009-05-06 Thread Greg Beaver
Kalle Sommer Nielsen wrote:
> kalle Thu May  7 03:14:07 2009 UTC
> 
>   Modified files:  (Branch: PHP_5_3)
> /php-src  UPGRADING 
>   Log:
>   * use is a reserved keyword

Hi,

FYI, use has been a reserved keyword since the initial commit of
zend_language_parser.y in October of 2000 :) (see
http://cvs.php.net/viewvc.cgi/Zend/zend_language_parser.y?revision=1.1&view=markup)

Greg

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/phar phar.c phar_internal.h tar.c /ext/phar/tests/tar require_hash.phpt tar_nohash.phpt /ext/phar/tests/tar/files Net_URL-1.0.15.tgz

2009-05-13 Thread Greg Beaver
cellog  Wed May 13 20:25:44 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/phar/tests/tar tar_nohash.phpt 
/php-src/ext/phar/tests/tar/files   Net_URL-1.0.15.tgz 

  Modified files:  
/php-srcNEWS 
/php-src/ext/phar   phar.c phar_internal.h tar.c 
/php-src/ext/phar/tests/tar require_hash.phpt 
  Log:
  fix Bug #48257: PharData throws exception with non-phar tar
  http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.599&r2=1.2027.2.547.2.965.2.600&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.599 
php-src/NEWS:1.2027.2.547.2.965.2.600
--- php-src/NEWS:1.2027.2.547.2.965.2.599   Tue May 12 22:18:14 2009
+++ php-src/NEWSWed May 13 20:25:43 2009
@@ -6,6 +6,7 @@
 
 - Disabled SQLite3::loadExtension for threaded SAPIs. (Scott)
 
+- Fixed bug #48257 (PharData throws exception with non-phar tar). (Greg)
 - Fixed bug #48227 (NumberFormatter::format leaks memory). (Felipe)
 - Fixed bug #48200 (compile failure with mbstring.c when 
   --enable-zend-multibyte is used). (Jani)
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar.c?r1=1.370.2.61&r2=1.370.2.62&diff_format=u
Index: php-src/ext/phar/phar.c
diff -u php-src/ext/phar/phar.c:1.370.2.61 php-src/ext/phar/phar.c:1.370.2.62
--- php-src/ext/phar/phar.c:1.370.2.61  Fri May  1 09:22:16 2009
+++ php-src/ext/phar/phar.c Wed May 13 20:25:43 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: phar.c,v 1.370.2.61 2009/05/01 09:22:16 tony2001 Exp $ */
+/* $Id: phar.c,v 1.370.2.62 2009/05/13 20:25:43 cellog Exp $ */
 
 #define PHAR_MAIN 1
 #include "phar_internal.h"
@@ -1345,7 +1345,7 @@
}
 
if (fp) {
-   if (phar_open_from_fp(fp, fname, fname_len, alias, alias_len, 
options, pphar, error TSRMLS_CC) == SUCCESS) {
+   if (phar_open_from_fp(fp, fname, fname_len, alias, alias_len, 
options, pphar, is_data, error TSRMLS_CC) == SUCCESS) {
if ((*pphar)->is_data || !PHAR_G(readonly)) {
(*pphar)->is_writeable = 1;
}
@@ -1519,7 +1519,7 @@
fname_len = strlen(actual);
}
 
-   ret =  phar_open_from_fp(fp, fname, fname_len, alias, alias_len, 
options, pphar, error TSRMLS_CC);
+   ret =  phar_open_from_fp(fp, fname, fname_len, alias, alias_len, 
options, pphar, is_data, error TSRMLS_CC);
 
if (actual) {
efree(actual);
@@ -1563,7 +1563,7 @@
  * that the manifest is proper, then pass it to phar_parse_pharfile().  SUCCESS
  * or FAILURE is returned and pphar is set to a pointer to the phar's manifest
  */
-static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char 
*alias, int alias_len, int options, phar_archive_data** pphar, char **error 
TSRMLS_DC) /* {{{ */
+static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char 
*alias, int alias_len, int options, phar_archive_data** pphar, int is_data, 
char **error TSRMLS_DC) /* {{{ */
 {
const char token[] = "__HALT_COMPILER();";
const char zip_magic[] = "PK\x03\x04";
@@ -1706,7 +1706,7 @@
if (got > 512) {
if (phar_is_tar(pos, fname)) {
php_stream_rewind(fp);
-   return phar_parse_tarfile(fp, fname, 
fname_len, alias, alias_len, pphar, compression, error TSRMLS_CC);
+   return phar_parse_tarfile(fp, fname, 
fname_len, alias, alias_len, pphar, is_data, compression, error TSRMLS_CC);
}
}
}
@@ -2380,7 +2380,7 @@
fname_len = strlen(actual);
}
 
-   ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, 
REPORT_ERRORS, NULL, error TSRMLS_CC);
+   ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, 
REPORT_ERRORS, NULL, 0, error TSRMLS_CC);
 
if (actual) {
efree(actual);
@@ -3635,7 +3635,7 @@
php_info_print_table_header(2, "Phar: PHP Archive support", "enabled");
php_info_print_table_row(2, "Phar EXT version", PHP_PHAR_VERSION);
php_info_print_table_row(2, "Phar API version", PHP_PHAR_API_VERSION);
-   php_info_print_table_row(2, "CVS revision", "$Revision: 1.370.2.61 $");
+   php_info_print_table_row(2, "CVS revision", "$Revision: 1.370.2.62 $");
php_info_print_table_row(2, "Phar-based phar archives", "enabled");
php_info_print_table_row(2, "Tar-based phar archives", "enabled");
php_info_print_table_row(2, "ZIP-based phar archives", "enabled");
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar_internal.h?r1=1.109.2.30&r2=1.109.2.31&diff_format=u
Index: php-src/ext/phar/phar_internal.h
diff -u php-src/ext/phar/phar_internal.h:1.109.2.30 
php-src/ext/phar/phar_internal.h:1

[PHP-CVS] cvs: php-src /ext/phar phar.c phar_internal.h tar.c /ext/phar/tests/tar require_hash.phpt /ext/phar/tests/tar/files Net_URL-1.0.15.tgz

2009-05-13 Thread Greg Beaver
cellog  Wed May 13 20:26:18 2009 UTC

  Modified files:  
/php-src/ext/phar   phar.c phar_internal.h tar.c 
/php-src/ext/phar/tests/tar require_hash.phpt 
/php-src/ext/phar/tests/tar/files   Net_URL-1.0.15.tgz 
  Log:
  MFB: fix Bug #48257: PharData throws exception with non-phar tar
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar.c?r1=1.399&r2=1.400&diff_format=u
Index: php-src/ext/phar/phar.c
diff -u php-src/ext/phar/phar.c:1.399 php-src/ext/phar/phar.c:1.400
--- php-src/ext/phar/phar.c:1.399   Fri May  1 09:22:02 2009
+++ php-src/ext/phar/phar.c Wed May 13 20:26:18 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: phar.c,v 1.399 2009/05/01 09:22:02 tony2001 Exp $ */
+/* $Id: phar.c,v 1.400 2009/05/13 20:26:18 cellog Exp $ */
 
 #define PHAR_MAIN 1
 #include "phar_internal.h"
@@ -1345,7 +1345,7 @@
}
 
if (fp) {
-   if (phar_open_from_fp(fp, fname, fname_len, alias, alias_len, 
options, pphar, error TSRMLS_CC) == SUCCESS) {
+   if (phar_open_from_fp(fp, fname, fname_len, alias, alias_len, 
options, pphar, is_data, error TSRMLS_CC) == SUCCESS) {
if ((*pphar)->is_data || !PHAR_G(readonly)) {
(*pphar)->is_writeable = 1;
}
@@ -1519,7 +1519,7 @@
fname_len = strlen(actual);
}
 
-   ret =  phar_open_from_fp(fp, fname, fname_len, alias, alias_len, 
options, pphar, error TSRMLS_CC);
+   ret =  phar_open_from_fp(fp, fname, fname_len, alias, alias_len, 
options, pphar, is_data, error TSRMLS_CC);
 
if (actual) {
efree(actual);
@@ -1563,7 +1563,7 @@
  * that the manifest is proper, then pass it to phar_parse_pharfile().  SUCCESS
  * or FAILURE is returned and pphar is set to a pointer to the phar's manifest
  */
-static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char 
*alias, int alias_len, int options, phar_archive_data** pphar, char **error 
TSRMLS_DC) /* {{{ */
+static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char 
*alias, int alias_len, int options, phar_archive_data** pphar, int is_data, 
char **error TSRMLS_DC) /* {{{ */
 {
const char token[] = "__HALT_COMPILER();";
const char zip_magic[] = "PK\x03\x04";
@@ -1706,7 +1706,7 @@
if (got > 512) {
if (phar_is_tar(pos, fname)) {
php_stream_rewind(fp);
-   return phar_parse_tarfile(fp, fname, 
fname_len, alias, alias_len, pphar, compression, error TSRMLS_CC);
+   return phar_parse_tarfile(fp, fname, 
fname_len, alias, alias_len, pphar, is_data, compression, error TSRMLS_CC);
}
}
}
@@ -2380,7 +2380,7 @@
fname_len = strlen(actual);
}
 
-   ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, 
REPORT_ERRORS, NULL, error TSRMLS_CC);
+   ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, 
REPORT_ERRORS, NULL, 0, error TSRMLS_CC);
 
if (actual) {
efree(actual);
@@ -3635,7 +3635,7 @@
php_info_print_table_header(2, "Phar: PHP Archive support", "enabled");
php_info_print_table_row(2, "Phar EXT version", PHP_PHAR_VERSION);
php_info_print_table_row(2, "Phar API version", PHP_PHAR_API_VERSION);
-   php_info_print_table_row(2, "CVS revision", "$Revision: 1.399 $");
+   php_info_print_table_row(2, "CVS revision", "$Revision: 1.400 $");
php_info_print_table_row(2, "Phar-based phar archives", "enabled");
php_info_print_table_row(2, "Tar-based phar archives", "enabled");
php_info_print_table_row(2, "ZIP-based phar archives", "enabled");
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar_internal.h?r1=1.122&r2=1.123&diff_format=u
Index: php-src/ext/phar/phar_internal.h
diff -u php-src/ext/phar/phar_internal.h:1.122 
php-src/ext/phar/phar_internal.h:1.123
--- php-src/ext/phar/phar_internal.h:1.122  Wed Apr 29 03:24:08 2009
+++ php-src/ext/phar/phar_internal.hWed May 13 20:26:18 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: phar_internal.h,v 1.122 2009/04/29 03:24:08 cellog Exp $ */
+/* $Id: phar_internal.h,v 1.123 2009/05/13 20:26:18 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -633,7 +633,7 @@
 
 /* tar functions in tar.c */
 int phar_is_tar(char *buf, char *fname);
-int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char 
*alias, int alias_len, phar_archive_data** pphar, php_uint32 compression, char 
**error TSRMLS_DC);
+int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char 
*alias, int alias_len, phar_archive_data** pphar, int is_data, php_uint

[PHP-CVS] cvs: php-src /ext/standard http_fopen_wrapper.c

2009-05-14 Thread Greg Beaver
cellog  Thu May 14 13:36:45 2009 UTC

  Modified files:  
/php-src/ext/standard   http_fopen_wrapper.c 
  Log:
  fix potential free of NULL
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/http_fopen_wrapper.c?r1=1.142&r2=1.143&diff_format=u
Index: php-src/ext/standard/http_fopen_wrapper.c
diff -u php-src/ext/standard/http_fopen_wrapper.c:1.142 
php-src/ext/standard/http_fopen_wrapper.c:1.143
--- php-src/ext/standard/http_fopen_wrapper.c:1.142 Tue May  5 00:30:40 2009
+++ php-src/ext/standard/http_fopen_wrapper.c   Thu May 14 13:36:44 2009
@@ -19,7 +19,7 @@
|  Sara Golemon   |
+--+
  */
-/* $Id: http_fopen_wrapper.c,v 1.142 2009/05/05 00:30:40 jani Exp $ */ 
+/* $Id: http_fopen_wrapper.c,v 1.143 2009/05/14 13:36:44 cellog Exp $ */ 
 
 #include "php.h"
 #include "php_globals.h"
@@ -450,7 +450,9 @@
 have_header |= HTTP_HEADER_TYPE;
}
}
-   efree(tmp);
+   if (tmp) {
+   efree(tmp);
+   }
}
 
/* auth header if it was specified */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard http_fopen_wrapper.c

2009-05-14 Thread Greg Beaver
cellog  Thu May 14 13:36:56 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   http_fopen_wrapper.c 
  Log:
  MFH: fix potential free of NULL
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/http_fopen_wrapper.c?r1=1.99.2.12.2.9.2.15&r2=1.99.2.12.2.9.2.16&diff_format=u
Index: php-src/ext/standard/http_fopen_wrapper.c
diff -u php-src/ext/standard/http_fopen_wrapper.c:1.99.2.12.2.9.2.15 
php-src/ext/standard/http_fopen_wrapper.c:1.99.2.12.2.9.2.16
--- php-src/ext/standard/http_fopen_wrapper.c:1.99.2.12.2.9.2.15Tue May 
 5 00:31:56 2009
+++ php-src/ext/standard/http_fopen_wrapper.c   Thu May 14 13:36:56 2009
@@ -19,7 +19,7 @@
|  Sara Golemon   |
+--+
  */
-/* $Id: http_fopen_wrapper.c,v 1.99.2.12.2.9.2.15 2009/05/05 00:31:56 jani Exp 
$ */ 
+/* $Id: http_fopen_wrapper.c,v 1.99.2.12.2.9.2.16 2009/05/14 13:36:56 cellog 
Exp $ */ 
 
 #include "php.h"
 #include "php_globals.h"
@@ -407,7 +407,9 @@
 have_header |= HTTP_HEADER_TYPE;
}
}
-   efree(tmp);
+   if (tmp) {
+   efree(tmp);
+   }
}
 
/* auth header if it was specified */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard http_fopen_wrapper.c

2009-05-14 Thread Greg Beaver
Jani Taskinen wrote:
>
> In the future, please MFH to PHP_5_2 such fixes.
>
> --Jani 

Hi Jani,

5_2 doesn't have this problem, otherwise I would have :)

Greg

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard http_fopen_wrapper.c

2009-05-14 Thread Greg Beaver
Jani Taskinen wrote:
> Greg Beaver kirjoitti:
>> Jani Taskinen wrote:
>>> In the future, please MFH to PHP_5_2 such fixes.
>>>
>>> --Jani 
>>
>> Hi Jani,
>>
>> 5_2 doesn't have this problem, otherwise I would have :)
>
> Considering the fact that the code in this file does not differ at all
> between branches (for that part), of course it does have the problem.
> I already merged it. 

Hi,

Sorry, the problem was that my 5.2 had not been cvs up-ed and so I
thought it was different.  Apologies.

Greg

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/phar/tests/tar tar_nohash.phpt

2009-05-24 Thread Greg Beaver
cellog  Sun May 24 18:47:54 2009 UTC

  Modified files:  
/php-src/ext/phar/tests/tar tar_nohash.phpt 
  Log:
  add missing test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/tar/tar_nohash.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/phar/tests/tar/tar_nohash.phpt
diff -u /dev/null php-src/ext/phar/tests/tar/tar_nohash.phpt:1.2
--- /dev/null   Sun May 24 18:47:54 2009
+++ php-src/ext/phar/tests/tar/tar_nohash.phpt  Sun May 24 18:47:54 2009
@@ -0,0 +1,23 @@
+--TEST--
+Phar: tar archive, require_hash=1, should not error out
+--SKIPIF--
+
+
+
+--INI--
+phar.readonly=1
+phar.require_hash=1
+--FILE--
+getStub());
+} catch (Exception $e) {
+   echo $e->getMessage()."\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+string(0) ""
+===DONE===



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/phar phar_object.c /ext/phar/tests/tar phar_convert_phar4.phpt

2009-05-24 Thread Greg Beaver
cellog  Sun May 24 18:50:38 2009 UTC

  Added files: 
/php-src/ext/phar/tests/tar phar_convert_phar4.phpt 

  Modified files:  
/php-src/ext/phar   phar_object.c 
  Log:
  fix potential segfault when converting phars with metadata to other formats, 
add test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar_object.c?r1=1.297&r2=1.298&diff_format=u
Index: php-src/ext/phar/phar_object.c
diff -u php-src/ext/phar/phar_object.c:1.297 
php-src/ext/phar/phar_object.c:1.298
--- php-src/ext/phar/phar_object.c:1.297Tue May  5 01:42:06 2009
+++ php-src/ext/phar/phar_object.c  Sun May 24 18:50:37 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: phar_object.c,v 1.297 2009/05/05 01:42:06 cellog Exp $ */
+/* $Id: phar_object.c,v 1.298 2009/05/24 18:50:37 cellog Exp $ */
 
 #include "phar_internal.h"
 #include "func_interceptors.h"
@@ -2252,6 +2252,22 @@
phar->is_temporary_alias = source->is_temporary_alias;
phar->alias = source->alias;
 
+   if (source->metadata) {
+   zval *t;
+
+   t = source->metadata;
+   ALLOC_ZVAL(phar->metadata);
+   *phar->metadata = *t;
+   zval_copy_ctor(phar->metadata);
+#if PHP_VERSION_ID < 50300
+   phar->metadata->refcount = 1;
+#else
+   Z_SET_REFCOUNT_P(phar->metadata, 1);
+#endif
+
+   phar->metadata_len = 0;
+   }
+
/* first copy each file's uncompressed contents to a temporary file and 
set per-file flags */
for (zend_hash_internal_pointer_reset(&source->manifest); SUCCESS == 
zend_hash_has_more_elements(&source->manifest); 
zend_hash_move_forward(&source->manifest)) {
 

http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/tar/phar_convert_phar4.phpt?view=markup&rev=1.1
Index: php-src/ext/phar/tests/tar/phar_convert_phar4.phpt
+++ php-src/ext/phar/tests/tar/phar_convert_phar4.phpt
--TEST--
Phar::convertToPhar() with global metadata
--SKIPIF--


--INI--
phar.require_hash=0
phar.readonly=0
--FILE--
setMetadata('hi');
$phar->stopBuffering();
var_dump($phar->isFileFormat(Phar::TAR));
var_dump(strlen($phar->getStub()));
var_dump($phar->getMetadata());

$phar = $phar->convertToExecutable(Phar::TAR);
var_dump($phar->isFileFormat(Phar::TAR));
var_dump($phar->getStub());
var_dump($phar->getMetadata());

$phar['a'] = 'hi there';

$phar = $phar->convertToExecutable(Phar::PHAR, Phar::GZ);
var_dump($phar->isFileFormat(Phar::PHAR));
var_dump($phar->isCompressed());
var_dump(strlen($phar->getStub()));
var_dump($phar->getMetadata());

copy($fname . '.gz', $fname2);

$phar = new Phar($fname2);
var_dump($phar->isFileFormat(Phar::PHAR));
var_dump($phar->isCompressed() == Phar::GZ);
var_dump(strlen($phar->getStub()));
var_dump($phar->getMetadata());

?>
===DONE===
--CLEAN--

--EXPECT--
bool(false)
int(6683)
string(2) "hi"
bool(true)
string(60) "http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/phar phar_object.c /ext/phar/tests/tar phar_convert_phar4.phpt

2009-05-24 Thread Greg Beaver
cellog  Sun May 24 18:50:58 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/phar/tests/tar phar_convert_phar4.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/phar   phar_object.c 
  Log:
  MFH: fix potential segfault when converting phars with metadata to other 
formats, add test
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.608&r2=1.2027.2.547.2.965.2.609&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.608 
php-src/NEWS:1.2027.2.547.2.965.2.609
--- php-src/NEWS:1.2027.2.547.2.965.2.608   Tue May 19 18:32:25 2009
+++ php-src/NEWSSun May 24 18:50:57 2009
@@ -19,6 +19,8 @@
   PDO_PGSQL). (Matteo)
 - Fixed bug #38802 (max_redirects and ignore_errors).
   (patch by datib...@php.net)
+- Fixed potential segfault with converting phars containing metadata to other
+  formats (Greg).
 
 
 07 May 2009, PHP 5.3.0 RC 2
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar_object.c?r1=1.266.2.61&r2=1.266.2.62&diff_format=u
Index: php-src/ext/phar/phar_object.c
diff -u php-src/ext/phar/phar_object.c:1.266.2.61 
php-src/ext/phar/phar_object.c:1.266.2.62
--- php-src/ext/phar/phar_object.c:1.266.2.61   Tue May  5 01:41:51 2009
+++ php-src/ext/phar/phar_object.c  Sun May 24 18:50:58 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: phar_object.c,v 1.266.2.61 2009/05/05 01:41:51 cellog Exp $ */
+/* $Id: phar_object.c,v 1.266.2.62 2009/05/24 18:50:58 cellog Exp $ */
 
 #include "phar_internal.h"
 #include "func_interceptors.h"
@@ -2252,6 +2252,22 @@
phar->is_temporary_alias = source->is_temporary_alias;
phar->alias = source->alias;
 
+   if (source->metadata) {
+   zval *t;
+
+   t = source->metadata;
+   ALLOC_ZVAL(phar->metadata);
+   *phar->metadata = *t;
+   zval_copy_ctor(phar->metadata);
+#if PHP_VERSION_ID < 50300
+   phar->metadata->refcount = 1;
+#else
+   Z_SET_REFCOUNT_P(phar->metadata, 1);
+#endif
+
+   phar->metadata_len = 0;
+   }
+
/* first copy each file's uncompressed contents to a temporary file and 
set per-file flags */
for (zend_hash_internal_pointer_reset(&source->manifest); SUCCESS == 
zend_hash_has_more_elements(&source->manifest); 
zend_hash_move_forward(&source->manifest)) {
 

http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/tar/phar_convert_phar4.phpt?view=markup&rev=1.1
Index: php-src/ext/phar/tests/tar/phar_convert_phar4.phpt
+++ php-src/ext/phar/tests/tar/phar_convert_phar4.phpt
--TEST--
Phar::convertToPhar() with global metadata
--SKIPIF--


--INI--
phar.require_hash=0
phar.readonly=0
--FILE--
setMetadata('hi');
$phar->stopBuffering();
var_dump($phar->isFileFormat(Phar::TAR));
var_dump(strlen($phar->getStub()));
var_dump($phar->getMetadata());

$phar = $phar->convertToExecutable(Phar::TAR);
var_dump($phar->isFileFormat(Phar::TAR));
var_dump($phar->getStub());
var_dump($phar->getMetadata());

$phar['a'] = 'hi there';

$phar = $phar->convertToExecutable(Phar::PHAR, Phar::GZ);
var_dump($phar->isFileFormat(Phar::PHAR));
var_dump($phar->isCompressed());
var_dump(strlen($phar->getStub()));
var_dump($phar->getMetadata());

copy($fname . '.gz', $fname2);

$phar = new Phar($fname2);
var_dump($phar->isFileFormat(Phar::PHAR));
var_dump($phar->isCompressed() == Phar::GZ);
var_dump(strlen($phar->getStub()));
var_dump($phar->getMetadata());

?>
===DONE===
--CLEAN--

--EXPECT--
bool(false)
int(6683)
string(2) "hi"
bool(true)
string(60) "http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/phar tar.c /ext/phar/tests/tar bignames_overflow.phpt /ext/phar/tests/tar/files make.dangerous.tar.php.inc

2009-06-04 Thread Greg Beaver
cellog  Thu Jun  4 19:59:09 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/phar/tests/tar bignames_overflow.phpt 
/php-src/ext/phar/tests/tar/files   make.dangerous.tar.php.inc 

  Modified files:  
/php-srcNEWS 
/php-src/ext/phar   tar.c 
  Log:
  MFPECL: fix security vulnerability in phar's handling of long tar filenames
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.614&r2=1.2027.2.547.2.965.2.615&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.614 
php-src/NEWS:1.2027.2.547.2.965.2.615
--- php-src/NEWS:1.2027.2.547.2.965.2.614   Thu Jun  4 07:01:47 2009
+++ php-src/NEWSThu Jun  4 19:59:09 2009
@@ -23,8 +23,9 @@
   PDO_PGSQL). (Matteo)
 - Fixed bug #38802 (max_redirects and ignore_errors).
   (patch by datib...@php.net)
+- Fixed security vulnerability in phar's handling of long tar filenames. (Greg)
 - Fixed potential segfault with converting phars containing metadata to other
-  formats (Greg).
+  formats. (Greg)
 
 
 07 May 2009, PHP 5.3.0 RC 2
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tar.c?r1=1.55.2.28&r2=1.55.2.29&diff_format=u
Index: php-src/ext/phar/tar.c
diff -u php-src/ext/phar/tar.c:1.55.2.28 php-src/ext/phar/tar.c:1.55.2.29
--- php-src/ext/phar/tar.c:1.55.2.28Wed May 13 20:25:43 2009
+++ php-src/ext/phar/tar.c  Thu Jun  4 19:59:09 2009
@@ -330,16 +330,19 @@
 
if (!old && hdr->prefix[0] != 0) {
char name[256];
+   int i, j;
 
-   strcpy(name, hdr->prefix);
-   /* remove potential buffer overflow */
-   if (hdr->name[99]) {
-   strncat(name, hdr->name, 100);
-   } else {
-   strcat(name, hdr->name);
+   for (i = 0; i < 155; i++) {
+   name[i] = hdr->prefix[i];
+   if (name[i] == '\0') {
+   break;
+   }
+   }
+   for (j = 0; j < 100; j++) {
+   name[i+j] = hdr->name[j];
}
 
-   entry.filename_len = strlen(hdr->prefix) + 100;
+   entry.filename_len = i+j;
 
if (name[entry.filename_len - 1] == '/') {
/* some tar programs store directories with 
trailing slash */
@@ -347,8 +350,16 @@
}
entry.filename = pestrndup(name, entry.filename_len, 
myphar->is_persistent);
} else {
-   entry.filename = pestrdup(hdr->name, 
myphar->is_persistent);
-   entry.filename_len = strlen(entry.filename);
+   int i;
+
+   /* calculate strlen, which can be no longer than 100 */
+   for (i = 0; i < 100; i++) {
+   if (hdr->name[i] == '\0') {
+   break;
+   }
+   }
+   entry.filename_len = i;
+   entry.filename = pestrndup(hdr->name, i, 
myphar->is_persistent);
 
if (entry.filename[entry.filename_len - 1] == '/') {
/* some tar programs store directories with 
trailing slash */

http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/tar/bignames_overflow.phpt?view=markup&rev=1.1
Index: php-src/ext/phar/tests/tar/bignames_overflow.phpt
+++ php-src/ext/phar/tests/tar/bignames_overflow.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/tar/files/make.dangerous.tar.php.inc?view=markup&rev=1.1
Index: php-src/ext/phar/tests/tar/files/make.dangerous.tar.php.inc
+++ php-src/ext/phar/tests/tar/files/make.dangerous.tar.php.inc



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/phar tar.c /ext/phar/tests/tar bignames_overflow.phpt /ext/phar/tests/tar/files make.dangerous.tar.php.inc

2009-06-04 Thread Greg Beaver
cellog  Thu Jun  4 20:00:01 2009 UTC

  Modified files:  
/php-src/ext/phar   tar.c 
/php-src/ext/phar/tests/tar bignames_overflow.phpt 
/php-src/ext/phar/tests/tar/files   make.dangerous.tar.php.inc 
  Log:
  MFPECL: fix security vulnerability in phar's handling of long tar filenames
  http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tar.c?r1=1.68&r2=1.69&diff_format=u
Index: php-src/ext/phar/tar.c
diff -u php-src/ext/phar/tar.c:1.68 php-src/ext/phar/tar.c:1.69
--- php-src/ext/phar/tar.c:1.68 Wed May 13 20:26:18 2009
+++ php-src/ext/phar/tar.c  Thu Jun  4 20:00:01 2009
@@ -330,16 +330,19 @@
 
if (!old && hdr->prefix[0] != 0) {
char name[256];
+   int i, j;
 
-   strcpy(name, hdr->prefix);
-   /* remove potential buffer overflow */
-   if (hdr->name[99]) {
-   strncat(name, hdr->name, 100);
-   } else {
-   strcat(name, hdr->name);
+   for (i = 0; i < 155; i++) {
+   name[i] = hdr->prefix[i];
+   if (name[i] == '\0') {
+   break;
+   }
+   }
+   for (j = 0; j < 100; j++) {
+   name[i+j] = hdr->name[j];
}
 
-   entry.filename_len = strlen(hdr->prefix) + 100;
+   entry.filename_len = i+j;
 
if (name[entry.filename_len - 1] == '/') {
/* some tar programs store directories with 
trailing slash */
@@ -347,8 +350,16 @@
}
entry.filename = pestrndup(name, entry.filename_len, 
myphar->is_persistent);
} else {
-   entry.filename = pestrdup(hdr->name, 
myphar->is_persistent);
-   entry.filename_len = strlen(entry.filename);
+   int i;
+
+   /* calculate strlen, which can be no longer than 100 */
+   for (i = 0; i < 100; i++) {
+   if (hdr->name[i] == '\0') {
+   break;
+   }
+   }
+   entry.filename_len = i;
+   entry.filename = pestrndup(hdr->name, i, 
myphar->is_persistent);
 
if (entry.filename[entry.filename_len - 1] == '/') {
/* some tar programs store directories with 
trailing slash */
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/tar/bignames_overflow.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/phar/tests/tar/bignames_overflow.phpt
diff -u /dev/null php-src/ext/phar/tests/tar/bignames_overflow.phpt:1.2
--- /dev/null   Thu Jun  4 20:00:01 2009
+++ php-src/ext/phar/tests/tar/bignames_overflow.phpt   Thu Jun  4 20:00:01 2009
@@ -0,0 +1,40 @@
+--TEST--
+Phar: tar with huge filenames, buffer overflow
+--SKIPIF--
+
+--INI--
+phar.require_hash=0
+--FILE--
+init();
+$tar->addFile(str_repeat('a', 101), 'hi');
+$tar->addFile(str_repeat('a', 255), 'hi2');
+$tar->close();
+
+$p1 = new PharData($fname);
+foreach ($p1 as $file) {
+   echo $file->getFileName(), "\n";
+}
+echo $p1[str_repeat('a', 101)]->getContent() . "\n";
+echo $p1[str_repeat('a', 255)]->getContent() . "\n";
+
+?>
+===DONE===
+--CLEAN--
+
+--EXPECT--
+a
+aaa
+hi
+hi2
+===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/tar/files/make.dangerous.tar.php.inc?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/phar/tests/tar/files/make.dangerous.tar.php.inc
diff -u /dev/null 
php-src/ext/phar/tests/tar/files/make.dangerous.tar.php.inc:1.2
--- /dev/null   Thu Jun  4 20:00:01 2009
+++ php-src/ext/phar/tests/tar/files/make.dangerous.tar.php.inc Thu Jun  4 
20:00:01 2009
@@ -0,0 +1,170 @@
+compress = $compress;
+if ($compress === 'bz2' && !function_exists('bzopen')) {
+throw new PEAR2_Pyrus_Developer_Creator_Exception(
+'bzip2 extension not available');
+}
+if ($compress === 'zlib' && !function_exists('gzopen')) {
+throw new PEAR2_Pyrus_Developer_Creator_Exception(
+'zlib extension not available');
+}
+$this->path = $path;
+}
+
+/**
+ * save a file inside this package
+ * 
+ * This code is modified from Vincent Lascaux's File_Archive
+ * package, which is licensed

[PHP-CVS] cvs: php-src /ext/phar phar_object.c /ext/phar/tests phar_oo_011.phpt

2009-06-04 Thread Greg Beaver
cellog  Fri Jun  5 04:44:55 2009 UTC

  Modified files:  
/php-src/ext/phar   phar_object.c 
/php-src/ext/phar/tests phar_oo_011.phpt 
  Log:
  fixed isset() on sub-directories (isset('blah') if file 'blah/foo.php' exists)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar_object.c?r1=1.298&r2=1.299&diff_format=u
Index: php-src/ext/phar/phar_object.c
diff -u php-src/ext/phar/phar_object.c:1.298 
php-src/ext/phar/phar_object.c:1.299
--- php-src/ext/phar/phar_object.c:1.298Sun May 24 18:50:37 2009
+++ php-src/ext/phar/phar_object.c  Fri Jun  5 04:44:55 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: phar_object.c,v 1.298 2009/05/24 18:50:37 cellog Exp $ */
+/* $Id: phar_object.c,v 1.299 2009/06/05 04:44:55 cellog Exp $ */
 
 #include "phar_internal.h"
 #include "func_interceptors.h"
@@ -3526,6 +3526,9 @@
}
RETURN_TRUE;
} else {
+   if (zend_hash_exists(&phar_obj->arc.archive->virtual_dirs, 
fname, (uint) fname_len)) {
+   RETURN_TRUE;
+   }
RETURN_FALSE;
}
 }
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/phar_oo_011.phpt?r1=1.8&r2=1.9&diff_format=u
Index: php-src/ext/phar/tests/phar_oo_011.phpt
diff -u php-src/ext/phar/tests/phar_oo_011.phpt:1.8 
php-src/ext/phar/tests/phar_oo_011.phpt:1.9
--- php-src/ext/phar/tests/phar_oo_011.phpt:1.8 Wed Feb 20 13:32:59 2008
+++ php-src/ext/phar/tests/phar_oo_011.phpt Fri Jun  5 04:44:55 2009
@@ -16,9 +16,10 @@
 $phar = new Phar($fname);
 $phar->setInfoClass('SplFileObject');
 
-$phar['f.php'] = 'hi';
-var_dump(isset($phar['f.php']));
-echo $phar['f.php'];
+$phar['hi/f.php'] = 'hi';
+var_dump(isset($phar['hi']));
+var_dump(isset($phar['hi/f.php']));
+echo $phar['hi/f.php'];
 echo "\n";
 
 ?>
@@ -30,5 +31,6 @@
 ?>
 --EXPECT--
 bool(true)
+bool(true)
 hi
 ===DONE===



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/phar phar_object.c /ext/phar/tests phar_oo_011.phpt

2009-06-04 Thread Greg Beaver
cellog  Fri Jun  5 04:46:49 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
/php-src/ext/phar   phar_object.c 
/php-src/ext/phar/tests phar_oo_011.phpt 
  Log:
  MFH: fixed isset() on sub-directories (isset("blah") if file "blah/foo.php" 
exists)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.615&r2=1.2027.2.547.2.965.2.616&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.615 
php-src/NEWS:1.2027.2.547.2.965.2.616
--- php-src/NEWS:1.2027.2.547.2.965.2.615   Thu Jun  4 19:59:09 2009
+++ php-src/NEWSFri Jun  5 04:46:49 2009
@@ -23,6 +23,8 @@
   PDO_PGSQL). (Matteo)
 - Fixed bug #38802 (max_redirects and ignore_errors).
   (patch by datib...@php.net)
+- Fixed isset() on sub-directories (isset("blah") if file "blah/foo.php" 
exists).
+  (Greg)
 - Fixed security vulnerability in phar's handling of long tar filenames. (Greg)
 - Fixed potential segfault with converting phars containing metadata to other
   formats. (Greg)
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar_object.c?r1=1.266.2.62&r2=1.266.2.63&diff_format=u
Index: php-src/ext/phar/phar_object.c
diff -u php-src/ext/phar/phar_object.c:1.266.2.62 
php-src/ext/phar/phar_object.c:1.266.2.63
--- php-src/ext/phar/phar_object.c:1.266.2.62   Sun May 24 18:50:58 2009
+++ php-src/ext/phar/phar_object.c  Fri Jun  5 04:46:49 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: phar_object.c,v 1.266.2.62 2009/05/24 18:50:58 cellog Exp $ */
+/* $Id: phar_object.c,v 1.266.2.63 2009/06/05 04:46:49 cellog Exp $ */
 
 #include "phar_internal.h"
 #include "func_interceptors.h"
@@ -3526,6 +3526,9 @@
}
RETURN_TRUE;
} else {
+   if (zend_hash_exists(&phar_obj->arc.archive->virtual_dirs, 
fname, (uint) fname_len)) {
+   RETURN_TRUE;
+   }
RETURN_FALSE;
}
 }
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/phar_oo_011.phpt?r1=1.8&r2=1.8.2.1&diff_format=u
Index: php-src/ext/phar/tests/phar_oo_011.phpt
diff -u php-src/ext/phar/tests/phar_oo_011.phpt:1.8 
php-src/ext/phar/tests/phar_oo_011.phpt:1.8.2.1
--- php-src/ext/phar/tests/phar_oo_011.phpt:1.8 Wed Feb 20 13:32:59 2008
+++ php-src/ext/phar/tests/phar_oo_011.phpt Fri Jun  5 04:46:49 2009
@@ -16,9 +16,10 @@
 $phar = new Phar($fname);
 $phar->setInfoClass('SplFileObject');
 
-$phar['f.php'] = 'hi';
-var_dump(isset($phar['f.php']));
-echo $phar['f.php'];
+$phar['hi/f.php'] = 'hi';
+var_dump(isset($phar['hi']));
+var_dump(isset($phar['hi/f.php']));
+echo $phar['hi/f.php'];
 echo "\n";
 
 ?>
@@ -30,5 +31,6 @@
 ?>
 --EXPECT--
 bool(true)
+bool(true)
 hi
 ===DONE===



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS

2009-06-11 Thread Greg Beaver
cellog  Thu Jun 11 14:40:43 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
  Log:
  update NEWS about phar.phar on windows
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.622&r2=1.2027.2.547.2.965.2.623&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.622 
php-src/NEWS:1.2027.2.547.2.965.2.623
--- php-src/NEWS:1.2027.2.547.2.965.2.622   Wed Jun 10 18:39:15 2009
+++ php-src/NEWSThu Jun 11 14:40:43 2009
@@ -1,7 +1,7 @@
 PHPNEWS
 |||
 ?? ??? 2009, PHP 5.3.0 RC 4
-
+- Added phar.phar generation for Windows. (Greg)
 
 11 Jun 2009, PHP 5.3.0 RC 3
 - Upgraded bundled sqlite to version 3.6.14.2. (Scott, Ilia)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /win32/build Makefile mkdist.php

2009-06-11 Thread Greg Beaver
cellog  Thu Jun 11 14:43:03 2009 UTC

  Modified files:  
/php-src/win32/buildMakefile mkdist.php 
  Log:
  MFB: add phar.phar generation to windows
  
http://cvs.php.net/viewvc.cgi/php-src/win32/build/Makefile?r1=1.54&r2=1.55&diff_format=u
Index: php-src/win32/build/Makefile
diff -u php-src/win32/build/Makefile:1.54 php-src/win32/build/Makefile:1.55
--- php-src/win32/build/Makefile:1.54   Wed May 27 01:46:27 2009
+++ php-src/win32/build/MakefileThu Jun 11 14:43:03 2009
@@ -14,7 +14,7 @@
 #  | Author: Wez Furlong|
 #  +--+
 #
-# $Id: Makefile,v 1.54 2009/05/27 01:46:27 kalle Exp $
+# $Id: Makefile,v 1.55 2009/06/11 14:43:03 cellog Exp $
 # This is the makefile template for the win32 build
 
 CC="$(CL)"
@@ -128,7 +128,7 @@
-del /f /q 
$(BUILD_DIR)\php-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
-del /f /q 
$(BUILD_DIR)\php-debug-pack-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
-del /f /q 
$(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
-   $(BUILD_DIR)\php.exe -d date.timezone=UTC -n win32/build/mkdist.php 
"$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS) 
$(PHP_EXTRA_DIST_FILES)" "$(PECL_TARGETS) $(PECL_EXTRA_DIST_FILES)" 
"$(SNAPSHOT_TEMPLATE)"
+   $(BUILD_DIR)\php.exe -d date.timezone=UTC -n -dphar.readonly=0 
win32/build/mkdist.php "$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" 
"$(EXT_TARGETS) $(PHP_EXTRA_DIST_FILES)" "$(PECL_TARGETS) 
$(PECL_EXTRA_DIST_FILES)" "$(SNAPSHOT_TEMPLATE)"
cd $(BUILD_DIR)\php-$(PHP_VERSION_STRING)
-$(ZIP) -9 -q -r 
..\php-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
 .
cd ..\..
http://cvs.php.net/viewvc.cgi/php-src/win32/build/mkdist.php?r1=1.24&r2=1.25&diff_format=u
Index: php-src/win32/build/mkdist.php
diff -u php-src/win32/build/mkdist.php:1.24 php-src/win32/build/mkdist.php:1.25
--- php-src/win32/build/mkdist.php:1.24 Wed Jun  3 01:13:37 2009
+++ php-src/win32/build/mkdist.php  Thu Jun 11 14:43:03 2009
@@ -1,4 +1,4 @@
-isDir() || $file == 'phar.php') continue;
+echo 'adding ', $file, "\n";
+$phar[(string) $file] = file_get_contents($path_to_phar.  '/phar/' . 
$file);
+  }
+  $phar->setSignatureAlgorithm(Phar::SHA1);
+  $stub = file($path_to_phar . '/phar/phar.php');
+  unset($stub[0]); // remove hashbang
+  $phar->setStub(implode('', $stub));
+
+  echo "Creating phar.phar.bat\n";
+  file_put_contents($path_to_php . '/phar.phar.bat', "%~dp0php.exe 
%~dp0pharcommand.phar %1 %2 %3 %4 %5 %6 %7 %8 %9\r\n");
+}
+
 if (!is_dir($test_dir)) {
mkdir($test_dir);
 }
@@ -491,4 +512,5 @@
echo "WARNING: you don't have a snapshot template, your dist will not 
be complete\n";
 }
 
+make_phar_dot_phar($dist_dir);
 ?>



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /win32/build Makefile mkdist.php

2009-06-11 Thread Greg Beaver
cellog  Thu Jun 11 14:39:37 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/win32/buildMakefile mkdist.php 
  Log:
  add phar.phar creation on windows
  
http://cvs.php.net/viewvc.cgi/php-src/win32/build/Makefile?r1=1.35.2.1.2.6.2.12&r2=1.35.2.1.2.6.2.13&diff_format=u
Index: php-src/win32/build/Makefile
diff -u php-src/win32/build/Makefile:1.35.2.1.2.6.2.12 
php-src/win32/build/Makefile:1.35.2.1.2.6.2.13
--- php-src/win32/build/Makefile:1.35.2.1.2.6.2.12  Wed May 27 01:46:48 2009
+++ php-src/win32/build/MakefileThu Jun 11 14:39:37 2009
@@ -14,7 +14,7 @@
 #  | Author: Wez Furlong|
 #  +--+
 #
-# $Id: Makefile,v 1.35.2.1.2.6.2.12 2009/05/27 01:46:48 kalle Exp $
+# $Id: Makefile,v 1.35.2.1.2.6.2.13 2009/06/11 14:39:37 cellog Exp $
 # This is the makefile template for the win32 build
 
 CC="$(CL)"
@@ -128,7 +128,7 @@
-del /f /q 
$(BUILD_DIR)\php-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
-del /f /q 
$(BUILD_DIR)\php-debug-pack-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
-del /f /q 
$(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
-   $(BUILD_DIR)\php.exe -d date.timezone=UTC -n win32/build/mkdist.php 
"$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS) 
$(PHP_EXTRA_DIST_FILES)" "$(PECL_TARGETS) $(PECL_EXTRA_DIST_FILES)" 
"$(SNAPSHOT_TEMPLATE)"
+   $(BUILD_DIR)\php.exe -d date.timezone=UTC -n -dphar.readonly=0 
win32/build/mkdist.php "$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" 
"$(EXT_TARGETS) $(PHP_EXTRA_DIST_FILES)" "$(PECL_TARGETS) 
$(PECL_EXTRA_DIST_FILES)" "$(SNAPSHOT_TEMPLATE)"
cd $(BUILD_DIR)\php-$(PHP_VERSION_STRING)
-$(ZIP) -9 -q -r 
..\php-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
 .
cd ..\..
http://cvs.php.net/viewvc.cgi/php-src/win32/build/mkdist.php?r1=1.13.4.1.2.11&r2=1.13.4.1.2.12&diff_format=u
Index: php-src/win32/build/mkdist.php
diff -u php-src/win32/build/mkdist.php:1.13.4.1.2.11 
php-src/win32/build/mkdist.php:1.13.4.1.2.12
--- php-src/win32/build/mkdist.php:1.13.4.1.2.11Wed Jun  3 01:14:58 2009
+++ php-src/win32/build/mkdist.php  Thu Jun 11 14:39:37 2009
@@ -1,4 +1,4 @@
-isDir() || $file == 'phar.php') continue;
+echo 'adding ', $file, "\n";
+$phar[(string) $file] = file_get_contents($path_to_phar.  '/phar/' . 
$file);
+  }
+  $phar->setSignatureAlgorithm(Phar::SHA1);
+  $stub = file($path_to_phar . '/phar/phar.php');
+  unset($stub[0]); // remove hashbang
+  $phar->setStub(implode('', $stub));
+
+  echo "Creating phar.phar.bat\n";
+  file_put_contents($path_to_php . '/phar.phar.bat', "%~dp0php.exe 
%~dp0pharcommand.phar %1 %2 %3 %4 %5 %6 %7 %8 %9\r\n");
+}
+
 if (!is_dir($test_dir)) {
mkdir($test_dir);
 }
@@ -489,4 +510,5 @@
echo "WARNING: you don't have a snapshot template, your dist will not 
be complete\n";
 }
 
+make_phar_dot_phar($dist_dir);
 ?>



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS

2009-06-13 Thread Greg Beaver
cellog  Sat Jun 13 16:43:05 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
  Log:
  fix criminally unclear NEWS entry by me
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.624&r2=1.2027.2.547.2.965.2.625&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.624 
php-src/NEWS:1.2027.2.547.2.965.2.625
--- php-src/NEWS:1.2027.2.547.2.965.2.624   Fri Jun 12 01:05:25 2009
+++ php-src/NEWSSat Jun 13 16:43:04 2009
@@ -35,8 +35,8 @@
   (Kanwaljeet Singla, Venkat Raman Don, Pierre)
 - Fixed bug #38802 (max_redirects and ignore_errors).
   (patch by datib...@php.net)
-- Fixed isset() on sub-directories (isset("blah") if file "blah/foo.php"
-  exists). (Greg)
+- Fixed isset() on phar sub-directories (isset($phar["blah"]) if
+  file "blah/foo.php" exists in the phar archive). (Greg)
 - Fixed security vulnerability in phar's handling of long tar filenames. (Greg)
 - Fixed potential segfault with converting phars containing metadata to other
   formats. (Greg)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/spl php_spl.c /ext/spl/tests spl_autoload_bug48541.phpt

2009-06-13 Thread Greg Beaver
cellog  Sat Jun 13 17:28:35 2009 UTC

  Added files: 
/php-src/ext/spl/tests  spl_autoload_bug48541.phpt 

  Modified files:  
/php-src/ext/splphp_spl.c 
  Log:
  fix Bug #48541: spl_autoload_register only registers first closure, then 
leaks the others
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.158&r2=1.159&diff_format=u
Index: php-src/ext/spl/php_spl.c
diff -u php-src/ext/spl/php_spl.c:1.158 php-src/ext/spl/php_spl.c:1.159
--- php-src/ext/spl/php_spl.c:1.158 Tue Jun  9 01:57:57 2009
+++ php-src/ext/spl/php_spl.c   Sat Jun 13 17:28:35 2009
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_spl.c,v 1.158 2009/06/09 01:57:57 scottmac Exp $ */
+/* $Id: php_spl.c,v 1.159 2009/06/13 17:28:35 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -503,8 +503,24 @@
alfi.func_ptr = fcc.function_handler;
obj_ptr = fcc.object_ptr;
if (Z_TYPE_P(zcallable) == IS_OBJECT) {
+   zstr lc_name;
+
+   size_t func_name_len = Z_UNISIZE(zfunc_name);
+
alfi.closure = zcallable;
Z_ADDREF_P(zcallable);
+
+   lc_name.v = Z_UNIVAL(zfunc_name).v = 
erealloc(Z_UNIVAL(zfunc_name).v, func_name_len + 2 + 
sizeof(zcallable->value.obj.handle));
+   memcpy(lc_name.s + func_name_len, 
&(zcallable->value.obj.handle), sizeof(zcallable->value.obj.handle));
+   func_name_len += sizeof(zcallable->value.obj.handle);
+   if (Z_TYPE(zfunc_name) == IS_UNICODE) {
+   func_name_len /= sizeof(UChar);
+   Z_STRLEN(zfunc_name) = func_name_len;
+   lc_name.u[func_name_len] = 0;
+   } else {
+   Z_STRLEN(zfunc_name) = func_name_len;
+   lc_name.s[func_name_len] = '\0';
+   }
}
if (error) {
efree(error);
@@ -512,6 +528,9 @@

zend_u_str_tolower(Z_TYPE(zfunc_name), Z_UNIVAL(zfunc_name), 
Z_UNILEN(zfunc_name));
if (SPL_G(autoload_functions) && 
zend_u_hash_exists(SPL_G(autoload_functions), Z_TYPE(zfunc_name), 
Z_UNIVAL(zfunc_name), Z_UNILEN(zfunc_name)+1)) {
+   if (alfi.closure) {
+   Z_DELREF_P(zcallable);
+   }
goto skip;
}
 

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/spl_autoload_bug48541.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/spl_autoload_bug48541.phpt
+++ php-src/ext/spl/tests/spl_autoload_bug48541.phpt
--TEST--
SPL: spl_autoload_register() Bug #48541: registering multiple closures fails 
with memleaks
--FILE--

===DONE===
--EXPECT--
a called
b called
foo
===DONE===


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/spl php_spl.c /ext/spl/tests spl_autoload_bug48541.phpt

2009-06-13 Thread Greg Beaver
cellog  Sat Jun 13 17:30:50 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/spl/tests  spl_autoload_bug48541.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/splphp_spl.c 
  Log:
  fix Bug #48541: spl_autoload_register only registers first closure, then 
leaks the others.  Fix missing erealloc in fix for bug #40091 (PHP_5_3 only)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.625&r2=1.2027.2.547.2.965.2.626&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.625 
php-src/NEWS:1.2027.2.547.2.965.2.626
--- php-src/NEWS:1.2027.2.547.2.965.2.625   Sat Jun 13 16:43:04 2009
+++ php-src/NEWSSat Jun 13 17:30:49 2009
@@ -3,8 +3,12 @@
 ?? ??? 2009, PHP 5.3.0 RC 4
 - Added phar.phar generation for Windows. (Greg)
 
+- Fixed bug #48541 (spl_autoload_register only registers first closure, then
+  leaks the others). (Greg)
 - Fixed bug #48533 (__callStatic is not invoked for private/protected methods).
   (Felipe)
+- Fixed missing erealloc() in fix for Bug #40091 in spl_autoload_register.
+  (Greg)
 
 11 Jun 2009, PHP 5.3.0 RC 3
 - Upgraded bundled sqlite to version 3.6.14.2. (Scott, Ilia)
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.17.2.37&r2=1.52.2.28.2.17.2.38&diff_format=u
Index: php-src/ext/spl/php_spl.c
diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.37 
php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.38
--- php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.37   Tue Jun  9 01:58:07 2009
+++ php-src/ext/spl/php_spl.c   Sat Jun 13 17:30:50 2009
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_spl.c,v 1.52.2.28.2.17.2.37 2009/06/09 01:58:07 scottmac Exp $ */
+/* $Id: php_spl.c,v 1.52.2.28.2.17.2.38 2009/06/13 17:30:50 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -497,10 +497,6 @@
alfi.ce = fcc.calling_scope;
alfi.func_ptr = fcc.function_handler;
obj_ptr = fcc.object_ptr;
-   if (Z_TYPE_P(zcallable) == IS_OBJECT) {
-   alfi.closure = zcallable;
-   Z_ADDREF_P(zcallable);
-   }
if (error) {
efree(error);
}
@@ -509,12 +505,27 @@
zend_str_tolower_copy(lc_name, func_name, func_name_len);
efree(func_name);
 
+   if (Z_TYPE_P(zcallable) == IS_OBJECT) {
+   alfi.closure = zcallable;
+   Z_ADDREF_P(zcallable);
+
+   lc_name = erealloc(lc_name, func_name_len + 2 + 
sizeof(zcallable->value.obj.handle));
+   memcpy(lc_name + func_name_len, 
&(zcallable->value.obj.handle),
+   sizeof(zcallable->value.obj.handle));
+   func_name_len += sizeof(zcallable->value.obj.handle);
+   lc_name[func_name_len] = '\0';
+   }
+
if (SPL_G(autoload_functions) && 
zend_hash_exists(SPL_G(autoload_functions), (char*)lc_name, func_name_len+1)) {
+   if (alfi.closure) {
+   Z_DELREF_P(zcallable);
+   }
goto skip;
}
 
if (obj_ptr && !(alfi.func_ptr->common.fn_flags & 
ZEND_ACC_STATIC)) {
/* add object id to the hash to ensure uniqueness, for 
more reference look at bug #40091 */
+   lc_name = erealloc(lc_name, func_name_len + 2 + 
sizeof(zend_object_handle));
memcpy(lc_name + func_name_len, 
&Z_OBJ_HANDLE_P(obj_ptr), sizeof(zend_object_handle));
func_name_len += sizeof(zend_object_handle);
lc_name[func_name_len] = '\0';

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/spl_autoload_bug48541.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/spl_autoload_bug48541.phpt
+++ php-src/ext/spl/tests/spl_autoload_bug48541.phpt
--TEST--
SPL: spl_autoload_register() Bug #48541: registering multiple closures fails 
with memleaks
--FILE--

===DONE===
--EXPECT--
a called
b called
foo
===DONE===


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS

2009-06-13 Thread Greg Beaver
cellog  Sat Jun 13 17:34:22 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
  Log:
  remove missing erealloc entry that will go in php 5.2 NEWS
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.626&r2=1.2027.2.547.2.965.2.627&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.626 
php-src/NEWS:1.2027.2.547.2.965.2.627
--- php-src/NEWS:1.2027.2.547.2.965.2.626   Sat Jun 13 17:30:49 2009
+++ php-src/NEWSSat Jun 13 17:34:21 2009
@@ -7,8 +7,6 @@
   leaks the others). (Greg)
 - Fixed bug #48533 (__callStatic is not invoked for private/protected methods).
   (Felipe)
-- Fixed missing erealloc() in fix for Bug #40091 in spl_autoload_register.
-  (Greg)
 
 11 Jun 2009, PHP 5.3.0 RC 3
 - Upgraded bundled sqlite to version 3.6.14.2. (Scott, Ilia)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/spl php_spl.c

2009-06-13 Thread Greg Beaver
cellog  Sat Jun 13 17:35:38 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/splphp_spl.c 
  Log:
  fix missing erealloc in fix for bug #40091, spl_autoload_register of more 
than 1 copy of the same method in different objects
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1555&r2=1.2027.2.547.2.1556&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1555 php-src/NEWS:1.2027.2.547.2.1556
--- php-src/NEWS:1.2027.2.547.2.1555Fri Jun 12 20:50:58 2009
+++ php-src/NEWSSat Jun 13 17:35:37 2009
@@ -3,6 +3,8 @@
 ?? Jun 2009, PHP 5.2.10
 - Fixed bug #48514 (cURL extension uses same resource name for simple and
   multi APIs). (Felipe)
+- Fixed missing erealloc() in fix for Bug #40091 in spl_autoload_register.
+  (Greg)
 
 11 Jun 2009, PHP 5.2.10RC2
 - Updated timezone database to version 2009.9 (2009i) (Derick)
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.20&r2=1.52.2.28.2.21&diff_format=u
Index: php-src/ext/spl/php_spl.c
diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.20 
php-src/ext/spl/php_spl.c:1.52.2.28.2.21
--- php-src/ext/spl/php_spl.c:1.52.2.28.2.20Wed Dec 31 11:17:43 2008
+++ php-src/ext/spl/php_spl.c   Sat Jun 13 17:35:37 2009
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_spl.c,v 1.52.2.28.2.20 2008/12/31 11:17:43 sebastian Exp $ */
+/* $Id: php_spl.c,v 1.52.2.28.2.21 2009/06/13 17:35:37 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
#include "config.h"
@@ -464,6 +464,7 @@
 
if (obj_ptr && !(alfi.func_ptr->common.fn_flags & 
ZEND_ACC_STATIC)) {
/* add object id to the hash to ensure uniqueness, for 
more reference look at bug #40091 */
+   lc_name = erealloc(lc_name, func_name_len + 2 + 
sizeof(zend_object_handle));
memcpy(lc_name + func_name_len, 
&Z_OBJ_HANDLE_PP(obj_ptr), sizeof(zend_object_handle));
func_name_len += sizeof(zend_object_handle);
lc_name[func_name_len] = '\0';



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar/tests phar_oo_010.phpt

2009-06-18 Thread Greg Beaver
cellog  Thu Jun 18 18:12:04 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/phar/tests phar_oo_010.phpt 
  Log:
  fix EXPECT section of test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/phar_oo_010.phpt?r1=1.7&r2=1.7.2.1&diff_format=u
Index: php-src/ext/phar/tests/phar_oo_010.phpt
diff -u php-src/ext/phar/tests/phar_oo_010.phpt:1.7 
php-src/ext/phar/tests/phar_oo_010.phpt:1.7.2.1
--- php-src/ext/phar/tests/phar_oo_010.phpt:1.7 Wed Feb 20 13:32:59 2008
+++ php-src/ext/phar/tests/phar_oo_010.phpt Thu Jun 18 18:12:04 2009
@@ -46,10 +46,10 @@
 bool(true)
 bool(true)
 ===DIR===
-bool(false)
+bool(true)
 ===NA===
 bool(false)
 bool(false)
 bool(false)
-bool(false)
+bool(true)
 ===DONE===



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/phar/tests phar_oo_010.phpt

2009-06-18 Thread Greg Beaver
cellog  Thu Jun 18 18:12:11 2009 UTC

  Modified files:  
/php-src/ext/phar/tests phar_oo_010.phpt 
  Log:
  fix EXPECT section of test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/phar_oo_010.phpt?r1=1.7&r2=1.8&diff_format=u
Index: php-src/ext/phar/tests/phar_oo_010.phpt
diff -u php-src/ext/phar/tests/phar_oo_010.phpt:1.7 
php-src/ext/phar/tests/phar_oo_010.phpt:1.8
--- php-src/ext/phar/tests/phar_oo_010.phpt:1.7 Wed Feb 20 13:32:59 2008
+++ php-src/ext/phar/tests/phar_oo_010.phpt Thu Jun 18 18:12:10 2009
@@ -46,10 +46,10 @@
 bool(true)
 bool(true)
 ===DIR===
-bool(false)
+bool(true)
 ===NA===
 bool(false)
 bool(false)
 bool(false)
-bool(false)
+bool(true)
 ===DONE===



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/phar/phar pharcommand.inc

2009-06-24 Thread Greg Beaver
cellog  Wed Jun 24 22:12:47 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
/php-src/ext/phar/phar  pharcommand.inc 
  Log:
  fix slightly unclear error message in generation of phar.phar
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.647&r2=1.2027.2.547.2.965.2.648&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.647 
php-src/NEWS:1.2027.2.547.2.965.2.648
--- php-src/NEWS:1.2027.2.547.2.965.2.647   Wed Jun 24 17:43:09 2009
+++ php-src/NEWSWed Jun 24 22:12:47 2009
@@ -1,6 +1,7 @@
 PHPNEWS
 |||
 ?? ??? 2009, PHP 5.3.0 RC 5
+- Fixed slightly unclear message in generation of phar.phar. (Greg+others)
 - Fixed memory leak in json_decode() when depth is less than 0. (Felipe)
 
 - Fixed bug #48643 (String functions memory issue). (Dmitry)
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar/pharcommand.inc?r1=1.49.2.15&r2=1.49.2.16&diff_format=u
Index: php-src/ext/phar/phar/pharcommand.inc
diff -u php-src/ext/phar/phar/pharcommand.inc:1.49.2.15 
php-src/ext/phar/phar/pharcommand.inc:1.49.2.16
--- php-src/ext/phar/phar/pharcommand.inc:1.49.2.15 Thu Jun  4 12:22:32 2009
+++ php-src/ext/phar/phar/pharcommand.inc   Wed Jun 24 22:12:47 2009
@@ -210,16 +210,28 @@
 */
static function cli_arg_typ_loader($arg, $cfg, $key)
{
-   if (($arg == '0' || $arg == '1') && !file_exists($arg)) {
+   if (($arg == '0' || $arg == '1') && !file_exists($arg) && 
substr(PHP_OS, 0, 3) != 'WIN') {
$found = NULL;
-   $apiver = `pear -q info PHP_Archive 2>/dev/null|grep 
'API Version'`;
-   $apiver = trim(substr($apiver, strlen('API Version')));
+   $apiver = false;
+   $path = explode(PATH_SEPARATOR, $_ENV['PATH']);
+   $pear = false;
+   foreach ($path as $component) {
+   if (file_exists($component . 
DIRECTORY_SEPARATOR . 'pear')
+   && is_executable($component . 
DIRECTORY_SEPARATOR . 'pear')) {
+   $pear = true;
+   break;
+   }
+   }
+   if ($pear) {
+   $apiver = `pear -q info PHP_Archive 
2>/dev/null|grep 'API Version'`;
+   $apiver = trim(substr($apiver, strlen('API 
Version')));
+   }
if ($apiver) {
-   self::notice("Pear package PHP_Archive: API 
Version: $apiver.\n");
+   self::notice("PEAR package PHP_Archive: API 
Version: $apiver.\n");
$files  = explode("\n", `pear list-files 
PHP_Archive`);
$phpdir = `pear config-get php_dir 2>/dev/null`;
$phpdir = trim($phpdir);
-   self::notice("Pear package PHP_Archive: 
$phpdir.\n");
+   self::notice("PEAR package PHP_Archive: 
$phpdir.\n");
if (is_dir($phpdir)) {
foreach($files as $ent) {
$matches = NULL;
@@ -234,13 +246,13 @@
}
}
} else {
-   self::notice("Pear package PHP_Archive: 
corrupt or inaccessible base dir: $php_dir.\n");
+   self::notice("PEAR package PHP_Archive: 
corrupt or inaccessible base dir: $php_dir.\n");
}
}
if (isset($found)) {
-   self::notice("Pear package PHP_Archive: 
$found.\n");
+   self::notice("PEAR package PHP_Archive: 
$found.\n");
} else {
-   $msg = "Pear package PHP_Archive or Archive.php 
class file not found.\n";
+   $msg = "PEAR package PHP_Archive not installed: 
generated phar will require PHP's phar extension be enabled.\n";
if ($arg == '0') {
self::notice($msg);
} else {
@@ -1554,7 +1566,7 @@
$use_ext = extension_loaded('phar');
$version = array(
'PHP Version' => phpversion(),
-   'phar.phar version' => '$Revision: 1.49.2.15 $',
+   'phar.phar version' => '$Revision: 1.49.2.16 $'

[PHP-CVS] cvs: php-src /ext/phar tar.c /ext/phar/phar pharcommand.inc /ext/phar/tests/tar tar_openssl_hash.phpt /ext/phar/tests/tar/files P1-1.0.0.tgz P1-1.0.0.tgz.pubkey

2009-06-24 Thread Greg Beaver
cellog  Wed Jun 24 22:19:47 2009 UTC

  Added files: 
/php-src/ext/phar/tests/tar tar_openssl_hash.phpt 
/php-src/ext/phar/tests/tar/files   P1-1.0.0.tgz P1-1.0.0.tgz.pubkey 

  Modified files:  
/php-src/ext/phar   tar.c 
/php-src/ext/phar/phar  pharcommand.inc 
  Log:
  fix Bug #48681: openssl signature verification for tar archives broken in 
ext/phar, merge small fixes to phar.phar generation from PHP_5_3
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tar.c?r1=1.69&r2=1.70&diff_format=u
Index: php-src/ext/phar/tar.c
diff -u php-src/ext/phar/tar.c:1.69 php-src/ext/phar/tar.c:1.70
--- php-src/ext/phar/tar.c:1.69 Thu Jun  4 20:00:01 2009
+++ php-src/ext/phar/tar.c  Wed Jun 24 22:19:46 2009
@@ -255,6 +255,8 @@
phar_tar_number(hdr->size, sizeof(hdr->size));
 
if (((!old && hdr->prefix[0] == 0) || old) && strlen(hdr->name) 
== sizeof(".phar/signature.bin")-1 && !strncmp(hdr->name, 
".phar/signature.bin", sizeof(".phar/signature.bin")-1)) {
+   off_t curloc;
+
if (size > 511) {
if (error) {
spprintf(error, 4096, "phar error: 
tar-based phar \"%s\" has signature that is larger than 511 bytes, cannot 
process", fname);
@@ -264,6 +266,7 @@
phar_destroy_phar_data(myphar TSRMLS_CC);
return FAILURE;
}
+   curloc = php_stream_tell(fp);
read = php_stream_read(fp, buf, size);
if (read != size) {
if (error) {
@@ -280,7 +283,7 @@
 #else
 # define PHAR_GET_32(buffer) (php_uint32) *(buffer)
 #endif
-   if (FAILURE == phar_verify_signature(fp, 
php_stream_tell(fp) - size - 512, PHAR_GET_32(buf), buf + 8, PHAR_GET_32(buf + 
4), fname, &myphar->signature, &myphar->sig_len, error TSRMLS_CC)) {
+   if (FAILURE == phar_verify_signature(fp, 
php_stream_tell(fp) - size - 512, PHAR_GET_32(buf), buf + 8, size - 8, fname, 
&myphar->signature, &myphar->sig_len, error TSRMLS_CC)) {
if (error) {
char *save = *error;
spprintf(error, 4096, "phar error: 
tar-based phar \"%s\" signature cannot be verified: %s", fname, save);
@@ -288,11 +291,11 @@
}
goto bail;
}
+   php_stream_seek(fp, curloc + 512, SEEK_SET);
/* signature checked out, let's ensure this is the last 
file in the phar */
-   size = ((size+511)&~511) + 512;
if (((hdr->typeflag == '\0') || (hdr->typeflag == 
TAR_FILE)) && size > 0) {
/* this is not good enough - seek succeeds even 
on truncated tars */
-   php_stream_seek(fp, size, SEEK_CUR);
+   php_stream_seek(fp, 512, SEEK_CUR);
if ((uint)php_stream_tell(fp) > totalsize) {
if (error) {
spprintf(error, 4096, "phar 
error: \"%s\" is a corrupted tar file (truncated)", fname);
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar/pharcommand.inc?r1=1.54&r2=1.55&diff_format=u
Index: php-src/ext/phar/phar/pharcommand.inc
diff -u php-src/ext/phar/phar/pharcommand.inc:1.54 
php-src/ext/phar/phar/pharcommand.inc:1.55
--- php-src/ext/phar/phar/pharcommand.inc:1.54  Thu Jun  4 12:21:59 2009
+++ php-src/ext/phar/phar/pharcommand.inc   Wed Jun 24 22:19:47 2009
@@ -210,16 +210,28 @@
 */
static function cli_arg_typ_loader($arg, $cfg, $key)
{
-   if (($arg == '0' || $arg == '1') && !file_exists($arg)) {
+   if (($arg == '0' || $arg == '1') && !file_exists($arg) && 
substr(PHP_OS, 0, 3) != 'WIN') {
$found = NULL;
-   $apiver = `pear -q info PHP_Archive 2>/dev/null|grep 
'API Version'`;
-   $apiver = trim(substr($apiver, strlen('API Version')));
+   $apiver = false;
+   $path = explode(PATH_SEPARATOR, $_ENV['PATH']);
+   $pear = false;
+   foreach ($path as $component) {
+   if (file_exists($component . 
DIRECTORY_SEPARATOR . 'pear')
+   && is_executable($component . 
DIRECTORY_SEPARATOR . 'pear'))) {
+   $pear = true;
+   break;
+   }
+   }
+   if ($pear) {
+   $apiver = `pear -q info PHP_Archive 
2

Re: [PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/phar/phar pharcommand.inc

2009-06-25 Thread Greg Beaver
Lukas Kahwe Smith wrote:
> 
> On 25.06.2009, at 00:12, Greg Beaver wrote:
> 
>> cellogWed Jun 24 22:12:47 2009 UTC
>>
>>  Modified files:  (Branch: PHP_5_3)
>>/php-srcNEWS
>>/php-src/ext/phar/pharpharcommand.inc
>>  Log:
>>  fix slightly unclear error message in generation of phar.phar
> 
> 
> This doesnt need to be merged to HEAD?

Hi,

It was merged to HEAD here http://news.php.net/php.cvs/58971

Thanks,
Greg

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/phar tar.c /ext/phar/tests/tar tar_openssl_hash.phpt /ext/phar/tests/tar/files P1-1.0.0.tgz P1-1.0.0.tgz.pubkey

2009-06-30 Thread Greg Beaver
cellog  Tue Jun 30 14:49:12 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/phar/tests/tar tar_openssl_hash.phpt 
/php-src/ext/phar/tests/tar/files   P1-1.0.0.tgz P1-1.0.0.tgz.pubkey 

  Modified files:  
/php-srcNEWS 
/php-src/ext/phar   tar.c 
  Log:
  fixed bug #48681 (openssl signature verification for tar archives broken)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.657&r2=1.2027.2.547.2.965.2.658&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.657 
php-src/NEWS:1.2027.2.547.2.965.2.658
--- php-src/NEWS:1.2027.2.547.2.965.2.657   Tue Jun 30 11:39:15 2009
+++ php-src/NEWSTue Jun 30 14:49:11 2009
@@ -2,6 +2,8 @@
 |||
 ?? ??? 2009, PHP 5.3.1
 
+- Fixed bug #48681 (openssl signature verification for tar archives broken).
+  (Greg)
 - Fixed bug #38091 (Mail() does not use FQDN when sending SMTP helo). 
   (Kalle, Rick Yorgason)
 
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tar.c?r1=1.55.2.29&r2=1.55.2.30&diff_format=u
Index: php-src/ext/phar/tar.c
diff -u php-src/ext/phar/tar.c:1.55.2.29 php-src/ext/phar/tar.c:1.55.2.30
--- php-src/ext/phar/tar.c:1.55.2.29Thu Jun  4 19:59:09 2009
+++ php-src/ext/phar/tar.c  Tue Jun 30 14:49:12 2009
@@ -255,6 +255,8 @@
phar_tar_number(hdr->size, sizeof(hdr->size));
 
if (((!old && hdr->prefix[0] == 0) || old) && strlen(hdr->name) 
== sizeof(".phar/signature.bin")-1 && !strncmp(hdr->name, 
".phar/signature.bin", sizeof(".phar/signature.bin")-1)) {
+   off_t curloc;
+
if (size > 511) {
if (error) {
spprintf(error, 4096, "phar error: 
tar-based phar \"%s\" has signature that is larger than 511 bytes, cannot 
process", fname);
@@ -264,6 +266,7 @@
phar_destroy_phar_data(myphar TSRMLS_CC);
return FAILURE;
}
+   curloc = php_stream_tell(fp);
read = php_stream_read(fp, buf, size);
if (read != size) {
if (error) {
@@ -280,7 +283,7 @@
 #else
 # define PHAR_GET_32(buffer) (php_uint32) *(buffer)
 #endif
-   if (FAILURE == phar_verify_signature(fp, 
php_stream_tell(fp) - size - 512, PHAR_GET_32(buf), buf + 8, PHAR_GET_32(buf + 
4), fname, &myphar->signature, &myphar->sig_len, error TSRMLS_CC)) {
+   if (FAILURE == phar_verify_signature(fp, 
php_stream_tell(fp) - size - 512, PHAR_GET_32(buf), buf + 8, size - 8, fname, 
&myphar->signature, &myphar->sig_len, error TSRMLS_CC)) {
if (error) {
char *save = *error;
spprintf(error, 4096, "phar error: 
tar-based phar \"%s\" signature cannot be verified: %s", fname, save);
@@ -288,11 +291,11 @@
}
goto bail;
}
+   php_stream_seek(fp, curloc + 512, SEEK_SET);
/* signature checked out, let's ensure this is the last 
file in the phar */
-   size = ((size+511)&~511) + 512;
if (((hdr->typeflag == '\0') || (hdr->typeflag == 
TAR_FILE)) && size > 0) {
/* this is not good enough - seek succeeds even 
on truncated tars */
-   php_stream_seek(fp, size, SEEK_CUR);
+   php_stream_seek(fp, 512, SEEK_CUR);
if ((uint)php_stream_tell(fp) > totalsize) {
if (error) {
spprintf(error, 4096, "phar 
error: \"%s\" is a corrupted tar file (truncated)", fname);

http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/tar/tar_openssl_hash.phpt?view=markup&rev=1.1
Index: php-src/ext/phar/tests/tar/tar_openssl_hash.phpt
+++ php-src/ext/phar/tests/tar/tar_openssl_hash.phpt
--TEST--
Phar: tar archive, require_hash=1, OpenSSL hash
--SKIPIF--




--INI--
phar.readonly=1
phar.require_hash=1
--FILE--
getMessage()."\n";
}

?>
===DONE===
--EXPECT--
===DONE===

http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/tar/files/P1-1.0.0.tgz.pubkey?view=markup&rev=1.1
Index: php-src/ext/phar/tests/tar/files/P1-1.0.0.tgz.pubkey
+++ php-src/ext/phar/tests/tar/files/P1-1.0.0.tgz.pubkey
-BEGIN PUBLIC KEY-
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4drcwddPs6LmIbdT1ifT
Ev8HXh1Fk1yNusCDoCX6mYkgqvCmx02F/9k5q7n6CPblTcF5mdDI8kcRrUHmyXtD
9X0d7RN7BakZMPH5KPaNkXiXsI9YGSb39AnZgYw01n6u0W6Ohha+KwOsrxkKCF4u
LjPLQAlM+3uD8y9Tz2fF+pAE901kHrd3ue7a5i5EtW0bzl5QfxnwFZXAO0StQ9dF
slzibRH+1pFjMRxDnlgYmLQF6jMWm9Ty6x9UH9HZ3E3F9QZEQVXWT9

[PHP-CVS] svn: p ecl/phar/trunk/tar.c ecl/phar/trunk/tests/tar/bignames.phpt hp/php-src/branches/PHP_5_3/NEWS hp/php-src/branches/PHP_5_3/ext/phar/tar.c hp/php-src/branches/PHP_5_3/ext/phar/tests/tar/

2009-07-22 Thread Greg Beaver
cellog   Wed, 22 Jul 2009 18:13:38 +

Revision: http://svn.php.net/viewvc?view=revision&revision=284618

Log:
fix php bug #49018 (phar tar stores long filenames with prefix/name reversed)

Bug: http://pecl.php.net/bugs/49018 (unknown) 
  
Changed paths:
U   pecl/phar/trunk/tar.c
U   pecl/phar/trunk/tests/tar/bignames.phpt
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/phar/tar.c
U   php/php-src/branches/PHP_5_3/ext/phar/tests/tar/bignames.phpt
U   php/php-src/trunk/ext/phar/tar.c
U   php/php-src/trunk/ext/phar/tests/tar/bignames.phpt

Modified: pecl/phar/trunk/tar.c
===
--- pecl/phar/trunk/tar.c   2009-07-22 16:10:00 UTC (rev 284617)
+++ pecl/phar/trunk/tar.c   2009-07-22 18:13:38 UTC (rev 284618)
@@ -2,7 +2,7 @@
   +--+
   | TAR archive support for Phar |
   +--+
-  | Copyright (c) 2005-2008 The PHP Group|
+  | Copyright (c) 2005-2009 The PHP Group|
   +--+
   | This source file is subject to version 3.01 of the PHP license,  |
   | that is bundled with this package in the file LICENSE, and is|
@@ -39,7 +39,7 @@

 /* adapted from format_octal() in libarchive
  *
- * Copyright (c) 2003-2008 Tim Kientzle
+ * Copyright (c) 2003-2009 Tim Kientzle
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -343,6 +343,9 @@
}
for (j = 0; j < 100; j++) {
name[i+j] = hdr->name[j];
+   if (name[i+j] == '\0') {
+   break;
+   }
}

entry.filename_len = i+j;
@@ -644,8 +647,8 @@
}
return ZEND_HASH_APPLY_STOP;
}
-   memcpy(header.prefix, entry->filename+100, entry->filename_len 
- 100);
-   memcpy(header.name, entry->filename, 100);
+   memcpy(header.prefix, entry->filename, entry->filename_len - 
100);
+   memcpy(header.name, entry->filename + (entry->filename_len - 
100), 100);
} else {
memcpy(header.name, entry->filename, entry->filename_len);
}

Modified: pecl/phar/trunk/tests/tar/bignames.phpt
===
--- pecl/phar/trunk/tests/tar/bignames.phpt 2009-07-22 16:10:00 UTC (rev 
284617)
+++ pecl/phar/trunk/tests/tar/bignames.phpt 2009-07-22 18:13:38 UTC (rev 
284618)
@@ -11,11 +11,11 @@
 $pname = 'phar://' . $fname;

 $p1 = new PharData($fname);
-$p1[str_repeat('a', 101)] = 'hi';
+$p1[str_repeat('a', 100) . 'b'] = 'hi';
 $p1[str_repeat('a', 255)] = 'hi2';
 copy($fname, $fname2);
 $p2 = new PharData($fname2);
-echo $p2[str_repeat('a', 101)]->getContent() . "\n";
+echo $p2[str_repeat('a', 100) . 'b']->getContent() . "\n";
 echo $p2[str_repeat('a', 255)]->getContent() . "\n";

 try {

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2009-07-22 16:10:00 UTC (rev 284617)
+++ php/php-src/branches/PHP_5_3/NEWS   2009-07-22 18:13:38 UTC (rev 284618)
@@ -6,6 +6,8 @@
 - Fixed open_basedir circumvention for mail.log. (Maksymilian Arciemowicz,
   Stas)

+- Fixed bug #49018 (phar tar stores long filenames wit prefix/name reversed).
+  (Greg)
 - Fixed bug #48962 (cURL does not upload files with specified filename).
   (Ilia)
 - Fixed bug #48929 (Double \r\n after HTTP headers when "header" context

Modified: php/php-src/branches/PHP_5_3/ext/phar/tar.c
===
--- php/php-src/branches/PHP_5_3/ext/phar/tar.c 2009-07-22 16:10:00 UTC (rev 
284617)
+++ php/php-src/branches/PHP_5_3/ext/phar/tar.c 2009-07-22 18:13:38 UTC (rev 
284618)
@@ -343,6 +343,9 @@
}
for (j = 0; j < 100; j++) {
name[i+j] = hdr->name[j];
+   if (name[i+j] == '\0') {
+   break;
+   }
}

entry.filename_len = i+j;
@@ -644,8 +647,8 @@
}
return ZEND_HASH_APPLY_STOP;
}
-   memcpy(header.prefix, entry->filename+100, entry->filename_len 
- 100);
-   memcpy(header.name, entry->filename, 100);
+   memcpy(header.prefix, entry->filename, entry->filename_len - 
1

[PHP-CVS] svn: p ecl/phar/trunk/tar.c ecl/phar/trunk/tests/tar/bignames.phpt hp/php-src/branches/PHP_5_3/NEWS hp/php-src/branches/PHP_5_3/ext/phar/tar.c hp/php-src/branches/PHP_5_3/ext/phar/tests/tar/

2009-07-22 Thread Greg Beaver
cellog   Wed, 22 Jul 2009 18:13:38 +

Revision: http://svn.php.net/viewvc?view=revision&revision=284618

Log:
fix php bug #49018 (phar tar stores long filenames with prefix/name reversed)

Bug: http://bugs.php.net/49018 (unknown) 
  
Changed paths:
U   pecl/phar/trunk/tar.c
U   pecl/phar/trunk/tests/tar/bignames.phpt
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/phar/tar.c
U   php/php-src/branches/PHP_5_3/ext/phar/tests/tar/bignames.phpt
U   php/php-src/trunk/ext/phar/tar.c
U   php/php-src/trunk/ext/phar/tests/tar/bignames.phpt

Modified: pecl/phar/trunk/tar.c
===
--- pecl/phar/trunk/tar.c   2009-07-22 16:10:00 UTC (rev 284617)
+++ pecl/phar/trunk/tar.c   2009-07-22 18:13:38 UTC (rev 284618)
@@ -2,7 +2,7 @@
   +--+
   | TAR archive support for Phar |
   +--+
-  | Copyright (c) 2005-2008 The PHP Group|
+  | Copyright (c) 2005-2009 The PHP Group|
   +--+
   | This source file is subject to version 3.01 of the PHP license,  |
   | that is bundled with this package in the file LICENSE, and is|
@@ -39,7 +39,7 @@

 /* adapted from format_octal() in libarchive
  *
- * Copyright (c) 2003-2008 Tim Kientzle
+ * Copyright (c) 2003-2009 Tim Kientzle
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -343,6 +343,9 @@
}
for (j = 0; j < 100; j++) {
name[i+j] = hdr->name[j];
+   if (name[i+j] == '\0') {
+   break;
+   }
}

entry.filename_len = i+j;
@@ -644,8 +647,8 @@
}
return ZEND_HASH_APPLY_STOP;
}
-   memcpy(header.prefix, entry->filename+100, entry->filename_len 
- 100);
-   memcpy(header.name, entry->filename, 100);
+   memcpy(header.prefix, entry->filename, entry->filename_len - 
100);
+   memcpy(header.name, entry->filename + (entry->filename_len - 
100), 100);
} else {
memcpy(header.name, entry->filename, entry->filename_len);
}

Modified: pecl/phar/trunk/tests/tar/bignames.phpt
===
--- pecl/phar/trunk/tests/tar/bignames.phpt 2009-07-22 16:10:00 UTC (rev 
284617)
+++ pecl/phar/trunk/tests/tar/bignames.phpt 2009-07-22 18:13:38 UTC (rev 
284618)
@@ -11,11 +11,11 @@
 $pname = 'phar://' . $fname;

 $p1 = new PharData($fname);
-$p1[str_repeat('a', 101)] = 'hi';
+$p1[str_repeat('a', 100) . 'b'] = 'hi';
 $p1[str_repeat('a', 255)] = 'hi2';
 copy($fname, $fname2);
 $p2 = new PharData($fname2);
-echo $p2[str_repeat('a', 101)]->getContent() . "\n";
+echo $p2[str_repeat('a', 100) . 'b']->getContent() . "\n";
 echo $p2[str_repeat('a', 255)]->getContent() . "\n";

 try {

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2009-07-22 16:10:00 UTC (rev 284617)
+++ php/php-src/branches/PHP_5_3/NEWS   2009-07-22 18:13:38 UTC (rev 284618)
@@ -6,6 +6,8 @@
 - Fixed open_basedir circumvention for mail.log. (Maksymilian Arciemowicz,
   Stas)

+- Fixed bug #49018 (phar tar stores long filenames wit prefix/name reversed).
+  (Greg)
 - Fixed bug #48962 (cURL does not upload files with specified filename).
   (Ilia)
 - Fixed bug #48929 (Double \r\n after HTTP headers when "header" context

Modified: php/php-src/branches/PHP_5_3/ext/phar/tar.c
===
--- php/php-src/branches/PHP_5_3/ext/phar/tar.c 2009-07-22 16:10:00 UTC (rev 
284617)
+++ php/php-src/branches/PHP_5_3/ext/phar/tar.c 2009-07-22 18:13:38 UTC (rev 
284618)
@@ -343,6 +343,9 @@
}
for (j = 0; j < 100; j++) {
name[i+j] = hdr->name[j];
+   if (name[i+j] == '\0') {
+   break;
+   }
}

entry.filename_len = i+j;
@@ -644,8 +647,8 @@
}
return ZEND_HASH_APPLY_STOP;
}
-   memcpy(header.prefix, entry->filename+100, entry->filename_len 
- 100);
-   memcpy(header.name, entry->filename, 100);
+   memcpy(header.prefix, entry->filename, entry->filename_len - 
100);

[PHP-CVS] svn: p ecl/phar/trunk/tar.c ecl/phar/trunk/tests/tar/bignames.phpt hp/php-src/branches/PHP_5_3/NEWS hp/php-src/branches/PHP_5_3/ext/phar/tar.c hp/php-src/branches/PHP_5_3/ext/phar/tests/tar/

2009-07-22 Thread Greg Beaver
cellog   Wed, 22 Jul 2009 18:13:38 +

Revision: http://svn.php.net/viewvc?view=revision&revision=284618

Log:
fix php bug #49018 (phar tar stores long filenames with prefix/name reversed)

Bug: http://bugs.php.net/49018 (Closed) phar tar stores long filenames with 
prefix/name reversed
  
Changed paths:
U   pecl/phar/trunk/tar.c
U   pecl/phar/trunk/tests/tar/bignames.phpt
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/phar/tar.c
U   php/php-src/branches/PHP_5_3/ext/phar/tests/tar/bignames.phpt
U   php/php-src/trunk/ext/phar/tar.c
U   php/php-src/trunk/ext/phar/tests/tar/bignames.phpt

Modified: pecl/phar/trunk/tar.c
===
--- pecl/phar/trunk/tar.c   2009-07-22 16:10:00 UTC (rev 284617)
+++ pecl/phar/trunk/tar.c   2009-07-22 18:13:38 UTC (rev 284618)
@@ -2,7 +2,7 @@
   +--+
   | TAR archive support for Phar |
   +--+
-  | Copyright (c) 2005-2008 The PHP Group|
+  | Copyright (c) 2005-2009 The PHP Group|
   +--+
   | This source file is subject to version 3.01 of the PHP license,  |
   | that is bundled with this package in the file LICENSE, and is|
@@ -39,7 +39,7 @@

 /* adapted from format_octal() in libarchive
  *
- * Copyright (c) 2003-2008 Tim Kientzle
+ * Copyright (c) 2003-2009 Tim Kientzle
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -343,6 +343,9 @@
}
for (j = 0; j < 100; j++) {
name[i+j] = hdr->name[j];
+   if (name[i+j] == '\0') {
+   break;
+   }
}

entry.filename_len = i+j;
@@ -644,8 +647,8 @@
}
return ZEND_HASH_APPLY_STOP;
}
-   memcpy(header.prefix, entry->filename+100, entry->filename_len 
- 100);
-   memcpy(header.name, entry->filename, 100);
+   memcpy(header.prefix, entry->filename, entry->filename_len - 
100);
+   memcpy(header.name, entry->filename + (entry->filename_len - 
100), 100);
} else {
memcpy(header.name, entry->filename, entry->filename_len);
}

Modified: pecl/phar/trunk/tests/tar/bignames.phpt
===
--- pecl/phar/trunk/tests/tar/bignames.phpt 2009-07-22 16:10:00 UTC (rev 
284617)
+++ pecl/phar/trunk/tests/tar/bignames.phpt 2009-07-22 18:13:38 UTC (rev 
284618)
@@ -11,11 +11,11 @@
 $pname = 'phar://' . $fname;

 $p1 = new PharData($fname);
-$p1[str_repeat('a', 101)] = 'hi';
+$p1[str_repeat('a', 100) . 'b'] = 'hi';
 $p1[str_repeat('a', 255)] = 'hi2';
 copy($fname, $fname2);
 $p2 = new PharData($fname2);
-echo $p2[str_repeat('a', 101)]->getContent() . "\n";
+echo $p2[str_repeat('a', 100) . 'b']->getContent() . "\n";
 echo $p2[str_repeat('a', 255)]->getContent() . "\n";

 try {

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2009-07-22 16:10:00 UTC (rev 284617)
+++ php/php-src/branches/PHP_5_3/NEWS   2009-07-22 18:13:38 UTC (rev 284618)
@@ -6,6 +6,8 @@
 - Fixed open_basedir circumvention for mail.log. (Maksymilian Arciemowicz,
   Stas)

+- Fixed bug #49018 (phar tar stores long filenames wit prefix/name reversed).
+  (Greg)
 - Fixed bug #48962 (cURL does not upload files with specified filename).
   (Ilia)
 - Fixed bug #48929 (Double \r\n after HTTP headers when "header" context

Modified: php/php-src/branches/PHP_5_3/ext/phar/tar.c
===
--- php/php-src/branches/PHP_5_3/ext/phar/tar.c 2009-07-22 16:10:00 UTC (rev 
284617)
+++ php/php-src/branches/PHP_5_3/ext/phar/tar.c 2009-07-22 18:13:38 UTC (rev 
284618)
@@ -343,6 +343,9 @@
}
for (j = 0; j < 100; j++) {
name[i+j] = hdr->name[j];
+   if (name[i+j] == '\0') {
+   break;
+   }
}

entry.filename_len = i+j;
@@ -644,8 +647,8 @@
}
return ZEND_HASH_APPLY_STOP;
}
-   memcpy(header.prefix, entry->filename+100, entry->filename_len 
- 100);
-   memcpy(header.name, entry->filename, 100);
+   memcpy(heade

  1   2   3   4   5   >