diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-03 22:52:20 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-03 22:52:20 +0100 |
commit | f8d795820e780a6322e054c26c581570613c14f0 (patch) | |
tree | 99d3ae01ce564752807341c5743863b4c92513f8 /sapi/cgi | |
parent | d2cb200e10ada6fa44c54a29292bb4665728fff0 (diff) | |
download | php-git-f8d795820e780a6322e054c26c581570613c14f0.tar.gz |
Reindent phpt files
Diffstat (limited to 'sapi/cgi')
-rw-r--r-- | sapi/cgi/tests/003.phpt | 10 | ||||
-rw-r--r-- | sapi/cgi/tests/004.phpt | 6 | ||||
-rw-r--r-- | sapi/cgi/tests/006.phpt | 10 | ||||
-rw-r--r-- | sapi/cgi/tests/008.phpt | 10 | ||||
-rw-r--r-- | sapi/cgi/tests/011.phpt | 14 | ||||
-rw-r--r-- | sapi/cgi/tests/apache_request_headers.phpt | 6 | ||||
-rw-r--r-- | sapi/cgi/tests/include.inc | 96 | ||||
-rw-r--r-- | sapi/cgi/tests/skipif.inc | 4 |
8 files changed, 78 insertions, 78 deletions
diff --git a/sapi/cgi/tests/003.phpt b/sapi/cgi/tests/003.phpt index 4b4d29267d..00c59c7278 100644 --- a/sapi/cgi/tests/003.phpt +++ b/sapi/cgi/tests/003.phpt @@ -23,12 +23,12 @@ $code =' /* some test script */ class test { /* {{{ */ - public $var = "test"; //test var -#perl style comment - private $pri; /* private attr */ + public $var = "test"; //test var +#perl style comment + private $pri; /* private attr */ - function foo(/* void */) { - } + function foo(/* void */) { + } } /* }}} */ diff --git a/sapi/cgi/tests/004.phpt b/sapi/cgi/tests/004.phpt index b46dce7052..1de856e346 100644 --- a/sapi/cgi/tests/004.phpt +++ b/sapi/cgi/tests/004.phpt @@ -17,7 +17,7 @@ $code =' <?php class test { - private $pri; + private $pri; } var_dump(test::$pri); @@ -27,9 +27,9 @@ var_dump(test::$pri); file_put_contents($filename, $code); if (defined("PHP_WINDOWS_VERSION_MAJOR")) { - var_dump(`$php -n -f "$filename"`); + var_dump(`$php -n -f "$filename"`); } else { - var_dump(`$php -n -f "$filename" 2>/dev/null`); + var_dump(`$php -n -f "$filename" 2>/dev/null`); } var_dump(`$php -n -f "wrong"`); diff --git a/sapi/cgi/tests/006.phpt b/sapi/cgi/tests/006.phpt index c78229880c..479d4a9441 100644 --- a/sapi/cgi/tests/006.phpt +++ b/sapi/cgi/tests/006.phpt @@ -19,7 +19,7 @@ $code = ' $test = "var"; class test { - private $var; + private $var; } echo test::$var; @@ -35,8 +35,8 @@ var_dump(`"$php" -n -l some.unknown`); $code = ' <?php -class test - private $var; +class test + private $var; } ?> @@ -45,9 +45,9 @@ class test file_put_contents($filename, $code); if (defined("PHP_WINDOWS_VERSION_MAJOR")) { - var_dump(`"$php" -n -l "$filename"`); + var_dump(`"$php" -n -l "$filename"`); } else { - var_dump(`"$php" -n -l "$filename" 2>/dev/null`); + var_dump(`"$php" -n -l "$filename" 2>/dev/null`); } @unlink($filename); diff --git a/sapi/cgi/tests/008.phpt b/sapi/cgi/tests/008.phpt index be2fd578e7..05d9d8c190 100644 --- a/sapi/cgi/tests/008.phpt +++ b/sapi/cgi/tests/008.phpt @@ -16,12 +16,12 @@ $code = ' $test = "var"; //var /* test class */ class test { - private $var = array(); + private $var = array(); - public static function foo(Test $arg) { - echo "hello"; - var_dump($this); - } + public static function foo(Test $arg) { + echo "hello"; + var_dump($this); + } } $o = new test; diff --git a/sapi/cgi/tests/011.phpt b/sapi/cgi/tests/011.phpt index 6d4a6ed7f9..263c2e61ef 100644 --- a/sapi/cgi/tests/011.phpt +++ b/sapi/cgi/tests/011.phpt @@ -13,13 +13,13 @@ reset_env_vars(); $f = tempnam(sys_get_temp_dir(), 'cgitest'); function test($script) { - file_put_contents($GLOBALS['f'], $script); - $cmd = escapeshellcmd($GLOBALS['php']); - $cmd .= ' -n -dreport_zend_debug=0 -dhtml_errors=0 ' . escapeshellarg($GLOBALS['f']); - echo "----------\n"; - echo rtrim($script) . "\n"; - echo "----------\n"; - passthru($cmd); + file_put_contents($GLOBALS['f'], $script); + $cmd = escapeshellcmd($GLOBALS['php']); + $cmd .= ' -n -dreport_zend_debug=0 -dhtml_errors=0 ' . escapeshellarg($GLOBALS['f']); + echo "----------\n"; + echo rtrim($script) . "\n"; + echo "----------\n"; + passthru($cmd); } test('<?php ?>'); diff --git a/sapi/cgi/tests/apache_request_headers.phpt b/sapi/cgi/tests/apache_request_headers.phpt index bda9ef8b70..647508a64a 100644 --- a/sapi/cgi/tests/apache_request_headers.phpt +++ b/sapi/cgi/tests/apache_request_headers.phpt @@ -21,9 +21,9 @@ passthru("$php -n $file"); $names = array('HTTP_X_TEST', 'HTTP_X__TEST', 'HTTP_X_'); foreach ($names as $name) { - putenv($name."=".str_repeat("A", 256)); - passthru("$php -n -q $file"); - putenv($name); + putenv($name."=".str_repeat("A", 256)); + passthru("$php -n -q $file"); + putenv($name); } unlink($file); diff --git a/sapi/cgi/tests/include.inc b/sapi/cgi/tests/include.inc index 61b339e49f..cd9236f116 100644 --- a/sapi/cgi/tests/include.inc +++ b/sapi/cgi/tests/include.inc @@ -2,64 +2,64 @@ function get_cgi_path() /* {{{ */ { - $php = getenv("TEST_PHP_EXECUTABLE"); + $php = getenv("TEST_PHP_EXECUTABLE"); - $cli = false; - $cgi = false; + $cli = false; + $cgi = false; - if (file_exists($php) && is_executable($php)) { - $version = `$php -n -v`; - if (strstr($version, "(cli)")) { - /* that's cli */ - $cli = true; - } else if (strpos($version, "(cgi")) { - /* that's cgi */ - return $php; - } - } + if (file_exists($php) && is_executable($php)) { + $version = `$php -n -v`; + if (strstr($version, "(cli)")) { + /* that's cli */ + $cli = true; + } else if (strpos($version, "(cgi")) { + /* that's cgi */ + return $php; + } + } - if ($cli) { - /* trying to guess ... */ - $php_path = $php; - if (defined("PHP_WINDOWS_VERSION_MAJOR")) { - /* On Windows it should be in the same dir as php.exe in most of the cases. */ - $php_path = dirname($php); + if ($cli) { + /* trying to guess ... */ + $php_path = $php; + if (defined("PHP_WINDOWS_VERSION_MAJOR")) { + /* On Windows it should be in the same dir as php.exe in most of the cases. */ + $php_path = dirname($php); - if (is_dir($php_path) && file_exists("$php_path/php-cgi.exe") && is_executable("$php_path/php-cgi.exe")) { - return "$php_path/php-cgi.exe"; - } - } else { - for ($i = 0; $i < 2; $i++) { - $slash_pos = strrpos($php_path, "/"); - if ($slash_pos) { - $php_path = substr($php_path, 0, $slash_pos); - } else { - return FALSE; - } - } + if (is_dir($php_path) && file_exists("$php_path/php-cgi.exe") && is_executable("$php_path/php-cgi.exe")) { + return "$php_path/php-cgi.exe"; + } + } else { + for ($i = 0; $i < 2; $i++) { + $slash_pos = strrpos($php_path, "/"); + if ($slash_pos) { + $php_path = substr($php_path, 0, $slash_pos); + } else { + return FALSE; + } + } - if ($php_path && is_dir($php_path) && file_exists($php_path."/cgi/php-cgi") && is_executable($php_path."/cgi/php-cgi")) { - /* gotcha */ - return $php_path."/cgi/php-cgi"; - } - } - return false; - } - /* uhm? what's that then? */ - return false; + if ($php_path && is_dir($php_path) && file_exists($php_path."/cgi/php-cgi") && is_executable($php_path."/cgi/php-cgi")) { + /* gotcha */ + return $php_path."/cgi/php-cgi"; + } + } + return false; + } + /* uhm? what's that then? */ + return false; } /* }}} */ function reset_env_vars() /* {{{ */ { - putenv("REDIRECT_STATUS"); - putenv("QUERY_STRING"); - putenv("PATH_TRANSLATED"); - putenv("SCRIPT_FILENAME"); - putenv("SERVER_SOFTWARE"); - putenv("SERVER_NAME"); - putenv("GATEWAY_INTERFACE"); - putenv("REQUEST_METHOD"); + putenv("REDIRECT_STATUS"); + putenv("QUERY_STRING"); + putenv("PATH_TRANSLATED"); + putenv("SCRIPT_FILENAME"); + putenv("SERVER_SOFTWARE"); + putenv("SERVER_NAME"); + putenv("GATEWAY_INTERFACE"); + putenv("REQUEST_METHOD"); } /* }}} */ diff --git a/sapi/cgi/tests/skipif.inc b/sapi/cgi/tests/skipif.inc index d2cef23589..2145a9e410 100644 --- a/sapi/cgi/tests/skipif.inc +++ b/sapi/cgi/tests/skipif.inc @@ -1,13 +1,13 @@ <?php if (substr(php_sapi_name(), 0, 3) == "cgi") { - exit; + exit; } include dirname(__FILE__)."/include.inc"; if (!get_cgi_path()) { - die("skip CGI not found"); + die("skip CGI not found"); } ?> |