-
+ |
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 71bdad17b9523..07603a808e010 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 99967ce3d6d58..e744030de741f 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.
-
+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
+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'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
+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.
+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.
+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/lsapilib.c b/sapi/litespeed/lsapilib.c
index c4ed6bb4d639d..685892e708149 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 )
@@ -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);
@@ -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 */
@@ -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.h b/sapi/litespeed/lscriu.h
index 9f40df37d50fc..cc0186ef79f44 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 1ad35218eded9..7ee34fccaa3af 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.init.d b/sapi/phpdbg/phpdbg.init.d
index 99a1ab328b897..1f0b1fdbf92b1 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/web-bootstrap.php b/sapi/phpdbg/web-bootstrap.php
index 7b8c5d30de8dc..046062997ee69 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 56dcaaa1f7194..c02f80f2ca881 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/find_tested.php b/scripts/dev/find_tested.php
index 4e1e2a3bb4f34..24e49d092c498 100644
--- a/scripts/dev/find_tested.php
+++ b/scripts/dev/find_tested.php
@@ -71,7 +71,7 @@
/**
* The loop to output the test coverage info
* Should output: Extension, Class Name, Method/Function Name, Test Status, Test Files
- */
+ */
foreach($extension_method_info as $record) {
echo $record[EXTENSION_NAME] . ",";
echo $record[CLASS_NAME] . ",";
@@ -84,7 +84,7 @@
* Marks the "tested" status of methods in $method_info according
* to whether they are tested in $phpt_files
*/
-function mark_methods_as_tested($method_info, $phpt_files) {
+function mark_methods_as_tested($method_info, $phpt_files) {
foreach($phpt_files as $phpt_file) {
$tested_functions = extract_tests($phpt_file);
@@ -97,7 +97,7 @@ function mark_methods_as_tested($method_info, $phpt_files) {
// matched the method name
if ($current_method_record[IS_DUPLICATE] == true) {
// we cannot be sure which class this method corresponds to,
- // so mark method as needing to be verified
+ // so mark method as needing to be verified
$current_method_record[IS_TESTED] = "verify";
} else {
$current_method_record[IS_TESTED] = "yes";
@@ -114,7 +114,7 @@ function mark_methods_as_tested($method_info, $phpt_files) {
* returns an array containing a record for each defined method.
*/
function populate_method_info() {
-
+
$method_info = array();
// get functions
@@ -197,21 +197,21 @@ function get_phpt_files($dir, &$phpt_file_count, &$all_phpt)
}
/**
- * Extract tests from a specified file, returns an array of tested function tokens
- */
+ * Extract tests from a specified file, returns an array of tested function tokens
+ */
function extract_tests($file) {
$code = file_get_contents($file);
-
+
if (!preg_match('/--FILE--\s*(.*)\s*--(EXPECTF|EXPECTREGEX|EXPECT)?--/is', $code, $r)) {
//print "Unable to get code in ".$file."\n";
return array();
}
-
+
$tokens = token_get_all($r[1]);
$functions = array_filter($tokens, 'filter_functions');
$functions = array_map( 'map_token_value',$functions);
$functions = array_unique($functions);
-
+
return $functions;
}
diff --git a/scripts/dev/gen_verify_stub b/scripts/dev/gen_verify_stub
index 1dc3ba0cee99f..ac6dc4434d2b0 100755
--- a/scripts/dev/gen_verify_stub
+++ b/scripts/dev/gen_verify_stub
@@ -39,7 +39,7 @@ do
done
for TARBALL in "$PHPROOT/php-$RELEASE_VER.tar.bz2" "$PHPROOT/php-$RELEASE_VER.tar.gz" "$PHPROOT/php-$RELEASE_VER.tar.xz"
-do
+do
basename $TARBALL
echo "SHA256 hash: `sha256sum $TARBALL | cut -d' ' -f1`";
echo PGP signature:
diff --git a/scripts/man1/phpize.1.in b/scripts/man1/phpize.1.in
index d2852fdcc5468..b885326bfed22 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 362a2c95151ed..3e81ad4f5a300 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/server-tests-config.php b/server-tests-config.php
index 5961deea9828b..645a5e8e98262 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 @@
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/travis/ext/pgsql/setup.sh b/travis/ext/pgsql/setup.sh
index 32b39a40443e4..ef13733edc9d3 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 b47c3c0acadce..29ec59d9b6da1 100644
--- a/win32/build/Makefile
+++ b/win32/build/Makefile
@@ -87,14 +87,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
@@ -147,7 +147,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 e20e92848b166..ff8025362abf1 100644
--- a/win32/build/buildconf.js
+++ b/win32/build/buildconf.js
@@ -55,17 +55,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 19ab8421ae6bc..b49218b0f0c93 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -70,7 +70,7 @@ if (VS_TOOLSET) {
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 62d4f6148b5bb..6acbfdfb865d5 100644
--- a/win32/build/config.w32.phpize.in
+++ b/win32/build/config.w32.phpize.in
@@ -46,7 +46,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 24ffc489228cb..0d64e68fa4992 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -49,7 +49,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 */
@@ -126,7 +126,7 @@ var PHP_VERSION_STRING = "7.3.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;
}
@@ -228,7 +228,7 @@ function condense_path(path)
/* on a different drive */
break;
}
-
+
return path;
}
@@ -243,7 +243,7 @@ function ConfigureArg(type, optname, helptext, defval)
this.arg = "--" + type + "-" + optname;
this.imparg = "--" + opptype + "-" + optname;
}
-
+
this.optname = optname;
this.helptext = helptext;
this.defval = defval;
@@ -290,7 +290,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 = "";
@@ -310,7 +310,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];
@@ -349,7 +349,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);
@@ -478,7 +478,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) {
@@ -507,7 +507,7 @@ can be built that way. \
}
}
}
-
+
if (PHP_SNAPSHOT_BUILD != "no" && argval == "no") {
force = true;
for (j = 0; j < snapshot_build_exclusions.length; j++) {
@@ -810,7 +810,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];
@@ -883,7 +883,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 {
@@ -962,7 +962,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)
@@ -984,7 +984,7 @@ function GREP_HEADER(header_name, regex, path_to_check)
if (typeof(p) == "string") {
c = file_get_contents(p);
}
- }
+ }
if (!c) {
return false;
}
@@ -1004,7 +1004,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;
}
@@ -1022,7 +1022,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;
@@ -1039,7 +1039,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();
@@ -1159,15 +1159,15 @@ function generate_version_info_resource(makefiletarget, basename, creditspath, s
MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": $(PHP_DIR)\\build\\template.rc");
MFO.WriteLine("\t" + CMD_MOD1 + "$(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" + CMD_MOD1 + "$(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);
@@ -1227,7 +1227,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" + CMD_MOD2 + "echo SAPI " + sapiname_for_printing + " build complete");
if (MODE_PHPIZE) {
@@ -1247,7 +1247,7 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
ldflags = "$(LDFLAGS)";
manifest = "-" + CMD_MOD2 + "$(_VC_MANIFEST_EMBED_EXE)";
}
-
+
if (PHP_SANITIZER == "yes") {
if (CLANG_TOOLSET) {
add_asan_opts("CFLAGS_" + SAPI, "LIBS_" + SAPI, (is_lib ? "ARFLAGS_" : "LDFLAGS_") + SAPI);
@@ -1287,7 +1287,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")) {
@@ -1307,7 +1307,7 @@ function ADD_DIST_FILE(filename)
} else {
ADD_FLAG("PHP_EXTRA_DIST_FILES", filename);
}
-}
+}
function file_get_contents(filename)
{
@@ -1417,7 +1417,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 {
@@ -1447,7 +1447,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) {
@@ -1495,7 +1495,7 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
MFO.WriteLine(dllname + ": $(BUILD_DIR)\\" + dllname);
MFO.WriteLine("\t" + CMD_MOD2 + "echo EXT " + extname + " build complete");
MFO.WriteBlankLines(1);
-
+
DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_' + EXT + ')');
} else {
ADD_FLAG("STATIC_EXT_OBJS", "$(" + EXT + "_GLOBAL_OBJS)");
@@ -1532,9 +1532,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) {
@@ -1600,7 +1600,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("\\");
@@ -1626,7 +1626,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;
@@ -1641,7 +1641,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);
@@ -1671,7 +1671,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;
@@ -1691,7 +1691,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 {
@@ -1715,7 +1715,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 " +
"--suppress=unmatchedSuppression " +
"--suppressions-list=win32\\build\\cppcheck_suppress.txt ";
@@ -1737,9 +1737,9 @@ function ADD_SOURCES(dir, file_list, target, obj_dir)
MFO.WriteLine("\t" + CMD_MOD1 + "$(CC) $(" + flags + ") $(CFLAGS) $(" + bd_flags_name + ") /c " + dir + "\\" + src + " /Fo" + sub_build + d + obj);
if ("clang" == PHP_ANALYZER) {
- MFO.WriteLine("\t" + CMD_MOD1 + "\"$(CLANG_CL)\" " + analyzer_base_args + " $(" + flags + "_ANALYZER) $(CFLAGS_ANALYZER) $(" + bd_flags_name + "_ANALYZER) " + dir + "\\" + src);
+ MFO.WriteLine("\t" + CMD_MOD1 + "\"$(CLANG_CL)\" " + analyzer_base_args + " $(" + flags + "_ANALYZER) $(CFLAGS_ANALYZER) $(" + bd_flags_name + "_ANALYZER) " + dir + "\\" + src);
} else if ("cppcheck" == PHP_ANALYZER) {
- MFO.WriteLine("\t\"" + CMD_MOD1 + "$(CPPCHECK)\" " + analyzer_base_args + " $(" + flags + "_ANALYZER) $(CFLAGS_ANALYZER) $(" + bd_flags_name + "_ANALYZER) " + analyzer_base_flags + " " + dir + "\\" + src);
+ MFO.WriteLine("\t\"" + CMD_MOD1 + "$(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" + CMD_MOD1 + "\"$(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\" ");
@@ -1764,8 +1764,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)) {
@@ -1809,11 +1809,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);
@@ -2022,7 +2022,7 @@ function generate_tmp_php_ini()
if ("shared" != extensions_enabled[i][1]) {
continue;
}
-
+
var directive = (extensions_enabled[i][2] ? 'zend_extension' : 'extension');
var ext_name = extensions_enabled[i][0];
@@ -2249,11 +2249,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);
@@ -2295,7 +2295,7 @@ function generate_config_h()
pieces += '" "';
}
}
-
+
outfile.WriteLine("#define " + keys[i] + " " + pieces);
}
@@ -2311,7 +2311,7 @@ function generate_config_h()
}
}
-
+
outfile.Close();
}
@@ -2327,7 +2327,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"), "\\\\");
@@ -2449,7 +2449,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.+? /, "")
@@ -2514,7 +2514,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);
@@ -2542,7 +2542,7 @@ function generate_makefile()
MF.WriteLine(" " + CMD_MOD2 + "for %D in ($(INSTALL_HEADERS_DIR)) do " + CMD_MOD2 + "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(" " + CMD_MOD2 + "if not exist $(BUILD_DIR_DEV)\\include\\" + headers_install[i][2] + " mkdir $(BUILD_DIR_DEV)\\include\\" +
+ MF.WriteLine(" " + CMD_MOD2 + "if not exist $(BUILD_DIR_DEV)\\include\\" + headers_install[i][2] + " mkdir $(BUILD_DIR_DEV)\\include\\" +
headers_install[i][2] + ">nul");
MF.WriteLine(" " + CMD_MOD2 + "copy " + headers_install[i][0] + " " + "$(BUILD_DIR_DEV)\\include\\" + headers_install[i][2] + " /y >nul");
}
@@ -2620,7 +2620,7 @@ function generate_makefile()
FSO.DeleteFile(PHP_MAKEFILE_FRAGMENTS, true);
}
- MF.Close();
+ MF.Close();
}
function ADD_FLAG(name, flags, target)
@@ -2635,7 +2635,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
@@ -2644,7 +2644,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);
}
@@ -2721,7 +2721,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();
@@ -2742,14 +2742,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);
@@ -3113,7 +3113,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 8c394ca6490d4..aa5da5c4d08c4 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 30e8ee156460c..3f8d6e05c1333 100644
--- a/win32/build/mkdist.php
+++ b/win32/build/mkdist.php
@@ -68,13 +68,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);
@@ -106,7 +106,7 @@ function get_depends($module)
continue;
}
}
-
+
if ($is_pecl) {
if (!in_array($dep, $pecl_dll_deps)) {
$pecl_dll_deps[] = $dep;
@@ -203,7 +203,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');
@@ -212,14 +212,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);
-
+
} /* }}} */
@@ -251,7 +251,7 @@ function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */
$text_files = array(
"LICENSE" => "license.txt",
"NEWS" => "news.txt",
- "INSTALL" => "install.txt",
+ "INSTALL" => "install.txt",
"README.REDIST.BINS" => "readme-redist-bins.txt",
"php.ini-development" => "php.ini-development",
"php.ini-production" => "php.ini-production"
@@ -327,9 +327,9 @@ function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */
}
/* 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
*/
@@ -451,7 +451,7 @@ function copy_test_dir($directory, $dest)
}
}
- closedir($directory_list);
+ closedir($directory_list);
}
function make_phar_dot_phar($dist_dir)
@@ -537,7 +537,7 @@ function make_phar_dot_phar($dist_dir)
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/*");
@@ -567,7 +567,7 @@ function make_phar_dot_phar($dist_dir)
}
}
}
-
+
/* copy c++ runtime */
$items = glob("$snapshot_template/dlls/*.CRT");
diff --git a/win32/codepage.c b/win32/codepage.c
index 16e480e5fff5c..73645bc22b766 100644
--- a/win32/codepage.c
+++ b/win32/codepage.c
@@ -177,7 +177,7 @@ PW32CP wchar_t *php_win32_cp_conv_ascii_to_w(const char* in, size_t in_len, size
}
ret_idx += 8;
- {
+ {
const __m128i hi = _mm_unpackhi_epi8(block, mask);
_mm_storeu_si128((__m128i *)ret_idx, hi);
}