From b67f699dcd0ec318dbb153811b53e124fd3774d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Thu, 7 May 2020 10:21:44 +0200 Subject: [PATCH] Rename the recently introduced Sysvsem class to SysvSemaphore --- UPGRADING | 2 +- ext/sysvsem/sysvsem.c | 14 +++++++------- ext/sysvsem/sysvsem.stub.php | 10 +++++----- ext/sysvsem/sysvsem_arginfo.h | 8 ++++---- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/UPGRADING b/UPGRADING index 00f7b88f1b..84b345ff9c 100644 --- a/UPGRADING +++ b/UPGRADING @@ -417,7 +417,7 @@ PHP 8.0 UPGRADE NOTES locale component from the default. - Sysvsem: - . sem_get() will now return an Sysvsem object rather than a resource. + . sem_get() will now return an SysvSemaphore object rather than a resource. Return value checks using is_resource() should be replaced with checks for `false`. diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c index df9f62116f..7422c64354 100644 --- a/ext/sysvsem/sysvsem.c +++ b/ext/sysvsem/sysvsem.c @@ -86,7 +86,7 @@ ZEND_GET_MODULE(sysvsem) #define SYSVSEM_USAGE 1 #define SYSVSEM_SETVAL 2 -/* Sysvsem class */ +/* SysvSemaphore class */ zend_class_entry *sysvsem_ce; static zend_object_handlers sysvsem_object_handlers; @@ -108,7 +108,7 @@ static zend_object *sysvsem_create_object(zend_class_entry *class_type) { } static zend_function *sysvsem_get_constructor(zend_object *object) { - zend_throw_error(NULL, "Cannot directly construct Sysvsem, use sem_get() instead"); + zend_throw_error(NULL, "Cannot directly construct SysvSemaphore, use sem_get() instead"); return NULL; } @@ -154,7 +154,7 @@ static void sysvsem_free_obj(zend_object *object) PHP_MINIT_FUNCTION(sysvsem) { zend_class_entry ce; - INIT_CLASS_ENTRY(ce, "Sysvsem", class_Sysvsem_methods); + INIT_CLASS_ENTRY(ce, "SysvSemaphore", class_SysvSemaphore_methods); sysvsem_ce = zend_register_internal_class(&ce); sysvsem_ce->ce_flags |= ZEND_ACC_FINAL; sysvsem_ce->create_object = sysvsem_create_object; @@ -187,7 +187,7 @@ PHP_MINFO_FUNCTION(sysvsem) #undef SETVAL_WANTS_PTR #endif -/* {{{ proto Sysvsem sem_get(int key [, int max_acquire [, int perm [, int auto_release]]) +/* {{{ proto SysvSemaphore sem_get(int key [, int max_acquire [, int perm [, int auto_release]]) Return an id for the semaphore with the given key, and allow max_acquire (default 1) processes to acquire it simultaneously */ PHP_FUNCTION(sem_get) { @@ -341,7 +341,7 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire) } /* }}} */ -/* {{{ proto bool sem_acquire(Sysvsem id) +/* {{{ proto bool sem_acquire(SysvSemaphore id) Acquires the semaphore with the given id, blocking if necessary */ PHP_FUNCTION(sem_acquire) { @@ -349,7 +349,7 @@ PHP_FUNCTION(sem_acquire) } /* }}} */ -/* {{{ proto bool sem_release(Sysvsem id) +/* {{{ proto bool sem_release(SysvSemaphore id) Releases the semaphore with the given id */ PHP_FUNCTION(sem_release) { @@ -357,7 +357,7 @@ PHP_FUNCTION(sem_release) } /* }}} */ -/* {{{ proto bool sem_remove(Sysvsem id) +/* {{{ proto bool sem_remove(SysvSemaphore id) Removes semaphore from Unix systems */ /* diff --git a/ext/sysvsem/sysvsem.stub.php b/ext/sysvsem/sysvsem.stub.php index e6fe1b4b7d..095720df60 100644 --- a/ext/sysvsem/sysvsem.stub.php +++ b/ext/sysvsem/sysvsem.stub.php @@ -2,17 +2,17 @@ /** @generate-function-entries */ -final class Sysvsem +final class SysvSemaphore { } /** * @todo use bool for $auto_release */ -function sem_get(int $key, int $max_acquire = 1, int $perm = 0666, int $auto_release = 1): Sysvsem|false {} +function sem_get(int $key, int $max_acquire = 1, int $perm = 0666, int $auto_release = 1): SysvSemaphore|false {} -function sem_acquire(Sysvsem $sem_identifier, bool $nowait = false): bool {} +function sem_acquire(SysvSemaphore $semaphore, bool $nowait = false): bool {} -function sem_release(Sysvsem $sem_identifier): bool {} +function sem_release(SysvSemaphore $semaphore): bool {} -function sem_remove(Sysvsem $sem_identifier): bool {} +function sem_remove(SysvSemaphore $semaphore): bool {} diff --git a/ext/sysvsem/sysvsem_arginfo.h b/ext/sysvsem/sysvsem_arginfo.h index 83948fed3f..d1500b81b6 100644 --- a/ext/sysvsem/sysvsem_arginfo.h +++ b/ext/sysvsem/sysvsem_arginfo.h @@ -1,6 +1,6 @@ /* This is a generated file, edit the .stub.php file instead. */ -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_sem_get, 0, 1, Sysvsem, MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_sem_get, 0, 1, SysvSemaphore, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, key, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, max_acquire, IS_LONG, 0, "1") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, perm, IS_LONG, 0, "0666") @@ -8,12 +8,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_sem_get, 0, 1, Sysvsem, MAY_ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sem_acquire, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, sem_identifier, Sysvsem, 0) + ZEND_ARG_OBJ_INFO(0, semaphore, SysvSemaphore, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, nowait, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sem_release, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, sem_identifier, Sysvsem, 0) + ZEND_ARG_OBJ_INFO(0, semaphore, SysvSemaphore, 0) ZEND_END_ARG_INFO() #define arginfo_sem_remove arginfo_sem_release @@ -34,6 +34,6 @@ static const zend_function_entry ext_functions[] = { }; -static const zend_function_entry class_Sysvsem_methods[] = { +static const zend_function_entry class_SysvSemaphore_methods[] = { ZEND_FE_END }; -- 2.40.0