[PHP-CVS-DAILY] cvs: php-src / ChangeLog

2007-06-21 Thread changelog
changelog   Fri Jun 22 01:31:19 2007 UTC

  Modified files:  
/php-srcChangeLog 
  Log:
  ChangeLog update
  
http://cvs.php.net/viewvc.cgi/php-src/ChangeLog?r1=1.2726r2=1.2727diff_format=u
Index: php-src/ChangeLog
diff -u php-src/ChangeLog:1.2726 php-src/ChangeLog:1.2727
--- php-src/ChangeLog:1.2726Thu Jun 21 01:31:20 2007
+++ php-src/ChangeLog   Fri Jun 22 01:31:19 2007
@@ -1,3 +1,54 @@
+2007-06-21  Raghubansh Kumar  [EMAIL PROTECTED]
+
+* ext/standard/tests/file/filesize_variation-win32.phpt
+  ext/standard/tests/file/filesize_variation.phpt
+  ext/standard/tests/file/lstat_stat_basic.phpt
+  ext/standard/tests/file/lstat_stat_error.phpt
+  ext/standard/tests/file/rename_variation-win32.phpt
+  ext/standard/tests/file/rename_variation.phpt
+  ext/standard/tests/file/stat_basic-win32.phpt
+  ext/standard/tests/file/stat_error-win32.phpt:
+  New tests for file system handling functions
+
+* ext/standard/tests/file/filesize_variation-win32.phpt
+  ext/standard/tests/file/filesize_variation-win32.phpt
+  ext/standard/tests/file/filesize_variation.phpt
+  ext/standard/tests/file/filesize_variation.phpt
+  ext/standard/tests/file/lstat_stat_basic.phpt
+  ext/standard/tests/file/lstat_stat_basic.phpt
+  ext/standard/tests/file/lstat_stat_error.phpt
+  ext/standard/tests/file/lstat_stat_error.phpt
+  ext/standard/tests/file/rename_variation-win32.phpt
+  ext/standard/tests/file/rename_variation-win32.phpt
+  ext/standard/tests/file/rename_variation.phpt
+  ext/standard/tests/file/rename_variation.phpt
+  ext/standard/tests/file/stat_basic-win32.phpt
+  ext/standard/tests/file/stat_basic-win32.phpt
+  ext/standard/tests/file/stat_error-win32.phpt
+  ext/standard/tests/file/stat_error-win32.phpt:
+  
+  file filesize_variation-win32.phpt was initially added on branch PHP_5_2.
+
+* ext/standard/tests/file/file.inc
+  ext/standard/tests/file/file.inc:
+  New functons to compare stat array
+
+2007-06-21  Dmitry Stogov  [EMAIL PROTECTED]
+
+* ext/standard/php_fopen_wrapper.c
+  ext/standard/php_fopen_wrapper.c:
+  Proper fix for bug #39215 Inappropriate close of stdin/stdout/stderr
+
+* php.ini-dist
+  php.ini-dist
+  php.ini-recommended
+  php.ini-recommended:
+  Fixed default values
+
+* sapi/cgi/cgi_main.c
+  sapi/cgi/cgi_main.c:
+  no need to return exit status of the last fastcgi request
+
 2007-06-20  Ilia Alshanetsky  [EMAIL PROTECTED]
 
 * (PHP_5_2)


[PHP-CVS] cvs: php-src(PHP_5_2) /sapi/cgi cgi_main.c

2007-06-21 Thread Dmitry Stogov
dmitry  Thu Jun 21 08:40:43 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/sapi/cgi   cgi_main.c 
  Log:
  no need to return exit status of the last fastcgi request
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15.2.41r2=1.267.2.15.2.42diff_format=u
Index: php-src/sapi/cgi/cgi_main.c
diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.41 
php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.42
--- php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.41 Mon Jun  4 15:38:12 2007
+++ php-src/sapi/cgi/cgi_main.c Thu Jun 21 08:40:43 2007
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: cgi_main.c,v 1.267.2.15.2.41 2007/06/04 15:38:12 tony2001 Exp $ */
+/* $Id: cgi_main.c,v 1.267.2.15.2.42 2007/06/21 08:40:43 dmitry Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -1834,6 +1834,10 @@
if (bindpath) {
free(bindpath);
}
+   if (max_requests != 1) {
+   /* no need to return exit_status of the 
last request */
+   exit_status = 0;
+   }
break;
}
/* end of fastcgi loop */

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



