Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
404 changes: 404 additions & 0 deletions ext/date/php_date.c

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions ext/opcache/ZendAccelerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "zend_accelerator_util_funcs.h"
#include "zend_accelerator_hash.h"
#include "zend_file_cache.h"
#include "zend_user_cache.h"
#include "zend_system_id.h"
#include "ext/pcre/php_pcre.h"
#include "ext/standard/basic_functions.h"
Expand Down Expand Up @@ -2820,6 +2821,8 @@ zend_result accel_post_deactivate(void)
ZCG(cwd) = NULL;
}

zend_opcache_user_cache_post_deactivate();

if (!ZCG(enabled) || !accel_startup_ok) {
return SUCCESS;
}
Expand Down
1 change: 1 addition & 0 deletions ext/opcache/ZendAccelerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ typedef struct _zend_persistent_script {

typedef struct _zend_accel_directives {
zend_long memory_consumption;
zend_long user_cache_shm_size;
zend_long max_accelerated_files;
double max_wasted_percentage;
char *user_blacklist_filename;
Expand Down
4 changes: 4 additions & 0 deletions ext/opcache/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ PHP_NEW_EXTENSION([opcache], m4_normalize([
zend_accelerator_hash.c
zend_accelerator_module.c
zend_accelerator_util_funcs.c
zend_user_cache.c
zend_user_cache_storage.c
zend_user_cache_shared_graph.c
zend_user_cache_entries.c
zend_file_cache.c
zend_persist_calc.c
zend_persist.c
Expand Down
4 changes: 4 additions & 0 deletions ext/opcache/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ ZEND_EXTENSION('opcache', "\
zend_accelerator_hash.c \
zend_accelerator_module.c \
zend_accelerator_util_funcs.c \
zend_user_cache.c \
zend_user_cache_storage.c \
zend_user_cache_shared_graph.c \
zend_user_cache_entries.c \
zend_persist.c \
zend_persist_calc.c \
zend_file_cache.c \
Expand Down
2 changes: 2 additions & 0 deletions ext/opcache/opcache.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

function opcache_reset(): bool {}

function opcache_user_cache_reset(): bool {}

/**
* @return array<string, mixed>|false
* @refcount 1
Expand Down
6 changes: 5 additions & 1 deletion ext/opcache/opcache_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 75 additions & 0 deletions ext/opcache/opcache_user_cache.stub.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?php

/** @generate-class-entries */

namespace Opcache {

/** @strict-properties */
final readonly class UserCacheInfo
{
private function __construct() {}

public string $scope;

public bool $available;

public ?string $unavailableReason;

public bool $enabled;

public bool $startupFailed;

public bool $backendInitialized;

public int $configuredMemory;

public int $sharedMemorySize;

public int $usedMemory;

public int $freeMemory;

public int $wastedMemory;

public int $entryCount;

public int $entryCapacity;

public int $tombstoneCount;
}

/** @not-serializable */
final class UserCache
{
public function __construct(string $scope) {}

public function store(string $key, null|bool|int|float|string|array|object $value, int $ttl = 0): bool {}

public function storeMultiple(array $values, int $ttl = 0): bool {}

public function increment(string $key, int $step = 1, int $ttl = 0): int|false {}

public function decrement(string $key, int $step = 1, int $ttl = 0): int|false {}

public function fetch(string $key, null|bool|int|float|string|array|object $default = null): null|bool|int|float|string|array|object {}

public function fetchMultiple(array $keys, mixed $default = null): array {}

public function delete(string $key): bool {}

public function deleteMultiple(array $keys): bool {}

public function clear(): bool {}

public function has(string $key): bool {}

public function lock(string $key, int $lease = 0): bool {}

public function unlock(string $key): bool {}

public function remember(string $key, callable $callback, int $ttl = 0): mixed {}

public function info(): UserCacheInfo {}
}

}
212 changes: 212 additions & 0 deletions ext/opcache/opcache_user_cache_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ext/opcache/tests/fpm/CONFLICTS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fpm
13 changes: 13 additions & 0 deletions ext/opcache/tests/fpm/skipif.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip not for Windows');
}
if (!getmyuid() && !getenv('TEST_FPM_RUN_AS_ROOT')) {
die('skip Refusing to run as root');
}

require_once __DIR__ . '/tester.inc';

if (!FPM\Tester::findExecutable()) {
die('skip php-fpm binary not found');
}
4 changes: 4 additions & 0 deletions ext/opcache/tests/fpm/tester.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php

set_include_path(__DIR__ . '/../../../../sapi/fpm/tests' . PATH_SEPARATOR . get_include_path());
require_once __DIR__ . '/../../../../sapi/fpm/tests/tester.inc';
Loading
Loading