Permalink
Browse files

Merge branch 'opcache' of ../php-5.5

Conflicts:
	ZendAccelerator.c
  • Loading branch information...
2 parents 86bba30 + f0d19c9 commit bfadf4716291bd50c08298cacffee6db9d37bdd9 @laruence laruence committed Nov 6, 2013
Showing with 6 additions and 53 deletions.
  1. +2 −2 README
  2. +3 −46 ZendAccelerator.c
  3. +0 −4 config.m4
  4. +1 −1 zend_accelerator_module.c
View
4 README
@@ -80,8 +80,8 @@ opcache.max_accelerated_files (default "2000")
The maximum number of keys (scripts) in the OPcache hash table.
The number is actually the first one in the following set of prime
numbers that is bigger than the one supplied: { 223, 463, 983, 1979, 3907,
- 7963, 16229, 32531, 65407, 130987 }. Only numbers between 200 and 100000
- are allowed.
+ 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }. Only numbers
+ between 200 and 1000000 are allowed.
opcache.max_wasted_percentage (default "5")
The maximum percentage of "wasted" memory until a restart is scheduled.
View
@@ -37,9 +37,6 @@
#include "zend_API.h"
#include "zend_ini.h"
#include "TSRM/tsrm_virtual_cwd.h"
-#ifdef HAVE_PHAR_HEADER
-# include "ext/phar/php_phar.h"
-#endif
#include "zend_accelerator_util_funcs.h"
#include "zend_accelerator_hash.h"
@@ -147,23 +144,6 @@ static inline int is_cacheable_stream_path(const char *filename)
memcmp(filename, "phar://", sizeof("phar://") - 1) == 0;
}
-#ifdef HAVE_PHAR_HEADER
-static inline int is_phar_relative_alias_path(const char *filename, char **alias, int *alias_len)
-{
- if (memcmp(filename, "phar://", sizeof("phar://") - 1) == 0
- && filename[sizeof("phar://") - 1] != '\0' && filename[sizeof("phar://") - 1] != '/') {
- char *slash;
- *alias = (char*)filename + sizeof("phar://") - 1;
- slash = strstr(*alias, "/");
- if (slash) {
- *alias_len = slash - *alias;
- return 1;
- }
- }
- return 0;
-}
-#endif
-
/* O+ overrides PHP chdir() function and remembers the current working directory
* in ZCG(cwd) and ZCG(cwd_len). Later accel_getcwd() can use stored value and
* avoid getcwd() call.
@@ -1048,37 +1028,14 @@ char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_lengt
}
memcpy(ZCG(key) + cur_len, include_path, include_path_len);
ZCG(key)[key_length] = '\0';
- } else {
- /* not use_cwd */
- key_length = path_length;
+ } else {
+ /* not use_cwd */
+ key_length = path_length;
if ((size_t)key_length >= sizeof(ZCG(key))) {
ZCG(key_len) = 0;
return NULL;
}
-#ifdef HAVE_PHAR_HEADER
- else {
- char *alias;
- int alias_len;
- if (is_phar_relative_alias_path(file_handle->filename, &alias, &alias_len)) {
- char *phar_path;
- int phar_path_len;
- if (phar_resolve_alias(alias, alias_len, &phar_path, &phar_path_len TSRMLS_CC) == SUCCESS) {
- int filename_len = strlen(file_handle->filename);
- memcpy(ZCG(key), "phar://", sizeof("phar://") -1);
- memcpy(ZCG(key) + sizeof("phar://") - 1, phar_path, phar_path_len);
- memcpy(ZCG(key) + sizeof("phar://") - 1 + phar_path_len,
- alias + alias_len, filename_len - alias_len - sizeof("phar://") + 2);
- key_length = filename_len + (phar_path_len - alias_len);
- } else {
- memcpy(ZCG(key), file_handle->filename, key_length + 1);
- }
- } else {
- memcpy(ZCG(key), file_handle->filename, key_length + 1);
- }
- }
-#else
memcpy(ZCG(key), file_handle->filename, key_length + 1);
-#endif
}
*key_len = ZCG(key_len) = key_length;
View
@@ -363,10 +363,6 @@ if test "$flock_type" == "unknown"; then
AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no])
fi
-if test -r $phpincludedir"/ext/phar/php_phar.h"; then
- AC_DEFINE([HAVE_PHAR_HEADER], [], [phar header file exists])
-fi
-
PHP_NEW_EXTENSION(opcache,
ZendAccelerator.c \
zend_accelerator_blacklist.c \
@@ -34,7 +34,7 @@
#define STRING_NOT_NULL(s) (NULL == (s)?"":s)
#define MIN_ACCEL_FILES 200
-#define MAX_ACCEL_FILES 100000
+#define MAX_ACCEL_FILES 1000000
#define TOKENTOSTR(X) #X
static void (*orig_file_exists)(INTERNAL_FUNCTION_PARAMETERS) = NULL;

0 comments on commit bfadf47

Please sign in to comment.