[PHP-CVS] cvs: php-src /sapi/cgi cgi_main.c

2007-06-21 Thread Dmitry Stogov
dmitry  Thu Jun 21 08:40:56 2007 UTC

  Modified files:  
/php-src/sapi/cgi   cgi_main.c 
  Log:
  no need to return exit status of the last fastcgi request
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.325r2=1.326diff_format=u
Index: php-src/sapi/cgi/cgi_main.c
diff -u php-src/sapi/cgi/cgi_main.c:1.325 php-src/sapi/cgi/cgi_main.c:1.326
--- php-src/sapi/cgi/cgi_main.c:1.325   Mon Jun  4 15:37:38 2007
+++ php-src/sapi/cgi/cgi_main.c Thu Jun 21 08:40:56 2007
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: cgi_main.c,v 1.325 2007/06/04 15:37:38 tony2001 Exp $ */
+/* $Id: cgi_main.c,v 1.326 2007/06/21 08:40:56 dmitry Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -1748,6 +1748,10 @@
if (bindpath) {
free(bindpath);
}
+   if (max_requests != 1) {
+   /* no need to return exit_status of the 
last request */
+   exit_status = 0;
+   }
break;
}
/* end of fastcgi loop */

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



[PHP-CVS] cvs: php-src / php.ini-dist php.ini-recommended

2007-06-21 Thread Dmitry Stogov
dmitry  Thu Jun 21 09:01:57 2007 UTC

  Modified files:  
/php-srcphp.ini-dist php.ini-recommended 
  Log:
  Fixed default values
  
  
http://cvs.php.net/viewvc.cgi/php-src/php.ini-dist?r1=1.265r2=1.266diff_format=u
Index: php-src/php.ini-dist
diff -u php-src/php.ini-dist:1.265 php-src/php.ini-dist:1.266
--- php-src/php.ini-dist:1.265  Sun May 27 18:04:32 2007
+++ php-src/php.ini-distThu Jun 21 09:01:57 2007
@@ -425,7 +425,7 @@
 ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not 
grok
 ; what PATH_INFO is.  For more information on PATH_INFO, see the cgi specs.  
Setting
 ; this to 1 will cause PHP CGI to fix it's paths to conform to the spec.  A 
setting
-; of zero causes PHP to behave as before.  Default is zero.  You should fix 
your scripts
+; of zero causes PHP to behave as before.  Default is 1.  You should fix your 
scripts
 ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
 ; cgi.fix_pathinfo=0
 
http://cvs.php.net/viewvc.cgi/php-src/php.ini-recommended?r1=1.215r2=1.216diff_format=u
Index: php-src/php.ini-recommended
diff -u php-src/php.ini-recommended:1.215 php-src/php.ini-recommended:1.216
--- php-src/php.ini-recommended:1.215   Sun May 27 18:04:32 2007
+++ php-src/php.ini-recommended Thu Jun 21 09:01:57 2007
@@ -460,7 +460,7 @@
 ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not 
grok
 ; what PATH_INFO is.  For more information on PATH_INFO, see the cgi specs.  
Setting
 ; this to 1 will cause PHP CGI to fix it's paths to conform to the spec.  A 
setting
-; of zero causes PHP to behave as before.  Default is zero.  You should fix 
your scripts
+; of zero causes PHP to behave as before.  Default is 1.  You should fix your 
scripts
 ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
 ; cgi.fix_pathinfo=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) / php.ini-dist php.ini-recommended

2007-06-21 Thread Dmitry Stogov
dmitry  Thu Jun 21 09:02:21 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcphp.ini-dist php.ini-recommended 
  Log:
  Fixed default values
  
  
