-
+ |
 PHP-FPM real-time status page
|
-
Pool Status
+
Pool Status
-
Active Processes status
+
Active Processes status
PID↓ | Start Time | Start Since | Requests Served | Request Duration | Request method | Request URI | Content Length | User | Script |
-
Idle Processes status
+
Idle Processes status
PID↓ | Start Time | Start Since | Requests Served | Request Duration | Request method | Request URI | Content Length | User | Script | Last Request %CPU | Last Request Memory |
diff --git a/sapi/fpm/tests/fcgi.inc b/sapi/fpm/tests/fcgi.inc
index 71bdad17b95..07603a808e0 100644
--- a/sapi/fpm/tests/fcgi.inc
+++ b/sapi/fpm/tests/fcgi.inc
@@ -603,7 +603,7 @@ class Client
}
if ($resp['type'] == self::END_REQUEST) {
$this->_requests[$resp['requestId']]['state'] = self::REQ_STATE_OK;
- if ($resp['requestId'] == $requestId) {
+ if ($resp['requestId'] == $requestId) {
break;
}
}
diff --git a/sapi/litespeed/README.md b/sapi/litespeed/README.md
index 99967ce3d6d..e744030de74 100644
--- a/sapi/litespeed/README.md
+++ b/sapi/litespeed/README.md
@@ -3,27 +3,27 @@ Introduction
LiteSpeed SAPI module is a dedicated interface for PHP integration with
LiteSpeed Web Server. LiteSpeed SAPI has similar architecture to the
-FastCGI SAPI with there major enhancements: better performance, dynamic
+FastCGI SAPI with there major enhancements: better performance, dynamic
spawning and PHP configuration modification through web server
-configuration and .htaccess files.
+configuration and .htaccess files.
Our simple benchmark test ("hello world") shows that PHP with
LiteSpeed SAPI has 30% better performance over PHP with FastCGI SAPI,
-which is nearly twice the performance that Apache mod_php can deliver.
-
-A major drawback of FastCGI PHP comparing to Apache mod_php is lacking
-the flexibilities in PHP configurations. PHP configurations cannot be
-changed at runtime via configuration files like .htaccess files or web
-server's virtual host configuration. In shared hosting environment,
-each hosting account will has its own "open_basedir" overridden in
-server configuration to enhance server security when mod_php is used.
-usually, FastCGI PHP is not an option in shared hosting environment
-due to lacking of this flexibility. LiteSpeed SAPI is carefully designed
-to address this issue. PHP configurations can be modified the same way
-as that in mod_php with the same configuration directives.
+which is nearly twice the performance that Apache mod_php can deliver.
-PHP with LiteSpeed SAPI is highly recommended over FastCGI PHP for
-PHP scripting with LiteSpeed web server.
+A major drawback of FastCGI PHP comparing to Apache mod_php is lacking
+the flexibilities in PHP configurations. PHP configurations cannot be
+changed at runtime via configuration files like .htaccess files or web
+server's virtual host configuration. In shared hosting environment,
+each hosting account will has its own "open_basedir" overridden in
+server configuration to enhance server security when mod_php is used.
+usually, FastCGI PHP is not an option in shared hosting environment
+due to lacking of this flexibility. LiteSpeed SAPI is carefully designed
+to address this issue. PHP configurations can be modified the same way
+as that in mod_php with the same configuration directives.
+
+PHP with LiteSpeed SAPI is highly recommended over FastCGI PHP for
+PHP scripting with LiteSpeed web server.
Building PHP with LiteSpeed SAPI
@@ -31,9 +31,9 @@ Building PHP with LiteSpeed SAPI
You need to add "--with-litespeed" to the configure command to build
PHP with LiteSpeed SAPI, all other SAPI related configure options
-should be removed.
+should be removed.
-For example:
+For example:
./configure --with-litespeed
make
@@ -42,17 +42,17 @@ directory after the compilation succeeds. Copy it to
'lsws/fcgi-bin/lsphp' or wherever you prefer, if LiteSpeed web server
has been configured to run PHP with LiteSpeed SAPI already, you just
need to overwrite the old executable with this one and you are all
-set.
+set.
Start PHP from command line
===========================
Usually, lsphp is managed by LiteSpeed web server in a single server
-installation. lsphp can be used in clustered environment with one
-LiteSpeed web server at the front, load balancing lsphp processes
+installation. lsphp can be used in clustered environment with one
+LiteSpeed web server at the front, load balancing lsphp processes
running on multiple backend servers. In such environment, lsphp can be
-start manually from command with option "-b
", socket
-address can be IPv4, IPv6 or Unix Domain Socket address.
+start manually from command with option "-b ", socket
+address can be IPv4, IPv6 or Unix Domain Socket address.
for example:
./lsphp -b [::]:3000
@@ -76,56 +76,56 @@ Using LiteSpeed PHP with LiteSpeed Web Server
=============================================
Detailed information about how to configure LiteSpeed web server with
-PHP support is available from our website, at:
+PHP support is available from our website, at:
https://www.litespeedtech.com/docs/webserver
Usually, PHP support has been configured out of box, you don't need to
change it unless you want to change PHP interface from FastCGI to
-LiteSpeed SAPI or vice versa.
+LiteSpeed SAPI or vice versa.
Brief instructions are as follow:
1) Login to web administration interface, go to 'Server'->'Ext App' tab,
add an external application of type "LSAPI app", "Command" should be
- set to a shell command that executes the PHP binary you just built.
- "Instances" should be set to "1". Add "LSAPI_CHILDREN" environment
- variable to match the value of "Max Connections". More tunable
- environment variable described below can be added.
+ set to a shell command that executes the PHP binary you just built.
+ "Instances" should be set to "1". Add "LSAPI_CHILDREN" environment
+ variable to match the value of "Max Connections". More tunable
+ environment variable described below can be added.
2) Go to 'Server'->'Script Handler' tab, add a script handler
configuration: set 'suffix' to 'php', 'Handler Type' to 'LiteSpeed
API', 'Handler Name' should be the name of external application
- just defined.
+ just defined.
-3) Click 'Apply Changes' link on the top left of the page, then click
- 'graceful restart'. Now PHP is running with LiteSpeed SAPI.
+3) Click 'Apply Changes' link on the top left of the page, then click
+ 'graceful restart'. Now PHP is running with LiteSpeed SAPI.
Tunings
-------
There are a few environment variables that can be tweaked to control the
-behavior of LSAPI application.
+behavior of LSAPI application.
* LSAPI_CHILDREN or PHP_LSAPI_CHILDREN (default: 0)
-There are two ways to let PHP handle multiple requests concurrently,
-Server Managed Mode and Self Managed Mode. In Server Managed Mode,
+There are two ways to let PHP handle multiple requests concurrently,
+Server Managed Mode and Self Managed Mode. In Server Managed Mode,
LiteSpeed web server dynamically spawn/stop PHP processes, in this mode
-"Instances" should match "Max Connections" configuration for PHP
-external application. To start PHP in Self Managed Mode, "Instances"
+"Instances" should match "Max Connections" configuration for PHP
+external application. To start PHP in Self Managed Mode, "Instances"
should be set to "1", while "LSAPI_CHILDREN" environment variable should
-be set to match the value of "Max Connections" and >1. Web Server will
-start one PHP process, this process will start/stop children PHP processes
-dynamically based on on demand. If "LSAPI_CHILDREN" <=1, PHP will be
+be set to match the value of "Max Connections" and >1. Web Server will
+start one PHP process, this process will start/stop children PHP processes
+dynamically based on on demand. If "LSAPI_CHILDREN" <=1, PHP will be
started in server managed mode.
-Self Managed Mode is preferred because all PHP processes can share one
+Self Managed Mode is preferred because all PHP processes can share one
shared memory block for the opcode cache.
Usually, there is no need to set value of LSAPI_CHILDREN over 100 in
-most server environment.
+most server environment.
* LSAPI_AVOID_FORK (default: 0)
@@ -151,22 +151,22 @@ LSAPI_CHIDLREN, When LSAPI_AVOID_FORK is set to 1, the default value is 0.
* LSAPI_MAX_REQS or PHP_LSAPI_MAX_REQUESTS (default value: 10000)
This controls how many requests each child process will handle before
-it exits automatically. Several PHP functions have been identified
-having memory leaks. This parameter can help reducing memory usage
-of leaky PHP functions.
+it exits automatically. Several PHP functions have been identified
+having memory leaks. This parameter can help reducing memory usage
+of leaky PHP functions.
* LSAPI_MAX_IDLE (default value: 300 seconds)
-In Self Managed Mode, LSAPI_MAX_IDLE controls how long a idle child
-process will wait for a new request before it exits. This option help
+In Self Managed Mode, LSAPI_MAX_IDLE controls how long a idle child
+process will wait for a new request before it exits. This option help
releasing system resources taken by idle processes.
* LSAPI_MAX_IDLE_CHILDREN
(default value: 1/3 of LSAPI_CHILDREN or LSAPI_CHILDREN)
-In Self Managed Mode, LSAI_MAX_IDLE_CHILDREN controls how many idle
+In Self Managed Mode, LSAI_MAX_IDLE_CHILDREN controls how many idle
children processes are allowed. Excessive idle children processes
will be killed by the parent process immediately.
When LSAPI_AVOID_FORK is set to 0, the default value is 1/3 of
@@ -176,10 +176,10 @@ is LSAPI_CHILDREN.
* LSAPI_MAX_PROCESS_TIME (default value: 300 seconds)
-In Self Managed Mode, LSAPI_MAX_PROCESS_TIME controls the maximum
+In Self Managed Mode, LSAPI_MAX_PROCESS_TIME controls the maximum
processing time allowed when processing a request. If a child process
-can not finish processing of a request in the given time period, it
-will be killed by the parent process. This option can help getting rid
+can not finish processing of a request in the given time period, it
+will be killed by the parent process. This option can help getting rid
of dead or runaway child process.
@@ -187,26 +187,26 @@ of dead or runaway child process.
In Self Managed Mode, LSAPI_PGRP_MAX_IDLE controls how long the parent
process will wait before exiting when there is no child process.
-This option help releasing system resources taken by an idle parent
+This option help releasing system resources taken by an idle parent
process.
* LSAPI_PPID_NO_CHECK
By default a LSAPI application check the existence of its parent process
-and exits automatically if the parent process died. This is to reduce
-orphan process when web server is restarted. However, it is desirable
-to disable this feature, such as when a LSAPI process was started
-manually from command line. LSAPI_PPID_NO_CHECK should be set when
+and exits automatically if the parent process died. This is to reduce
+orphan process when web server is restarted. However, it is desirable
+to disable this feature, such as when a LSAPI process was started
+manually from command line. LSAPI_PPID_NO_CHECK should be set when
you want to disable the checking of existence of parent process.
-When PHP started by "-b" option, it is disabled automatically.
+When PHP started by "-b" option, it is disabled automatically.
Compatibility with Apache mod_php
=================================
-LSAPI PHP supports PHP configuration overridden via web server configuration
-as well as .htaccess.
+LSAPI PHP supports PHP configuration overridden via web server configuration
+as well as .htaccess.
Since 4.0 release "apache_response_headers" function is supported.
diff --git a/sapi/litespeed/config.m4 b/sapi/litespeed/config.m4
index 268b9aecde3..36e614c8537 100644
--- a/sapi/litespeed/config.m4
+++ b/sapi/litespeed/config.m4
@@ -10,7 +10,7 @@ PHP_ARG_WITH(litespeed,,
if test "$PHP_LITESPEED" != "no"; then
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/litespeed/Makefile.frag,$abs_srcdir/sapi/litespeed,sapi/litespeed)
SAPI_LITESPEED_PATH=sapi/litespeed/php
- PHP_SELECT_SAPI(litespeed, program, lsapi_main.c lsapilib.c, "", '$(SAPI_LITESPEED_PATH)')
+ PHP_SELECT_SAPI(litespeed, program, lsapi_main.c lsapilib.c, "", '$(SAPI_LITESPEED_PATH)')
case $host_alias in
*darwin*)
BUILD_LITESPEED="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_BINARY_OBJS:.lo=.o) \$(PHP_LITESPEED_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_LITESPEED_PATH)"
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index 0c5f5cc9ac4..1cfd45ebbf0 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -500,7 +500,7 @@ static void init_request_info( void )
{
char * pContentType = LSAPI_GetHeader( H_CONTENT_TYPE );
char * pAuth;
-
+
SG(request_info).content_type = pContentType ? pContentType : "";
SG(request_info).request_method = LSAPI_GetRequestMethod();
SG(request_info).query_string = LSAPI_GetQueryString();
@@ -510,7 +510,7 @@ static void init_request_info( void )
/* It is not reset by zend engine, set it to 200. */
SG(sapi_headers).http_response_code = 200;
-
+
pAuth = LSAPI_GetHeader( H_AUTHORIZATION );
php_handle_auth_data(pAuth);
}
@@ -546,7 +546,7 @@ static int lsapi_module_main(int show_source)
if (php_request_startup() == FAILURE ) {
return -1;
}
-
+
if (show_source) {
zend_syntax_highlighter_ini syntax_highlighter_ini;
@@ -768,7 +768,7 @@ static int lsapi_activate_user_ini_mk_user_config(_lsapi_activate_user_ini_ctx *
/* Find cached config entry: If not found, create one */
ctx->entry = zend_hash_str_find_ptr(&user_config_cache, ctx->path, ctx->path_len);
- if (!ctx->entry)
+ if (!ctx->entry)
{
ctx->entry = pemalloc(sizeof(user_config_cache_entry), 1);
ctx->entry->expires = 0;
@@ -815,7 +815,7 @@ static int lsapi_activate_user_ini_walk_down_the_path(_lsapi_activate_user_ini_c
strncmp(ctx->path, ctx->doc_root, docroot_len) != 0;
if (is_outside_of_docroot) {
- php_parse_user_ini_file(ctx->path, PG(user_ini_filename),
+ php_parse_user_ini_file(ctx->path, PG(user_ini_filename),
&ctx->entry->user_config);
} else {
walk_down_the_path(ctx->doc_root, ctx->path,
@@ -838,7 +838,7 @@ static int lsapi_activate_user_ini_finally(_lsapi_activate_user_ini_ctx *ctx,
int rc = SUCCESS;
fn_activate_user_ini_chain_t *fn_next = next;
- php_ini_activate_config(&ctx->entry->user_config, PHP_INI_PERDIR,
+ php_ini_activate_config(&ctx->entry->user_config, PHP_INI_PERDIR,
PHP_INI_STAGE_HTACCESS);
if (*fn_next) {
@@ -869,7 +869,7 @@ static int lsapi_activate_user_ini( void )
&lsapi_activate_user_ini_finally,
NULL
};
-
+
return fn_chain[0](&ctx, (fn_activate_user_ini_chain_t*)(fn_chain + 1));
}
@@ -1025,7 +1025,7 @@ static int cli_main( int argc, char * argv[] )
zend_uv.html_errors = 0; /* tell the engine we're in non-html mode */
CG(in_compilation) = 0; /* not initialized but needed for several options */
SG(options) |= SAPI_OPTION_NO_CHDIR;
-
+
for( ini = ini_defaults; *ini; ini+=2 ) {
psKey = zend_string_init(*ini, strlen( *ini ), 1);
zend_alter_ini_entry_chars(psKey,
@@ -1254,11 +1254,11 @@ int main( int argc, char * argv[] )
#endif
#if PHP_MAJOR_VERSION >= 7
-#if defined(ZEND_SIGNALS) || PHP_MINOR_VERSION > 0
+#if defined(ZEND_SIGNALS) || PHP_MINOR_VERSION > 0
zend_signal_startup();
#endif
#endif
-
+
if (argc > 1 ) {
if ( parse_opt( argc, argv, &climode,
&php_ini_path, &php_bind ) == -1 ) {
@@ -1289,7 +1289,7 @@ int main( int argc, char * argv[] )
* options: the latter override the former.
*/
init_sapi_from_env(&lsapi_sapi_module);
-
+
if ( ignore_php_ini )
lsapi_sapi_module.php_ini_ignore = 1;
@@ -1329,7 +1329,7 @@ int main( int argc, char * argv[] )
#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
int is_criu = LSCRIU_Init(); // Must be called before the regular init as it unsets the parameters.
#endif
-
+
LSAPI_Init_Env_Parameters( NULL );
lsapi_mode = 1;
@@ -1343,7 +1343,7 @@ int main( int argc, char * argv[] )
int iRequestsProcessed = 0;
int result;
-
+
while( ( result = LSAPI_Prefork_Accept_r( &g_req )) >= 0 ) {
#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
if (is_criu && !result) {
diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c
index f377472fe53..685892e7081 100644
--- a/sapi/litespeed/lsapilib.c
+++ b/sapi/litespeed/lsapilib.c
@@ -153,7 +153,7 @@ static int s_max_busy_workers = -1;
static char *s_stderr_log_path = NULL;
static int s_ignore_pid = -1;
-LSAPI_Request g_req =
+LSAPI_Request g_req =
{ .m_fdListen = -1, .m_fd = -1 };
static char s_secret[24];
@@ -216,7 +216,7 @@ static int HTTP_HEADER_LEN[H_TRANSFER_ENCODING+1] =
};
-static const char *s_log_level_names[8] =
+static const char *s_log_level_names[8] =
{
"", "DEBUG","INFO", "NOTICE", "WARN", "ERROR", "CRIT", "FATAL"
};
@@ -229,7 +229,7 @@ void LSAPI_Log(int flag, const char * fmt, ...)
if (flag & LSAPI_LOG_TIMESTAMP_BITS)
{
struct timeval tv;
- struct tm tm;
+ struct tm tm;
gettimeofday(&tv, NULL);
localtime_r(&tv.tv_sec, &tm);
if (flag & LSAPI_LOG_TIMESTAMP_FULL)
@@ -244,20 +244,20 @@ void LSAPI_Log(int flag, const char * fmt, ...)
tm.tm_hour, tm.tm_min, tm.tm_sec);
}
}
-
+
int level = flag & LSAPI_LOG_LEVEL_BITS;
if (level && level <= LSAPI_LOG_FLAG_FATAL)
{
p += snprintf(p, 100, "[%s] ", s_log_level_names[level]);
}
-
+
if (flag & LSAPI_LOG_PID)
{
p += snprintf(p, 100, "[%d] ", s_pid);
}
-
+
if (p > buf)
- fprintf(stderr, "%.*s", (int)(p - buf), buf);
+ fprintf(stderr, "%.*s", (int)(p - buf), buf);
va_list ap;
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
@@ -276,7 +276,7 @@ void LSAPI_Log(int flag, const char * fmt, ...)
#endif
-static int lsapi_parent_dead()
+static int lsapi_parent_dead()
{
// Return non-zero if the parent is dead. 0 if still alive.
if (!s_ppid) {
@@ -409,7 +409,7 @@ static void lsapi_close_connection(LSAPI_Request *pReq)
__sync_fetch_and_sub(s_busy_workers, 1);
if (s_worker_status)
s_worker_status->m_connected = 0;
-}
+}
static inline ssize_t lsapi_read( int fd, void * pBuf, size_t len )
@@ -708,8 +708,8 @@ static int validateHeaders( LSAPI_Request * pReq )
{
if ( pReq->m_pHeaderIndex->m_headerOff[i] )
{
- if (pReq->m_pHeaderIndex->m_headerOff[i] > totalLen
- || pReq->m_pHeaderIndex->m_headerLen[i]
+ if (pReq->m_pHeaderIndex->m_headerOff[i] > totalLen
+ || pReq->m_pHeaderIndex->m_headerLen[i]
+ pReq->m_pHeaderIndex->m_headerOff[i] > totalLen)
return -1;
}
@@ -721,8 +721,8 @@ static int validateHeaders( LSAPI_Request * pReq )
pEnd = pCur + pReq->m_pHeader->m_cntUnknownHeaders;
while( pCur < pEnd )
{
- if (pCur->nameOff > totalLen
- || pCur->nameOff + pCur->nameLen > totalLen
+ if (pCur->nameOff > totalLen
+ || pCur->nameOff + pCur->nameLen > totalLen
|| pCur->valueOff > totalLen
|| pCur->valueOff + pCur->valueLen > totalLen)
return -1;
@@ -868,7 +868,7 @@ int LSAPI_is_suEXEC_Daemon(void)
static int LSAPI_perror_r( LSAPI_Request * pReq, const char * pErr1, const char *pErr2 )
{
char achError[4096];
- int n = snprintf(achError, sizeof(achError), "[%d] %s:%s: %s\n", getpid(),
+ int n = snprintf(achError, sizeof(achError), "[%d] %s:%s: %s\n", getpid(),
pErr1, (pErr2)?pErr2:"", strerror(errno));
if (n > (int)sizeof(achError))
n = sizeof(achError);
@@ -1194,13 +1194,13 @@ static int parseRequest( LSAPI_Request * pReq, int totalLen )
if ( parseEnv( pReq->m_pEnvList, pReq->m_pHeader->m_cntEnv,
&pBegin, pEnd ) == -1 )
return -1;
- if (pReq->m_pHeader->m_scriptFileOff < 0
- || pReq->m_pHeader->m_scriptFileOff >= totalLen
+ if (pReq->m_pHeader->m_scriptFileOff < 0
+ || pReq->m_pHeader->m_scriptFileOff >= totalLen
|| pReq->m_pHeader->m_scriptNameOff < 0
|| pReq->m_pHeader->m_scriptNameOff >= totalLen
|| pReq->m_pHeader->m_queryStringOff < 0
|| pReq->m_pHeader->m_queryStringOff >= totalLen
- || pReq->m_pHeader->m_requestMethodOff < 0
+ || pReq->m_pHeader->m_requestMethodOff < 0
|| pReq->m_pHeader->m_requestMethodOff >= totalLen)
{
fprintf(stderr, "%d: bad request header - ERROR#1\n", getpid());
@@ -1231,13 +1231,13 @@ static int parseRequest( LSAPI_Request * pReq, int totalLen )
{
fixHeaderIndexEndian( pReq );
}
-
+
if (validateHeaders(pReq) == -1)
{
fprintf(stderr, "%d: bad request header - ERROR#2\n", getpid());
return -1;
}
-
+
pReq->m_reqBodyLen = pReq->m_pHeader->m_reqBodyLen;
if ( pReq->m_reqBodyLen == -2 )
{
@@ -1258,7 +1258,7 @@ static struct lsapi_packet_header s_ack = {'L', 'S',
LSAPI_REQ_RECEIVED, LSAPI_ENDIAN, {LSAPI_PACKET_HEADER_LEN} };
static struct lsapi_packet_header s_conn_close_pkt = {'L', 'S',
LSAPI_CONN_CLOSE, LSAPI_ENDIAN, {LSAPI_PACKET_HEADER_LEN} };
-
+
static inline int send_notification_pkt( int fd, struct lsapi_packet_header *pkt )
{
@@ -1575,7 +1575,7 @@ int LSAPI_Accept_r( LSAPI_Request * pReq )
static struct lsapi_packet_header finish = {'L', 'S',
LSAPI_RESP_END, LSAPI_ENDIAN, {LSAPI_PACKET_HEADER_LEN} };
-
+
int LSAPI_Finish_r( LSAPI_Request * pReq )
{
/* finish req body */
@@ -1639,10 +1639,10 @@ char * LSAPI_GetHeader_r( LSAPI_Request * pReq, int headerIndex )
off = pReq->m_pHeaderIndex->m_headerOff[ headerIndex ];
if ( !off )
return NULL;
- if ( *(pReq->m_pHttpHeader + off
+ if ( *(pReq->m_pHttpHeader + off
+ pReq->m_pHeaderIndex->m_headerLen[ headerIndex ]) )
{
- *( pReq->m_pHttpHeader + off
+ *( pReq->m_pHttpHeader + off
+ pReq->m_pHeaderIndex->m_headerLen[ headerIndex ]) = 0;
}
return pReq->m_pHttpHeader + off;
@@ -2092,7 +2092,7 @@ static char * GetHeaderVar( LSAPI_Request * pReq, const char * name )
{
if ( strcmp( name, CGI_HEADERS[i] ) == 0 )
{
- pValue = pReq->m_pHttpHeader
+ pValue = pReq->m_pHttpHeader
+ pReq->m_pHeaderIndex->m_headerOff[i];
if ( *(pValue + pReq->m_pHeaderIndex->m_headerLen[i]) != '\0')
{
@@ -2128,7 +2128,7 @@ static char * GetHeaderVar( LSAPI_Request * pReq, const char * name )
if (( pKey == pKeyEnd )&& (!*p ))
{
pValue = pReq->m_pHttpHeader + pCur->valueOff;
-
+
if ( *(pValue + pCur->valueLen) != '\0')
{
*(pValue + pCur->valueLen) = '\0';
@@ -2792,7 +2792,7 @@ static void lsapi_sigchild( int signal )
{
int status, pid;
lsapi_child_status * child_status;
- if (g_prefork_server == NULL)
+ if (g_prefork_server == NULL)
return;
while( 1 )
{
@@ -2842,9 +2842,9 @@ static void lsapi_sigchild( int signal )
static int lsapi_init_children_status(void)
{
int size = 4096;
- int max_children = g_prefork_server->m_iMaxChildren
+ int max_children = g_prefork_server->m_iMaxChildren
+ g_prefork_server->m_iExtraChildren;
-
+
char * pBuf;
size = max_children * sizeof( lsapi_child_status ) * 2 + 3 * sizeof(int);
size = (size + 4095) / 4096 * 4096;
@@ -2878,11 +2878,11 @@ static void dump_debug_info( lsapi_child_status * pStatus, long tmCur )
fprintf( stderr, "[%s] Possible runaway process, PPID: %d, PID: %d, "
"reqCount: %d, process time: %ld, checkpoint time: %ld, start "
- "time: %ld\n", ctime(&tmCur), getpid(), pStatus->m_pid,
- pStatus->m_iReqCounter, tmCur - pStatus->m_tmReqBegin,
+ "time: %ld\n", ctime(&tmCur), getpid(), pStatus->m_pid,
+ pStatus->m_iReqCounter, tmCur - pStatus->m_tmReqBegin,
tmCur - pStatus->m_tmLastCheckPoint, tmCur - pStatus->m_tmStart );
snprintf( achCmd, 1024, "gdb --batch -ex \"attach %d\" -ex \"set height 0\" "
- "-ex \"bt\" >&2;PATH=$PATH:/usr/sbin lsof -p %d >&2",
+ "-ex \"bt\" >&2;PATH=$PATH:/usr/sbin lsof -p %d >&2",
pStatus->m_pid, pStatus->m_pid );
if ( system( achCmd ) == -1 )
perror( "system()" );
@@ -2907,8 +2907,8 @@ static void lsapi_check_child_status( long tmCur )
if ( !pStatus->m_inProcess )
{
- if (g_prefork_server->m_iCurChildren - dying
- > g_prefork_server->m_iMaxChildren
+ if (g_prefork_server->m_iCurChildren - dying
+ > g_prefork_server->m_iMaxChildren
|| idle > g_prefork_server->m_iMaxIdleChildren)
{
++pStatus->m_iKillSent;
@@ -2916,7 +2916,7 @@ static void lsapi_check_child_status( long tmCur )
}
else
{
- if (s_max_idle_secs> 0
+ if (s_max_idle_secs> 0
&& tmCur - pStatus->m_tmWaitBegin > s_max_idle_secs + 5)
{
++pStatus->m_iKillSent;
@@ -2949,7 +2949,7 @@ static void lsapi_check_child_status( long tmCur )
}
if ( tobekilled )
{
- if (( kill( pStatus->m_pid, tobekilled ) == -1 ) &&
+ if (( kill( pStatus->m_pid, tobekilled ) == -1 ) &&
( errno == ESRCH ))
{
pStatus->m_pid = 0;
@@ -2967,7 +2967,7 @@ static void lsapi_check_child_status( long tmCur )
if ( abs( g_prefork_server->m_iCurChildren - count ) > 1 )
{
fprintf( stderr, "Children tracking is wrong: PID: %d, Cur Children: %d,"
- " count: %d, idle: %d, dying: %d\n", getpid(),
+ " count: %d, idle: %d, dying: %d\n", getpid(),
g_prefork_server->m_iCurChildren, count, idle, dying );
}
}
@@ -2993,7 +2993,7 @@ static void lsapi_check_child_status( long tmCur )
//}
-static int lsapi_prefork_server_accept( lsapi_prefork_server * pServer,
+static int lsapi_prefork_server_accept( lsapi_prefork_server * pServer,
LSAPI_Request * pReq )
{
struct sigaction act, old_term, old_quit, old_int,
@@ -3062,13 +3062,13 @@ static int lsapi_prefork_server_accept( lsapi_prefork_server * pServer,
FD_ZERO( &readfds );
FD_SET( pServer->m_fd, &readfds );
- timeout.tv_sec = 1;
+ timeout.tv_sec = 1;
timeout.tv_usec = 0;
ret = (*g_fnSelect)(pServer->m_fd+1, &readfds, NULL, NULL, &timeout);
if (ret == 1 )
{
- if (pServer->m_iCurChildren >= pServer->m_iMaxChildren
- && s_accepting_workers
+ if (pServer->m_iCurChildren >= pServer->m_iMaxChildren
+ && s_accepting_workers
&& (ret = __sync_add_and_fetch(s_accepting_workers, 0)) > 0)
{
usleep( 200 );
@@ -3087,13 +3087,13 @@ static int lsapi_prefork_server_accept( lsapi_prefork_server * pServer,
continue;
}
- if (pServer->m_iCurChildren >=
+ if (pServer->m_iCurChildren >=
pServer->m_iMaxChildren + pServer->m_iExtraChildren)
{
fprintf( stderr, "Reached max children process limit: %d, extra: %d,"
" current: %d, busy: %d, please increase LSAPI_CHILDREN.\n",
- pServer->m_iMaxChildren, pServer->m_iExtraChildren,
- pServer->m_iCurChildren,
+ pServer->m_iMaxChildren, pServer->m_iExtraChildren,
+ pServer->m_iCurChildren,
s_busy_workers ? *s_busy_workers : -1 );
usleep( 100000 );
continue;
@@ -3192,7 +3192,7 @@ static int lsapi_prefork_server_accept( lsapi_prefork_server * pServer,
void lsapi_error( const char * pMessage, int err_no )
{
- fprintf( stderr, "%d: %s, errno: %d (%s)\n", getpid(), pMessage, err_no,
+ fprintf( stderr, "%d: %s, errno: %d (%s)\n", getpid(), pMessage, err_no,
strerror( err_no ) );
}
@@ -3222,7 +3222,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq )
lsapi_close_connection(pReq);
}
}
-
+
if ( (unsigned int)s_req_processed > s_max_reqs )
return -1;
@@ -3249,7 +3249,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq )
{
if ( !g_running )
return -1;
- if (s_req_processed && s_worker_status
+ if (s_req_processed && s_worker_status
&& s_worker_status->m_iKillSent)
return -1;
FD_ZERO( &readfds );
@@ -3267,7 +3267,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq )
if (s_accepting_workers)
__sync_fetch_and_sub(s_accepting_workers, 1);
}
-
+
if ( ret == 0 )
{
if ( s_worker_status )
@@ -3291,7 +3291,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq )
}
else if ( ret >= 1 )
{
- if (s_req_processed && s_worker_status
+ if (s_req_processed && s_worker_status
&& s_worker_status->m_iKillSent)
return -1;
if ( fd == pReq->m_fdListen )
@@ -3305,7 +3305,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq )
__sync_fetch_and_add(s_busy_workers, 1);
fd = pReq->m_fd;
-
+
lsapi_set_nblock( fd, 0 );
//init_conn_key( pReq->m_fd );
if ( !s_keepListener )
@@ -3337,7 +3337,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq )
s_worker_status->m_iKillSent = 0;
s_worker_status->m_inProcess = 1;
++s_worker_status->m_iReqCounter;
- s_worker_status->m_tmReqBegin =
+ s_worker_status->m_tmReqBegin =
s_worker_status->m_tmLastCheckPoint = time(NULL);
}
++s_req_processed;
@@ -3411,7 +3411,7 @@ void LSAPI_No_Check_ppid(void)
}
-int LSAPI_Get_ppid()
+int LSAPI_Get_ppid()
{
return(s_ppid);
}
@@ -3521,7 +3521,7 @@ static int lsapi_check_path(const char *p, char *final, int max_len)
return -1;
}
p = final;
- if (realpath(p, resolved_path) == NULL
+ if (realpath(p, resolved_path) == NULL
&& errno != ENOENT && errno != EACCES)
return -1;
if (strncmp(resolved_path, "/etc/", 5) == 0)
@@ -3576,13 +3576,13 @@ int LSAPI_Init_Env_Parameters( fn_select_t fp )
const char *p;
int n;
int avoidFork = 0;
-
+
p = getenv("LSAPI_STDERR_LOG");
if (p)
{
lsapi_reopen_stderr(p);
}
-
+
p = getenv( "PHP_LSAPI_MAX_REQUESTS" );
if ( !p )
p = getenv( "LSAPI_MAX_REQS" );
@@ -3675,7 +3675,7 @@ int LSAPI_Init_Env_Parameters( fn_select_t fp )
{
LSAPI_No_Check_ppid();
}
-
+
p = getenv("LSAPI_MAX_BUSY_WORKER");
if (p)
{
@@ -3684,7 +3684,7 @@ int LSAPI_Init_Env_Parameters( fn_select_t fp )
if (n >= 0)
LSAPI_No_Check_ppid();
}
-
+
p = getenv( "LSAPI_DUMP_DEBUG_INFO" );
if ( p )
@@ -3950,7 +3950,7 @@ static void lsapi_MD5Transform(uint32 buf[4], uint32 const in[16])
}
-int LSAPI_Set_Restored_Parent_Pid(int pid)
+int LSAPI_Set_Restored_Parent_Pid(int pid)
{
int old_ppid = s_ppid;
s_restored_ppid = pid;
diff --git a/sapi/litespeed/lscriu.c b/sapi/litespeed/lscriu.c
index f767738f1b2..6ceed3fb8bc 100644
--- a/sapi/litespeed/lscriu.c
+++ b/sapi/litespeed/lscriu.c
@@ -21,18 +21,18 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
-met:
+met:
* Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
+ notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
- with the distribution.
+ with the distribution.
* Neither the name of the Lite Speed Technologies Inc nor the
names of its contributors may be used to endorse or promote
products derived from this software without specific prior
- written permission.
+ written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -44,7 +44,7 @@ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define HAVE_MSGHDR_MSG_CONTROL
@@ -107,7 +107,7 @@ static int s_fd_native = -1;
static char *s_criu_image_path = NULL;
static int s_pid = 0;
-typedef enum
+typedef enum
{
CRIU_GCOUNTER_SHM,
CRIU_GCOUNTER_SIG,
@@ -127,15 +127,15 @@ int LSAPI_Get_ppid();
#define lscriu_dbg(...) \
do { if (s_criu_debug) fprintf(stderr, __VA_ARGS__); } while(0)
#else
-#define lscriu_dbg(...)
+#define lscriu_dbg(...)
#endif
-
+
#define lscriu_err(...) fprintf(stderr, __VA_ARGS__)
-
+
#define SUN_PATH_MAX (sizeof(((struct sockaddr_un *)NULL)->sun_path))
-typedef struct
+typedef struct
{
pid_t m_iPidToDump;
char m_chImageDirectory[1024];
@@ -143,7 +143,7 @@ typedef struct
char m_chServiceAddress[SUN_PATH_MAX];
} criu_native_dump_t;
-typedef struct
+typedef struct
{
int m_iDumpResult;
char m_chDumpResponseMessage[1024];
@@ -259,7 +259,7 @@ static int LSCRIU_load_liblscapi(void)
void *lib_handle = NULL;
void *pthread_lib_handle = NULL;
char ch;
-
+
if (s_native)
return 0;
// Numerical signals indicates Apache
@@ -299,10 +299,10 @@ static void LSCRIU_Wink_Server_is_Ready(void)
// Not used for native
return;
}
- if (getenv("LSAPI_UNIQE"))
+ if (getenv("LSAPI_UNIQE"))
snprintf(sem_name, sizeof sem_name - 1, "lsphp[hash=%s].is_ready",
getenv("LSAPI_UNIQE"));
- else
+ else
snprintf(sem_name, sizeof sem_name - 1, "lsphp[euid=0x%x].is_ready",
geteuid());
@@ -314,28 +314,28 @@ static void LSCRIU_Wink_Server_is_Ready(void)
if (psem_close(is_ready_sem) < 0)
lsapi_error(sem_name, errno);
}
- else if (errno != ENOENT)
+ else if (errno != ENOENT)
lsapi_error(sem_name, errno);
}
-static char *LSCRIU_Error_File_Name(char *pchFile, int max_len)
+static char *LSCRIU_Error_File_Name(char *pchFile, int max_len)
{
const char *pchDefaultSocketPath = "/tmp/";
const char *pchDefaultLogFileName = "lsws_error.log";
- snprintf(pchFile, max_len, "%s%s", pchDefaultSocketPath,
+ snprintf(pchFile, max_len, "%s%s", pchDefaultSocketPath,
pchDefaultLogFileName);
return pchFile;
}
-#ifdef LSAPILIB_DEBUG_CRIU
+#ifdef LSAPILIB_DEBUG_CRIU
static void LSCRIU_Debugging(void) {
char *pchCRIUDebug;
pchCRIUDebug = getenv("LSAPI_CRIU_DEBUG");
- if (!pchCRIUDebug)
+ if (!pchCRIUDebug)
pchCRIUDebug = getenv("LSCAPI_CRIU_DEBUG");
- //fprintf(stderr,"(%d) LSCRIU: CRIU debug environment variable: %s\n",
+ //fprintf(stderr,"(%d) LSCRIU: CRIU debug environment variable: %s\n",
// s_pid, pchCRIUDebug);
// I've made it easy to turn on debugging. CloudLinux Apache sets
// LSCAPI_CRIU_DEBUG to nothing to indicate it's on. Sigh.
@@ -347,7 +347,7 @@ static void LSCRIU_Debugging(void) {
(((*pchCRIUDebug == 'O') ||
(*pchCRIUDebug == 'o')) &&
((*(pchCRIUDebug + 1)) &&
- ((*(pchCRIUDebug + 1) == 'F') || (*(pchCRIUDebug + 1) == 'f'))))))
+ ((*(pchCRIUDebug + 1) == 'F') || (*(pchCRIUDebug + 1) == 'f'))))))
{
lscriu_dbg("LSCRIU (%d): CRIU Debugging disabled by environment\n", s_pid);
s_criu_debug = 0;
@@ -355,7 +355,7 @@ static void LSCRIU_Debugging(void) {
else {
s_criu_debug = 1;
lscriu_dbg("LSCRIU (%d): CRIU Debugging enabled by environment\n", s_pid);
- fprintf(stderr,"LSCRIU (%d): CRIU debug environment variable: %s\n",
+ fprintf(stderr,"LSCRIU (%d): CRIU debug environment variable: %s\n",
s_pid, pchCRIUDebug);
}
}
@@ -366,7 +366,7 @@ static void LSCRIU_Restored_Error(int iFatal, char *format, ...) {
int iOldUMask;
int iFd = -1;
char chFile[1024];
-
+
if (!iFatal) {
// LSCRIU_Debugging();
if (!s_criu_debug) {
@@ -379,7 +379,7 @@ static void LSCRIU_Restored_Error(int iFatal, char *format, ...) {
return;
}
iOldUMask = umask(0);
- iFd = open( chFile, O_WRONLY | O_APPEND | O_CREAT,
+ iFd = open( chFile, O_WRONLY | O_APPEND | O_CREAT,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
umask(iOldUMask);
if (iFd >= 0) {
@@ -393,9 +393,9 @@ static void LSCRIU_Restored_Error(int iFatal, char *format, ...) {
char buf[0x1000];
vsnprintf(buf, sizeof(buf), format, ap);
va_end(ap);
-
+
int n = snprintf(chFullMessage, sizeof(chFullMessage),
- "%04d-%02d-%02d %02d:%02d:%02d.%03d: LSCRIU (%d): %s %s\n",
+ "%04d-%02d-%02d %02d:%02d:%02d.%03d: LSCRIU (%d): %s %s\n",
sTm.tm_year + 1900,
sTm.tm_mon + 1,
sTm.tm_mday,
@@ -404,7 +404,7 @@ static void LSCRIU_Restored_Error(int iFatal, char *format, ...) {
sTm.tm_sec,
sTimeb.millitm,
s_pid,
- iFatal ? "FATAL! " : "(debug) ",
+ iFatal ? "FATAL! " : "(debug) ",
buf);
if (n > (int)sizeof(chFullMessage))
n = sizeof(chFullMessage);
@@ -438,7 +438,7 @@ static int LSCRIU_Native_Dump(pid_t iPid,
if (write(iFdNative,
&criu_native_dump,
sizeof(criu_native_dump)) == -1) {
- lscriu_err("LSCRIU (%d): Error sending dump request to the listener: %s\n",
+ lscriu_err("LSCRIU (%d): Error sending dump request to the listener: %s\n",
s_pid, strerror(errno));
return(-1);
}
@@ -461,7 +461,7 @@ static int LSCRIU_Native_Dump(pid_t iPid,
static void LSCRIU_CloudLinux_Checkpoint(void)
{
int iRet;
-
+
if ((!s_native) && (!s_lscapi_dump_me)) {
lscriu_dbg("LSCRIU (%d): Not native and unable to dump - abandon one-time "
"dump\n", s_pid);
@@ -471,7 +471,7 @@ static void LSCRIU_CloudLinux_Checkpoint(void)
iRet = s_lscapi_dump_me();
if (iRet < 0) {
char *pchError;
- lscriu_err("LSCRIU: CloudLinux dump of PID: %d, error: %s\n",
+ lscriu_err("LSCRIU: CloudLinux dump of PID: %d, error: %s\n",
s_pid, strerror(errno));
}
if (iRet == 0) {
@@ -482,11 +482,11 @@ static void LSCRIU_CloudLinux_Checkpoint(void)
s_restored = 1;
LSAPI_reset_server_state();
/*
- Here we have restored the php process, so we should to tell (via
+ Here we have restored the php process, so we should to tell (via
semaphore) mod_lsapi that we are started and ready to receive data.
*/
LSCRIU_Wink_Server_is_Ready();
- lscriu_err("LSCRIU: Successful CloudLinux restore of PID: %d, parent: %d.\n",
+ lscriu_err("LSCRIU: Successful CloudLinux restore of PID: %d, parent: %d.\n",
getpid(), getppid());
}
LSCRIU_Set_Initial_Start_Reqs(0);
@@ -603,22 +603,22 @@ static int LSCRIU_Init_Env_Parameters(void)
int n;
p = getenv("LSAPI_INITIAL_START");
- if (!p)
+ if (!p)
p = getenv("LSAPI_BACKEND_INITIAL_START");
if (p) {
n = atoi(p);
if (n > 0) {
- lscriu_dbg("LSCRIU (%d): Set start requests based on environment (%d)\n",
+ lscriu_dbg("LSCRIU (%d): Set start requests based on environment (%d)\n",
getpid(), n);
LSCRIU_Set_Initial_Start_Reqs(n);
} else {
- lscriu_dbg("LSCRIU (%d): LSAPI_INITIAL_START set to 0 disabled\n",
+ lscriu_dbg("LSCRIU (%d): LSAPI_INITIAL_START set to 0 disabled\n",
getpid());
return 0;
}
} else {
- lscriu_dbg("LSCRIU (%d): LSAPI_INITIAL_START NOT set - disabled\n",
+ lscriu_dbg("LSCRIU (%d): LSAPI_INITIAL_START NOT set - disabled\n",
getpid());
return 0;
}
@@ -627,11 +627,11 @@ static int LSCRIU_Init_Env_Parameters(void)
GlobalCounterType_t gc_type = CRIU_GCOUNTER_SHM;
char *env;
if ((env = getenv("LSAPI_CRIU_USE_SHM"))) {
- // CloudLinux doc: Off (shared memory) or Signals.
+ // CloudLinux doc: Off (shared memory) or Signals.
// Litespeed doc: On (shared memory) or Signals
- // So just check the first character for an 'S' and if not, then
+ // So just check the first character for an 'S' and if not, then
// use shared memory. Pipe support is lost (sigh).
- if ((*env == 'S') || (*env == 's'))
+ if ((*env == 'S') || (*env == 's'))
gc_type = CRIU_GCOUNTER_SIG; // Just assume the rest is signals
// else use the default of shared memory
}
@@ -644,7 +644,7 @@ static int LSCRIU_Init_Env_Parameters(void)
(((*env == 'O') || (*env == 'o')) &&
((*(env + 1) == 'N') || (*(env + 1) == 'n'))))
gc_type = CRIU_GCOUNTER_SIG;
- else if (*env == 2)
+ else if (*env == 2)
gc_type = CRIU_GCOUNTER_PIPE; // The only case for pipe
//else use the default of shared memory
}
@@ -657,7 +657,7 @@ static int LSCRIU_Init_Env_Parameters(void)
lscriu_dbg("LSCRIU (%d): Use shared memory\n", getpid());
LSCRIU_Set_Global_Counter_Type(gc_type);
}
- else
+ else
lscriu_dbg("LSCRIU (%d): NOT Listening\n", getpid());
char *criu_mode = NULL;
@@ -691,7 +691,7 @@ void LSCRIU_inc_req_procssed()
++s_requests_count;
}
- lscriu_dbg("LSCRIU (%d): s_requests_count %d counter %d\n", getpid(),
+ lscriu_dbg("LSCRIU (%d): s_requests_count %d counter %d\n", getpid(),
s_requests_count, s_initial_start_reqs);
if (s_initial_start_reqs > 0 && s_requests_count <= s_initial_start_reqs) {
diff --git a/sapi/litespeed/lscriu.h b/sapi/litespeed/lscriu.h
index 9f40df37d50..cc0186ef79f 100644
--- a/sapi/litespeed/lscriu.h
+++ b/sapi/litespeed/lscriu.h
@@ -21,18 +21,18 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
-met:
+met:
* Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
+ notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
- with the distribution.
+ with the distribution.
* Neither the name of the Lite Speed Technologies Inc nor the
names of its contributors may be used to endorse or promote
products derived from this software without specific prior
- written permission.
+ written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -44,7 +44,7 @@ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _LSCRIU_H_
diff --git a/sapi/phpdbg/.phpdbginit b/sapi/phpdbg/.phpdbginit
index 1ad35218ede..7ee34fccaa3 100644
--- a/sapi/phpdbg/.phpdbginit
+++ b/sapi/phpdbg/.phpdbginit
@@ -25,7 +25,7 @@
*/
/*
-function my_debugging_function()
+function my_debugging_function()
{
var_dump(func_get_args());
}
@@ -49,31 +49,31 @@ if (function_exists('readline_completion_function')) {
/*
Setting argv made trivial ...
-
+
argv 1 2 3 4
^ set argv for next execution
-
+
argv
^ unset argv for next execution
-
+
*/
function argv()
{
$argv = func_get_args();
-
+
if (!$argv) {
$_SERVER['argv'] = array();
$_SERVER['argc'] = 0;
return;
}
-
+
$_SERVER['argv'] = array_merge
(
array("phpdbg"),
$argv
- );
+ );
$_SERVER['argc'] = count($_SERVER['argv']);
-
+
return $_SERVER['argv'];
}
:>
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index 5af6ba619b9..2a5ea29a0ba 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -1324,7 +1324,7 @@ void phpdbg_free_wrapper(void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{
{
zend_mm_heap *heap = zend_mm_get_heap();
if (UNEXPECTED(heap == p)) {
- /* TODO: heap maybe allocated by mmap(zend_mm_init) or malloc(USE_ZEND_ALLOC=0)
+ /* TODO: heap maybe allocated by mmap(zend_mm_init) or malloc(USE_ZEND_ALLOC=0)
* let's prevent it from segfault for now
*/
} else {
diff --git a/sapi/phpdbg/phpdbg.init.d b/sapi/phpdbg/phpdbg.init.d
index 99a1ab328b8..1f0b1fdbf92 100755
--- a/sapi/phpdbg/phpdbg.init.d
+++ b/sapi/phpdbg/phpdbg.init.d
@@ -44,7 +44,7 @@ insanity()
return 1
fi
fi
-
+
return 0
}
diff --git a/sapi/phpdbg/phpdbg_io.c b/sapi/phpdbg/phpdbg_io.c
index 1bf7227b1fd..150647aa7eb 100644
--- a/sapi/phpdbg/phpdbg_io.c
+++ b/sapi/phpdbg/phpdbg_io.c
@@ -193,14 +193,14 @@ PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo) {
static int phpdbg_output_pager(int sock, const char *ptr, int len) {
int count = 0, bytes = 0;
const char *p = ptr, *endp = ptr + len;
-
+
while ((p = memchr(p, '\n', endp - p))) {
count++;
p++;
-
+
if (count % PHPDBG_G(lines) == 0) {
bytes += write(sock, ptr + bytes, (p - ptr) - bytes);
-
+
if (memchr(p, '\n', endp - p)) {
char buf[PHPDBG_MAX_CMD];
zend_quiet_write(sock, ZEND_STRL("\r---Type to continue or q to quit---"));
@@ -224,7 +224,7 @@ PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len) {
if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) {
return phpdbg_send_bytes(sock, ptr, len);
}
-
+
if ((PHPDBG_G(flags) & PHPDBG_HAS_PAGINATION)
&& !(PHPDBG_G(flags) & PHPDBG_WRITE_XML)
&& PHPDBG_G(io)[PHPDBG_STDOUT].fd == sock
diff --git a/sapi/phpdbg/phpdbg_parser.c b/sapi/phpdbg/phpdbg_parser.c
index da08df21997..16ca21d5d1a 100644
--- a/sapi/phpdbg/phpdbg_parser.c
+++ b/sapi/phpdbg/phpdbg_parser.c
@@ -1,19 +1,19 @@
/* A Bison parser, made by GNU Bison 2.7.12-4996. */
/* Bison implementation for Yacc-like parsers in C
-
+
Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
@@ -26,7 +26,7 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
-
+
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
diff --git a/sapi/phpdbg/phpdbg_parser.h b/sapi/phpdbg/phpdbg_parser.h
index d13cfbc0a50..2a27a4e7dff 100644
--- a/sapi/phpdbg/phpdbg_parser.h
+++ b/sapi/phpdbg/phpdbg_parser.h
@@ -1,19 +1,19 @@
/* A Bison parser, made by GNU Bison 2.7.12-4996. */
/* Bison interface for Yacc-like parsers in C
-
+
Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
@@ -26,7 +26,7 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
-
+
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c
index ed5633b845c..bc1ac22f261 100644
--- a/sapi/phpdbg/phpdbg_print.c
+++ b/sapi/phpdbg/phpdbg_print.c
@@ -370,7 +370,7 @@ void phpdbg_print_opcodes_class(const char *class) {
}
}
} ZEND_HASH_FOREACH_END();
-
+
return;
}
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index fc25e30af11..70c02221aa8 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -618,7 +618,7 @@ int phpdbg_compile(void) /* {{{ */
data->len += start_line_len;
for (i = 1; i <= data->lines; i++) {
data->line[i] += start_line_len;
- }
+ }
zend_hash_update_ptr(&PHPDBG_G(file_sources), PHPDBG_G(ops)->filename, data);
}
diff --git a/sapi/phpdbg/phpdbg_set.c b/sapi/phpdbg/phpdbg_set.c
index 7cb8d0639fb..dc69221a50e 100644
--- a/sapi/phpdbg/phpdbg_set.c
+++ b/sapi/phpdbg/phpdbg_set.c
@@ -74,7 +74,7 @@ PHPDBG_SET(pagination) /* {{{ */
default:
phpdbg_error("setpagination", "type=\"wrongargs\"", "set pagination used incorrectly: set pagination ");
}
-
+
return SUCCESS;
} /* }}} */
@@ -90,7 +90,7 @@ PHPDBG_SET(lines) /* {{{ */
default:
phpdbg_error("setlines", "type=\"wrongargs\"", "set lines used incorrectly: set lines ");
}
-
+
return SUCCESS;
} /* }}} */
diff --git a/sapi/phpdbg/phpdbg_watch.c b/sapi/phpdbg/phpdbg_watch.c
index 0c0df7f97ad..8fa47ca1df8 100644
--- a/sapi/phpdbg/phpdbg_watch.c
+++ b/sapi/phpdbg/phpdbg_watch.c
@@ -428,7 +428,7 @@ void phpdbg_update_watch_ref(phpdbg_watchpoint_t *watch) {
phpdbg_store_watchpoint_btree(&coll->ref);
phpdbg_activate_watchpoint(&coll->ref);
phpdbg_watch_backup_data(&coll->ref);
-
+
zend_hash_init(&coll->parents, 8, shitty stupid parameter, NULL, 0);
zend_hash_index_add_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) watch->ref, coll);
}
diff --git a/sapi/phpdbg/web-bootstrap.php b/sapi/phpdbg/web-bootstrap.php
index 7b8c5d30de8..046062997ee 100644
--- a/sapi/phpdbg/web-bootstrap.php
+++ b/sapi/phpdbg/web-bootstrap.php
@@ -1,26 +1,26 @@
'localhost',
'HTTP_CONNECTION' => 'keep-alive',
diff --git a/sapi/phpdbg/xml.md b/sapi/phpdbg/xml.md
index 56dcaaa1f71..c02f80f2ca8 100644
--- a/sapi/phpdbg/xml.md
+++ b/sapi/phpdbg/xml.md
@@ -297,7 +297,7 @@ info (subcommands)
- <classinfo num="" /> with num having an integer value, indicating the number of loaded user-defined classes
- Each class is enumerated with first a <class>, then an optional <parents> container and then a <classsource> element
-- The <parents> container contains the <class> elements of the parent of the last <class> element.
+- The <parents> container contains the <class> elements of the parent of the last <class> element.
- <class type="" flags="" name="" methodcount="" />
- type: either "User" or "Internal"
- flags: either "Interface", "Class" or "Abstract Class"
diff --git a/scripts/dev/credits b/scripts/dev/credits
index 5be84fda074..0683f59882d 100755
--- a/scripts/dev/credits
+++ b/scripts/dev/credits
@@ -7,14 +7,14 @@ for what in ext sapi
do
file=ext/standard/credits_$what.h
cat >$file <
-
+
diff --git a/scripts/dev/generate-phpt/src/codeSnippets/emptyUnsetUndefNull.txt b/scripts/dev/generate-phpt/src/codeSnippets/emptyUnsetUndefNull.txt
index 7e28494f5b6..a9577812056 100644
--- a/scripts/dev/generate-phpt/src/codeSnippets/emptyUnsetUndefNull.txt
+++ b/scripts/dev/generate-phpt/src/codeSnippets/emptyUnsetUndefNull.txt
@@ -3,7 +3,7 @@ unset($unset_var);
$variation_array = array(
'unset var' => @$unset_var,
- 'undefined var' => @$undefined_var,
+ 'undefined var' => @$undefined_var,
'empty string DQ' => "",
'empty string SQ' => '',
'uppercase NULL' => NULL,
diff --git a/scripts/dev/generate-phpt/src/generate-phpt.php b/scripts/dev/generate-phpt/src/generate-phpt.php
index 4f57a70b54a..73071e28460 100644
--- a/scripts/dev/generate-phpt/src/generate-phpt.php
+++ b/scripts/dev/generate-phpt/src/generate-phpt.php
@@ -39,17 +39,17 @@ try {
if($options->hasOption('s')) {
$optionalSections->setOptions($options);
}
-
+
if($options->hasOption('c')) {
$name = $options->getOption('c')."_".$options->getOption('m');
$method = new gtMethod($options->getOption('c'), $options->getOption('m'));
-
+
$method->setArgumentNames();
$method->setArgumentLists();
$method->setInitialisationStatements();
-
+
$method->setConstructorArgumentNames();
$method->setConstructorInitStatements();
$method->setConstructorArgumentList();
diff --git a/scripts/dev/generate-phpt/src/gtClassMap.php b/scripts/dev/generate-phpt/src/gtClassMap.php
index 3e45b4764de..1c346b83ce3 100644
--- a/scripts/dev/generate-phpt/src/gtClassMap.php
+++ b/scripts/dev/generate-phpt/src/gtClassMap.php
@@ -1,23 +1,23 @@
'gtCodeSnippet.php',
'gtTestSubject' => 'gtTestSubject.php',
'gtFunction' => 'gtFunction.php',
'gtMethod' => 'gtMethod.php',
'gtTestCaseWriter' => 'gtTestCaseWriter.php',
'gtText' => 'gtText.php',
-
-
-
+
+
+
'gtCommandLineOptions' => 'setup/gtCommandLineOptions.php',
'gtOptionalSections' => 'setup/gtOptionalSections.php',
'gtMissingArgumentException' => 'setup/exceptions/gtMissingArgumentException.php',
'gtUnknownOptionException' => 'setup/exceptions/gtUnknownOptionException.php',
'gtUnknownSectionException' => 'setup/exceptions/gtUnknownSectionException.php',
'gtMissingOptionsException' => 'setup/exceptions/gtMissingOptionsException.php',
-
+
'gtPreCondition' => 'setup/gtPreCondition.php',
'gtPreConditionList' => 'setup/gtPreConditionList.php',
'gtIsSpecifiedTestType' => 'setup/preconditions/gtIsSpecifiedTestType.php',
@@ -26,21 +26,21 @@
'gtIsValidClass' => 'setup/preconditions/gtIsValidClass.php',
'gtIsValidMethod' => 'setup/preconditions/gtIsValidMethod.php',
'gtIsValidFunction' => 'setup/preconditions/gtIsValidFunction.php',
-
-
+
+
'gtTestCase' => 'testcase/gtTestCase.php',
'gtVariationTestCase' => 'testcase/gtVariationTestCase.php',
'gtVariationTestCaseFunction' => 'testcase/gtVariationTestCaseFunction.php',
'gtVariationTestCaseMethod' => 'testcase/gtVariationTestCaseMethod.php',
-
+
'gtBasicTestCase' => 'testcase/gtBasicTestCase.php',
'gtBasicTestCaseFunction' => 'testcase/gtBasicTestCaseFunction.php',
'gtBasicTestCaseMethod' => 'testcase/gtBasicTestCaseMethod.php',
-
+
'gtErrorTestCase' => 'testcase/gtErrorTestCase.php',
'gtErrorTestCaseFunction' => 'testcase/gtErrorTestCaseFunction.php',
'gtErrorTestCaseMethod' => 'testcase/gtErrorTestCaseMethod.php',
-
+
'gtVariationContainer' => 'testcase/gtVariationContainer.php',
'gtVariationContainerMethod' => 'testcase/gtVariationContainerMethod.php',
'gtVariationContainerFunction' => 'testcase/gtVariationContainerFunction.php',
diff --git a/scripts/dev/generate-phpt/src/gtCodeSnippet.php b/scripts/dev/generate-phpt/src/gtCodeSnippet.php
index 220fbdf6997..dc6543201a7 100644
--- a/scripts/dev/generate-phpt/src/gtCodeSnippet.php
+++ b/scripts/dev/generate-phpt/src/gtCodeSnippet.php
@@ -2,7 +2,7 @@
/**
* Retrieves code snippets for adding to test cases
- *
+ *
*/
class gtCodeSnippet
{
@@ -14,21 +14,21 @@ class gtCodeSnippet
* @return array
*/
public static function get($name) {
-
+
$filename = dirname(__FILE__) . '/codeSnippets/' . $name . '.txt';
if (!file_exists($filename)) {
throw new LogicException('The code snippet ' . $name . ' does not exist');
}
-
+
$lines = file($filename);
foreach($lines as $l) {
$array[] = rtrim($l);
}
return $array;
}
-
-
+
+
/**
* Append the code snippet on to an existing array
*
@@ -47,11 +47,11 @@ class gtCodeSnippet
foreach ($text as $t) {
$array[] = rtrim($t);
}
-
+
return $array;
}
-
-
+
+
/**
* Appends blank entries on to an array
*
@@ -64,9 +64,9 @@ class gtCodeSnippet
for ($i=0; $i< $numberOfLines; $i++) {
$array[] = "";
}
-
+
return $array;
}
-
+
}
?>
\ No newline at end of file
diff --git a/scripts/dev/generate-phpt/src/gtFunction.php b/scripts/dev/generate-phpt/src/gtFunction.php
index 47f4bafcb34..b2752ad637b 100644
--- a/scripts/dev/generate-phpt/src/gtFunction.php
+++ b/scripts/dev/generate-phpt/src/gtFunction.php
@@ -7,7 +7,7 @@
class gtFunction extends gtTestSubject {
private $functionName;
-
+
/**
* Set the name of the name of the function
*
diff --git a/scripts/dev/generate-phpt/src/gtMethod.php b/scripts/dev/generate-phpt/src/gtMethod.php
index 820d7e0a760..dc8438c3b5f 100644
--- a/scripts/dev/generate-phpt/src/gtMethod.php
+++ b/scripts/dev/generate-phpt/src/gtMethod.php
@@ -39,7 +39,7 @@ class gtMethod extends gtTestSubject {
}
}
-
+
/**
* Set the names of the mandatory and optional arguments to the method
*
@@ -87,14 +87,14 @@ class gtMethod extends gtTestSubject {
public function getClassName() {
return $this->className;
}
-
+
/**
* Set the list of arguments to be passed to the constructor
*
*/
public function setConstructorArgumentList() {
if(count ($this->constructorArgumentNames) > 0) {
-
+
for( $i = 0; $i < count( $this->constructorArgumentNames ); $i++) {
$this->constructorArgumentList .= "\$".$this->constructorArgumentNames[$i].", ";
}
@@ -112,7 +112,7 @@ class gtMethod extends gtTestSubject {
return $this->constructorArgumentList;
}
-
+
/**
* Set up the source statements that initialise constructor arguments;
*
@@ -126,7 +126,7 @@ class gtMethod extends gtTestSubject {
}
-
+
/**
* Return the constructor initialisation statements
*
diff --git a/scripts/dev/generate-phpt/src/gtTestCaseWriter.php b/scripts/dev/generate-phpt/src/gtTestCaseWriter.php
index cc57863d9bd..9438e0f2ea1 100644
--- a/scripts/dev/generate-phpt/src/gtTestCaseWriter.php
+++ b/scripts/dev/generate-phpt/src/gtTestCaseWriter.php
@@ -5,20 +5,20 @@
*
*/
class gtTestCaseWriter {
-
+
public static function write($name, $string, $type, $count = 0) {
if ($type == 'b') {
$fileName = $name."_basic.phpt";
}
-
+
if ($type == 'e') {
$fileName = $name."_error.phpt";
}
-
+
if ($type == 'v') {
$fileName = $name."_variation".$count.".phpt";
}
-
+
$fh = fopen($fileName, 'w');
fwrite ($fh, $string);
fclose($fh);
diff --git a/scripts/dev/generate-phpt/src/gtTestSubject.php b/scripts/dev/generate-phpt/src/gtTestSubject.php
index 76454dc7b85..782c99d6c72 100644
--- a/scripts/dev/generate-phpt/src/gtTestSubject.php
+++ b/scripts/dev/generate-phpt/src/gtTestSubject.php
@@ -10,7 +10,7 @@ abstract class gtTestSubject {
protected $allowedArgumentLists;
protected $maximumArgumentList;
-
+
protected $initialisationStatements;
@@ -31,7 +31,7 @@ abstract class gtTestSubject {
public function getOptionalArgumentNames() {
return $this->optionalArgumentNames;
}
-
+
public function setArgumentLists() {
$this->setValidArgumentLists();
$this->setExtraArgumentList();
@@ -48,7 +48,7 @@ abstract class gtTestSubject {
$this->extraArgumentList .= "\$".$this->mandatoryArgumentNames[$i].", ";
}
}
-
+
if(count ($this->optionalArgumentNames) > 0) {
for( $i = 0; $i < count( $this->optionalArgumentNames ); $i++) {
$this->extraArgumentList .= "\$".$this->optionalArgumentNames[$i].", ";
@@ -57,7 +57,7 @@ abstract class gtTestSubject {
$this->extraArgumentList= $this->extraArgumentList. "\$extra_arg";
}
-
+
/**
* Return the list of arguments as it appears in the function call
@@ -105,7 +105,7 @@ abstract class gtTestSubject {
$this->allowedArgumentLists[0] .= "\$".$this->mandatoryArgumentNames[$i].", ";
}
}
-
+
if(count ($this->optionalArgumentNames) > 0) {
for( $i = 0; $i < count( $this->optionalArgumentNames ); $i++) {
$this->allowedArgumentLists[] = $this->allowedArgumentLists[$i]."\$".$this->optionalArgumentNames[$i].", ";
@@ -153,7 +153,7 @@ abstract class gtTestSubject {
}
}
}
-
+
/**
* Return the initialisation statements
*
diff --git a/scripts/dev/generate-phpt/src/setup/gtCommandLineOptions.php b/scripts/dev/generate-phpt/src/setup/gtCommandLineOptions.php
index 0e4d878bab4..b1068e46004 100644
--- a/scripts/dev/generate-phpt/src/setup/gtCommandLineOptions.php
+++ b/scripts/dev/generate-phpt/src/setup/gtCommandLineOptions.php
@@ -22,7 +22,7 @@ class gtCommandLineOptions {
'x',
'k',
);
-
+
protected $options;
protected function isShortOption($arg)
@@ -44,7 +44,7 @@ class gtCommandLineOptions {
if(count($argv) < 2) {
throw new gtMissingOptionsException('Command line options are required');
}
-
+
for ($i=1; $iisShortOption($argv[$i])) {
@@ -72,7 +72,7 @@ class gtCommandLineOptions {
$this->options[$option] = $argv[$i];
}
}
-
+
/**
*
*/
diff --git a/scripts/dev/generate-phpt/src/setup/gtOptionalSections.php b/scripts/dev/generate-phpt/src/setup/gtOptionalSections.php
index 1d2a163175b..6c6de183456 100644
--- a/scripts/dev/generate-phpt/src/setup/gtOptionalSections.php
+++ b/scripts/dev/generate-phpt/src/setup/gtOptionalSections.php
@@ -28,11 +28,11 @@ class gtOptionalSections {
if($commandLineOptions->hasOption('k')) {
$this->skipifKey = $commandLineOptions->getOption('k');
}
-
+
if($commandLineOptions->hasOption('x')) {
$this->skipifExt = $commandLineOptions->getOption('x');
}
-
+
}
}
@@ -46,7 +46,7 @@ class gtOptionalSections {
public function getSkipifKey() {
return $this->skipifKey;
}
-
+
public function getSkipifExt() {
return $this->skipifExt;
}
@@ -61,7 +61,7 @@ class gtOptionalSections {
}
return false;
}
-
+
public function hasSkipifExt() {
if($this->skipifExt != '') {
return true;
@@ -75,7 +75,7 @@ class gtOptionalSections {
public function hasClean() {
return $this->optSections['clean'];
}
-
+
public function hasDone() {
return $this->optSections['done'];
}
diff --git a/scripts/dev/generate-phpt/src/setup/gtPreCondition.php b/scripts/dev/generate-phpt/src/setup/gtPreCondition.php
index 858395bc9dc..294b41e9f2c 100644
--- a/scripts/dev/generate-phpt/src/setup/gtPreCondition.php
+++ b/scripts/dev/generate-phpt/src/setup/gtPreCondition.php
@@ -5,10 +5,10 @@
*
*/
abstract class gtPreCondition {
-
- abstract public function check($clo);
-
- abstract public function getMessage();
-
+
+ abstract public function check($clo);
+
+ abstract public function getMessage();
+
}
?>
\ No newline at end of file
diff --git a/scripts/dev/generate-phpt/src/setup/gtPreConditionList.php b/scripts/dev/generate-phpt/src/setup/gtPreConditionList.php
index 06c17521f2f..88f9b36205c 100644
--- a/scripts/dev/generate-phpt/src/setup/gtPreConditionList.php
+++ b/scripts/dev/generate-phpt/src/setup/gtPreConditionList.php
@@ -5,10 +5,10 @@
*
*/
class gtPreConditionList {
-
+
private $preConditions = array(
'gtIsSpecifiedTestType',
- 'gtIsSpecifiedFunctionOrMethod',
+ 'gtIsSpecifiedFunctionOrMethod',
'gtIfClassHasMethod',
'gtIsValidClass',
'gtIsValidFunction',
diff --git a/scripts/dev/generate-phpt/src/setup/preconditions/gtIfClassHasMethod.php b/scripts/dev/generate-phpt/src/setup/preconditions/gtIfClassHasMethod.php
index c91b210714c..edd7a1cbae6 100644
--- a/scripts/dev/generate-phpt/src/setup/preconditions/gtIfClassHasMethod.php
+++ b/scripts/dev/generate-phpt/src/setup/preconditions/gtIfClassHasMethod.php
@@ -5,7 +5,7 @@
*
*/
class gtIfClassHasMethod extends gtPreCondition {
-
+
public function check( $clo) {
if($clo->hasOption('c')) {
if(!$clo->hasOption('m')) {
@@ -15,7 +15,7 @@ class gtIfClassHasMethod extends gtPreCondition {
}
return true;
}
-
+
public function getMessage() {
return gtText::get('methodNotSpecified');
}
diff --git a/scripts/dev/generate-phpt/src/setup/preconditions/gtIsSpecifiedFunctionOrMethod.php b/scripts/dev/generate-phpt/src/setup/preconditions/gtIsSpecifiedFunctionOrMethod.php
index 7495c73ecaa..f70af881ec0 100644
--- a/scripts/dev/generate-phpt/src/setup/preconditions/gtIsSpecifiedFunctionOrMethod.php
+++ b/scripts/dev/generate-phpt/src/setup/preconditions/gtIsSpecifiedFunctionOrMethod.php
@@ -5,15 +5,15 @@
*
*/
class gtIsSpecifiedFunctionOrMethod extends gtPreCondition {
-
+
public function check( $clo) {
if($clo->hasOption('f') || $clo->hasOption('m')) {
-
+
return true;
}
return false;
}
-
+
public function getMessage() {
return gtText::get('functionOrMethodNotSpecified');
}
diff --git a/scripts/dev/generate-phpt/src/setup/preconditions/gtIsSpecifiedTestType.php b/scripts/dev/generate-phpt/src/setup/preconditions/gtIsSpecifiedTestType.php
index 40530f3aca8..ebc0a68f576 100644
--- a/scripts/dev/generate-phpt/src/setup/preconditions/gtIsSpecifiedTestType.php
+++ b/scripts/dev/generate-phpt/src/setup/preconditions/gtIsSpecifiedTestType.php
@@ -5,15 +5,15 @@
*
*/
class gtIsSpecifiedTestType extends gtPreCondition {
-
+
public function check( $clo) {
if($clo->hasOption('b') || $clo->hasOption('e') || $clo->hasOption('v') ) {
-
+
return true;
}
return false;
}
-
+
public function getMessage() {
return gtText::get('testTypeNotSpecified');
}
diff --git a/scripts/dev/generate-phpt/src/testcase/gtBasicTestCase.php b/scripts/dev/generate-phpt/src/testcase/gtBasicTestCase.php
index 684c24dd7ea..92560c86311 100644
--- a/scripts/dev/generate-phpt/src/testcase/gtBasicTestCase.php
+++ b/scripts/dev/generate-phpt/src/testcase/gtBasicTestCase.php
@@ -23,12 +23,12 @@ abstract class gtBasicTestCase extends gtTestCase {
return new gtBasicTestCaseMethod($optionalSections);
}
}
-
+
public function constructSubjectCalls() {
$this->argInit();
$this->subjectCalls();
}
-
+
public function addBasicEcho() {
$this->testCase[] = "echo \"*** Test by calling method or function with its expected arguments ***\\n\";";
$this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
diff --git a/scripts/dev/generate-phpt/src/testcase/gtBasicTestCaseFunction.php b/scripts/dev/generate-phpt/src/testcase/gtBasicTestCaseFunction.php
index f64c6daf329..c0fc9eb61f5 100644
--- a/scripts/dev/generate-phpt/src/testcase/gtBasicTestCaseFunction.php
+++ b/scripts/dev/generate-phpt/src/testcase/gtBasicTestCaseFunction.php
@@ -22,13 +22,13 @@ class gtBasicTestCaseFunction extends gtBasicTestCase {
public function constructTestCase() {
$this->constructCommonHeaders();
-
+
$this->addBasicEcho();
-
+
$this->constructSubjectCalls();
-
+
$this->constructCommonClosing();
-
+
}
diff --git a/scripts/dev/generate-phpt/src/testcase/gtBasicTestCaseMethod.php b/scripts/dev/generate-phpt/src/testcase/gtBasicTestCaseMethod.php
index 3d3896e233b..d009d5038ae 100644
--- a/scripts/dev/generate-phpt/src/testcase/gtBasicTestCaseMethod.php
+++ b/scripts/dev/generate-phpt/src/testcase/gtBasicTestCaseMethod.php
@@ -10,34 +10,34 @@ class gtBasicTestCaseMethod extends gtBasicTestCase {
}
/**
- * Set the method
+ * Set the method
*
* @param gtMethod $method
*/
public function setMethod($method) {
$this->subject = $method;
}
-
+
public function constructTestCase() {
$this->constructCommonHeaders();
$this->addBasicEcho();
-
+
$this->constructorArgInit();
$this->constructorCreateInstance();
-
+
$this->constructSubjectCalls();
-
+
$this->constructCommonClosing();
-
+
}
public function testHeader() {
$this->testCase[] = "--TEST--";
$this->testCase[] = "Test class ".$this->subject->getClassName()." method ".$this->subject->getName()."() by calling it with its expected arguments";
-
+
}
-
+
public function subjectCalls() {
$lists = $this->subject->getValidArgumentLists();
@@ -45,7 +45,7 @@ public function constructTestCase() {
$this->testCase[] = "var_dump( \$class->".$this->subject->getName()."( ".$list." ) );";
$this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
}
- $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase );
+ $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase );
}
}
diff --git a/scripts/dev/generate-phpt/src/testcase/gtErrorTestCase.php b/scripts/dev/generate-phpt/src/testcase/gtErrorTestCase.php
index 214e3d28ba1..82f955cf467 100644
--- a/scripts/dev/generate-phpt/src/testcase/gtErrorTestCase.php
+++ b/scripts/dev/generate-phpt/src/testcase/gtErrorTestCase.php
@@ -17,7 +17,7 @@ abstract class gtErrorTestCase extends gtTestCase {
* @return test case object
*/
public static function getInstance($optionalSections, $type = 'function') {
-
+
if($type == 'function') {
return new gtErrorTestCaseFunction($optionalSections);
}
@@ -34,16 +34,16 @@ abstract class gtErrorTestCase extends gtTestCase {
public function getLongArgumentList() {
return $this->longArgumentList;
}
-
+
public function constructSubjectCalls() {
$this->argInit();
-
+
//Initialise the additional argument
$this->testCase[] = "\$extra_arg = ";
-
+
$this->subjectCalls();
}
-
+
public function addErrorEcho() {
$this->testCase[] = "echo \"*** Test by calling method or function with incorrect numbers of arguments ***\\n\";";
$this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
diff --git a/scripts/dev/generate-phpt/src/testcase/gtErrorTestCaseFunction.php b/scripts/dev/generate-phpt/src/testcase/gtErrorTestCaseFunction.php
index 2453acf6fde..fcba6d798c4 100644
--- a/scripts/dev/generate-phpt/src/testcase/gtErrorTestCaseFunction.php
+++ b/scripts/dev/generate-phpt/src/testcase/gtErrorTestCaseFunction.php
@@ -26,13 +26,13 @@ class gtErrorTestCaseFunction extends gtErrorTestCase {
*/
public function constructTestCase() {
$this->constructCommonHeaders();
-
+
$this->addErrorEcho();
-
+
$this->constructSubjectCalls();
-
+
$this->constructCommonClosing();
-
+
}
diff --git a/scripts/dev/generate-phpt/src/testcase/gtErrorTestCaseMethod.php b/scripts/dev/generate-phpt/src/testcase/gtErrorTestCaseMethod.php
index 647e52f93e6..fa1c8ca3f19 100644
--- a/scripts/dev/generate-phpt/src/testcase/gtErrorTestCaseMethod.php
+++ b/scripts/dev/generate-phpt/src/testcase/gtErrorTestCaseMethod.php
@@ -27,33 +27,33 @@ class gtErrorTestCaseMethod extends gtErrorTestCase {
*/
public function constructTestCase() {
$this->constructCommonHeaders();
-
+
$this->addErrorEcho();
-
+
$this->constructorArgInit();
$this->constructorCreateInstance();
-
+
$this->constructSubjectCalls();
-
+
$this->constructCommonClosing();
}
-
+
public function testHeader() {
$this->testCase[] = "--TEST--";
$this->testCase[] = "Test class ".$this->subject->getClassName()." method ".$this->subject->getName()."() by calling it more than or less than its expected arguments";
}
-
+
public function subjectCalls() {
// Construct the argument list to pass to the method being tested
$list = $this->subject->getExtraArgumentList();
$this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
$this->testCase[] = "var_dump(".$this->subject->getName()."( ".$list." ) );";
-
+
$list = $this->subject->getShortArgumentList();
$this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
$this->testCase[] = "var_dump(".$this->subject->getName()."( ".$list." ) );";
-
+
}
}
?>
\ No newline at end of file
diff --git a/scripts/dev/generate-phpt/src/testcase/gtTestCase.php b/scripts/dev/generate-phpt/src/testcase/gtTestCase.php
index 60c115a9c1a..e6fa7affcf2 100644
--- a/scripts/dev/generate-phpt/src/testcase/gtTestCase.php
+++ b/scripts/dev/generate-phpt/src/testcase/gtTestCase.php
@@ -80,11 +80,11 @@ abstract class gtTestCase {
*/
public function ConstructCommonClosing() {
$this->fileClosing();
-
+
if ($this->optionalSections->hasDone()) {
$this->addDone();
}
-
+
if ($this->optionalSections->hasClean()) {
$this->addClean();
}
diff --git a/scripts/dev/generate-phpt/src/testcase/gtVariationContainer.php b/scripts/dev/generate-phpt/src/testcase/gtVariationContainer.php
index 59951707ce1..f445d9e7f4d 100644
--- a/scripts/dev/generate-phpt/src/testcase/gtVariationContainer.php
+++ b/scripts/dev/generate-phpt/src/testcase/gtVariationContainer.php
@@ -4,9 +4,9 @@
* Container for all possible variation test cases
*/
abstract class gtVariationContainer {
-
+
protected $variationTests;
-
+
protected $dataTypes = array (
'array',
'boolean',
@@ -16,9 +16,9 @@ abstract class gtVariationContainer {
'object',
'string',
);
-
-
-
+
+
+
/**
* Return an instance of a containers for either function or method tests
*
@@ -26,21 +26,21 @@ abstract class gtVariationContainer {
* @return variation test container
*/
public static function getInstance ($optionalSections, $type = 'function') {
-
+
if($type == 'function') {
return new gtVariationContainerFunction($optionalSections);
}
if($type =='method') {
return new gtVariationContainerMethod($optionalSections);
}
-
+
}
-
-
+
+
public function constructAll() {
}
-
-
+
+
/**
* Returns all varaition tests as an array of arrays
*
@@ -49,6 +49,6 @@ abstract class gtVariationContainer {
public function getVariationTests() {
return $this->variationTests;
}
-
+
}
?>
\ No newline at end of file
diff --git a/scripts/dev/generate-phpt/src/testcase/gtVariationContainerFunction.php b/scripts/dev/generate-phpt/src/testcase/gtVariationContainerFunction.php
index a62882a81a0..b6a3aa473cd 100644
--- a/scripts/dev/generate-phpt/src/testcase/gtVariationContainerFunction.php
+++ b/scripts/dev/generate-phpt/src/testcase/gtVariationContainerFunction.php
@@ -4,14 +4,14 @@
* Container for all possible variation test cases of functions
*/
class gtVariationContainerFunction extends gtVariationContainer {
-
+
protected $function;
protected $optionalSections;
-
+
public function __construct($osl) {
$this->optionalSections = $osl;
}
-
+
/**
* Sets function being tested
*
@@ -20,15 +20,15 @@ class gtVariationContainerFunction extends gtVariationContainer {
public function setFunction(gtFunction $function) {
$this->function = $function;
}
-
-
+
+
/**
* constructs all possible variation testcases in array $this->variationTests
*
*/
public function constructAll() {
-
-
+
+
$numberOfArguments = count($this->function->getMandatoryArgumentNames()) + count($this->function->getOptionalArgumentNames());
for($i = 1; $i <= $numberOfArguments; $i++) {
foreach ($this->dataTypes as $d) {
@@ -38,6 +38,6 @@ class gtVariationContainerFunction extends gtVariationContainer {
$this->variationTests[] = $testCase->toString();
}
}
- }
+ }
}
?>
\ No newline at end of file
diff --git a/scripts/dev/generate-phpt/src/testcase/gtVariationContainerMethod.php b/scripts/dev/generate-phpt/src/testcase/gtVariationContainerMethod.php
index bee26b08aa2..0d24337b3b0 100644
--- a/scripts/dev/generate-phpt/src/testcase/gtVariationContainerMethod.php
+++ b/scripts/dev/generate-phpt/src/testcase/gtVariationContainerMethod.php
@@ -3,15 +3,15 @@
* Container for all possible variation test cases for a method
*/
class gtVariationContainerMethod extends gtVariationContainer {
-
+
protected $method;
protected $optionalSections;
-
+
public function __construct($osl) {
$this->optionalSections = $osl;
}
-
-
+
+
/**
* Sets the method to be tested
*
@@ -20,27 +20,27 @@ class gtVariationContainerMethod extends gtVariationContainer {
public function setMethod(gtMethod $method) {
$this->method = $method;
}
-
-
+
+
/**
* Constructs all variation tests in $this_variationTests
*
*/
public function constructAll() {
-
+
$numberOfArguments = count($this->method->getMandatoryArgumentNames()) + count($this->method->getOptionalArgumentNames());
-
+
for($i = 1; $i <= $numberOfArguments; $i++) {
-
+
foreach ($this->dataTypes as $d) {
-
+
$testCase = gtVariationTestCase::getInstance($this->optionalSections, 'method');
$testCase->setUp($this->method, $i, $d);
$testCase->constructTestCase();
$this->variationTests[] = $testCase->toString();
-
+
}
}
- }
+ }
}
?>
\ No newline at end of file
diff --git a/scripts/dev/generate-phpt/src/testcase/gtVariationTestCase.php b/scripts/dev/generate-phpt/src/testcase/gtVariationTestCase.php
index 039367d5b3d..e868b80795e 100644
--- a/scripts/dev/generate-phpt/src/testcase/gtVariationTestCase.php
+++ b/scripts/dev/generate-phpt/src/testcase/gtVariationTestCase.php
@@ -15,7 +15,7 @@ abstract class gtVariationTestCase extends gtTestCase {
* @return test case object
*/
public static function getInstance($optionalSections, $type = 'function') {
-
+
if($type == 'function') {
return new gtVariationTestCaseFunction($optionalSections);
}
diff --git a/scripts/dev/generate-phpt/src/testcase/gtVariationTestCaseFunction.php b/scripts/dev/generate-phpt/src/testcase/gtVariationTestCaseFunction.php
index 7bf1c8b778d..45cbe2046cc 100644
--- a/scripts/dev/generate-phpt/src/testcase/gtVariationTestCaseFunction.php
+++ b/scripts/dev/generate-phpt/src/testcase/gtVariationTestCaseFunction.php
@@ -32,22 +32,22 @@ class gtVariationTestCaseFunction extends gtVariationTestCase {
*
*/
public function constructTestCase() {
- $this->constructCommonHeaders();
-
+ $this->constructCommonHeaders();
+
$this->addVariationEcho();
-
+
$this->constructSubjectCalls();
-
+
$this->constructCommonClosing();
-
+
}
public function testHeader() {
$this->testCase[] = "--TEST--";
$this->testCase[] = "Test function ".$this->subject->getName()."() by substituting argument ".$this->argumentNumber." with ".$this->variationData." values.";
}
-
- public function subjectCalls() {
+
+ public function subjectCalls() {
$this->testCase = gtCodeSnippet::append('loopStart', $this->testCase);
// Construct the argument list to pass to the function being tested
@@ -59,6 +59,6 @@ class gtVariationTestCaseFunction extends gtVariationTestCase {
$this->testCase[] = " var_dump(".$this->subject->getName()."( ".$list." ) );";
$this->testCase = gtCodeSnippet::append('loopClose', $this->testCase);
}
-
+
}
?>
\ No newline at end of file
diff --git a/scripts/dev/generate-phpt/src/testcase/gtVariationTestCaseMethod.php b/scripts/dev/generate-phpt/src/testcase/gtVariationTestCaseMethod.php
index a9c921f9db5..db923f078ac 100644
--- a/scripts/dev/generate-phpt/src/testcase/gtVariationTestCaseMethod.php
+++ b/scripts/dev/generate-phpt/src/testcase/gtVariationTestCaseMethod.php
@@ -34,15 +34,15 @@ class gtVariationTestCaseMethod extends gtVariationTestCase {
*/
public function constructTestCase() {
$this->constructCommonHeaders();
-
+
$this->addVariationEcho();
-
+
$this->constructorArgInit();
$this->constructorCreateInstance();
-
+
$this->constructSubjectcalls();
$this->constructCommonClosing();
-
+
}
public function testHeader() {
diff --git a/scripts/dev/generate-phpt/tests/gtBasicTestCaseFunctionTest.php b/scripts/dev/generate-phpt/tests/gtBasicTestCaseFunctionTest.php
index dbba0d6470e..fa80c0766da 100644
--- a/scripts/dev/generate-phpt/tests/gtBasicTestCaseFunctionTest.php
+++ b/scripts/dev/generate-phpt/tests/gtBasicTestCaseFunctionTest.php
@@ -6,13 +6,13 @@ class gtBasicTestCaseFunctionTest extends PHPUnit_Framework_TestCase {
public function testTestCase() {
-
+
$f = new gtFunction('cos');
$f->setArgumentNames();
$f->setArgumentLists();
$f->setInitialisationStatements();
$optSect = new gtOptionalSections();
-
+
$btc = gtBasicTestCase::getInstance($optSect);
$btc->setFunction($f);
$btc->constructTestCase();
diff --git a/scripts/dev/generate-phpt/tests/gtBasicTestCaseMethodTest.php b/scripts/dev/generate-phpt/tests/gtBasicTestCaseMethodTest.php
index 81307f139ca..18768b62943 100644
--- a/scripts/dev/generate-phpt/tests/gtBasicTestCaseMethodTest.php
+++ b/scripts/dev/generate-phpt/tests/gtBasicTestCaseMethodTest.php
@@ -6,7 +6,7 @@ class gtBasicTestCaseMethodTest extends PHPUnit_Framework_TestCase {
public function testTestCase() {
-
+
$f = new gtMethod('DOMDocument','createAttribute');
$f->setArgumentNames();
$f->setArgumentLists();
@@ -18,11 +18,11 @@ class gtBasicTestCaseMethodTest extends PHPUnit_Framework_TestCase {
$btc = gtBasicTestCaseMethod::getInstance($optSect, 'method');
$btc->setMethod($f);
$btc->constructTestCase();
-
+
$fs = $btc->toString();
$this->assertTrue(is_string($fs));
-
+
}
}
?>
\ No newline at end of file
diff --git a/scripts/dev/generate-phpt/tests/gtCodeSnippetTest.php b/scripts/dev/generate-phpt/tests/gtCodeSnippetTest.php
index bc0c48a5a1c..6d4d5861c31 100644
--- a/scripts/dev/generate-phpt/tests/gtCodeSnippetTest.php
+++ b/scripts/dev/generate-phpt/tests/gtCodeSnippetTest.php
@@ -5,7 +5,7 @@ require_once dirname(__FILE__) . '/../src/gtAutoload.php';
class gtCodeSnippetTest extends PHPUnit_Framework_TestCase
{
-
+
public function testAppend() {
$array = array('something', 'nothing');
$array = gtCodeSnippet::append('loopClose', $array);
diff --git a/scripts/dev/generate-phpt/tests/gtCommandLineOptionsTest.php b/scripts/dev/generate-phpt/tests/gtCommandLineOptionsTest.php
index 2fd6818a450..1bf32b46086 100644
--- a/scripts/dev/generate-phpt/tests/gtCommandLineOptionsTest.php
+++ b/scripts/dev/generate-phpt/tests/gtCommandLineOptionsTest.php
@@ -5,7 +5,7 @@ require_once 'PHPUnit/Framework.php';
class gtCommandLineOptionsTest extends PHPUnit_Framework_TestCase
{
-
+
/**
* @expectedException RuntimeException
*/
@@ -26,7 +26,7 @@ require_once 'PHPUnit/Framework.php';
$this->assertTrue($clo->hasOption('f'));
$this->assertEquals('some-function', $clo->getOption('f'));
}
-
+
/**
* @expectedException RuntimeException
*/
@@ -34,7 +34,7 @@ require_once 'PHPUnit/Framework.php';
$clo = new gtCommandLineOptions();
$clo->parse(array('generate-phpt.php', '-z'));
}
-
+
/**
* @expectedException RuntimeException
*/
diff --git a/scripts/dev/generate-phpt/tests/gtErrorTestCaseFunctionTest.php b/scripts/dev/generate-phpt/tests/gtErrorTestCaseFunctionTest.php
index 5b72fcc9f5b..c6399168be3 100644
--- a/scripts/dev/generate-phpt/tests/gtErrorTestCaseFunctionTest.php
+++ b/scripts/dev/generate-phpt/tests/gtErrorTestCaseFunctionTest.php
@@ -6,23 +6,23 @@ class gtErrorTestCaseFunctionTest extends PHPUnit_Framework_TestCase {
public function testTestCase() {
-
+
$f = new gtFunction('cos');
$f->setArgumentNames();
$f->setArgumentLists();
$f->setInitialisationStatements();
-
+
$optSect = new gtOptionalSections();
-
+
$btc = gtErrorTestCase::getInstance($optSect);
$btc->setFunction($f);
$btc->constructTestCase();
-
-
+
+
$fs = $btc->toString();
$this->assertTrue(is_string($fs));
-
+
}
-
+
}
?>
\ No newline at end of file
diff --git a/scripts/dev/generate-phpt/tests/gtErrorTestCaseMethodTest.php b/scripts/dev/generate-phpt/tests/gtErrorTestCaseMethodTest.php
index 7077881296f..894a5515971 100644
--- a/scripts/dev/generate-phpt/tests/gtErrorTestCaseMethodTest.php
+++ b/scripts/dev/generate-phpt/tests/gtErrorTestCaseMethodTest.php
@@ -6,7 +6,7 @@ class gtErrorTestCaseMethodTest extends PHPUnit_Framework_TestCase {
public function testTestCase() {
-
+
$f = new gtMethod('DOMDocument', 'createAttribute');
$f->setArgumentNames();
$f->setArgumentLists();
@@ -15,14 +15,14 @@ class gtErrorTestCaseMethodTest extends PHPUnit_Framework_TestCase {
$f->setConstructorArgumentNames();
$f->setConstructorInitStatements();
-
+
$optSect = new gtOptionalSections();
-
+
$btc = gtErrorTestCase::getInstance($optSect,'method');
$btc->setMethod($f);
$btc->constructTestCase();
-
-
+
+
$fs = $btc->toString();
$this->assertTrue(is_string($fs));
}
diff --git a/scripts/dev/generate-phpt/tests/gtFunctionTest.php b/scripts/dev/generate-phpt/tests/gtFunctionTest.php
index 0aa7eac1199..5afcd950d46 100644
--- a/scripts/dev/generate-phpt/tests/gtFunctionTest.php
+++ b/scripts/dev/generate-phpt/tests/gtFunctionTest.php
@@ -43,25 +43,25 @@ class gtFunctionTest extends PHPUnit_Framework_TestCase
$this->assertEquals('$ver1', $f->getShortArgumentList());
}
-
+
public function testAllArgumentList() {
$f = new gtFunction('version_compare');
$f->setArgumentNames();
$f->setValidArgumentLists();
$a = $f->getValidArgumentLists();
-
+
$this->assertEquals('$ver1, $ver2', $a[0]);
$this->assertEquals('$ver1, $ver2, $oper', $a[1]);
}
-
+
public function testInitialisation() {
$f = new gtFunction('version_compare');
$f->setArgumentNames();
$f->setInitialisationStatements();
$a = $f->getInitialisationStatements();
-
+
$this->assertEquals('$ver1 = ', $a[0]);
$this->assertEquals('$ver2 = ', $a[1]);
$this->assertEquals('$oper = ', $a[2]);
diff --git a/scripts/dev/generate-phpt/tests/gtIsSpecifiedFunctionOrMethodTest.php b/scripts/dev/generate-phpt/tests/gtIsSpecifiedFunctionOrMethodTest.php
index 064edf3b655..a60f77ef377 100644
--- a/scripts/dev/generate-phpt/tests/gtIsSpecifiedFunctionOrMethodTest.php
+++ b/scripts/dev/generate-phpt/tests/gtIsSpecifiedFunctionOrMethodTest.php
@@ -20,16 +20,16 @@ class gtIsSpecifiedFunctionOrMethodTest extends PHPUnit_Framework_TestCase {
$ch = new gtIsSpecifiedFunctionOrMethod();
$this->assertTrue($ch->check($clo));
}
-
+
public function testNotValid() {
$clo = new gtCommandLineOptions();
$clo->parse(array('generate-phpt.php', '-b'));
$ch = new gtIsSpecifiedFunctionOrMethod();
$this->assertFalse($ch->check($clo));
-
+
}
-
+
public function testMessage() {
$clo = new gtCommandLineOptions();
diff --git a/scripts/dev/generate-phpt/tests/gtIsSpecifiedTestTypeTest.php b/scripts/dev/generate-phpt/tests/gtIsSpecifiedTestTypeTest.php
index c8b0a4e36a9..bc7cf9412d7 100644
--- a/scripts/dev/generate-phpt/tests/gtIsSpecifiedTestTypeTest.php
+++ b/scripts/dev/generate-phpt/tests/gtIsSpecifiedTestTypeTest.php
@@ -20,7 +20,7 @@ class gtIsSpecifiedTestTypeTest extends PHPUnit_Framework_TestCase {
$ch = new gtIsSpecifiedTestType();
$this->assertFalse($ch->check($clo));
}
-
+
public function testMessage() {
$clo = new gtCommandLineOptions();
diff --git a/scripts/dev/generate-phpt/tests/gtIsValidClassTest.php b/scripts/dev/generate-phpt/tests/gtIsValidClassTest.php
index 51ca87879d6..507ca232db5 100644
--- a/scripts/dev/generate-phpt/tests/gtIsValidClassTest.php
+++ b/scripts/dev/generate-phpt/tests/gtIsValidClassTest.php
@@ -20,7 +20,7 @@ class gtIsValidClassTest extends PHPUnit_Framework_TestCase {
$ch = new gtIsValidClass();
$this->assertFalse($ch->check($clo));
}
-
+
public function testNotGiven() {
$clo = new gtCommandLineOptions();
@@ -28,7 +28,7 @@ class gtIsValidClassTest extends PHPUnit_Framework_TestCase {
$ch = new gtIsValidClass();
$this->assertTrue($ch->check($clo));
}
-
+
public function testMessage() {
$clo = new gtCommandLineOptions();
diff --git a/scripts/dev/generate-phpt/tests/gtIsValidFunctionTest.php b/scripts/dev/generate-phpt/tests/gtIsValidFunctionTest.php
index d4700b9d665..07a7038dccd 100644
--- a/scripts/dev/generate-phpt/tests/gtIsValidFunctionTest.php
+++ b/scripts/dev/generate-phpt/tests/gtIsValidFunctionTest.php
@@ -20,7 +20,7 @@ class gtIsValidFunctionTest extends PHPUnit_Framework_TestCase {
$ch = new gtIsValidFunction();
$this->assertFalse($ch->check($clo));
}
-
+
public function testNotSupplied() {
$clo = new gtCommandLineOptions();
@@ -28,7 +28,7 @@ class gtIsValidFunctionTest extends PHPUnit_Framework_TestCase {
$ch = new gtIsValidFunction();
$this->assertTrue($ch->check($clo));
}
-
+
public function testMessage() {
$clo = new gtCommandLineOptions();
diff --git a/scripts/dev/generate-phpt/tests/gtIsValidMethodTest.php b/scripts/dev/generate-phpt/tests/gtIsValidMethodTest.php
index fe069977eff..0f1b349f4d5 100644
--- a/scripts/dev/generate-phpt/tests/gtIsValidMethodTest.php
+++ b/scripts/dev/generate-phpt/tests/gtIsValidMethodTest.php
@@ -20,7 +20,7 @@ class gtIsValidMethodTest extends PHPUnit_Framework_TestCase {
$ch = new gtIsValidMethod();
$this->assertFalse($ch->check($clo));
}
-
+
public function testNotGiven() {
$clo = new gtCommandLineOptions();
@@ -28,7 +28,7 @@ class gtIsValidMethodTest extends PHPUnit_Framework_TestCase {
$ch = new gtIsValidMethod();
$this->assertTrue($ch->check($clo));
}
-
+
public function testMessage() {
$clo = new gtCommandLineOptions();
diff --git a/scripts/dev/generate-phpt/tests/gtOptionalSectionsTest.php b/scripts/dev/generate-phpt/tests/gtOptionalSectionsTest.php
index dbf29945676..541dbdf2ddb 100644
--- a/scripts/dev/generate-phpt/tests/gtOptionalSectionsTest.php
+++ b/scripts/dev/generate-phpt/tests/gtOptionalSectionsTest.php
@@ -27,29 +27,29 @@ class gtOptionalSectionsTest extends PHPUnit_Framework_TestCase
$opt = new gtOptionalSections();
$opt->setOptions($clo);
}
-
+
public function testSkip() {
$clo = new gtCommandLineOptions();
$clo->parse(array('generate-phpt.php', '-s', 'skipif', '-x', 'standard'));
$opt = new gtOptionalSections();
$opt->setOptions($clo);
-
+
$opt = new gtOptionalSections();
$opt->setOptions($clo);
-
+
$this->assertEquals('standard', $opt->getSkipifExt() );
}
-
+
public function testSkipKey() {
$clo = new gtCommandLineOptions();
$clo->parse(array('generate-phpt.php', '-s', 'skipif', '-k', 'win'));
$opt = new gtOptionalSections();
$opt->setOptions($clo);
-
+
$opt = new gtOptionalSections();
$opt->setOptions($clo);
-
+
$this->assertEquals('win', $opt->getSkipifKey() );
}
diff --git a/scripts/dev/generate-phpt/tests/gtVariationTestCaseFunctionTest.php b/scripts/dev/generate-phpt/tests/gtVariationTestCaseFunctionTest.php
index df9f21c309e..83178b21e78 100644
--- a/scripts/dev/generate-phpt/tests/gtVariationTestCaseFunctionTest.php
+++ b/scripts/dev/generate-phpt/tests/gtVariationTestCaseFunctionTest.php
@@ -5,55 +5,55 @@ require_once dirname(__FILE__) . '/../src/gtAutoload.php';
class gtVariationTestCaseFunctionTest extends PHPUnit_Framework_TestCase {
public function testTestCase() {
-
+
$f = new gtFunction('cos');
$f->setArgumentNames();
$f->setArgumentLists();
-
+
$optSect = new gtOptionalSections();
-
+
$vtc = gtVariationTestCase::getInstance($optSect);
$vtc->setUp($f, 1, 'int');
$vtc->constructTestCase();
-
+
$fs = $vtc->toString();
$this->assertTrue(is_string($fs));
-
+
}
public function testTestCase2() {
-
+
$f = new gtFunction('date_sunrise');
$f->setArgumentNames();
$f->setArgumentLists();
$a = $f->getMandatoryArgumentNames();
-
+
$optSect = new gtOptionalSections();
-
+
$vtc = gtVariationTestCase::getInstance($optSect);
$vtc->setUp($f, 6, 'int');
$vtc->constructTestCase();
-
+
$fs = $vtc->toString();
$this->assertTrue(is_string($fs));
-
+
}
-
+
public function testTestCase3() {
-
+
$f = new gtFunction('date_sunrise');
$f->setArgumentNames();
$f->setArgumentLists();
-
+
$optSect = new gtOptionalSections();
$vtc = gtVariationTestCase::getInstance($optSect);
$vtc->setUp($f, 6, 'array');
$vtc->constructTestCase();
-
+
$fs = $vtc->toString();
$this->assertTrue(is_string($fs));
-
+
}
}
?>
\ No newline at end of file
diff --git a/scripts/dev/generate-phpt/tests/gtVariationTestCaseMethodTest.php b/scripts/dev/generate-phpt/tests/gtVariationTestCaseMethodTest.php
index d99b6562d00..a074fcceeb3 100644
--- a/scripts/dev/generate-phpt/tests/gtVariationTestCaseMethodTest.php
+++ b/scripts/dev/generate-phpt/tests/gtVariationTestCaseMethodTest.php
@@ -5,23 +5,23 @@ require_once dirname(__FILE__) . '/../src/gtAutoload.php';
class gtVariationTestCaseMethodTest extends PHPUnit_Framework_TestCase {
public function testTestCase() {
-
+
$f = new gtMethod('DOMDocument','createAttribute');
$f->setArgumentNames();
$f->setArgumentLists();
$f->setConstructorArgumentNames();
$f->setConstructorInitStatements();
-
+
$optSect = new gtOptionalSections();
-
+
$vtc = gtVariationTestCase::getInstance($optSect, 'method');
$vtc->setUp($f, 1, 'int');
$vtc->constructTestCase();
$fs = $vtc->toString();
-
+
$this->assertTrue(is_string($fs));
-
+
}
}
?>
\ No newline at end of file
diff --git a/scripts/man1/phpize.1.in b/scripts/man1/phpize.1.in
index d2852fdcc54..b885326bfed 100644
--- a/scripts/man1/phpize.1.in
+++ b/scripts/man1/phpize.1.in
@@ -44,5 +44,5 @@ available through the world-wide-web at the following url:
.P
If you did not receive a copy of the PHP license and are unable to
obtain it through the world-wide-web, please send a note to
-.B license@php.net
+.B license@php.net
so we can mail you a copy immediately.
diff --git a/scripts/phpize.in b/scripts/phpize.in
index 6302d4ee2f3..e67e3d9cc40 100644
--- a/scripts/phpize.in
+++ b/scripts/phpize.in
@@ -31,7 +31,7 @@ phpize_no_configm4()
echo "Cannot find config.m4. "
echo "Make sure that you run '$0$clean' in the top level source directory of the module"
- echo
+ echo
}
phpize_clean()
@@ -107,8 +107,8 @@ phpize_check_shtool()
if test ! -x "$builddir/build/shtool"; then
cat < aclocal.m4)
@@ -164,7 +164,7 @@ phpize_autotools()
# Main script
-case "$1" in
+case "$1" in
# Cleanup
--clean)
phpize_check_configm4 1
diff --git a/scripts/phpize.m4 b/scripts/phpize.m4
index 1094e2812c8..39f79984301 100644
--- a/scripts/phpize.m4
+++ b/scripts/phpize.m4
@@ -6,7 +6,7 @@ ifdef([AC_PRESERVE_HELP_ORDER], [AC_PRESERVE_HELP_ORDER], [])
PHP_CONFIG_NICE(config.nice)
-dnl
+dnl
AC_DEFUN([PHP_EXT_BUILDDIR],[.])dnl
AC_DEFUN([PHP_EXT_DIR],[""])dnl
AC_DEFUN([PHP_EXT_SRCDIR],[$abs_srcdir])dnl
@@ -45,7 +45,7 @@ phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
-
+
if test -z "$prefix"; then
AC_MSG_ERROR([Cannot find php-config. Please use --with-php-config=PATH])
fi
diff --git a/server-tests-config.php b/server-tests-config.php
index 5961deea982..645a5e8e982 100755
--- a/server-tests-config.php
+++ b/server-tests-config.php
@@ -6,7 +6,7 @@
that are directly executed, so you can also set things
like PHPRC here to force an executable to use a
specific php.ini file. */
-
+
$conf = array(
/* path to the php source tree */
'TEST_PHP_SRCDIR' => NULL,
@@ -43,7 +43,7 @@ $conf = array(
TEST_WEB_BASE_URL should be the base url pointing
to TEST_PHP_SRCDIR, which should then be accessible via
an http server.
-
+
An example would be:
TEST_WEB_BASE_URL=http://localhost/test
TEST_BASE_PATH=/path/to/htdocs/test
diff --git a/server-tests.php b/server-tests.php
index ff4b9f6ffc3..f914b011871 100755
--- a/server-tests.php
+++ b/server-tests.php
@@ -154,13 +154,13 @@ function post_result_data($query,$data)
$post = "php_test_data=" . urlencode(base64_encode(preg_replace("/[\\x00]/", "[0x0]", $data)));
$r = new HTTPRequest($url,NULL,NULL,$post);
return $this->response_headers['Status']=='200';
-}
+}
function execute($command, $args=NULL, $input=NULL, $cwd=NULL, $env=NULL)
{
$data = "";
-
+
if (gettype($args)=='array') {
$args = join($args,' ');
}
@@ -179,7 +179,7 @@ function execute($command, $args=NULL, $input=NULL, $cwd=NULL, $env=NULL)
return NULL;
}
}
-
+
fclose($pipes[0]);
while (true) {
@@ -247,7 +247,7 @@ class HTTPRequest
/*
URL is the full url
headers is assoc array of outgoing http headers
-
+
options may include
timeout
proxy_host
@@ -255,7 +255,7 @@ class HTTPRequest
proxy_user
proxy_pass
method (GET|POST)
-
+
post data is, well, post data. It is not processed so
multipart stuff must be prepared before calling this
(or add it to class)
@@ -269,14 +269,14 @@ class HTTPRequest
$this->postdata = &$postdata;
$this->doRequest();
}
-
+
function doRequest()
{
if (!$this->_validateUrl()) return;
-
- if (isset($this->options['timeout']))
+
+ if (isset($this->options['timeout']))
$this->timeout = (int)$this->options['timeout'];
-
+
$this->_sendHTTP();
}
@@ -295,7 +295,7 @@ class HTTPRequest
$this->urlparts['path'] = '/';
return TRUE;
}
-
+
function _parseResponse()
{
if (preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $this->incoming_payload, $match)) {
@@ -319,7 +319,7 @@ class HTTPRequest
$this->errmsg = 'Invalid HTTP Response';
return FALSE;
}
-
+
function &_getRequest()
{
$fullpath = $this->urlparts['path'].
@@ -343,13 +343,13 @@ class HTTPRequest
$headertext .= "$k: $v\r\n";
}
$method = trim($this->options['method'])?strtoupper(trim($this->options['method'])):'GET';
- $this->outgoing_payload =
+ $this->outgoing_payload =
"$method $fullpath HTTP/1.0\r\n".
$headertext."\r\n".
$this->postdata;
return $this->outgoing_payload;
}
-
+
function _sendHTTP()
{
$this->_getRequest();
@@ -378,7 +378,7 @@ class HTTPRequest
$this->errmsg = "Error Sending Request Data to $host";
return NULL;
}
-
+
while ($data = fread($fp, 32768)) {
$this->incoming_payload .= $data;
}
@@ -422,7 +422,7 @@ class testHarness {
'w' => array('TEST_WEB' ,'' ,0 ,'run tests via http'),
'x' => array('TEST_WEB_EXT' ,'file ext' ,'php' ,'http file extension to use')
);
-
+
public $conf = array();
public $test_to_run = array();
public $test_files = array();
@@ -439,7 +439,7 @@ class testHarness {
public $test_executable_iscgi = false;
public $inisettings; // the test executables settings, used for web tests
public $iswin32 = false;
-
+
public $ddash = "=====================================================================";
public $sdash = "---------------------------------------------------------------------";
@@ -463,7 +463,7 @@ class testHarness {
'error_append_string'=>'',
'auto_prepend_file'=>'',
'auto_append_file'=>'',
- );
+ );
public $env = array();
public $info_params = array();
@@ -472,7 +472,7 @@ class testHarness {
$this->checkRequirements();
$this->env = $_ENV;
$this->removeSensitiveEnvVars();
-
+
$this->initializeConfiguration();
$this->parseArgs();
$this->setTestPaths();
@@ -490,13 +490,13 @@ class testHarness {
$this->conf['TEST_PHP_SRCDIR'] = str_replace('/','\\',$this->conf['TEST_PHP_SRCDIR']);
$this->conf['TEST_BASE_PATH'] = str_replace('/','\\',$this->conf['TEST_BASE_PATH']);
}
-
+
if (!$this->conf['TEST_WEB'] && !is_executable($this->conf['TEST_PHP_EXECUTABLE'])) {
$this->error("invalid PHP executable specified by TEST_PHP_EXECUTABLE = " .
$this->conf['TEST_PHP_EXECUTABLE']);
return false;
}
-
+
$this->getInstalledExtensions();
$this->getExecutableInfo();
$this->getExecutableIniSettings();
@@ -506,11 +506,11 @@ class testHarness {
// add TEST_PHP_SRCDIR to the include path, this facilitates
// tests including files from src/tests
//$this->ini_overwrites['include_path'] = $this->cwd.($this->iswin32?';.;':':.:').$this->exec_info['INCLUDE_PATH'];
-
+
$params = array();
settings2array($this->ini_overwrites,$params);
$this->info_params = settings2params($params);
-
+
$this->contextHeader();
if ($this->conf['TEST_CONTEXT_INFO']) return;
$this->loadFileList();
@@ -524,7 +524,7 @@ class testHarness {
$out = $this->runscript(PHP_INI_SETTINGS_SCRIPT,true);
$this->inisettings = unserialize($out);
}
-
+
function getExecutableInfo()
{
$out = $this->runscript(PHP_INFO_SCRIPT,true);
@@ -540,7 +540,7 @@ class testHarness {
}
$this->exec_info = $info;
}
-
+
function getInstalledExtensions()
{
// get the list of installed extensions
@@ -579,21 +579,21 @@ class testHarness {
}
}
-
+
// Use this function to do any displaying of text, so that
// things can be over-written as necessary.
-
+
function writemsg($msg) {
-
+
echo $msg;
-
+
}
-
+
// Another wrapper function, this one should be used any time
// a particular test passes or fails
-
+
function showstatus($item, $status, $reason = '') {
-
+
switch($status) {
case 'PASSED':
$this->writemsg("PASSED: $item ($reason)\n");
@@ -606,8 +606,8 @@ class testHarness {
break;
}
}
-
-
+
+
function help()
{
$usage = "usage: php run-tests.php [options]\n";
@@ -616,17 +616,17 @@ class testHarness {
}
return $usage;
}
-
+
function parseArgs() {
global $argc;
global $argv;
global $_SERVER;
-
+
if (!isset($argv)) {
$argv = $_SERVER['argv'];
$argc = $_SERVER['argc'];
}
-
+
$conf = NULL;
for ($i=1; $i<$argc;) {
if ($argv[$i][0] != '-') continue;
@@ -661,7 +661,7 @@ class testHarness {
break;
}
}
-
+
// set config into environment, this allows
// executed tests to find out about the test
// configurations. config file or args overwrite
@@ -680,14 +680,14 @@ class testHarness {
$this->env['SSH_AUTH_SOCK']='deleted';
$this->env['SSH_TTY']='deleted';
}
-
+
function setEnvConfigVar($name)
{
if (isset($this->env[$name])) {
$this->conf[$name] = $this->env[$name];
}
}
-
+
function initializeConfiguration()
{
foreach ($this->xargs as $arg=>$arg_info) {
@@ -715,7 +715,7 @@ class testHarness {
}
}
}
-
+
function test_sort($a, $b) {
$ta = strpos($a, "{$this->cwd}/tests")===0 ? 1 + (strpos($a, "{$this->cwd}/tests/run-test")===0 ? 1 : 0) : 0;
$tb = strpos($b, "{$this->cwd}/tests")===0 ? 1 + (strpos($b, "{$this->cwd}/tests/run-test")===0 ? 1 : 0) : 0;
@@ -745,7 +745,7 @@ class testHarness {
exit;
}
}
-
+
//
// Write test context information.
//
@@ -767,12 +767,12 @@ class testHarness {
foreach ($this->conf as $k=>$v) {
$conf .= sprintf("%-20.s: %s\n",$k,$v);
}
-
+
$exeinfo = '';
if (!$this->conf['TEST_WEB'])
$exeinfo = "CWD : {$this->cwd}\n".
"PHP : {$this->conf['TEST_PHP_EXECUTABLE']}\n";
-
+
$this->writemsg("\n$this->ddash\n".
"$exeinfo$info\n".
"Test Harness Configuration:\n$conf\n".
@@ -780,7 +780,7 @@ class testHarness {
"Test Dirs : $dirs\n".
"$this->ddash\n");
}
-
+
function loadFileList()
{
foreach ($this->test_dirs as $dir) {
@@ -793,7 +793,7 @@ class testHarness {
usort($this->test_files,array($this,"test_sort"));
$this->writemsg("found ".count($this->test_files)." files\n");
}
-
+
function moveTestFiles()
{
if (!$this->conf['TEST_BASE_PATH'] ||
@@ -819,7 +819,7 @@ class testHarness {
}
$this->test_files = $files;
}
-
+
function findFilesInDir($dir,$is_ext_dir=FALSE,$ignore=FALSE)
{
$skip = array('.', '..', 'CVS');
@@ -833,13 +833,13 @@ class testHarness {
}
$this->findFilesInDir("$dir/$name", FALSE, $ignore || $skip_ext);
}
-
+
// Cleanup any left-over tmp files from last run.
if (substr($name, -4) == '.tmp') {
@unlink("$dir/$name");
continue;
}
-
+
// Otherwise we're only interested in *.phpt files.
if (substr($name, -5) == '.phpt') {
if ($ignore) {
@@ -852,7 +852,7 @@ class testHarness {
}
closedir($o);
}
-
+
function runHeader()
{
$this->writemsg("TIME START " . date('Y-m-d H:i:s', $this->start_time) . "\n".$this->ddash."\n");
@@ -862,14 +862,14 @@ class testHarness {
$this->writemsg("Running all test files.\n");
}
}
-
+
function run()
{
$this->start_time = time();
$this->runHeader();
// Run selected tests.
if (count($this->test_to_run)) {
-
+
foreach($this->test_to_run as $name=>$runnable) {
if(!preg_match("/\.phpt$/", $name))
continue;
@@ -891,10 +891,10 @@ class testHarness {
$this->writemsg("No tests were run.\n");
return;
}
-
+
$n_total = count($this->test_results);
$n_total += $this->ignored_by_ext;
-
+
$sum_results = array('PASSED'=>0, 'SKIPPED'=>0, 'FAILED'=>0);
foreach ($this->test_results as $v) {
$sum_results[$v]++;
@@ -904,7 +904,7 @@ class testHarness {
foreach ($sum_results as $v => $n) {
$percent_results[$v] = (100.0 * $n) / $n_total;
}
-
+
$this->writemsg("\n".$this->ddash."\n".
"TIME END " . date('Y-m-d H:i:s', $this->end_time) . "\n".
$this->ddash."\n".
@@ -920,7 +920,7 @@ class testHarness {
$this->sdash."\n".
"Time taken : " . sprintf("%4d seconds", $this->end_time - $this->start_time) . "\n".
$this->ddash."\n");
-
+
$failed_test_summary = '';
if ($this->failed_tests) {
$failed_test_summary .= "\n".$this->ddash."\n".
@@ -930,7 +930,7 @@ class testHarness {
}
$failed_test_summary .= $this->ddash."\n";
}
-
+
if ($failed_test_summary && !$this->conf['NO_PHPTEST_SUMMARY']) {
$this->writemsg($failed_test_summary);
}
@@ -944,9 +944,9 @@ class testHarness {
flush();
$user_input = fgets($fp, 10);
$just_save_results = (strtolower($user_input[0]) == 's');
-
+
if ($just_save_results || strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') {
- /*
+ /*
* Collect information about the host system for our report
* Fetch phpinfo() output so that we can see the PHP environment
* Make an archive of all the failed tests
@@ -961,12 +961,12 @@ class testHarness {
$user_email = trim(fgets($fp, 1024));
$user_email = str_replace("@", " at ", str_replace(".", " dot ", $user_email));
}
-
+
$failed_tests_data = '';
$sep = "\n" . str_repeat('=', 80) . "\n";
-
+
$failed_tests_data .= $failed_test_summary . "\n";
-
+
if (array_sum($this->failed_tests)) {
foreach ($this->failed_tests as $test_info) {
$failed_tests_data .= $sep . $test_info['name'];
@@ -978,7 +978,7 @@ class testHarness {
} else {
$status = "success";
}
-
+
$failed_tests_data .= "\n" . $sep . 'BUILD ENVIRONMENT' . $sep;
$failed_tests_data .= "OS:\n". PHP_OS. "\n\n";
$automake = $autoconf = $libtool = $compiler = 'N/A';
@@ -999,7 +999,7 @@ class testHarness {
}
}
}
-
+
$failed_tests_data .= "Automake:\n$automake\n";
$failed_tests_data .= "Autoconf:\n$autoconf\n";
$failed_tests_data .= "Libtool:\n$libtool\n";
@@ -1013,7 +1013,7 @@ class testHarness {
$failed_tests_data .= $sep . "PHPINFO" . $sep;
$failed_tests_data .= shell_exec($this->conf['TEST_PHP_EXECUTABLE'].' -dhtml_errors=0 -i');
-
+
$compression = 0;
if ($just_save_results ||
@@ -1022,7 +1022,7 @@ class testHarness {
$fp = fopen($output_file, "w");
fwrite($fp, $failed_tests_data);
fclose($fp);
-
+
if (!$just_save_results)
echo "\nThe test script was unable to automatically send the report to PHP's QA Team\n";
echo "Please send ".$output_file." to ".PHP_QA_EMAIL." manually, thank you.\n";
@@ -1032,7 +1032,7 @@ class testHarness {
}
}
}
-
+
if($this->conf['REPORT_EXIT_STATUS'] and $sum_results['FAILED']) {
exit(1);
}
@@ -1041,7 +1041,7 @@ class testHarness {
function getINISettings(&$section_text)
{
$ini_settings = $this->ini_overwrites;
- // Any special ini settings
+ // Any special ini settings
// these may overwrite the test defaults...
if (array_key_exists('INI', $section_text)) {
settings2array(preg_split( "/[\n\r]+/", $section_text['INI']), $ini_settings);
@@ -1090,11 +1090,11 @@ class testHarness {
// eval fails if no newline
return eval("$data\n");
}
-
+
function getENVSettings(&$section_text,$testfile)
{
$env = $this->env;
- // Any special environment settings
+ // Any special environment settings
// these may overwrite the test defaults...
if (array_key_exists('ENV', $section_text)) {
$sect = $this->evalSettings($testfile,$section_text['ENV']);
@@ -1107,7 +1107,7 @@ class testHarness {
function getEvalTestSettings($section_text,$testfile)
{
$rq = array();
- // Any special environment settings
+ // Any special environment settings
// these may overwrite the test defaults...
if ($section_text) {
$sect = $this->evalSettings($testfile,$section_text);
@@ -1116,7 +1116,7 @@ class testHarness {
}
return $rq;
}
-
+
//
// Load the sections of the test file.
//
@@ -1131,10 +1131,10 @@ class testHarness {
'_FILE' => $file,
'_DIR' => realpath(dirname($file)),
);
-
+
$fp = @fopen($file, "r")
or $this->error("Cannot open test file: $file");
-
+
$section = '';
while (!feof($fp)) {
$line = fgets($fp);
@@ -1144,7 +1144,7 @@ class testHarness {
$section_text[$section] = '';
continue;
}
-
+
// Add to the section text.
$section_text[$section] .= $line;
}
@@ -1199,7 +1199,7 @@ class testHarness {
if ($this->conf['TEST_PHP_DETAILED'] > 2)
print "SKIPIF: [$output]\n";
if (preg_match("/^skip/i", $output)){
-
+
$reason = (preg_match("/^skip\s*(.+)\$/", $output)) ? preg_replace("/^skip\s*(.+)\$/", "\\1", $output) : FALSE;
$this->showstatus($section_text['TEST'], 'SKIPPED', $reason);
return 'SKIPPED';
@@ -1221,15 +1221,15 @@ class testHarness {
{
if ($this->conf['TEST_PHP_DETAILED'])
$this->writemsg("\n=================\nTEST $file\n");
-
+
$section_text = $this->getSectionText($file);
-
+
if ($this->iswin32)
$shortname = str_replace($this->conf['TEST_BASE_PATH'].'\\', '', $file);
else
$shortname = str_replace($this->conf['TEST_BASE_PATH'].'/', '', $file);
$tested = $section_text['TEST']." [$shortname]";
-
+
if ($this->conf['TEST_WEB']) {
$tmp_file = preg_replace('/\.phpt$/','.'.$this->conf['TEST_WEB_EXT'],$file);
$uri = $this->conf['TEST_BASE_SCRIPT_NAME'].str_replace($this->conf['TEST_BASE_PATH'], '', $tmp_file);
@@ -1238,19 +1238,19 @@ class testHarness {
$tmp_file = preg_replace('/\.phpt$/','.php',$file);
}
@unlink($tmp_file);
-
- // unlink old test results
+
+ // unlink old test results
@unlink(preg_replace('/\.phpt$/','.diff',$file));
@unlink(preg_replace('/\.phpt$/','.log',$file));
@unlink(preg_replace('/\.phpt$/','.exp',$file));
@unlink(preg_replace('/\.phpt$/','.out',$file));
-
+
if (!$this->conf['TEST_WEB']) {
// Reset environment from any previous test.
$env = $this->getENVSettings($section_text,$tmp_file);
$ini_overwrites = $this->getINIParams($section_text);
}
-
+
// if this is a cgi test, prepare for it
$query_string = '';
$havepost = array_key_exists('POST', $section_text) && !empty($section_text['POST']);
@@ -1276,7 +1276,7 @@ class testHarness {
$method = isset($request['method'])?$request['method']:$havepost?'POST':'GET';
$query_string = $haveget?$section_text['GET']:'';
-
+
$options = array();
$options['method']=$method;
if (isset($this->conf['timeout'])) $options['timeout'] = $this->conf['timeout'];
@@ -1284,7 +1284,7 @@ class testHarness {
if (isset($this->conf['proxy_port'])) $options['proxy_port'] = $this->conf['proxy_port'];
if (isset($this->conf['proxy_user'])) $options['proxy_user'] = $this->conf['proxy_user'];
if (isset($this->conf['proxy_pass'])) $options['proxy_pass'] = $this->conf['proxy_pass'];
-
+
$post = $havepost?$section_text['POST']:NULL;
$url = $this->conf['TEST_SERVER_URL'];
if (isset($request['SCRIPT_NAME']))
@@ -1303,7 +1303,7 @@ class testHarness {
$this->writemsg("\nURL = $url\n");
} else if ($do_cgi) {
$query_string = $haveget?$section_text['GET']:'';
-
+
if (!array_key_exists('GATEWAY_INTERFACE', $env))
$env['GATEWAY_INTERFACE']='CGI/1.1';
if (!array_key_exists('SERVER_SOFTWARE', $env))
@@ -1327,7 +1327,7 @@ class testHarness {
$env['SCRIPT_NAME']='';
if (!array_key_exists('SCRIPT_FILENAME', $env))
$env['SCRIPT_FILENAME']='';
-
+
if (array_key_exists('POST', $section_text) && (!$haveget || !empty($section_text['POST']))) {
$post = $section_text['POST'];
$content_length = strlen($post);
@@ -1346,14 +1346,14 @@ class testHarness {
$env['CONTENT_LENGTH']='';
}
if ($this->conf['TEST_PHP_DETAILED'] > 1)
- $this->writemsg("\nCONTENT_LENGTH = " . $env['CONTENT_LENGTH'] .
- "\nCONTENT_TYPE = " . $env['CONTENT_TYPE'] .
- "\nPATH_TRANSLATED = " . $env['PATH_TRANSLATED'] .
- "\nPATH_INFO = " . $env['PATH_INFO'] .
- "\nQUERY_STRING = " . $env['QUERY_STRING'] .
- "\nREDIRECT_STATUS = " . $env['REDIRECT_STATUS'] .
- "\nREQUEST_METHOD = " . $env['REQUEST_METHOD'] .
- "\nSCRIPT_NAME = " . $env['SCRIPT_NAME'] .
+ $this->writemsg("\nCONTENT_LENGTH = " . $env['CONTENT_LENGTH'] .
+ "\nCONTENT_TYPE = " . $env['CONTENT_TYPE'] .
+ "\nPATH_TRANSLATED = " . $env['PATH_TRANSLATED'] .
+ "\nPATH_INFO = " . $env['PATH_INFO'] .
+ "\nQUERY_STRING = " . $env['QUERY_STRING'] .
+ "\nREDIRECT_STATUS = " . $env['REDIRECT_STATUS'] .
+ "\nREQUEST_METHOD = " . $env['REQUEST_METHOD'] .
+ "\nSCRIPT_NAME = " . $env['SCRIPT_NAME'] .
"\nSCRIPT_FILENAME = " . $env['SCRIPT_FILENAME'] . "\n");
/* not cgi spec to put query string on command line,
but used by a couple tests to catch a security hole
@@ -1390,14 +1390,14 @@ class testHarness {
}
}
}
-
+
if ($this->conf['TEST_PHP_DETAILED'] > 2) {
echo "HEADERS: ";
print_r($headers);
echo "OUTPUT: \n$out\n";
-
+
}
-
+
// Does the output match what is expected?
$output = trim($out);
$output = preg_replace('/\r\n/',"\n",$output);
@@ -1473,7 +1473,7 @@ class testHarness {
$wanted_re = str_replace('%f', '[+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?', $wanted_re);
$wanted_re = str_replace('%c', '.', $wanted_re);
// %f allows two points "-.0.0" but that is the best *simple* expression
-
+
}
/* DEBUG YOUR REGEX HERE
var_dump($wanted_re);
@@ -1482,7 +1482,7 @@ class testHarness {
*/
$failed = !preg_match("/^$wanted_re\$/s", $output);
}
-
+
$skipexpect = false;
if (!$failed && $this->conf['TEST_WEB'] && isset($section_text['EXPECTHEADERS'])) {
$want = array();
@@ -1502,7 +1502,7 @@ class testHarness {
$failed = TRUE;
}
}
-
+
// different servers may do different things on non-200 results
// for instance, IIS will deliver it's own error pages, so we
// cannot expect to match up the EXPECT section. We may however,
@@ -1510,50 +1510,50 @@ class testHarness {
// need to change later.
$skipexpect = isset($headers['Status']) && $headers['Status'] != 200;
}
-
+
if (!$failed && !$skipexpect && isset($section_text['EXPECT'])) {
$wanted = $section_text['EXPECT'];
$wanted = preg_replace('/\r\n/',"\n",$wanted);
$failed = (0 != strcmp($output,$wanted));
}
-
+
if (!$failed) {
@unlink($tmp_file);
$this->showstatus($tested, 'PASSED');
return 'PASSED';
}
-
+
// Test failed so we need to report details.
$this->showstatus($tested, 'FAILED');
-
+
$this->failed_tests[] = array(
'name' => $file,
'test_name' => $tested,
'output' => preg_replace('/\.phpt$/','.log', $file),
'diff' => preg_replace('/\.phpt$/','.diff', $file)
);
-
+
if ($this->conf['TEST_PHP_DETAILED'])
$this->writemsg(generate_diff($wanted,$output)."\n");
-
+
// write .exp
if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'E') !== FALSE) {
$logname = preg_replace('/\.phpt$/','.exp',$file);
file_put_contents($logname,$wanted);
}
-
+
// write .out
if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'O') !== FALSE) {
$logname = preg_replace('/\.phpt$/','.out',$file);
file_put_contents($logname,$output);
}
-
+
// write .diff
if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'D') !== FALSE) {
$logname = preg_replace('/\.phpt$/','.diff',$file);
file_put_contents($logname,generate_diff($wanted,$output));
}
-
+
// write .log
if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'L') !== FALSE) {
$logname = preg_replace('/\.phpt$/','.log',$file);
@@ -1572,7 +1572,7 @@ class testHarness {
//
// Write an error in a format recognizable to Emacs or MSVC.
//
- function error_report($testname,$logname,$tested)
+ function error_report($testname,$logname,$tested)
{
$testname = realpath($testname);
$logname = realpath($logname);
diff --git a/tests/classes/constants_basic_003.inc b/tests/classes/constants_basic_003.inc
index 5eb9065b828..17e067b534e 100644
--- a/tests/classes/constants_basic_003.inc
+++ b/tests/classes/constants_basic_003.inc
@@ -1,5 +1,5 @@
diff --git a/tests/classes/interface_optional_arg_003.inc b/tests/classes/interface_optional_arg_003.inc
index 27b3350da05..be2a69a4c6c 100644
--- a/tests/classes/interface_optional_arg_003.inc
+++ b/tests/classes/interface_optional_arg_003.inc
@@ -1,4 +1,4 @@
-
diff --git a/tests/lang/016.inc b/tests/lang/016.inc
index b73333f7b02..56aa85d65b1 100644
--- a/tests/lang/016.inc
+++ b/tests/lang/016.inc
@@ -1,4 +1,4 @@
-
*** Testing assignments and variable aliasing: ***
-
This should read "blah": \n"; ?>
@@ -22,7 +22,7 @@ This should read "this is nifty":
*** Testing integer operators ***
-
*********************************
*** Testing real operators ***
-
*** Testing if/elseif/else control ***
-
** spelling correction by kluzz **
-\n";
@@ -98,7 +98,7 @@ if (0) { /* this code is not supposed to be executed */
echo "hmm, this shouldn't be displayed #1
\n";
$j++;
if (1) {
- $i
+ $i
+=
$j;
if (0) {
@@ -128,7 +128,7 @@ if (0) { /* this code is not supposed to be executed */
} elseif (2-2) { /* as long as 2-2==0, this isn't supposed to be executed either */
$i = ++$j;
echo "hmm, this shouldn't be displayed #2
\n";
- if (1) {
+ if (1) {
$j = ++$i;
if (0) {
$j = $i*2+$j*($i++);
@@ -182,7 +182,7 @@ if (0) { /* this code is not supposed to be executed */
?>
*** C-style else-if's ***
-\n";
@@ -199,7 +199,7 @@ if (0) { /* this code is not supposed to be executed */
*************************
*** WHILE tests ***
-
-
*** hash test... ***
-
*** Hash resizing test ***
- 0) {
@@ -295,7 +295,7 @@ while ($i > 0) {
*** break/continue test ***
-\n";
@@ -349,7 +349,7 @@ while ($i<5) {
********************************
-\n"; # testing some PHP style comment...
}
diff --git a/tests/lang/023-2.inc b/tests/lang/023-2.inc
index 6dd1e730f16..a66030775d1 100644
--- a/tests/lang/023-2.inc
+++ b/tests/lang/023-2.inc
@@ -1,5 +1,5 @@
-This is Finish.phtml. This file is supposed to be included
+This is Finish.phtml. This file is supposed to be included
from regression_test.phtml. This is normal HTML.
diff --git a/tests/quicktester.inc b/tests/quicktester.inc
index 48ed6b549fa..70cb1156843 100644
--- a/tests/quicktester.inc
+++ b/tests/quicktester.inc
@@ -15,7 +15,7 @@ TESTS;
Remember to NOT put a trailing ; after a line!
*/
-error_reporting(E_ALL);
+error_reporting(E_ALL);
$tests = explode("\n",$tests);
$success = TRUE;
foreach ($tests as $n=>$test)
@@ -72,4 +72,4 @@ foreach ($tests as $n=>$test)
}
}
if ($success) echo "OK";
-
+
diff --git a/tests/security/open_basedir.inc b/tests/security/open_basedir.inc
index c5de8ca1126..d229f8497fd 100644
--- a/tests/security/open_basedir.inc
+++ b/tests/security/open_basedir.inc
@@ -3,7 +3,7 @@
// This file contains helper functions for testing open_basedir configuration
// Care must be taken with where the directories are created because different
// SAPIs set the working directory differently. So simply creating a directory
-// relative to the current working directory like this: mkdir("blah") might
+// relative to the current working directory like this: mkdir("blah") might
// actually create it in several different places depending on the SAPI..!
//
// Note also depending on the version of php being tested, so the open_basedir
@@ -26,7 +26,7 @@ function recursive_delete_directory($directory) {
// Make sure the directory is valid
if (is_dir($directory) == FALSE) {
return FALSE;
- }
+ }
// Check we can access the directory
if (is_readable($directory) == FALSE) {
@@ -110,7 +110,7 @@ function test_open_basedir_array($function) {
global $savedDirectory;
test_open_basedir_before($function);
- test_open_basedir_error($function);
+ test_open_basedir_error($function);
var_dump(is_array($function("./../.")));
var_dump(is_array($function("../ok")));
var_dump(is_array($function("ok.txt")));
@@ -124,7 +124,7 @@ function test_open_basedir_array($function) {
function test_open_basedir($function) {
global $savedDirectory;
test_open_basedir_before($function);
- test_open_basedir_error($function);
+ test_open_basedir_error($function);
var_dump($function("./../."));
var_dump($function("../ok"));
var_dump($function("ok.txt"));
diff --git a/travis/ext/pgsql/setup.sh b/travis/ext/pgsql/setup.sh
index 32b39a40443..ef13733edc9 100755
--- a/travis/ext/pgsql/setup.sh
+++ b/travis/ext/pgsql/setup.sh
@@ -1,4 +1,4 @@
#!/bin/bash
-echo '
+echo '
' >> "./ext/pgsql/tests/config.inc"
psql -c 'create database test;' -U postgres
\ No newline at end of file
diff --git a/win32/build/Makefile b/win32/build/Makefile
index 1412f8405d6..68fa579b5f4 100644
--- a/win32/build/Makefile
+++ b/win32/build/Makefile
@@ -74,14 +74,14 @@ Zend\zend_language_parser.c Zend\zend_language_parser.h: Zend\zend_language_pars
sapi\phpdbg\phpdbg_parser.c sapi\phpdbg\phpdbg_parser.h: sapi\phpdbg\phpdbg_parser.y
$(BISON) --output=sapi/phpdbg/phpdbg_parser.c -v -d -p phpdbg_ sapi/phpdbg/phpdbg_parser.y
-
+
!if $(RE2C) != ""
Zend\zend_ini_scanner.c: Zend\zend_ini_scanner.l
$(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l
Zend\zend_language_scanner.c: Zend\zend_language_scanner.l
$(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c Zend/zend_language_scanner.l
-
+
sapi\phpdbg\phpdbg_lexer.c: sapi\phpdbg\phpdbg_lexer.l
$(RE2C) $(RE2C_FLAGS) --no-generation-date -cbdFo sapi/phpdbg/phpdbg_lexer.c sapi/phpdbg/phpdbg_lexer.l
!endif
@@ -134,7 +134,7 @@ $(BUILD_DIR) $(BUILD_DIRS_SUB) $(BUILD_DIR_DEV):
@for %D in ($(BUILD_DIRS_SUB)) do @if not exist %D @mkdir %D > NUL
@if not exist $(BUILD_DIR_DEV) @mkdir $(BUILD_DIR_DEV) > NUL
@cd "$(PHP_SRC_DIR)"
-
+
clean-sapi:
@echo Cleaning SAPI
diff --git a/win32/build/buildconf.js b/win32/build/buildconf.js
index 9d2f318c972..2fbbdad93cc 100644
--- a/win32/build/buildconf.js
+++ b/win32/build/buildconf.js
@@ -56,17 +56,17 @@ function find_config_w32(dirname)
var c, i, ok, n;
var item = null;
var re_dep_line = new RegExp("ADD_EXTENSION_DEP\\([^,]*\\s*,\\s*['\"]([^'\"]+)['\"].*\\)", "gm");
-
+
for (; !fc.atEnd(); fc.moveNext())
{
ok = true;
/* check if we already picked up a module with the same dirname;
* if we have, don't include it here */
n = FSO.GetFileName(fc.item());
-
+
if (n == '.svn' || n == 'tests')
continue;
-
+
// WScript.StdOut.WriteLine("checking " + dirname + "/" + n);
if (MODULES.Exists(n)) {
WScript.StdOut.WriteLine("Skipping " + dirname + "/" + n + " -- already have a module with that name");
diff --git a/win32/build/config.w32 b/win32/build/config.w32
index 43b03626a42..4f7a4634422 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -66,7 +66,7 @@ if (VS_TOOLSET && PHP_MP != 'disable') {
if(PHP_DEBUG == 'yes') {
STDOUT.WriteLine('WARNING: Debug builds cannot be built using multi processing');
} else {
- // no from disable-all
+ // no from disable-all
if(PHP_MP == 'auto' || PHP_MP == 'no') {
ADD_FLAG('CFLAGS', ' /MP ');
PHP_MP_DISABLED = false;
diff --git a/win32/build/config.w32.phpize.in b/win32/build/config.w32.phpize.in
index 5d9cd6efa6d..812d28faf5e 100644
--- a/win32/build/config.w32.phpize.in
+++ b/win32/build/config.w32.phpize.in
@@ -44,7 +44,7 @@ ARG_WITH('prefix', 'PHP installation prefix', PHP_PREFIX);
ARG_WITH('mp', 'Tell Visual Studio use up to [n,auto,disable] processes for compilation', 'auto');
var PHP_MP_DISABLED = true;
if (VS_TOOLSET && PHP_MP != 'disable') {
- // no from disable-all
+ // no from disable-all
if(PHP_MP == 'auto' || PHP_MP == 'no') {
ADD_FLAG('CFLAGS', ' /MP ');
PHP_MP_DISABLED = false;
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index 1771297a545..b216659ebf9 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -48,7 +48,7 @@ var PHP_TEST_INI_EXT_EXCLUDE = "";
var PHP_MAKEFILE_FRAGMENTS = PHP_SRC_DIR + "\\Makefile.fragments.w32";
-/* Care also about NTDDI_VERSION and _WIN32_WINNT in config.w32.h.in
+/* Care also about NTDDI_VERSION and _WIN32_WINNT in config.w32.h.in
and manifest. */
var WINVER = "0x0601"; /* 7/2008r2 */
@@ -122,7 +122,7 @@ var PHP_VERSION_STRING = "7.2.0";
function get_version_numbers()
{
var cin = file_get_contents("configure.ac");
-
+
if (cin.match(new RegExp("PHP_MAJOR_VERSION=(\\d+)"))) {
PHP_VERSION = RegExp.$1;
}
@@ -224,7 +224,7 @@ function condense_path(path)
/* on a different drive */
break;
}
-
+
return path;
}
@@ -239,7 +239,7 @@ function ConfigureArg(type, optname, helptext, defval)
this.arg = "--" + type + "-" + optname;
this.imparg = "--" + opptype + "-" + optname;
}
-
+
this.optname = optname;
this.helptext = helptext;
this.defval = defval;
@@ -286,7 +286,7 @@ function word_wrap_and_indent(indent, text, line_suffix, indent_char)
if (text == null) {
return "";
}
-
+
var words = text.split(new RegExp("\\s+", "g"));
var i = 0;
var ret_text = "";
@@ -306,7 +306,7 @@ function word_wrap_and_indent(indent, text, line_suffix, indent_char)
for (i = 0; i < indent; i++) {
space += indent_char;
}
-
+
for (i = 0; i < words.length; i++) {
if (this_line.length) {
t = this_line + " " + words[i];
@@ -345,7 +345,7 @@ function conf_process_args()
var analyzed = false;
var nice = "cscript /nologo configure.js ";
var disable_all = false;
-
+
args = WScript.Arguments;
for (i = 0; i < args.length; i++) {
arg = args(i);
@@ -470,7 +470,7 @@ can be built that way. \
analyzed = analyze_arg(arg.defval);
shared = analyzed[0];
argval = analyzed[1];
-
+
// Don't trust a default "yes" answer for a non-core module
// in a snapshot build
if (PHP_SNAPSHOT_BUILD != "no" && argval == "yes" && !shared) {
@@ -499,7 +499,7 @@ can be built that way. \
}
}
}
-
+
if (PHP_SNAPSHOT_BUILD != "no" && argval == "no") {
force = true;
for (j = 0; j < snapshot_build_exclusions.length; j++) {
@@ -787,7 +787,7 @@ function CHECK_LIB(libnames, target, path_to_check, common_name)
var i, j, k, libname;
var location = false;
var path = path_to_check.split(';');
-
+
for (i = 0; i < libnames.length; i++) {
libname = libnames[i];
@@ -860,7 +860,7 @@ function OLD_CHECK_LIB(libnames, target, path_to_check)
} else {
target = "_" + target.toUpperCase();
}
-
+
if (path_to_check == null) {
path_to_check = php_usual_lib_suspects;
} else {
@@ -939,7 +939,7 @@ function CHECK_FUNC_IN_HEADER(header_name, func_name, path_to_check, add_to_flag
return c;
}
STDOUT.WriteLine("No");
- return false;
+ return false;
}
function GREP_HEADER(header_name, regex, path_to_check)
@@ -961,7 +961,7 @@ function GREP_HEADER(header_name, regex, path_to_check)
if (typeof(p) == "string") {
c = file_get_contents(p);
}
- }
+ }
if (!c) {
return false;
}
@@ -981,7 +981,7 @@ function GREP_HEADER(header_name, regex, path_to_check)
function CHECK_HEADER_ADD_INCLUDE(header_name, flag_name, path_to_check, use_env, add_dir_part, add_to_flag_only)
{
var dir_part_to_add = "";
-
+
if (use_env == null) {
use_env = true;
}
@@ -999,7 +999,7 @@ function CHECK_HEADER_ADD_INCLUDE(header_name, flag_name, path_to_check, use_env
} else {
path_to_check += ";" + php_usual_include_suspects;
}
-
+
var p = search_paths(header_name, path_to_check, use_env ? "INCLUDE" : null);
var have = 0;
var sym;
@@ -1016,7 +1016,7 @@ function CHECK_HEADER_ADD_INCLUDE(header_name, flag_name, path_to_check, use_env
if (typeof(p) == "string" && add_dir_part) {
ADD_FLAG(flag_name, '/I "' + p + dir_part_to_add + '" ');
}
- }
+ }
have = p ? 1 : 0
sym = header_name.toUpperCase();
@@ -1136,15 +1136,15 @@ function generate_version_info_resource(makefiletarget, basename, creditspath, s
MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": $(PHP_DIR)\\build\\template.rc");
MFO.WriteLine("\t$(RC) /nologo $(BASE_INCLUDES) /I $(PHP_DIR)/include /n /fo $(BUILD_DIR)\\" + resname + logo + debug +
' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"'
- + makefiletarget + '\\"" /d URL="\\"' + project_url +
- '\\"" /d INTERNAL_NAME="\\"' + internal_name + versioning +
+ + makefiletarget + '\\"" /d URL="\\"' + project_url +
+ '\\"" /d INTERNAL_NAME="\\"' + internal_name + versioning +
'\\"" /d THANKS_GUYS="\\"' + thanks + '\\"" $(PHP_DIR)\\build\\template.rc');
} else {
MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": win32\\build\\template.rc");
MFO.WriteLine("\t$(RC) /nologo $(BASE_INCLUDES) /n /fo $(BUILD_DIR)\\" + resname + logo + debug +
' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"'
- + makefiletarget + '\\"" /d URL="\\"' + project_url +
- '\\"" /d INTERNAL_NAME="\\"' + internal_name + versioning +
+ + makefiletarget + '\\"" /d URL="\\"' + project_url +
+ '\\"" /d INTERNAL_NAME="\\"' + internal_name + versioning +
'\\"" /d THANKS_GUYS="\\"' + thanks + '\\"" win32\\build\\template.rc');
}
MFO.WriteBlankLines(1);
@@ -1204,7 +1204,7 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
resname = generate_version_info_resource(makefiletarget, sapiname, configure_module_dirname, true);
manifest_name = generate_version_info_manifest(makefiletarget);
-
+
MFO.WriteLine(makefiletarget + ": $(BUILD_DIR)\\" + makefiletarget);
MFO.WriteLine("\t@echo SAPI " + sapiname_for_printing + " build complete");
if (MODE_PHPIZE) {
@@ -1224,7 +1224,7 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
ldflags = "$(LDFLAGS)";
manifest = "-@$(_VC_MANIFEST_EMBED_EXE)";
}
-
+
if (PHP_SANITIZER == "yes") {
if (CLANG_TOOLSET) {
add_asan_opts("CFLAGS_" + SAPI, "LIBS_" + SAPI, (is_lib ? "ARFLAGS_" : "LDFLAGS_") + SAPI);
@@ -1264,7 +1264,7 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
if (manifest) {
MFO.WriteLine("\t" + manifest);
}
-
+
DEFINE('CFLAGS_' + SAPI + '_OBJ', '$(CFLAGS_' + SAPI + ')');
if (configure_module_dirname.match("pecl")) {
@@ -1284,7 +1284,7 @@ function ADD_DIST_FILE(filename)
} else {
ADD_FLAG("PHP_EXTRA_DIST_FILES", filename);
}
-}
+}
function file_get_contents(filename)
{
@@ -1387,7 +1387,7 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
if (force_all_shared()) {
shared = true;
eval("PHP_" + EXT + "_SHARED = true;");
- } else {
+ } else {
eval("shared = PHP_" + EXT + "_SHARED;");
}
} else {
@@ -1417,7 +1417,7 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
MFO.WriteBlankLines(1);
ADD_SOURCES(configure_module_dirname, file_list, extname, obj_dir);
-
+
MFO.WriteBlankLines(1);
if (shared) {
@@ -1465,7 +1465,7 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
MFO.WriteLine(dllname + ": $(BUILD_DIR)\\" + dllname);
MFO.WriteLine("\t@echo EXT " + extname + " build complete");
MFO.WriteBlankLines(1);
-
+
DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_' + EXT + ')');
} else {
ADD_FLAG("STATIC_EXT_OBJS", "$(" + EXT + "_GLOBAL_OBJS)");
@@ -1502,9 +1502,9 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
}
}
}
-
+
extension_module_ptrs += '\tphpext_' + extname + '_ptr,\r\n';
-
+
DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_PHP) $(CFLAGS_' + EXT + ')');
}
if (MODE_PHPIZE) {
@@ -1569,7 +1569,7 @@ function ADD_SOURCES(dir, file_list, target, obj_dir)
var _tmp = src.split("\\");
var filename = _tmp.pop();
-
+
// build the obj out dir and use it as a key
var dirname = _tmp.join("\\");
@@ -1595,7 +1595,7 @@ function ADD_SOURCES(dir, file_list, target, obj_dir)
var build_dir = (dirname ? obj_dir + "\\" + dirname : obj_dir).replace(new RegExp("^..\\\\"), "");
}
- obj = sub_build + build_dir + "\\" + filename.replace(re, ".obj");
+ obj = sub_build + build_dir + "\\" + filename.replace(re, ".obj");
if (i > 0) {
srcs_line += " " + dir + "\\" + src;
@@ -1610,7 +1610,7 @@ function ADD_SOURCES(dir, file_list, target, obj_dir)
if (!srcs_by_dir.hasOwnProperty(build_dir)) {
srcs_by_dir[build_dir] = [];
- }
+ }
/* storing the index from the file_list */
srcs_by_dir[build_dir].push(i);
@@ -1640,7 +1640,7 @@ function ADD_SOURCES(dir, file_list, target, obj_dir)
if (PHP_ANALYZER == "clang") {
var analyzer_base_args = X64 ? "-m64" : "-m32";
var analyzer_base_flags = "";
-
+
analyzer_base_args += " --analyze";
var vc_ver;
@@ -1660,7 +1660,7 @@ function ADD_SOURCES(dir, file_list, target, obj_dir)
} else {
analyzer_base_flags += " -D _MSC_VER=" + probe_binary(PATH_PROG('cl', null));
}
-
+
if (X64) {
analyzer_base_flags += " -D _M_X64 -D _WIN64";
} else {
@@ -1681,7 +1681,7 @@ function ADD_SOURCES(dir, file_list, target, obj_dir)
"--library=win32\\build\\cppcheck.cfg " +
"--library=" + cppcheck_lib + " " +
/* "--rule-file=win32\build\cppcheck_rules.xml " + */
- " --std=c89 --std=c++11 " +
+ " --std=c89 --std=c++11 " +
"--quiet --inconclusive --template=vs -j 4 ";
var cppcheck_build_dir = get_define("CPPCHECK_BUILD_DIR");
@@ -1701,9 +1701,9 @@ function ADD_SOURCES(dir, file_list, target, obj_dir)
MFO.WriteLine("\t@$(CC) $(" + flags + ") $(CFLAGS) $(" + bd_flags_name + ") /c " + dir + "\\" + src + " /Fo" + sub_build + d + obj);
if ("clang" == PHP_ANALYZER) {
- MFO.WriteLine("\t@\"$(CLANG_CL)\" " + analyzer_base_args + " $(" + flags + "_ANALYZER) $(CFLAGS_ANALYZER) $(" + bd_flags_name + "_ANALYZER) " + dir + "\\" + src);
+ MFO.WriteLine("\t@\"$(CLANG_CL)\" " + analyzer_base_args + " $(" + flags + "_ANALYZER) $(CFLAGS_ANALYZER) $(" + bd_flags_name + "_ANALYZER) " + dir + "\\" + src);
} else if ("cppcheck" == PHP_ANALYZER) {
- MFO.WriteLine("\t\"@$(CPPCHECK)\" " + analyzer_base_args + " $(" + flags + "_ANALYZER) $(CFLAGS_ANALYZER) $(" + bd_flags_name + "_ANALYZER) " + analyzer_base_flags + " " + dir + "\\" + src);
+ MFO.WriteLine("\t\"@$(CPPCHECK)\" " + analyzer_base_args + " $(" + flags + "_ANALYZER) $(CFLAGS_ANALYZER) $(" + bd_flags_name + "_ANALYZER) " + analyzer_base_flags + " " + dir + "\\" + src);
}else if (PHP_ANALYZER == "pvs") {
MFO.WriteLine("\t@\"$(PVS_STUDIO)\" --cl-params $(" + flags + ") $(CFLAGS) $(" + bd_flags_name + ") /c " + dir + "\\" + src + " --source-file " + dir + "\\" + src
+ " --cfg PVS-Studio.conf --errors-off \"V122 V117 V111\" ");
@@ -1728,8 +1728,8 @@ function ADD_SOURCES(dir, file_list, target, obj_dir)
DEFINE(sym, tv);
- /* Generate the object response file and define it to the Makefile. This can be
- useful when getting the "command line too long" linker errors.
+ /* Generate the object response file and define it to the Makefile. This can be
+ useful when getting the "command line too long" linker errors.
TODO pack this into a function when response files are used for other kinds of info. */
var obj_lst_fh = null;
if (!FSO.FileExists(obj_lst_fn)) {
@@ -1773,11 +1773,11 @@ function generate_internal_functions()
var indata;
STDOUT.WriteLine("Generating main/internal_functions.c");
-
+
infile = FSO.OpenTextFile("main/internal_functions.c.in", 1);
indata = infile.ReadAll();
infile.Close();
-
+
indata = indata.replace("@EXT_INCLUDE_CODE@", extension_include_code);
indata = indata.replace("@EXT_MODULE_PTRS@", extension_module_ptrs);
@@ -1953,7 +1953,7 @@ function generate_tmp_php_ini()
if ("shared" != extensions_enabled[i][1]) {
continue;
}
-
+
var directive = "extension";
if ("opcache" == extensions_enabled[i][0] || "xdebug" == extensions_enabled[i][0]) {
directive = "zend_extension";
@@ -2172,11 +2172,11 @@ function generate_config_h()
prefix = PHP_PREFIX.replace(new RegExp("\\\\", "g"), "\\\\");
STDOUT.WriteLine("Generating main/config.w32.h");
-
+
infile = FSO.OpenTextFile("win32/build/config.w32.h.in", 1);
indata = infile.ReadAll();
infile.Close();
-
+
outfile = FSO.CreateTextFile("main/config.w32.h", true);
indata = indata.replace(new RegExp("@PREFIX@", "g"), prefix);
@@ -2218,7 +2218,7 @@ function generate_config_h()
pieces += '" "';
}
}
-
+
outfile.WriteLine("#define " + keys[i] + " " + pieces);
}
@@ -2229,7 +2229,7 @@ function generate_config_h()
outfile.WriteLine("#define HAVE_ATANH 1");
}
-
+
outfile.Close();
}
@@ -2245,7 +2245,7 @@ function generate_phpize()
var MF = FSO.CreateTextFile(dest + "/phpize.js", true);
var DEPS = FSO.CreateTextFile(dest + "/ext_deps.js", true);
-
+
prefix = get_define("PHP_PREFIX");
prefix = prefix.replace(new RegExp("/", "g"), "\\");
prefix = prefix.replace(new RegExp("\\\\", "g"), "\\\\");
@@ -2367,7 +2367,7 @@ function handle_analyzer_makefile_flags(fd, key, val)
}
val = new_val;
- if ("clang" == PHP_ANALYZER) {
+ if ("clang" == PHP_ANALYZER) {
val = val.replace(/\/FD /, "")
.replace(/\/Fp.+? /, "")
.replace(/\/Fo.+? /, "")
@@ -2432,7 +2432,7 @@ function generate_makefile()
/* \s+\/ eliminates extra whitespace caused when using \ for string continuation,
whereby \/ is the start of the next compiler switch */
var val = trim(configure_subst.Item(keys[i])).replace(/\s+\//gm, " /");
-
+
MF.WriteLine(keys[i] + "=" + val + " ");
MF.WriteBlankLines(1);
@@ -2460,7 +2460,7 @@ function generate_makefile()
MF.WriteLine(" @for %D in ($(INSTALL_HEADERS_DIR)) do @if not exist $(BUILD_DIR_DEV)\\include\\%D mkdir $(BUILD_DIR_DEV)\\include\\%D >nul");
for (i in headers_install) {
if (headers_install[i][2] != "") {
- MF.WriteLine(" @if not exist $(BUILD_DIR_DEV)\\include\\" + headers_install[i][2] + " mkdir $(BUILD_DIR_DEV)\\include\\" +
+ MF.WriteLine(" @if not exist $(BUILD_DIR_DEV)\\include\\" + headers_install[i][2] + " mkdir $(BUILD_DIR_DEV)\\include\\" +
headers_install[i][2] + ">nul");
MF.WriteLine(" @copy " + headers_install[i][0] + " " + "$(BUILD_DIR_DEV)\\include\\" + headers_install[i][2] + " /y >nul");
}
@@ -2538,7 +2538,7 @@ function generate_makefile()
FSO.DeleteFile(PHP_MAKEFILE_FRAGMENTS, true);
}
- MF.Close();
+ MF.Close();
}
function ADD_FLAG(name, flags, target)
@@ -2553,7 +2553,7 @@ function ADD_FLAG(name, flags, target)
/* Prefix with a space, thus making sure the
current flag is not a substring of some
other. It's still not a complete check if
- some flags with spaces got added.
+ some flags with spaces got added.
TODO rework to use an array, so direct
match can be done. This will also
@@ -2562,7 +2562,7 @@ function ADD_FLAG(name, flags, target)
if (curr_flags.indexOf(" " + flags) >= 0 || curr_flags.indexOf(flags + " ") >= 0) {
return;
}
-
+
flags = curr_flags + " " + flags;
configure_subst.Remove(name);
}
@@ -2639,7 +2639,7 @@ function copy_and_subst(srcname, destname, subst_array)
content = content.replace(re, rep);
}
-
+
var f = FSO.CreateTextFile(destname, true);
f.Write(content);
f.Close();
@@ -2660,14 +2660,14 @@ function glob(path_pattern)
if (FSO.FileExists(path_pattern)) {
return new Array(path_pattern);
}
-
+
// first, build as much as possible that doesn't have a pattern
for (p = 0; p < path_parts.length; p++) {
if (path_parts[p].match(is_pat_re))
break;
if (p)
base += "\\";
- base += path_parts[p];
+ base += path_parts[p];
}
return _inner_glob(base, p, path_parts);
@@ -3030,7 +3030,7 @@ function toolset_is_64()
return null != full.match(/x86_64/);*/
/* Even executed within an environment setup with vcvars32.bat,
- clang-cl doesn't recognize the arch toolset. But as it needs
+ clang-cl doesn't recognize the arch toolset. But as it needs
the VS environment, checking the arch of cl.exe is correct. */
return probe_binary(PATH_PROG('cl', null), 64);
} else if (ICC_TOOLSET) {
diff --git a/win32/build/default.manifest b/win32/build/default.manifest
index 8c394ca6490..aa5da5c4d08 100644
--- a/win32/build/default.manifest
+++ b/win32/build/default.manifest
@@ -7,8 +7,8 @@
-
-
+
+
@@ -17,7 +17,7 @@
-
+
diff --git a/win32/build/mkdist.php b/win32/build/mkdist.php
index f4969442b7b..7a39bea02b3 100644
--- a/win32/build/mkdist.php
+++ b/win32/build/mkdist.php
@@ -74,13 +74,13 @@ function get_depends($module)
"api-ms-win-crt-.+\.dll",
);
global $build_dir, $extra_dll_deps, $ext_targets, $sapi_targets, $pecl_targets, $phpdll, $per_module_deps, $pecl_dll_deps;
-
+
$bd = strtolower(realpath($build_dir));
$is_pecl = in_array($module, $pecl_targets);
-
+
$cmd = "$GLOBALS[build_dir]\\deplister.exe \"$module\" \"$GLOBALS[build_dir]\"";
- $proc = proc_open($cmd,
+ $proc = proc_open($cmd,
array(1 => array("pipe", "w")),
$pipes);
@@ -112,7 +112,7 @@ function get_depends($module)
continue;
}
}
-
+
if ($is_pecl) {
if (!in_array($dep, $pecl_dll_deps)) {
$pecl_dll_deps[] = $dep;
@@ -209,7 +209,7 @@ function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */
$hdr['size'] = octdec(trim($hdr['size']));
echo "File: $hdr[filename] $hdr[size]\n";
-
+
if ($filename == $hdr['filename']) {
echo "Found the file we want\n";
$dest = fopen($destfilename, 'wb');
@@ -218,14 +218,14 @@ function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */
echo "Wrote $x bytes into $destfilename\n";
break;
}
-
+
/* skip body of the file */
$size = 512 * ceil((int)$hdr['size'] / 512);
echo "Skipping $size bytes\n";
gzseek($fp, gztell($fp) + $size);
-
+
} while (!$done);
-
+
} /* }}} */
@@ -333,9 +333,9 @@ foreach ($extra_dll_deps as $dll) {
}
/* TODO:
-add sanity check and test if all required DLLs are present, per version
+add sanity check and test if all required DLLs are present, per version
This version works at least for 3.6, 3.8 and 4.0 (5.3-vc6, 5.3-vc9 and HEAD).
-Add ADD_DLLS to add extra DLLs like dynamic dependencies for standard
+Add ADD_DLLS to add extra DLLs like dynamic dependencies for standard
deps. For example, libenchant.dll loads libenchant_myspell.dll or
libenchant_ispell.dll
*/
@@ -457,7 +457,7 @@ function copy_test_dir($directory, $dest)
}
}
- closedir($directory_list);
+ closedir($directory_list);
}
function make_phar_dot_phar($dist_dir)
@@ -543,7 +543,7 @@ if (!$use_pear_template) {
extract_file_from_tarball('Archive_Tar', 'Archive/Tar.php', "$dist_dir/PEAR/go-pear-bundle");
extract_file_from_tarball('Console_Getopt', 'Console/Getopt.php', "$dist_dir/PEAR/go-pear-bundle");
}
-
+
/* add extras from the template dir */
if (file_exists($snapshot_template)) {
$items = glob("$snapshot_template/*");
@@ -573,7 +573,7 @@ if (file_exists($snapshot_template)) {
}
}
}
-
+
/* copy c++ runtime */
$items = glob("$snapshot_template/dlls/*.CRT");
diff --git a/win32/codepage.c b/win32/codepage.c
index 88232191844..25cd4d786f4 100644
--- a/win32/codepage.c
+++ b/win32/codepage.c
@@ -96,7 +96,7 @@ PW32CP wchar_t *php_win32_cp_conv_to_w(DWORD cp, DWORD flags, const char* in, si
PW32CP wchar_t *php_win32_cp_conv_ascii_to_w(const char* in, size_t in_len, size_t *out_len)
{/*{{{*/
wchar_t *ret = NULL;
- const char *idx = in, *end;
+ const char *idx = in, *end;
assert(in && in_len ? in[in_len] == '\0' : 1);
@@ -385,7 +385,7 @@ PW32CP wchar_t *php_win32_cp_env_any_to_w(const char* env)
} while (NULL != (cur = strchr(prev, '\0')) && cur++ && *cur && bin_len + (cur - prev) < 32760);
- envw = (wchar_t *) malloc((bin_len + 3) * sizeof(wchar_t));
+ envw = (wchar_t *) malloc((bin_len + 3) * sizeof(wchar_t));
if (!envw) {
SET_ERRNO_FROM_WIN32_CODE(ERROR_OUTOFMEMORY);
return NULL;
@@ -524,7 +524,7 @@ PW32CP const struct php_win32_cp *php_win32_cp_cli_do_restore(DWORD id)
/* {{{ proto bool sapi_windows_cp_set(int cp)
* Set process codepage. */
-PHP_FUNCTION(sapi_windows_cp_set)
+PHP_FUNCTION(sapi_windows_cp_set)
{
zend_long id;
const struct php_win32_cp *cp;
@@ -605,12 +605,12 @@ PHP_FUNCTION(sapi_windows_cp_conv)
php_error_docref(NULL, E_WARNING, "String is too long");
RETURN_NULL();
}
-
+
if (IS_LONG == Z_TYPE_P(z_in_cp)) {
if (ZEND_LONG_UINT_OVFL(Z_LVAL_P(z_in_cp))) {
php_error_docref(NULL, E_WARNING, "Argument %d is out of range", Z_LVAL_P(z_in_cp));
RETURN_NULL();
- }
+ }
in_cp = php_win32_cp_get_by_id((DWORD)Z_LVAL_P(z_in_cp));
if (!in_cp) {
@@ -631,7 +631,7 @@ PHP_FUNCTION(sapi_windows_cp_conv)
if (ZEND_LONG_UINT_OVFL(Z_LVAL_P(z_out_cp))) {
php_error_docref(NULL, E_WARNING, "Argument %d is out of range", Z_LVAL_P(z_out_cp));
RETURN_NULL();
- }
+ }
out_cp = php_win32_cp_get_by_id((DWORD)Z_LVAL_P(z_out_cp));
if (!out_cp) {
diff --git a/win32/codepage.h b/win32/codepage.h
index 9cfe3cd80b5..cf3d72e39bc 100644
--- a/win32/codepage.h
+++ b/win32/codepage.h
@@ -84,8 +84,8 @@ __forceinline static wchar_t *php_win32_cp_conv_any_to_w(const char* in, size_t
if (php_win32_cp_use_unicode()) {
/* First try the pure ascii conversion. This is the fastest way to do the
- thing. Only applicable if the source string is UTF-8 in general.
- While it could possibly be ok with European encodings, usage with
+ thing. Only applicable if the source string is UTF-8 in general.
+ While it could possibly be ok with European encodings, usage with
Asian encodings can cause unintended side effects. Lookup the term
"mojibake" if need more. */
ret = php_win32_cp_conv_ascii_to_w(in, in_len, out_len);
@@ -97,7 +97,7 @@ __forceinline static wchar_t *php_win32_cp_conv_any_to_w(const char* in, size_t
/* Still need this fallback with regard to possible broken data
in the existing scripts. Broken data might be hardcoded in
the user scripts, as UTF-8 settings was de facto ignored in
- older PHP versions. The fallback can be removed later for
+ older PHP versions. The fallback can be removed later for
the sake of purity, keep now for BC reasons. */
if (!ret) {
const struct php_win32_cp *acp = php_win32_cp_get_by_id(GetACP());
diff --git a/win32/cp_enc_map_gen.c b/win32/cp_enc_map_gen.c
index 243b1d2fbdc..2010e0ca4cb 100644
--- a/win32/cp_enc_map_gen.c
+++ b/win32/cp_enc_map_gen.c
@@ -165,7 +165,7 @@ static const struct cp cp_map[] = {
{ 65001, "utf-8", "UTF-8", "Unicode (UTF-8)" },
{ 0, NULL, NULL },
};
-
+
diff --git a/win32/dllmain.c b/win32/dllmain.c
index 2c52f54fb6a..1c5ed48c971 100644
--- a/win32/dllmain.c
+++ b/win32/dllmain.c
@@ -42,11 +42,11 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID dummy)
case DLL_PROCESS_ATTACH:
/*
* We do not need to check the return value of php_win32_init_gettimeofday()
- * because the symbol bare minimum symbol we need is always available on our
+ * because the symbol bare minimum symbol we need is always available on our
* lowest supported platform.
*
* On Windows 8 or greater, we use a more precise symbol to obtain the system
- * time, which is dynamically. The fallback allows us to proper support
+ * time, which is dynamically. The fallback allows us to proper support
* Vista/7/Server 2003 R2/Server 2008/Server 2008 R2.
*
* Instead simply initialize the global in win32/time.c for gettimeofday()
@@ -76,8 +76,8 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID dummy)
}
#ifdef HAVE_LIBXML
- /* This imply that only LIBXML_STATIC_FOR_DLL is supported ATM.
- If that changes, this place will need some rework.
+ /* This imply that only LIBXML_STATIC_FOR_DLL is supported ATM.
+ If that changes, this place will need some rework.
TODO Also this should be revisited as no initialization
might be needed for TS build (libxml build with TLS
support. */
diff --git a/win32/getrusage.c b/win32/getrusage.c
index 809a5dd84b1..4d5b8faf8de 100644
--- a/win32/getrusage.c
+++ b/win32/getrusage.c
@@ -21,8 +21,8 @@
#include "getrusage.h"
/*
- * Parts of this file is based on code from the OpenVSwitch project, that
- * is released under the Apache 2.0 license and is copyright 2014 Nicira, Inc.
+ * Parts of this file is based on code from the OpenVSwitch project, that
+ * is released under the Apache 2.0 license and is copyright 2014 Nicira, Inc.
* and have been modified to work with PHP.
*/
diff --git a/win32/getrusage.h b/win32/getrusage.h
index dd4b50cf39c..0bed8ba6f6e 100644
--- a/win32/getrusage.h
+++ b/win32/getrusage.h
@@ -21,8 +21,8 @@
/*
* Note
- *
- * RUSAGE_CHILDREN is not implemented, and the RUSAGE_THREAD will
+ *
+ * RUSAGE_CHILDREN is not implemented, and the RUSAGE_THREAD will
* therefore instead be used instead to emulate the behavior.
*/
diff --git a/win32/install.txt b/win32/install.txt
index 0b989e8fe97..283619d86a5 100644
--- a/win32/install.txt
+++ b/win32/install.txt
@@ -237,8 +237,8 @@ c:\php
Server modules provide significantly better performance and additional
functionality compared to the CGI binary. The FastCGI is significantly
more stable and can be faster than the ISAPI module with IIS.
- The CLI version is designed to let you use PHP for command line
- scripting. More information about CLI is available in the chapter
+ The CLI version is designed to let you use PHP for command line
+ scripting. More information about CLI is available in the chapter
about using PHP from the command line.
Warning
@@ -268,8 +268,8 @@ c:\php
The next step is to set up a valid configuration file for PHP, php.ini.
There are two ini files distributed in the zip file, php.ini-development
- and php.ini-production. We advise you to use php.ini-production,
- because we optimized the default settings in this file for performance,
+ and php.ini-production. We advise you to use php.ini-production,
+ because we optimized the default settings in this file for performance,
and security. Read this well documented file carefully because it has
changes from php.ini-production that will drastically affect your setup.
Some examples are display_errors being off and magic_quotes_gpc being off.
@@ -670,8 +670,8 @@ AddType application/x-httpd-php .php
PHPIniDir "C:/php"
Note: Remember to substitute your actual path to PHP for the c:/php/
- in the above examples. Take care to use either
- php5apache2.dll in your LoadModule directive and not php5apache.dll
+ in the above examples. Take care to use either
+ php5apache2.dll in your LoadModule directive and not php5apache.dll
as the latter ones are designed to run with Apache 1.3.x.
Note: If you want to use content negotiation, read related FAQ.
@@ -969,8 +969,8 @@ extension_dir = C:\php\extensions
extension=php_bz2.dll
* Some of the extensions need extra DLLs to work. Couple of them can
- be found in the distribution package, in in the main folder in PHP 5,
- but some, for example Oracle (php_oci8.dll) require DLLs which are
+ be found in the distribution package, in in the main folder in PHP 5,
+ but some, for example Oracle (php_oci8.dll) require DLLs which are
not bundled with the distribution package.
* Some of these DLLs are not bundled with the PHP distribution. See
each extensions documentation page for details. Also, read the
@@ -1004,7 +1004,7 @@ extension=php_bz2.dll
php_filepro.dll filePro functions Read-only access
php_ftp.dll FTP functions
php_gd2.dll GD library image functions GD2
- php_gettext.dll Gettext functions, requires libintl-1.dll,
+ php_gettext.dll Gettext functions, requires libintl-1.dll,
iconv.dll (bundled).
php_iconv.dll ICONV characterset conversion Requires: iconv.dll
php_imap.dll IMAP POP3 and NNTP functions None
@@ -1061,7 +1061,7 @@ Introduction to PECL Installations
When building PHP modules, it's important to have known-good versions
of the required tools (autoconf, automake, libtool, etc.) See the
- SVN Instructions for details on the required tools, and required
+ SVN Instructions for details on the required tools, and required
versions.
__________________________________________________________________
@@ -1078,10 +1078,10 @@ Downloading PECL extensions
PECL extensions that have releases listed on the PECL web site are
available for download and installation using the pecl command.
Specific revisions may also be specified.
- * SVN
+ * SVN
Most PECL extensions also reside in SVN. A web-based view may be
seen at http://svn.php.net/pecl/. To download straight from SVN,
- the following sequence of commands may be used.
+ the following sequence of commands may be used.
$ svn co http://svn.php.net/repository/pecl//trunk
diff --git a/win32/ioutil.c b/win32/ioutil.c
index 9a13c1cd6e2..07dc70d9177 100644
--- a/win32/ioutil.c
+++ b/win32/ioutil.c
@@ -38,7 +38,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
- */
+ */
#include
#include
@@ -112,7 +112,7 @@ PW32IO BOOL php_win32_ioutil_posix_to_open_opts(int flags, mode_t mode, php_iout
* be deleted even whilst it's open.
*/
/* opts->share = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; */
- /* XXX No UINX behavior Good to know it's doable.
+ /* XXX No UINX behavior Good to know it's doable.
Not being done as this means a behavior change. Should be evaluated properly. */
opts->share = FILE_SHARE_READ | FILE_SHARE_WRITE;
@@ -394,7 +394,7 @@ PW32IO int php_win32_ioutil_chdir_w(const wchar_t *path)
{/*{{{*/
int ret = 0;
DWORD err = 0;
-
+
if (!SetCurrentDirectoryW(path)) {
err = GetLastError();
ret = -1;
@@ -408,7 +408,7 @@ PW32IO int php_win32_ioutil_rename_w(const wchar_t *oldname, const wchar_t *newn
{/*{{{*/
int ret = 0;
DWORD err = 0;
-
+
PHP_WIN32_IOUTIL_CHECK_PATH_W(oldname, -1, 0)
PHP_WIN32_IOUTIL_CHECK_PATH_W(newname, -1, 0)
@@ -447,7 +447,7 @@ PW32IO wchar_t *php_win32_ioutil_getcwd_w(wchar_t *buf, size_t len)
}
buf = tmp_buf;
}
-
+
if (!GetCurrentDirectoryW(tmp_len, buf)) {
err = GetLastError();
SET_ERRNO_FROM_WIN32_CODE(err);
@@ -468,7 +468,7 @@ PW32IO size_t php_win32_ioutil_dirname(char *path, size_t len)
if (len == 0) {
return 0;
}
-
+
start = path;
/* Don't really care about the path normalization, pure parsing here. */
@@ -628,7 +628,7 @@ PW32IO HANDLE php_win32_ioutil_findfirstfile_w(char *path, WIN32_FIND_DATA *data
}
ret = FindFirstFileW(pathw, data);
-
+
if (INVALID_HANDLE_VALUE == ret && path) {
ret = FindFirstFileA(path, data);
}
diff --git a/win32/ioutil.h b/win32/ioutil.h
index 43b8859c876..1ce6cbbb7c0 100644
--- a/win32/ioutil.h
+++ b/win32/ioutil.h
@@ -38,7 +38,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
- */
+ */
#ifndef PHP_WIN32_IOUTIL_H
#define PHP_WIN32_IOUTIL_H
@@ -150,7 +150,7 @@ typedef enum {
PW32IO php_win32_ioutil_normalization_result php_win32_ioutil_normalize_path_w(wchar_t **buf, size_t len, size_t *new_len);
#ifdef PHP_EXPORTS
-/* This symbols are needed only for the DllMain, but should not be exported
+/* This symbols are needed only for the DllMain, but should not be exported
or be available when used with PHP binaries. */
BOOL php_win32_ioutil_init(void);
#endif
@@ -161,7 +161,7 @@ __forceinline static wchar_t *php_win32_ioutil_conv_any_to_w(const char* in, siz
{/*{{{*/
wchar_t *mb, *ret;
size_t mb_len;
-
+
mb = php_win32_cp_conv_any_to_w(in, in_len, &mb_len);
if (!mb) {
return NULL;
diff --git a/win32/nice.c b/win32/nice.c
index 4988ba55492..993df0a041d 100644
--- a/win32/nice.c
+++ b/win32/nice.c
@@ -22,7 +22,7 @@
/*
* Basic Windows implementation for the nice() function.
*
- * This implementation uses SetPriorityClass() as a backend for defining
+ * This implementation uses SetPriorityClass() as a backend for defining
* a process priority.
*
* The following values of inc, defines the value sent to SetPriorityClass():
@@ -44,19 +44,19 @@
*
* These values tries to mimic that of the UNIX version of nice().
*
- * This is applied to the main process, not per thread, although this could
+ * This is applied to the main process, not per thread, although this could
* be implemented using SetThreadPriority() at one point.
*
* Note, the following priority classes are left out with intention:
*
* . REALTIME_PRIORITY_CLASS
- * Realtime priority class requires special system permissions to set, and
+ * Realtime priority class requires special system permissions to set, and
* can be dangerous in certain cases.
*
* . PROCESS_MODE_BACKGROUND_BEGIN
* . PROCESS_MODE_BACKGROUND_END
- * Process mode is not covered because it can easily forgotten to be changed
- * back and can cause unforseen side effects that is hard to debug. Besides
+ * Process mode is not covered because it can easily forgotten to be changed
+ * back and can cause unforseen side effects that is hard to debug. Besides
* that, these do generally not really fit into making a Windows somewhat
* compatible nice() function.
*/
@@ -65,7 +65,7 @@ PHPAPI int nice(zend_long p)
{
DWORD dwFlag = NORMAL_PRIORITY_CLASS;
- if (p < -9) {
+ if (p < -9) {
dwFlag = HIGH_PRIORITY_CLASS;
} else if (p < -4) {
dwFlag = ABOVE_NORMAL_PRIORITY_CLASS;
diff --git a/win32/readdir.c b/win32/readdir.c
index 18e87d369d1..f3d33e61d73 100644
--- a/win32/readdir.c
+++ b/win32/readdir.c
@@ -118,7 +118,7 @@ struct dirent *readdir(DIR *dp)
memmove(dp->dent.d_name, _tmp, reclen + 1);
free(_tmp);
dp->dent.d_reclen = (unsigned short)reclen;
-
+
dp->offset++;
dp->dent.d_ino = 1;
diff --git a/win32/time.h b/win32/time.h
index 4fe00bc21e4..07afae487ab 100644
--- a/win32/time.h
+++ b/win32/time.h
@@ -55,7 +55,7 @@ PHPAPI int nanosleep( const struct timespec * rqtp, struct timespec * rmtp );
PHPAPI int usleep(unsigned int useconds);
#ifdef PHP_EXPORTS
-/* This symbols are needed only for the DllMain, but should not be exported
+/* This symbols are needed only for the DllMain, but should not be exported
or be available when used with PHP binaries. */
void php_win32_init_gettimeofday(void);
#endif
diff --git a/win32/winutil.c b/win32/winutil.c
index 6e37ddfbfc1..8cf5cbac0f7 100644
--- a/win32/winutil.c
+++ b/win32/winutil.c
@@ -123,7 +123,7 @@ PHP_WINUTIL_API int php_win32_code_to_errno(unsigned long w32Err)
int eerrno;
};
- static const struct code_to_errno_map errmap[] =
+ static const struct code_to_errno_map errmap[] =
{
/* 1 */ { ERROR_INVALID_FUNCTION , EINVAL }
/* 2 */ , { ERROR_FILE_NOT_FOUND , ENOENT }