summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-02-03 13:41:45 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-02-03 13:42:08 +0100
commit169805777c17892865ae462ae0a0895344a7fd3c (patch)
tree715ab54d18d387e0f2fec607a97462af525f2556 /ext
parent6b38251820be4ab2eb38c55d41c6680d0bff83f3 (diff)
parent58b17906f512866c2e34844fa497ecdf7f1e1e3d (diff)
downloadphp-git-169805777c17892865ae462ae0a0895344a7fd3c.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Apply tidy formatting
Diffstat (limited to 'ext')
-rwxr-xr-xext/ext_skel.php382
-rw-r--r--ext/ffi/ffi.stub.php4
-rwxr-xr-xext/fileinfo/create_data_file.php24
-rwxr-xr-xext/hash/bench.php136
-rw-r--r--ext/pdo_firebird/firebird_statement.c4
-rw-r--r--ext/pdo_firebird/pdo_firebird.c2
-rwxr-xr-xext/pdo_mysql/get_error_codes.php38
-rw-r--r--ext/pdo_sqlite/sqlite_statement.c2
-rwxr-xr-xext/phar/build_precommand.php62
-rw-r--r--ext/phar/makestub.php70
-rwxr-xr-xext/phar/phar/phar.php38
-rw-r--r--ext/phar/phar_object.stub.php6
-rw-r--r--ext/snmp/snmp.stub.php78
-rw-r--r--ext/zip/examples/addglob.php4
-rw-r--r--ext/zip/examples/create.php4
-rw-r--r--ext/zip/examples/dir.php4
-rw-r--r--ext/zip/examples/encryption.php6
-rw-r--r--ext/zip/examples/extract.php6
-rw-r--r--ext/zip/examples/extractAll.php6
-rw-r--r--ext/zip/examples/fopen.php8
-rw-r--r--ext/zip/examples/get_set_comments.php12
-rw-r--r--ext/zip/examples/odt.php22
-rw-r--r--ext/zip/examples/oldapi.php18
-rw-r--r--ext/zip/examples/set_compression.php2
24 files changed, 469 insertions, 469 deletions
diff --git a/ext/ext_skel.php b/ext/ext_skel.php
index 43734a2a67..5c6835940f 100755
--- a/ext/ext_skel.php
+++ b/ext/ext_skel.php
@@ -21,8 +21,8 @@
/* {{{ error
*/
function error($message) {
- printf('Error: %s%s', $message, PHP_EOL);
- exit;
+ printf('Error: %s%s', $message, PHP_EOL);
+ exit;
}
/* }}} */
@@ -114,152 +114,152 @@ OPTIONS
--help This help
HELP;
- exit;
+ exit;
}
/* }}} */
/* {{{ task
*/
function task($label, $callback) {
- printf('%s... ', $label);
+ printf('%s... ', $label);
- $callback();
+ $callback();
- printf('done%s', PHP_EOL);
+ printf('done%s', PHP_EOL);
}
/* }}} */
/* {{{ print_success
*/
function print_success() {
- global $options;
-
- if (PHP_OS_FAMILY != 'Windows') {
- $file_prefix = './';
- $make_prefix = '';
- } else {
- $file_prefix = '';
- $make_prefix = 'n';
- }
-
- printf('%1$sSuccess. The extension is now ready to be compiled. To do so, use the%s', PHP_EOL);
- printf('following steps:%1$s%1$s', PHP_EOL);
- printf('cd /path/to/php-src/ext/%s%s', $options['ext'], PHP_EOL);
- printf('phpize%s', PHP_EOL);
- printf('%sconfigure%s', $file_prefix, PHP_EOL);
- printf('%smake%2$s%2$s', $make_prefix, PHP_EOL);
- printf('Don\'t forget to run tests once the compilation is done:%s', PHP_EOL);
- printf('%smake test%2$s%2$s', $make_prefix, PHP_EOL);
- printf('Thank you for using PHP!%s', PHP_EOL);
+ global $options;
+
+ if (PHP_OS_FAMILY != 'Windows') {
+ $file_prefix = './';
+ $make_prefix = '';
+ } else {
+ $file_prefix = '';
+ $make_prefix = 'n';
+ }
+
+ printf('%1$sSuccess. The extension is now ready to be compiled. To do so, use the%s', PHP_EOL);
+ printf('following steps:%1$s%1$s', PHP_EOL);
+ printf('cd /path/to/php-src/ext/%s%s', $options['ext'], PHP_EOL);
+ printf('phpize%s', PHP_EOL);
+ printf('%sconfigure%s', $file_prefix, PHP_EOL);
+ printf('%smake%2$s%2$s', $make_prefix, PHP_EOL);
+ printf('Don\'t forget to run tests once the compilation is done:%s', PHP_EOL);
+ printf('%smake test%2$s%2$s', $make_prefix, PHP_EOL);
+ printf('Thank you for using PHP!%s', PHP_EOL);
}
/* }}} */
/* {{{ process_args
*/
function process_args($argv, $argc) {
- $options = [
- 'unix' => true,
- 'windows' => true,
- 'ext' => '',
- 'dir' => __DIR__ . DIRECTORY_SEPARATOR,
- 'skel' => __DIR__ . DIRECTORY_SEPARATOR . 'skeleton' . DIRECTORY_SEPARATOR,
- 'author' => false,
- 'experimental' => false,
- 'std' => false
- ];
-
- for($i = 1; $i < $argc; ++$i)
- {
- $val = $argv[$i];
-
- if($val[0] != '-' || $val[1] != '-')
- {
- continue;
- }
-
- switch($opt = strtolower(substr($val, 2)))
- {
- case 'help': {
- print_help();
- }
- case 'onlyunix': {
- $options['windows'] = false;
- }
- break;
- case 'onlywindows': {
- $options['unix'] = false;
- }
- break;
- case 'experimental': {
- $options['experimental'] = true;
- }
- break;
- case 'std': {
- $options['std'] = true;
- }
- break;
- case 'ext':
- case 'dir':
- case 'author': {
- if (!isset($argv[$i + 1]) || ($argv[$i + 1][0] == '-' && $argv[$i + 1][1] == '-')) {
- error('Argument "' . $val . '" expects a value, none passed');
- } else if ($opt == 'dir' && empty($argv[$i + 1])) {
- continue 2;
- }
-
- $options[$opt] = ($opt == 'dir' ? realpath($argv[$i + 1]) . DIRECTORY_SEPARATOR : $argv[$i + 1]);
- }
- break;
- default: {
- error('Unsupported argument "' . $val . '" passed');
- }
- }
- }
-
- if (empty($options['ext'])) {
- error('No extension name passed, use "--ext <name>"');
- } else if (!$options['unix'] && !$options['windows']) {
- error('Cannot pass both --onlyunix and --onlywindows');
- } else if (!is_dir($options['skel'])) {
- error('The skeleton directory was not found');
- }
-
- // Validate extension name
- if (!preg_match('/^[a-z][a-z0-9_]+$/i', $options['ext'])) {
- error('Invalid extension name. Valid names start with a letter,'
- .' followed by any number of letters, numbers, or underscores.'
- .' Using only lower case letters is preferred.');
- }
-
- $options['ext'] = str_replace(['\\', '/'], '', strtolower($options['ext']));
-
- return $options;
+ $options = [
+ 'unix' => true,
+ 'windows' => true,
+ 'ext' => '',
+ 'dir' => __DIR__ . DIRECTORY_SEPARATOR,
+ 'skel' => __DIR__ . DIRECTORY_SEPARATOR . 'skeleton' . DIRECTORY_SEPARATOR,
+ 'author' => false,
+ 'experimental' => false,
+ 'std' => false
+ ];
+
+ for($i = 1; $i < $argc; ++$i)
+ {
+ $val = $argv[$i];
+
+ if($val[0] != '-' || $val[1] != '-')
+ {
+ continue;
+ }
+
+ switch($opt = strtolower(substr($val, 2)))
+ {
+ case 'help': {
+ print_help();
+ }
+ case 'onlyunix': {
+ $options['windows'] = false;
+ }
+ break;
+ case 'onlywindows': {
+ $options['unix'] = false;
+ }
+ break;
+ case 'experimental': {
+ $options['experimental'] = true;
+ }
+ break;
+ case 'std': {
+ $options['std'] = true;
+ }
+ break;
+ case 'ext':
+ case 'dir':
+ case 'author': {
+ if (!isset($argv[$i + 1]) || ($argv[$i + 1][0] == '-' && $argv[$i + 1][1] == '-')) {
+ error('Argument "' . $val . '" expects a value, none passed');
+ } else if ($opt == 'dir' && empty($argv[$i + 1])) {
+ continue 2;
+ }
+
+ $options[$opt] = ($opt == 'dir' ? realpath($argv[$i + 1]) . DIRECTORY_SEPARATOR : $argv[$i + 1]);
+ }
+ break;
+ default: {
+ error('Unsupported argument "' . $val . '" passed');
+ }
+ }
+ }
+
+ if (empty($options['ext'])) {
+ error('No extension name passed, use "--ext <name>"');
+ } else if (!$options['unix'] && !$options['windows']) {
+ error('Cannot pass both --onlyunix and --onlywindows');
+ } else if (!is_dir($options['skel'])) {
+ error('The skeleton directory was not found');
+ }
+
+ // Validate extension name
+ if (!preg_match('/^[a-z][a-z0-9_]+$/i', $options['ext'])) {
+ error('Invalid extension name. Valid names start with a letter,'
+ .' followed by any number of letters, numbers, or underscores.'
+ .' Using only lower case letters is preferred.');
+ }
+
+ $options['ext'] = str_replace(['\\', '/'], '', strtolower($options['ext']));
+
+ return $options;
}
/* }}} */
/* {{{ process_source_tags
*/
function process_source_tags($file, $short_name) {
- global $options;
+ global $options;
- $source = file_get_contents($file);
+ $source = file_get_contents($file);
- if ($source === false) {
- error('Unable to open file for reading: ' . $short_name);
- }
+ if ($source === false) {
+ error('Unable to open file for reading: ' . $short_name);
+ }
- $source = str_replace('%EXTNAME%', $options['ext'], $source);
- $source = str_replace('%EXTNAMECAPS%', strtoupper($options['ext']), $source);
+ $source = str_replace('%EXTNAME%', $options['ext'], $source);
+ $source = str_replace('%EXTNAMECAPS%', strtoupper($options['ext']), $source);
- if (strpos($short_name, '.c') !== false || strpos($short_name, '.h') !== false) {
- static $header;
+ if (strpos($short_name, '.c') !== false || strpos($short_name, '.h') !== false) {
+ static $header;
- if (!$header) {
- if ($options['std']) {
- $author_len = strlen($options['author']);
- $credits = $options['author'] . ($author_len && $author_len <= 60 ? str_repeat(' ', 60 - $author_len) : '');
+ if (!$header) {
+ if ($options['std']) {
+ $author_len = strlen($options['author']);
+ $credits = $options['author'] . ($author_len && $author_len <= 60 ? str_repeat(' ', 60 - $author_len) : '');
- $header = <<<"HEADER"
+ $header = <<<"HEADER"
/*
+----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
@@ -276,141 +276,141 @@ function process_source_tags($file, $short_name) {
+----------------------------------------------------------------------+
*/
HEADER;
- } else {
- if ($options['author']) {
- $header = sprintf('/* %s extension for PHP (c) %d %s */', $options['ext'], date('Y'), $options['author']);
- } else {
- $header = sprintf('/* %s extension for PHP */', $options['ext']);
- }
- }
- }
-
- $source = str_replace('%HEADER%', $header, $source);
- }
-
- if (!file_put_contents($file, $source)) {
- error('Unable to save contents to file: ' . $short_name);
- }
+ } else {
+ if ($options['author']) {
+ $header = sprintf('/* %s extension for PHP (c) %d %s */', $options['ext'], date('Y'), $options['author']);
+ } else {
+ $header = sprintf('/* %s extension for PHP */', $options['ext']);
+ }
+ }
+ }
+
+ $source = str_replace('%HEADER%', $header, $source);
+ }
+
+ if (!file_put_contents($file, $source)) {
+ error('Unable to save contents to file: ' . $short_name);
+ }
}
/* }}} */
/* {{{ copy_config_scripts
*/
function copy_config_scripts() {
- global $options;
+ global $options;
- $files = [];
+ $files = [];
- if ($options['unix']) {
- $files[] = 'config.m4';
- }
+ if ($options['unix']) {
+ $files[] = 'config.m4';
+ }
- if ($options['windows']) {
- $files[] = 'config.w32';
- }
+ if ($options['windows']) {
+ $files[] = 'config.w32';
+ }
- $files[] = '.gitignore';
+ $files[] = '.gitignore';
- foreach($files as $config_script) {
- $new_config_script = $options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . $config_script;
+ foreach($files as $config_script) {
+ $new_config_script = $options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . $config_script;
- if (!copy($options['skel'] . $config_script . '.in', $new_config_script)) {
- error('Unable to copy config script: ' . $config_script);
- }
+ if (!copy($options['skel'] . $config_script . '.in', $new_config_script)) {
+ error('Unable to copy config script: ' . $config_script);
+ }
- process_source_tags($new_config_script, $config_script);
- }
+ process_source_tags($new_config_script, $config_script);
+ }
}
/* }}} */
/* {{{ copy_sources
*/
function copy_sources() {
- global $options;
+ global $options;
- $files = [
- 'skeleton.c' => $options['ext'] . '.c',
- 'skeleton.stub.php' => $options['ext'] . '.stub.php',
- 'php_skeleton.h' => 'php_' . $options['ext'] . '.h'
- ];
+ $files = [
+ 'skeleton.c' => $options['ext'] . '.c',
+ 'skeleton.stub.php' => $options['ext'] . '.stub.php',
+ 'php_skeleton.h' => 'php_' . $options['ext'] . '.h'
+ ];
- foreach ($files as $src_file => $dst_file) {
- if (!copy($options['skel'] . $src_file, $options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . $dst_file)) {
- error('Unable to copy source file: ' . $src_file);
- }
+ foreach ($files as $src_file => $dst_file) {
+ if (!copy($options['skel'] . $src_file, $options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . $dst_file)) {
+ error('Unable to copy source file: ' . $src_file);
+ }
- process_source_tags($options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . $dst_file, $dst_file);
- }
+ process_source_tags($options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . $dst_file, $dst_file);
+ }
}
/* }}} */
/* {{{ copy_tests
*/
function copy_tests() {
- global $options;
+ global $options;
- $test_files = glob($options['skel'] . 'tests/*', GLOB_MARK);
+ $test_files = glob($options['skel'] . 'tests/*', GLOB_MARK);
- if (!$test_files) {
- return;
- }
+ if (!$test_files) {
+ return;
+ }
- foreach ($test_files as $test) {
- if (is_dir($test)) {
- continue;
- }
+ foreach ($test_files as $test) {
+ if (is_dir($test)) {
+ continue;
+ }
- $new_test = str_replace([$options['skel'], '/'], ['', DIRECTORY_SEPARATOR], $test);
+ $new_test = str_replace([$options['skel'], '/'], ['', DIRECTORY_SEPARATOR], $test);
- if (!copy($test, $options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . $new_test)) {
- error('Unable to copy file: ' . $new_test);
- }
+ if (!copy($test, $options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . $new_test)) {
+ error('Unable to copy file: ' . $new_test);
+ }
- process_source_tags($options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . $new_test, $new_test);
- }
+ process_source_tags($options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . $new_test, $new_test);
+ }
}
/* }}} */
if (PHP_SAPI != 'cli') {
- error('This script is only suited for CLI');
+ error('This script is only suited for CLI');
}
if ($argc < 1) {
- print_help();
- exit;
+ print_help();
+ exit;
}
$options = process_args($argv, $argc);
if (!$options['dir'] || !is_dir($options['dir'])) {
- error('The selected output directory does not exist');
+ error('The selected output directory does not exist');
} else if (is_dir($options['dir'] . $options['ext'])) {
- error('There is already a folder named "' . $options['ext'] . '" in the output directory');
+ error('There is already a folder named "' . $options['ext'] . '" in the output directory');
} else if (!mkdir($options['dir'] . $options['ext'])) {
- error('Unable to create extension directory in the output directory');
+ error('Unable to create extension directory in the output directory');
} else if (!mkdir($options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . 'tests')) {
- error('Unable to create the tests directory');
+ error('Unable to create the tests directory');
}
if ($options['experimental']) {
- print('Creating EXPERIMENTAL... ');
+ print('Creating EXPERIMENTAL... ');
- if (file_put_contents($options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . 'EXPERIMENTAL', '') === false) {
- error('Unable to create the EXPERIMENTAL file');
- }
+ if (file_put_contents($options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . 'EXPERIMENTAL', '') === false) {
+ error('Unable to create the EXPERIMENTAL file');
+ }
- printf('done%s', PHP_EOL);
+ printf('done%s', PHP_EOL);
}
if (!empty($options['author'])) {
- print('Creating CREDITS... ');
+ print('Creating CREDITS... ');
- if (!file_put_contents($options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . 'CREDITS', $options['ext'] . PHP_EOL . $options['author'])) {
- error('Unable to create the CREDITS file');
- }
+ if (!file_put_contents($options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . 'CREDITS', $options['ext'] . PHP_EOL . $options['author'])) {
+ error('Unable to create the CREDITS file');
+ }
- printf('done%s', PHP_EOL);
+ printf('done%s', PHP_EOL);
}
date_default_timezone_set('UTC');
diff --git a/ext/ffi/ffi.stub.php b/ext/ffi/ffi.stub.php
index 812217f990..ff73d2e124 100644
--- a/ext/ffi/ffi.stub.php
+++ b/ext/ffi/ffi.stub.php
@@ -17,13 +17,13 @@ class FFI
*/
static function new($type, bool $owned = true, bool $persistent = false) {}
- /**
+ /**
* @prefer-ref $ptr
* @return void
*/
static function free(FFI\CData $ptr) {}
- /**
+ /**
* @param FFI\CType|string $type
* @prefer-ref $ptr
* @return ?FFI\CData
diff --git a/ext/fileinfo/create_data_file.php b/ext/fileinfo/create_data_file.php
index c1284c60cb..e85be002b0 100755
--- a/ext/fileinfo/create_data_file.php
+++ b/ext/fileinfo/create_data_file.php
@@ -2,17 +2,17 @@
/* This is a generated file, do not modify */
/* Usage: php create_data_file.php /path/to/magic.mgc > data_file.c */
<?php
- $dta = file_get_contents( $argv[1] );
- $dta_l = strlen($dta);
- $j = 0;
+ $dta = file_get_contents( $argv[1] );
+ $dta_l = strlen($dta);
+ $j = 0;
- echo "const unsigned char php_magic_database[$dta_l] = {\n";
- for ($i = 0; $i < $dta_l; $i++) {
- printf("0x%02X, ", ord($dta[$i]));
- if ($j % 16 == 15) {
- echo "\n";
- }
- $j++;
- }
- echo "};\n";
+ echo "const unsigned char php_magic_database[$dta_l] = {\n";
+ for ($i = 0; $i < $dta_l; $i++) {
+ printf("0x%02X, ", ord($dta[$i]));
+ if ($j % 16 == 15) {
+ echo "\n";
+ }
+ $j++;
+ }
+ echo "};\n";
?>
diff --git a/ext/hash/bench.php b/ext/hash/bench.php
index a1cc4bedd1..60c038ca99 100755
--- a/ext/hash/bench.php
+++ b/ext/hash/bench.php
@@ -5,68 +5,68 @@
This gives rather interesting results :)
Measures on a Notebook P4M-1.7 256MB Windows 2000:
- sha1 0.556691
- tiger160,3 0.774469
- tiger192,3 0.776314
- tiger128,3 0.777004
- ripemd128 0.896674
- sha256 1.011164
- md5 1.016032
- tiger160,4 1.056617
- tiger128,4 1.063101
- tiger192,4 1.069258
- haval160,3 1.125099
- haval128,3 1.125679
- haval224,3 1.128017
- haval192,3 1.130026
- haval256,3 1.134846
- ripemd160 1.150693
- haval128,4 1.686261
- haval192,4 1.687274
- haval160,4 1.693091
- haval256,4 1.699323
- haval224,4 1.743094
- haval160,5 2.003452
- haval192,5 2.008341
- haval256,5 2.009048
- haval128,5 2.009555
- haval224,5 2.015539
- sha384 3.370734
- sha512 3.381121
- whirlpool 6.912327
- snefru 9.268168
+ sha1 0.556691
+ tiger160,3 0.774469
+ tiger192,3 0.776314
+ tiger128,3 0.777004
+ ripemd128 0.896674
+ sha256 1.011164
+ md5 1.016032
+ tiger160,4 1.056617
+ tiger128,4 1.063101
+ tiger192,4 1.069258
+ haval160,3 1.125099
+ haval128,3 1.125679
+ haval224,3 1.128017
+ haval192,3 1.130026
+ haval256,3 1.134846
+ ripemd160 1.150693
+ haval128,4 1.686261
+ haval192,4 1.687274
+ haval160,4 1.693091
+ haval256,4 1.699323
+ haval224,4 1.743094
+ haval160,5 2.003452
+ haval192,5 2.008341
+ haval256,5 2.009048
+ haval128,5 2.009555
+ haval224,5 2.015539
+ sha384 3.370734
+ sha512 3.381121
+ whirlpool 6.912327
+ snefru 9.268168
Measures on a Desktop P4-2.4 512MB Debian (Linux-2.4):
- md5 0.147739
- haval128,3 0.317006
- haval192,3 0.317524
- haval256,3 0.317526
- haval160,3 0.323035
- haval224,3 0.333318
- ripemd128 0.353447
- sha1 0.376200
- ripemd160 0.413758
- sha256 0.435957
- haval160,4 0.452357
- haval224,4 0.454531
- haval128,4 0.458026
- haval256,4 0.459051
- haval192,4 0.468094
- haval128,5 0.524262
- haval160,5 0.529573
- haval224,5 0.533655
- haval256,5 0.534446
- haval192,5 0.543726
- tiger128,3 0.577975
- tiger160,3 0.579951
- tiger192,3 0.597111
- tiger192,4 0.781408
- tiger160,4 0.801243
- tiger128,4 0.812239
- sha512 1.298627
- sha384 1.313607
- whirlpool 1.556159
- snefru 5.703742
+ md5 0.147739
+ haval128,3 0.317006
+ haval192,3 0.317524
+ haval256,3 0.317526
+ haval160,3 0.323035
+ haval224,3 0.333318
+ ripemd128 0.353447
+ sha1 0.376200
+ ripemd160 0.413758
+ sha256 0.435957
+ haval160,4 0.452357
+ haval224,4 0.454531
+ haval128,4 0.458026
+ haval256,4 0.459051
+ haval192,4 0.468094
+ haval128,5 0.524262
+ haval160,5 0.529573
+ haval224,5 0.533655
+ haval256,5 0.534446
+ haval192,5 0.543726
+ tiger128,3 0.577975
+ tiger160,3 0.579951
+ tiger192,3 0.597111
+ tiger192,4 0.781408
+ tiger160,4 0.801243
+ tiger128,4 0.812239
+ sha512 1.298627
+ sha384 1.313607
+ whirlpool 1.556159
+ snefru 5.703742
*/
@@ -76,17 +76,17 @@ $data = file_get_contents(__FILE__);
$time = array();
for ($j = 0; $j < 10; $j++) {
- foreach (hash_algos() as $algo) {
- $start = microtime(true);
- for ($i = 0; $i < 1000; $i++) {
- hash($algo, $data);
- }
- $time[$algo] += microtime(true)-$start;
- }
+ foreach (hash_algos() as $algo) {
+ $start = microtime(true);
+ for ($i = 0; $i < 1000; $i++) {
+ hash($algo, $data);
+ }
+ $time[$algo] += microtime(true)-$start;
+ }
}
asort($time, SORT_NUMERIC);
foreach ($time as $a => $t) {
- printf("%-12s %02.6f\n", $a, $t);
+ printf("%-12s %02.6f\n", $a, $t);
}
?>
diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c
index 685b9d62ea..105d5a3587 100644
--- a/ext/pdo_firebird/firebird_statement.c
+++ b/ext/pdo_firebird/firebird_statement.c
@@ -625,7 +625,7 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
{
zend_long lval;
double dval;
-
+
if ((Z_STRLEN_P(parameter) == 0)) {
*(FB_BOOLEAN*)var->sqldata = FB_FALSE;
break;
@@ -663,7 +663,7 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
break;
}
#endif
-
+
/* check if a NULL should be inserted */
switch (Z_TYPE_P(parameter)) {
diff --git a/ext/pdo_firebird/pdo_firebird.c b/ext/pdo_firebird/pdo_firebird.c
index 79b3c396f1..d8e55957f2 100644
--- a/ext/pdo_firebird/pdo_firebird.c
+++ b/ext/pdo_firebird/pdo_firebird.c
@@ -82,7 +82,7 @@ PHP_MINFO_FUNCTION(pdo_firebird) /* {{{ */
{
char version[64];
isc_get_client_version(version);
-
+
php_info_print_table_start();
php_info_print_table_header(2, "PDO Driver for Firebird", "enabled");
php_info_print_table_row(2, "Client Library Version", version);
diff --git a/ext/pdo_mysql/get_error_codes.php b/ext/pdo_mysql/get_error_codes.php
index 4c956f8c4e..27910f8dad 100755
--- a/ext/pdo_mysql/get_error_codes.php
+++ b/ext/pdo_mysql/get_error_codes.php
@@ -1,28 +1,28 @@
#!/usr/bin/env php
<?php
- $codes = array();
- $maxlen = 0;
+ $codes = array();
+ $maxlen = 0;
- while (!feof(STDIN)) {
- $line = fgets(STDIN);
+ while (!feof(STDIN)) {
+ $line = fgets(STDIN);
- if (ereg('^\{[[:space:]]+(ER_.*)[[:space:]]+,[[:space:]]*"(.*)",[[:space:]]*"(.*)"', $line, $matches)) {
- $codes[$matches[1]] = $matches[2];
- $maxlen = max($maxlen, strlen($matches[1]));
- }
- }
+ if (ereg('^\{[[:space:]]+(ER_.*)[[:space:]]+,[[:space:]]*"(.*)",[[:space:]]*"(.*)"', $line, $matches)) {
+ $codes[$matches[1]] = $matches[2];
+ $maxlen = max($maxlen, strlen($matches[1]));
+ }
+ }
- if (empty($codes)) {
- fputs(STDERR, "input doesn't look like a MySQL sql_state.h file\n");
- exit(3);
- }
+ if (empty($codes)) {
+ fputs(STDERR, "input doesn't look like a MySQL sql_state.h file\n");
+ exit(3);
+ }
- echo "/* DO NOT EDIT THIS FILE!!! It is auto generated by get_error_codes.php */\n";
- foreach ($codes as $code => $state) {
- echo "#ifdef $code\n";
- printf(" case %-{$maxlen}s: return \"%s\";\n", $code, $state);
- echo "#endif\n";
- }
+ echo "/* DO NOT EDIT THIS FILE!!! It is auto generated by get_error_codes.php */\n";
+ foreach ($codes as $code => $state) {
+ echo "#ifdef $code\n";
+ printf(" case %-{$maxlen}s: return \"%s\";\n", $code, $state);
+ echo "#endif\n";
+ }
?>
diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c
index f937c4263b..db1bbf9b14 100644
--- a/ext/pdo_sqlite/sqlite_statement.c
+++ b/ext/pdo_sqlite/sqlite_statement.c
@@ -57,7 +57,7 @@ static void pdo_sqlite_stmt_set_column_count(pdo_stmt_t *stmt, int new_count)
}
/*
- * The column count has not changed : no need to reload columns description
+ * The column count has not changed : no need to reload columns description
* Note: Do not handle attribute name change, without column count change
*/
if (new_count == stmt->column_count) {
diff --git a/ext/phar/build_precommand.php b/ext/phar/build_precommand.php
index c2fe9c8e52..c427ffbd5b 100755
--- a/ext/phar/build_precommand.php
+++ b/ext/phar/build_precommand.php
@@ -10,44 +10,44 @@
* Phar Command
*/
foreach(array("SPL", "Reflection", "Phar") as $ext) {
- if (!extension_loaded($ext)) {
- echo "$argv[0] requires PHP extension $ext.\n";
- exit(1);
- }
+ if (!extension_loaded($ext)) {
+ echo "$argv[0] requires PHP extension $ext.\n";
+ exit(1);
+ }
}
<?php
$classes = array(
- 'DirectoryTreeIterator',
- 'DirectoryGraphIterator',
- 'InvertedRegexIterator',
- 'CLICommand',
- 'PharCommand',
- );
+ 'DirectoryTreeIterator',
+ 'DirectoryGraphIterator',
+ 'InvertedRegexIterator',
+ 'CLICommand',
+ 'PharCommand',
+ );
foreach($classes as $name) {
- echo "if (!class_exists('$name', 0))\n{\n";
- $f = file(dirname(__FILE__) . '/phar/' . strtolower($name) . '.inc');
- unset($f[0]);
- $c = count($f);
- while ($c && (strlen($f[$c]) == 0 || $f[$c] == "\n" || $f[$c] == "\r\n")) {
- unset($f[$c--]);
- }
- if (substr($f[$c], -2) == "\r\n") {
- $f[$c] = substr($f[$c], 0, -2);
- }
- if (substr($f[$c], -1) == "\n") {
- $f[$c] = substr($f[$c], 0, -1);
- }
- if (substr($f[$c], -2) == '?>') {
- $f[$c] = substr($f[$c], 0,-2);
- }
- while ($c && (strlen($f[$c]) == 0 || $f[$c] == "\n" || $f[$c] == "\r\n")) {
- unset($f[$c--]);
- }
- echo join('', $f);
- echo "\n}\n\n";
+ echo "if (!class_exists('$name', 0))\n{\n";
+ $f = file(dirname(__FILE__) . '/phar/' . strtolower($name) . '.inc');
+ unset($f[0]);
+ $c = count($f);
+ while ($c && (strlen($f[$c]) == 0 || $f[$c] == "\n" || $f[$c] == "\r\n")) {
+ unset($f[$c--]);
+ }
+ if (substr($f[$c], -2) == "\r\n") {
+ $f[$c] = substr($f[$c], 0, -2);
+ }
+ if (substr($f[$c], -1) == "\n") {
+ $f[$c] = substr($f[$c], 0, -1);
+ }
+ if (substr($f[$c], -2) == '?>') {
+ $f[$c] = substr($f[$c], 0,-2);
+ }
+ while ($c && (strlen($f[$c]) == 0 || $f[$c] == "\n" || $f[$c] == "\r\n")) {
+ unset($f[$c--]);
+ }
+ echo join('', $f);
+ echo "\n}\n\n";
}
echo 'new PharCommand($argc, $argv);'."\n";
diff --git a/ext/phar/makestub.php b/ext/phar/makestub.php
index 2feb730845..42ca3d62d3 100644
--- a/ext/phar/makestub.php
+++ b/ext/phar/makestub.php
@@ -4,18 +4,18 @@ $s = str_replace("\r", '', file_get_contents(dirname(__FILE__) . '/shortarc.php'
$s .= "\nExtract_Phar::go();\n__HALT_COMPILER();";
$news = '';
foreach (token_get_all($s) as $token) {
- if (is_array($token)) {
- if ($token[0] == T_COMMENT) {
- $token[1] = '';
- }
- if ($token[0] == T_WHITESPACE) {
- $n = str_repeat("\n", substr_count($token[1], "\n"));
- $token[1] = strlen($n) ? $n : ' ';
- }
- $news .= $token[1];
- } else {
- $news .= $token;
- }
+ if (is_array($token)) {
+ if ($token[0] == T_COMMENT) {
+ $token[1] = '';
+ }
+ if ($token[0] == T_WHITESPACE) {
+ $n = str_repeat("\n", substr_count($token[1], "\n"));
+ $token[1] = strlen($n) ? $n : ' ';
+ }
+ $news .= $token[1];
+ } else {
+ $news .= $token;
+ }
}
$s = $news . ' ?>';
$slen = strlen($s) - strlen('index.php') - strlen("000");
@@ -55,50 +55,50 @@ $s1split = str_split($s1, 2046);
$s3split = str_split($s3, 2046);
$took = false;
foreach ($s1split as $i => $chunk) {
- if ($took) {
- $s1split[$i] = substr($chunk, 1);
- $took = false;
- }
- if ($chunk[strlen($chunk) - 1] == '\\') {
- $s1split[$i] .= $s1split[$i + 1][0];
- $took = true;
- }
+ if ($took) {
+ $s1split[$i] = substr($chunk, 1);
+ $took = false;
+ }
+ if ($chunk[strlen($chunk) - 1] == '\\') {
+ $s1split[$i] .= $s1split[$i + 1][0];
+ $took = true;
+ }
}
foreach ($s3split as $i => $chunk) {
- if ($took) {
- $s3split[$i] = substr($chunk, 1);
- $took = false;
- }
- if ($chunk[strlen($chunk) - 1] == '\\') {
- $s3split[$i] .= $s3split[$i + 1][0];
- $took = true;
- }
+ if ($took) {
+ $s3split[$i] = substr($chunk, 1);
+ $took = false;
+ }
+ if ($chunk[strlen($chunk) - 1] == '\\') {
+ $s3split[$i] .= $s3split[$i + 1][0];
+ $took = true;
+ }
}
$stub .= "\tstatic const char newstub0[] = \"" . $webs . '";
';
foreach ($s1split as $i => $chunk) {
- $s1count = $i + 1;
- $stub .= "\tstatic const char newstub1_" . $i . '[] = "' . $chunk . '";
+ $s1count = $i + 1;
+ $stub .= "\tstatic const char newstub1_" . $i . '[] = "' . $chunk . '";
';
}
$stub .= "\tstatic const char newstub2[] = \"" . $s2 . "\";
";
foreach ($s3split as $i => $chunk) {
- $s3count = $i + 1;
- $stub .= "\tstatic const char newstub3_" . $i . '[] = "' . $chunk . '";
+ $s3count = $i + 1;
+ $stub .= "\tstatic const char newstub3_" . $i . '[] = "' . $chunk . '";
';
}
$stub .= "\n\tstatic const int newstub_len = " . $slen . ";
\t*len = spprintf(stub, name_len + web_len + newstub_len, \"%s%s" . str_repeat('%s', $s1count) . '%s%s%d'
- . str_repeat('%s', $s3count) . '", newstub0, web';
+ . str_repeat('%s', $s3count) . '", newstub0, web';
foreach ($s1split as $i => $unused) {
- $stub .= ', newstub1_' . $i;
+ $stub .= ', newstub1_' . $i;
}
$stub .= ', index_php, newstub2';
$stub .= ", name_len + web_len + newstub_len";
foreach ($s3split as $i => $unused) {
- $stub .= ', newstub3_' . $i;
+ $stub .= ', newstub3_' . $i;
}
$stub .= ");
}";
diff --git a/ext/phar/phar/phar.php b/ext/phar/phar/phar.php
index 13538777a5..53aa76f60a 100755
--- a/ext/phar/phar/phar.php
+++ b/ext/phar/phar/phar.php
@@ -12,37 +12,37 @@
if (!extension_loaded('phar'))
{
- if (!class_exists('PHP_Archive', 0)) {
- echo "Neither Extension Phar nor class PHP_Archive are available.\n";
- exit(1);
- }
- if (!in_array('phar', stream_get_wrappers())) {
- stream_wrapper_register('phar', 'PHP_Archive');
- }
- if (!class_exists('Phar',0)) {
- require 'phar://'.__FILE__.'/phar.inc';
- }
+ if (!class_exists('PHP_Archive', 0)) {
+ echo "Neither Extension Phar nor class PHP_Archive are available.\n";
+ exit(1);
+ }
+ if (!in_array('phar', stream_get_wrappers())) {
+ stream_wrapper_register('phar', 'PHP_Archive');
+ }
+ if (!class_exists('Phar',0)) {
+ require 'phar://'.__FILE__.'/phar.inc';
+ }
}
foreach(array("SPL", "Reflection") as $ext)
{
- if (!extension_loaded($ext)) {
- echo "$argv[0] requires PHP extension $ext.\n";
- exit(1);
- }
+ if (!extension_loaded($ext)) {
+ echo "$argv[0] requires PHP extension $ext.\n";
+ exit(1);
+ }
}
function command_include($file)
{
- $file = 'phar://' . __FILE__ . '/' . $file;
- if (file_exists($file)) {
- include($file);
- }
+ $file = 'phar://' . __FILE__ . '/' . $file;
+ if (file_exists($file)) {
+ include($file);
+ }
}
function command_autoload($classname)
{
- command_include(strtolower($classname) . '.inc');
+ command_include(strtolower($classname) . '.inc');
}
Phar::mapPhar();
diff --git a/ext/phar/phar_object.stub.php b/ext/phar/phar_object.stub.php
index a1719fddb9..2af9d5bc5e 100644
--- a/ext/phar/phar_object.stub.php
+++ b/ext/phar/phar_object.stub.php
@@ -96,7 +96,7 @@ class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
*/
public function offsetExists($entry) {}
- /**
+ /**
* @param string $entry
* @return PharFileInfo
*/
@@ -130,7 +130,7 @@ class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
/** @return void */
public function setSignatureAlgorithm(int $algorithm, string $privatekey = UNKNOWN) {}
- /**
+ /**
* @param resource $newstub
* @return bool
*/
@@ -318,7 +318,7 @@ class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAcc
/** @return void */
public function setSignatureAlgorithm(int $algorithm, string $privatekey = UNKNOWN) {}
- /**
+ /**
* @param resource $newstub
* @return bool
*/
diff --git a/ext/snmp/snmp.stub.php b/ext/snmp/snmp.stub.php
index 965a0fbc8d..ce085637be 100644
--- a/ext/snmp/snmp.stub.php
+++ b/ext/snmp/snmp.stub.php
@@ -78,43 +78,43 @@ function snmp_read_mib(string $filename): bool {}
class SNMP
{
- function __construct(int $version, string $host, string $community, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
-
- /** @return bool */
- function close() {}
-
- /** @return bool */
- function setSecurity(string $sec_level, string $auth_protocol = '', string $auth_passphrase = '', string $priv_protocol = '', string $priv_passphrase = '', string $contextName = '', string $contextEngineID = '') {}
-
- /**
- * @param array|string $object_id
- * @return array|bool
- */
- function get($object_id, bool $use_orignames = false) {}
-
- /**
- * @param array|string $object_id
- * @return array|bool
- */
- function getnext($object_id) {}
-
- /**
- * @param array|string $object_id
- * @return array|bool
- */
- function walk($object_id, bool $suffix_keys = false, int $max_repetitions = UNKNOWN, int $non_repeaters = UNKNOWN) {}
-
- /**
- * @param array|string $object_id
- * @param array|string $type
- * @param array|string $value
- * @return array|bool
- */
- function set($object_id, $type, $value) {}
-
- /** @return int */
- function getErrno() {}
-
- /** @return string */
- function getError() {}
+ function __construct(int $version, string $host, string $community, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
+
+ /** @return bool */
+ function close() {}
+
+ /** @return bool */
+ function setSecurity(string $sec_level, string $auth_protocol = '', string $auth_passphrase = '', string $priv_protocol = '', string $priv_passphrase = '', string $contextName = '', string $contextEngineID = '') {}
+
+ /**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+ function get($object_id, bool $use_orignames = false) {}
+
+ /**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+ function getnext($object_id) {}
+
+ /**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+ function walk($object_id, bool $suffix_keys = false, int $max_repetitions = UNKNOWN, int $non_repeaters = UNKNOWN) {}
+
+ /**
+ * @param array|string $object_id
+ * @param array|string $type
+ * @param array|string $value
+ * @return array|bool
+ */
+ function set($object_id, $type, $value) {}
+
+ /** @return int */
+ function getErrno() {}
+
+ /** @return string */
+ function getError() {}
}
diff --git a/ext/zip/examples/addglob.php b/ext/zip/examples/addglob.php
index 3c432f0be5..13ea83b02a 100644
--- a/ext/zip/examples/addglob.php
+++ b/ext/zip/examples/addglob.php
@@ -5,8 +5,8 @@ $z->open('a.zip', ZIPARCHIVE::CREATE);
/* or 'remove_all_path' => 0*/
$options = array(
- 'remove_path' => '/home/francis/myimages',
- 'add_path' => 'images/',
+ 'remove_path' => '/home/francis/myimages',
+ 'add_path' => 'images/',
);
$found = $z->addGlob("/home/pierre/cvs/gd/libgd/tests/*.png", 0, $options);
var_dump($found);
diff --git a/ext/zip/examples/create.php b/ext/zip/examples/create.php
index a41c8e6d0b..d835704c8e 100644
--- a/ext/zip/examples/create.php
+++ b/ext/zip/examples/create.php
@@ -9,9 +9,9 @@ $zip = new ZipArchive();
$filename = "./test112.zip";
if (!$zip->open($filename, ZIPARCHIVE::CREATE)) {
- exit("cannot open <$filename>\n");
+ exit("cannot open <$filename>\n");
} else {
- echo "file <$filename> OK\n";
+ echo "file <$filename> OK\n";
}
$zip->addFromString("testfilephp.txt" . time(), "#1 This is a test string added as testfilephp.txt.\n");
diff --git a/ext/zip/examples/dir.php b/ext/zip/examples/dir.php
index c362a72ba3..6fe56c0b9b 100644
--- a/ext/zip/examples/dir.php
+++ b/ext/zip/examples/dir.php
@@ -15,7 +15,7 @@ echo "filename: " . $za->filename . "\n";
echo "comment: " . $za->comment . "\n";
for ($i=0; $i<$za->numFiles;$i++) {
- echo "index: $i\n";
- print_r($za->statIndex($i));
+ echo "index: $i\n";
+ print_r($za->statIndex($i));
}
echo "numFile:" . $za->numFiles . "\n";
diff --git a/ext/zip/examples/encryption.php b/ext/zip/examples/encryption.php
index 9ef7dd8497..42d3850404 100644
--- a/ext/zip/examples/encryption.php
+++ b/ext/zip/examples/encryption.php
@@ -40,9 +40,9 @@ $zip->close();
echo "== Stream with context\n";
$ctx = stream_context_create(array(
- 'zip' => array(
- 'password' => $pass
- )
+ 'zip' => array(
+ 'password' => $pass
+ )
));
$text = file_get_contents("zip://$name#$file", false, $ctx);
printf("Size = %d\n", strlen($text));
diff --git a/ext/zip/examples/extract.php b/ext/zip/examples/extract.php
index 5276b0dca5..01a9c75aee 100644
--- a/ext/zip/examples/extract.php
+++ b/ext/zip/examples/extract.php
@@ -19,9 +19,9 @@ echo $zip->filename . "\n";
var_dump($zip);
$files = array('test', 'testdir/test2');
if (!$zip->extractTo("./testext/path/to", $files)) {
- echo "error!\n";
- echo $zip->status . "\n";
- echo $zip->statusSys . "\n";
+ echo "error!\n";
+ echo $zip->status . "\n";
+ echo $zip->statusSys . "\n";
}
diff --git a/ext/zip/examples/extractAll.php b/ext/zip/examples/extractAll.php
index d318a453df..69286b93ec 100644
--- a/ext/zip/examples/extractAll.php
+++ b/ext/zip/examples/extractAll.php
@@ -15,9 +15,9 @@ echo $zip->filename . "\n";
var_dump($zip);
$files = array('test', 'testdir/test2');
if (!$zip->extractTo("./testext/path/to")) {
- echo "error!\n";
- echo $zip->status . "\n";
- echo $zip->statusSys . "\n";
+ echo "error!\n";
+ echo $zip->status . "\n";
+ echo $zip->statusSys . "\n";
}
diff --git a/ext/zip/examples/fopen.php b/ext/zip/examples/fopen.php
index 80de5d052a..4dcedba74a 100644
--- a/ext/zip/examples/fopen.php
+++ b/ext/zip/examples/fopen.php
@@ -6,11 +6,11 @@ if (!extension_loaded('zip')) {
$fp = fopen('zip://' . dirname(__FILE__) . '/test.zip#test', 'r');
if (!$fp) {
- exit("cannot open\n");
+ exit("cannot open\n");
}
while (!feof($fp)) {
- $contents .= fread($fp, 2);
- echo "$contents\n";
+ $contents .= fread($fp, 2);
+ echo "$contents\n";
}
fclose($fp);
@@ -25,7 +25,7 @@ $fp = $z->getStream('test');
var_dump($fp);
if(!$fp) exit("\n");
while (!feof($fp)) {
- $contents .= fread($fp, 2);
+ $contents .= fread($fp, 2);
}
fclose($fp);
diff --git a/ext/zip/examples/get_set_comments.php b/ext/zip/examples/get_set_comments.php
index 600b51138d..a9faf08f33 100644
--- a/ext/zip/examples/get_set_comments.php
+++ b/ext/zip/examples/get_set_comments.php
@@ -7,9 +7,9 @@ $z->open('t.zip');
print_r($z);
for ($i=0; $i<$z->numFiles; $i++) {
- echo "index: $i\n";
- print_r($z->getCommentIndex($i));
- echo "\n\n";
+ echo "index: $i\n";
+ print_r($z->getCommentIndex($i));
+ echo "\n\n";
}
echo "foobar/ " . $z->getCommentName('foobar/') . "\n";
@@ -22,9 +22,9 @@ $z->setCommentName('foobar/', 'new comment foobar/');
$z->setArchiveComment( 'new archive comment');
for ($i=0; $i<$z->numFiles; $i++) {
- echo "index: $i\n";
- print_r($z->getCommentIndex($i));
- echo "\n\n";
+ echo "index: $i\n";
+ print_r($z->getCommentIndex($i));
+ echo "\n\n";
}
echo $z->getCommentName('foobar/') . "\n";
diff --git a/ext/zip/examples/odt.php b/ext/zip/examples/odt.php
index 195c781e33..3f923296a1 100644
--- a/ext/zip/examples/odt.php
+++ b/ext/zip/examples/odt.php
@@ -5,16 +5,16 @@ $reader = new XMLReader();
$reader->open('zip://' . dirname(__FILE__) . '/test.odt#meta.xml');
$odt_meta = array();
while ($reader->read()) {
- if ($reader->nodeType == XMLREADER::ELEMENT) {
- $elm = $reader->name;
- } else {
- if ($reader->nodeType == XMLREADER::END_ELEMENT && $reader->name == 'office:meta') {
- break;
- }
- if (!trim($reader->value)) {
- continue;
- }
- $odt_meta[$elm] = $reader->value;
- }
+ if ($reader->nodeType == XMLREADER::ELEMENT) {
+ $elm = $reader->name;
+ } else {
+ if ($reader->nodeType == XMLREADER::END_ELEMENT && $reader->name == 'office:meta') {
+ break;
+ }
+ if (!trim($reader->value)) {
+ continue;
+ }
+ $odt_meta[$elm] = $reader->value;
+ }
}
print_r($odt_meta);
diff --git a/ext/zip/examples/oldapi.php b/ext/zip/examples/oldapi.php
index 82a6277f3a..216de4837e 100644
--- a/ext/zip/examples/oldapi.php
+++ b/ext/zip/examples/oldapi.php
@@ -4,14 +4,14 @@ $zip = zip_open('examples/test1.zip');
var_dump($zip);
if ($zip) {
- $i = 0;
- while ($zip_entry = zip_read($zip)) {
- var_dump($zip_entry);
- $txt = zip_entry_read($zip_entry, 10);
+ $i = 0;
+ while ($zip_entry = zip_read($zip)) {
+ var_dump($zip_entry);
+ $txt = zip_entry_read($zip_entry, 10);
echo $i . ": " . $txt . "size: " . zip_entry_filesize($zip_entry) .
- "comp_method: " . zip_entry_compressionmethod($zip_entry) .
- "\n";
- $i++;
- }
- var_dump($zip_entry);
+ "comp_method: " . zip_entry_compressionmethod($zip_entry) .
+ "\n";
+ $i++;
+ }
+ var_dump($zip_entry);
}
diff --git a/ext/zip/examples/set_compression.php b/ext/zip/examples/set_compression.php
index 1efd88c7f1..49494e0bf7 100644
--- a/ext/zip/examples/set_compression.php
+++ b/ext/zip/examples/set_compression.php
@@ -8,7 +8,7 @@ $zip = new ZipArchive();
$filename = "a.zip";
if (!$zip->open($filename, ZIPARCHIVE::CREATE | ZipArchive::OVERWRITE)) {
- exit("cannot open <$filename>\n");
+ exit("cannot open <$filename>\n");
}
$zip->addFromString("testfilephp.txt", "#1 This is a test string added as testfilephp.txt.\n");