http://cvs.php.net/viewvc.cgi/php-src/php.ini-dist?r1=1.231.2.10.2.19r2=1.231.2.10.2.20diff_format=u
Index: php-src/php.ini-dist
diff -u php-src/php.ini-dist:1.231.2.10.2.19 
php-src/php.ini-dist:1.231.2.10.2.20
--- php-src/php.ini-dist:1.231.2.10.2.19Sun May 27 18:04:10 2007
+++ php-src/php.ini-distThu Jun 21 09:02:21 2007
@@ -500,7 +500,7 @@
 ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not 
grok
 ; what PATH_INFO is.  For more information on PATH_INFO, see the cgi specs.  
Setting
 ; this to 1 will cause PHP CGI to fix it's paths to conform to the spec.  A 
setting
-; of zero causes PHP to behave as before.  Default is zero.  You should fix 
your scripts
+; of zero causes PHP to behave as before.  Default is 1.  You should fix your 
scripts
 ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
 ; cgi.fix_pathinfo=0
 
http://cvs.php.net/viewvc.cgi/php-src/php.ini-recommended?r1=1.179.2.11.2.20r2=1.179.2.11.2.21diff_format=u
Index: php-src/php.ini-recommended
diff -u php-src/php.ini-recommended:1.179.2.11.2.20 
php-src/php.ini-recommended:1.179.2.11.2.21
--- php-src/php.ini-recommended:1.179.2.11.2.20 Sun May 27 18:04:10 2007
+++ php-src/php.ini-recommended Thu Jun 21 09:02:21 2007
@@ -548,7 +548,7 @@
 ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not 
grok
 ; what PATH_INFO is.  For more information on PATH_INFO, see the cgi specs.  
Setting
 ; this to 1 will cause PHP CGI to fix it's paths to conform to the spec.  A 
setting
-; of zero causes PHP to behave as before.  Default is zero.  You should fix 
your scripts
+; of zero causes PHP to behave as before.  Default is 1.  You should fix your 
scripts
 ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
 ; cgi.fix_pathinfo=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) /ext/standard php_fopen_wrapper.c

2007-06-21 Thread Dmitry Stogov
dmitry  Thu Jun 21 12:42:36 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   php_fopen_wrapper.c 
  Log:
  Proper fix for bug #39215 Inappropriate close of stdin/stdout/stderr 
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/php_fopen_wrapper.c?r1=1.45.2.4.2.6r2=1.45.2.4.2.7diff_format=u
Index: php-src/ext/standard/php_fopen_wrapper.c
diff -u php-src/ext/standard/php_fopen_wrapper.c:1.45.2.4.2.6 
php-src/ext/standard/php_fopen_wrapper.c:1.45.2.4.2.7
--- php-src/ext/standard/php_fopen_wrapper.c:1.45.2.4.2.6   Mon Jan  1 
09:36:08 2007
+++ php-src/ext/standard/php_fopen_wrapper.cThu Jun 21 12:42:36 2007
@@ -17,7 +17,7 @@
|  Hartmut Holzgraefe [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_fopen_wrapper.c,v 1.45.2.4.2.6 2007/01/01 09:36:08 sebastian Exp $ 
*/
+/* $Id: php_fopen_wrapper.c,v 1.45.2.4.2.7 2007/06/21 12:42:36 dmitry Exp $ */
 
 #include stdio.h
 #include stdlib.h
@@ -159,6 +159,7 @@
php_stream * stream = NULL;
char *p, *token, *pathdup;
long max_memory;
+   FILE *file = NULL;
 
if (!strncasecmp(path, php://, 6)) {
path += 6;
@@ -210,6 +211,7 @@
fd = dup(fd);
} else {
cli_in = 1;
+   file = stdin;
}
} else {
fd = dup(STDIN_FILENO);
@@ -222,6 +224,7 @@
fd = dup(fd);
} else {
cli_out = 1;
+   file = stdout;
}
} else {
fd = dup(STDOUT_FILENO);
@@ -234,6 +237,7 @@
fd = dup(fd);
} else {
cli_err = 1;
+   file = stderr;
}
} else {
fd = dup(STDERR_FILENO);
@@ -285,10 +289,14 @@
/* failed to dup */
return NULL;
}
-   
-   stream = php_stream_fopen_from_fd(fd, mode, NULL);
-   if (stream == NULL) {
-   close(fd);
+
+   if (file) {
+   stream = php_stream_fopen_from_file(file, mode);
+   } else {
+   stream = php_stream_fopen_from_fd(fd, mode, NULL);
+   if (stream == NULL) {
+   close(fd);
+   }
}
  
return stream;

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



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

2007-06-21 Thread Dmitry Stogov
dmitry  Thu Jun 21 12:42:58 2007 UTC

  Modified files:  
/php-src/ext/standard   php_fopen_wrapper.c 
  Log:
  Proper fix for bug #39215 Inappropriate close of stdin/stdout/stderr
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/php_fopen_wrapper.c?r1=1.59r2=1.60diff_format=u
Index: php-src/ext/standard/php_fopen_wrapper.c
diff -u php-src/ext/standard/php_fopen_wrapper.c:1.59 
php-src/ext/standard/php_fopen_wrapper.c:1.60
--- php-src/ext/standard/php_fopen_wrapper.c:1.59   Wed Jan 24 21:43:47 2007
+++ php-src/ext/standard/php_fopen_wrapper.cThu Jun 21 12:42:58 2007
@@ -17,7 +17,7 @@
|  Hartmut Holzgraefe [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_fopen_wrapper.c,v 1.59 2007/01/24 21:43:47 pollita Exp $ */
+/* $Id: php_fopen_wrapper.c,v 1.60 2007/06/21 12:42:58 dmitry Exp $ */
 
 #include stdio.h
 #include stdlib.h
@@ -159,6 +159,7 @@
php_stream * stream = NULL;
char *p, *token, *pathdup;
long max_memory;
+   FILE *file = NULL;
 
if (!strncasecmp(path, php://, 6)) {
path += 6;
@@ -212,6 +213,7 @@
fd = dup(fd);
} else {
cli_in = 1;
+   file = stdin;
}
} else {
fd = dup(STDIN_FILENO);
@@ -224,6 +226,7 @@
fd = dup(fd);
} else {
cli_out = 1;
+   file = stdout;
}
} else {
fd = dup(STDOUT_FILENO);
@@ -236,6 +239,7 @@
fd = dup(fd);
} else {
cli_err = 1;
+   file = stderr;
}
} else {
fd = dup(STDERR_FILENO);
@@ -287,10 +291,14 @@
/* failed to dup */
return NULL;
}
-   
-   stream = php_stream_fopen_from_fd(fd, mode, NULL);
-   if (stream == NULL) {
-   close(fd);
+
+   if (file) {
+   stream = php_stream_fopen_from_file(file, mode);
+   } else {
+   stream = php_stream_fopen_from_fd(fd, mode, NULL);
+   if (stream == NULL) {
+   close(fd);
+   }
}
  
return stream;

-- 
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/standard/tests/file file.inc

2007-06-21 Thread Raghubansh Kumar
kraghubaThu Jun 21 21:06:47 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard/tests/filefile.inc 
  Log:
  New functons to compare stat array
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/file.inc?r1=1.1.2.3r2=1.1.2.4diff_format=u
Index: php-src/ext/standard/tests/file/file.inc
diff -u php-src/ext/standard/tests/file/file.inc:1.1.2.3 
php-src/ext/standard/tests/file/file.inc:1.1.2.4
--- php-src/ext/standard/tests/file/file.inc:1.1.2.3Wed Jun  6 12:53:17 2007
+++ php-src/ext/standard/tests/file/file.incThu Jun 21 21:06:47 2007
@@ -6,8 +6,13 @@
create_links() : crate links of different types
delete_links() : delete links 
fill_files()   : fill file with specified contents 
-   change_file_perms : Change permission of files 
+   change_file_perms() : Change permission of files 
fill_buffer()  : fills buffer with specified contents
+   compare_self_stat() : compares the first 13 elements of the 
+stat with the corresponding named key values of
+the same stat.
+   compare_stats() : Compares two stat values
+
 */ 
 
 define('file_not_found', 2, 1);
@@ -514,3 +519,113 @@
 }
 
 
+
+/*
+ Prototype:
+  function compare_self_stat( array $stat );
+ Description:
+  Compares the each of the first 13 values of the stat array with the 
+  corresponding next 13 values of the same stat for equality
+  $stat = stat array
+
+ Retuns: true when all of them match, false otherwise
+*/
+function compare_self_stat( array $stat )
+{
+  //return value
+  $return_value = true;
+
+  // named keys present in a stat
+  $string_keys = array(dev, ino, mode, nlink, uid, gid, 
+   rdev, size, atime, mtime, ctime,
+   blksize, blocks);
+
+  // first numeric key
+  $key = 0;
+
+  // compare the values in the stat, which are accessed using numeric key with
+  // values accessed using string keys
+  foreach($string_keys as $str_key)
+  {
+if($stat[$key] != $stat[$str_key]) {
+  echo stat[$key] doesn't match with stat[$str_key]\n;
+  $flag = false;
+  $key++;
+}
+else {
+  $key++;
+}
+  } // end of foreach
+
+  return $return_value;
+}// end of compare_self_stat
+
+/*
+Prototype:
+  function compare_stats( array $stat1, array $stat2, array $fields, 
+  [string $op = ==, [ bool $flag = false] ]);
+Description:
+  Compares two stat values, stat value should be obtained by stat/lstat
+  $stat1 = first stat array
+  $stat2 = second stat array
+  $op = type of the comparision to be perform between elements of stat1 and 
stat2
+!= compare for not equal
+== comprae for equality
+  if each element of stat1 is  than stat2
+  if each element of stat1 is  than stat2
+  $fields = contains the key of the elements that needs to be compared. 
+type of the comparision is based on $op argument value
+  $flag = specify true to dump the stat1 and stat2 
+*/
+
+$all_stat_keys = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, dev, ino, 
mode, nlink, uid, gid, rdev, size, atime, mtime, ctime, 
blksize, blocks);
+
+function compare_stats($stat1, $stat2, $fields, $op = ==, $flag = false ) {
+  // dump the stat if requested
+  if ( $flag == true ) {
+var_dump($stat1);
+var_dump($stat2);
+  }
+
+  $result = true;
+
+  // compare values of given key from each stat array 
+  for($index = 0; $index  count($fields); $index++) 
+  {
+switch( $op )
+{
+   case ==:
+ if ( $stat1[ $fields[$index] ] != $stat2[ $fields[$index] ] ) {
+   $result = false;
+   echo stat1 do not match with stat2 at key value: 
$fields[$index]\n;
+ }
+ break;
+
+   case !=:
+ if ( $stat1[ $fields[$index] ] != $stat2[ $fields[$index] ] ) {
+   // do nothing as its not equal, else will take care of if equal
+ } else {
+   $result = false;
+   echo stat1 equals stat2 at key value: $fields[$index]\n;
+ }
+ break;
+
+   case :
+ if ( $stat1[ $fields[$index] ] = $stat2[ $fields[$index] ] ) {
+   $result = false;
+   echo stat1 is not greater than stat2 at key value: 
$fields[$index]\n;
+ }
+ break;
+
+   case :
+ if ( $stat1[ $fields[$index] ] = $stat2[ $fields[$index] ] ) {
+   $result = false;
+   echo stat1 is not lesser than stat2 at key value: 
$fields[$index]\n;
+ }
+ break;
+}
+  }
+  return $result;
+}
+
+?

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



[PHP-CVS] cvs: php-src /ext/standard/tests/file file.inc

2007-06-21 Thread Raghubansh Kumar
kraghubaThu Jun 21 21:08:38 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/filefile.inc 
  Log:
  New functons to compare stat array
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/file.inc?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/standard/tests/file/file.inc
diff -u php-src/ext/standard/tests/file/file.inc:1.4 
php-src/ext/standard/tests/file/file.inc:1.5
--- php-src/ext/standard/tests/file/file.inc:1.4Wed Jun  6 12:48:13 2007
+++ php-src/ext/standard/tests/file/file.incThu Jun 21 21:08:38 2007
@@ -6,8 +6,12 @@
create_links() : crate links of different types
delete_links() : delete links 
fill_files()   : fill file with specified contents 
-   change_file_perms : Change permission of files 
-   fill_buffer: fill buffer with specified contents
+   change_file_perms() : Change permission of files 
+   fill_buffer(): fill buffer with specified contents
+   compare_self_stat() : compares the first 13 elements of the 
+ stat with the corresponding named key values of 
+ the same stat. 
+   compare_stats() : Compares two stat values
 
 */ 
 
@@ -515,3 +519,113 @@
 }
 
 
+
+/*
+ Prototype:
+  function compare_self_stat( array $stat );
+ Description:
+  Compares the each of the first 13 values of the stat array with the 
+  corresponding next 13 values of the same stat for equality
+  $stat = stat array
+
+ Retuns: true when all of them match, false otherwise
+*/
+function compare_self_stat( array $stat )
+{
+  //return value
+  $return_value = true;
+
+  // named keys present in a stat
+  $string_keys = array(dev, ino, mode, nlink, uid, gid, 
+   rdev, size, atime, mtime, ctime,
+   blksize, blocks);
+
+  // first numeric key
+  $key = 0;
+
+  // compare the values in the stat, which are accessed using numeric key with
+  // values accessed using string keys
+  foreach($string_keys as $str_key)
+  {
+if($stat[$key] != $stat[$str_key]) {
+  echo stat[$key] doesn't match with stat[$str_key]\n;
+  $flag = false;
+  $key++;
+}
+else {
+  $key++;
+}
+  } // end of foreach
+
+  return $return_value;
+}// end of compare_self_stat
+
+/*
+Prototype:
+  function compare_stats( array $stat1, array $stat2, array $fields, 
+  [string $op = ==, [ bool $flag = false] ]);
+Description:
+  Compares two stat values, stat value should be obtained by stat/lstat
+  $stat1 = first stat array
+  $stat2 = second stat array
+  $op = type of the comparision to be perform between elements of stat1 and 
stat2
+!= compare for not equal
+== comprae for equality
+  if each element of stat1 is  than stat2
+  if each element of stat1 is  than stat2
+  $fields = contains the key of the elements that needs to be compared. 
+type of the comparision is based on $op argument value
+  $flag = specify true to dump the stat1 and stat2 
+*/
+
+$all_stat_keys = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, dev, ino, 
mode, nlink, uid, gid, rdev, size, atime, mtime, ctime, 
blksize, blocks);
+
+function compare_stats($stat1, $stat2, $fields, $op = ==, $flag = false ) {
+  // dump the stat if requested
+  if ( $flag == true ) {
+var_dump($stat1);
+var_dump($stat2);
+  }
+
+  $result = true;
+
+  // compare values of given key from each stat array 
+  for($index = 0; $index  count($fields); $index++) 
+  {
+switch( $op )
+{
+   case ==:
+ if ( $stat1[ $fields[$index] ] != $stat2[ $fields[$index] ] ) {
+   $result = false;
+   echo stat1 do not match with stat2 at key value: 
$fields[$index]\n;
+ }
+ break;
+
+   case !=:
+ if ( $stat1[ $fields[$index] ] != $stat2[ $fields[$index] ] ) {
+   // do nothing as its not equal, else will take care of if equal
+ } else {
+   $result = false;
+   echo stat1 equals stat2 at key value: $fields[$index]\n;
+ }
+ break;
+
+   case :
+ if ( $stat1[ $fields[$index] ] = $stat2[ $fields[$index] ] ) {
+   $result = false;
+   echo stat1 is not greater than stat2 at key value: 
$fields[$index]\n;
+ }
+ break;
+
+   case :
+ if ( $stat1[ $fields[$index] ] = $stat2[ $fields[$index] ] ) {
+   $result = false;
+   echo stat1 is not lesser than stat2 at key value: 
$fields[$index]\n;
+ }
+ break;
+}
+  }
+  return $result;
+}
+
+?

-- 
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/standard/tests/file filesize_variation-win32.phpt filesize_variation.phpt lstat_stat_basic.phpt lstat_stat_error.phpt rename_variation-win32.phpt rename_variation.

2007-06-21 Thread Raghubansh Kumar
kraghubaThu Jun 21 21:12:18 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/filestat_error-win32.phpt 
lstat_stat_error.phpt 
filesize_variation-win32.phpt 
rename_variation-win32.phpt 
stat_basic-win32.phpt 
filesize_variation.phpt 
rename_variation.phpt 
lstat_stat_basic.phpt 
  Log:
  New tests for file system handling functions
  

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/stat_error-win32.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/file/stat_error-win32.phpt
+++ php-src/ext/standard/tests/file/stat_error-win32.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/lstat_stat_error.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/file/lstat_stat_error.phpt
+++ php-src/ext/standard/tests/file/lstat_stat_error.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/filesize_variation-win32.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/file/filesize_variation-win32.phpt
+++ php-src/ext/standard/tests/file/filesize_variation-win32.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/rename_variation-win32.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/file/rename_variation-win32.phpt
+++ php-src/ext/standard/tests/file/rename_variation-win32.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/stat_basic-win32.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/file/stat_basic-win32.phpt
+++ php-src/ext/standard/tests/file/stat_basic-win32.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/filesize_variation.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/file/filesize_variation.phpt
+++ php-src/ext/standard/tests/file/filesize_variation.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/rename_variation.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/file/rename_variation.phpt
+++ php-src/ext/standard/tests/file/rename_variation.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/lstat_stat_basic.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/file/lstat_stat_basic.phpt
+++ php-src/ext/standard/tests/file/lstat_stat_basic.phpt

-- 
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/recode recode.c

2007-06-21 Thread Stanislav Malyshev
stasFri Jun 22 00:02:15 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/recode recode.c 
  Log:
  fix #41765
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/recode/recode.c?r1=1.37.2.1.2.2r2=1.37.2.1.2.3diff_format=u
Index: php-src/ext/recode/recode.c
diff -u php-src/ext/recode/recode.c:1.37.2.1.2.2 
php-src/ext/recode/recode.c:1.37.2.1.2.3
--- php-src/ext/recode/recode.c:1.37.2.1.2.2Mon Jan  1 09:36:05 2007
+++ php-src/ext/recode/recode.c Fri Jun 22 00:02:15 2007
@@ -16,7 +16,7 @@
+--+
  */
  
-/* $Id: recode.c,v 1.37.2.1.2.2 2007/01/01 09:36:05 sebastian Exp $ */
+/* $Id: recode.c,v 1.37.2.1.2.3 2007/06/22 00:02:15 stas Exp $ */
 
 /* {{{ includes  prototypes */
 
@@ -122,7 +122,7 @@
 {
php_info_print_table_start();
php_info_print_table_row(2, Recode Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.37.2.1.2.2 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.37.2.1.2.3 $);
php_info_print_table_end();
 }
 
@@ -132,7 +132,7 @@
 {
RECODE_REQUEST request = NULL;
char *r = NULL;
-   int r_len = 0, r_alen = 0;
+   size_t r_len = 0, r_alen = 0;
int req_len, str_len;
char *req, *str;
 

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



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

2007-06-21 Thread Stanislav Malyshev
stasFri Jun 22 00:05:54 2007 UTC

  Modified files:  
/php-src/ext/recode recode.c 
  Log:
  fix #41765
  
http://cvs.php.net/viewvc.cgi/php-src/ext/recode/recode.c?r1=1.41r2=1.42diff_format=u
Index: php-src/ext/recode/recode.c
diff -u php-src/ext/recode/recode.c:1.41 php-src/ext/recode/recode.c:1.42
--- php-src/ext/recode/recode.c:1.41Mon Jan  1 09:29:28 2007
+++ php-src/ext/recode/recode.c Fri Jun 22 00:05:54 2007
@@ -16,7 +16,7 @@
+--+
  */
  
-/* $Id: recode.c,v 1.41 2007/01/01 09:29:28 sebastian Exp $ */
+/* $Id: recode.c,v 1.42 2007/06/22 00:05:54 stas Exp $ */
 
 /* {{{ includes  prototypes */
 
@@ -122,7 +122,7 @@
 {
php_info_print_table_start();
php_info_print_table_row(2, Recode Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.41 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.42 $);
php_info_print_table_end();
 }
 
@@ -132,7 +132,7 @@
 {
RECODE_REQUEST request = NULL;
char *r = NULL;
-   int r_len = 0, r_alen = 0;
+   size_t r_len = 0, r_alen = 0;
int req_len, str_len;
char *req, *str;
 

-- 
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) /ext/recode recode.c

2007-06-21 Thread Stanislav Malyshev
stasFri Jun 22 00:06:54 2007 UTC

  Modified files:  (Branch: PHP_4_4)
/php-src/ext/recode recode.c 
  Log:
  fix #41765
  
http://cvs.php.net/viewvc.cgi/php-src/ext/recode/recode.c?r1=1.29.2.1.8.2r2=1.29.2.1.8.3diff_format=u
Index: php-src/ext/recode/recode.c
diff -u php-src/ext/recode/recode.c:1.29.2.1.8.2 
php-src/ext/recode/recode.c:1.29.2.1.8.3
--- php-src/ext/recode/recode.c:1.29.2.1.8.2Mon Jan  1 09:46:46 2007
+++ php-src/ext/recode/recode.c Fri Jun 22 00:06:54 2007
@@ -16,7 +16,7 @@
+--+
  */
  
-/* $Id: recode.c,v 1.29.2.1.8.2 2007/01/01 09:46:46 sebastian Exp $ */
+/* $Id: recode.c,v 1.29.2.1.8.3 2007/06/22 00:06:54 stas Exp $ */
 
 /* {{{ includes  prototypes */
 
@@ -119,7 +119,7 @@
 {
php_info_print_table_start();
php_info_print_table_row(2, Recode Support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.29.2.1.8.2 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.29.2.1.8.3 $);
php_info_print_table_end();
 }
 
@@ -132,7 +132,7 @@
zval **str;
zval **req;
bool success;
-   int r_len=0, r_alen =0;
+   size_t r_len=0, r_alen =0;
 
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, req, str) == 
FAILURE) {
WRONG_PARAM_COUNT;

-- 
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

2007-06-21 Thread Stanislav Malyshev
stasFri Jun 22 00:10:02 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
  Log:
  Fixed bug #41765 (Recode crashes/does not work on amd64)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.794r2=1.2027.2.547.2.795diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.794 php-src/NEWS:1.2027.2.547.2.795
--- php-src/NEWS:1.2027.2.547.2.794 Wed Jun 20 23:05:52 2007
+++ php-src/NEWSFri Jun 22 00:10:02 2007
@@ -36,6 +36,8 @@
 - Fixed PECL bug #11216 (crash in ZipArchive::addEmptyDir when a directory 
   already exists). (Pierre)
 
+- Fixed bug #41765 (Recode crashes/does not work on amd64) 
+  (nexus at smoula dot net, Stas)
 - Fixed bug #41724 (libxml_get_last_error() - errors service request scope).
   (thekid at php dot net, Ilia)
 - Fixed bug #41717 (imagepolygon does not respect thickness). (Pierre)

-- 
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) / NEWS

2007-06-21 Thread Stanislav Malyshev
stasFri Jun 22 00:10:27 2007 UTC

  Modified files:  (Branch: PHP_4_4)
/php-srcNEWS 
  Log:
  Fixed bug #41765 (Recode crashes/does not work on amd64)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.1247.2.920.2.239r2=1.1247.2.920.2.240diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.920.2.239 php-src/NEWS:1.1247.2.920.2.240
--- php-src/NEWS:1.1247.2.920.2.239 Mon Jun 18 22:03:32 2007
+++ php-src/NEWSFri Jun 22 00:10:27 2007
@@ -10,6 +10,8 @@
   input variables. Fix for MOPB-03-2007. (Stas)
 - Fixed INFILE LOCAL option handling with MySQL - now not allowed when 
   open_basedir or safe_mode is active (Stas)
+- Fixed bug #41765 (Recode crashes/does not work on amd64) 
+  (nexus at smoula dot net, Stas)
 - Fixed bug #41630 (segfault when an invalid color index is present in
   the image data). (Reported by Elliot [EMAIL PROTECTED] dot com) (Pierre)
 - Fixed bug #41628 (PHP settings leak between Virtual Hosts in

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