Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126077 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id A6C801A00BD for ; Thu, 28 Nov 2024 16:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1732812908; bh=08doUEHkKNymbSL00EMqdfcBZ7ODZGL+XZjpnjrizdc=; h=From:Date:Subject:To:From; b=CVnS+hEcYj1vG+0ksZkt7yv6KUKVJP4VdkjcY1qklBFrv0jet+DOtWSKwtcxY5jBu W+hqI5iPSHkN3+j6jNwW+pg8cQ6CWdDUr0VdTz++pg6xkzIrA3lVorF8OWwdVwg0gH 0F3TxFYqksQDaT0n1gVkQncyWLlAO2Wb8RaQodyRQ/QtYesHxb1eRq8VgcOhnkBjPz RQ+8qyS1cWq49z7uRJHdstVyteldP8bMSd5AOCC31FkYPxo/D7lvBf1Y9pI8YJq4fA lbi1d49bf88yyzycPRu0i5tpYlrF2itbvFZbm4rGECVtWNHuJT1EmyWOX25vOFUA3c Jg0pB3kyFbv8Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E0B6D18006C for ; Thu, 28 Nov 2024 16:55:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ua1-f47.google.com (mail-ua1-f47.google.com [209.85.222.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 28 Nov 2024 16:55:07 +0000 (UTC) Received: by mail-ua1-f47.google.com with SMTP id a1e0cc1a2514c-85b8ee01452so75181241.1 for ; Thu, 28 Nov 2024 08:58:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=melroseandco.uk; s=google; t=1732813096; x=1733417896; darn=lists.php.net; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=08doUEHkKNymbSL00EMqdfcBZ7ODZGL+XZjpnjrizdc=; b=YuV5FB5qvUeLOcUP0DEvQoigOgyH0siYH91+c2iufgdWxOb2CbUyDKoN3exSWIkG/D 0MmMKp5zTguANvbiELCW7SzlRjJj7z4biLF0xR8IXOK4eExH+dd2/wWc/TJ2Qmcxf8kc wCHEynp3neGOI0uwQoPKHVkJAzd/OOaKOViWezSv0fRT0Dl8QVTVz8etJ6lho1FkEKYH 6EbIdKbsZjrr5DXZvscrsrQ6oMqdtPSq8nYPLwE2qeb+1snIOxrZwoWpCMvFc3ZRM+Jz vTIetcSmkQQDbaZs/oz4lKqWYRLq0KpQSyCrGYv3+YS9F5qK1hJ2IfofaE91u//sIlFD 2bvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732813096; x=1733417896; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=08doUEHkKNymbSL00EMqdfcBZ7ODZGL+XZjpnjrizdc=; b=ui0TMmKqWhlkLZlnECN55hmrxQY20PaJlLDnwK6ymrHe5n5aNR4+Ks4Uzx4+YrtyWx oSbn44/fKeUi8MCVR8gGTPqCrM4W5QMPLq0JlzxvltUlcfisoadEa74Agc5lLgKfFpnl mMvk6wVswDfD3a2KNF+SCsWRcJ1Xabz5Oo+nn+lwVIxr3wN5YWCHLOL2eqohJS1+TQJW OiQCglhqxLBGgqRV4OUUJ9NsZmWFOAqIxoDR8fs3+UL10uoMj5t6f00eTssZeN1Q3iTx wPy1wh4YYBWU0Ci4W1iuZgKL+jxWQMEdp1Ps+mouoHgMWjvDZDKyfE7vThGSl0Bd1TiA Uy1w== X-Gm-Message-State: AOJu0YxpZdYRc3puwXkf0sgQDPekxGVH0S9W8CMfVZ8Wr3IW6o5vOxsE BT+FbxCd7aB3UI2jhzb4ncMTeexvcCkZpuTw23qyNlFTVgZwKnrcPikpEq9MTmO3thmduWSN+k1 qhY5TY0eJfSC0Ap4lL+com7KvvRumIItTWY5S6e+6jMvlu46ARfk= X-Gm-Gg: ASbGncsP6bex2/C0zl5tVyq7V8jCQ6EoIfc2V6KVKb3opGOsOPXI85bL8qqMMGtmQSP Nh6JRsMv+bkgUhU8p3rcNB5zU/eL+jw== X-Google-Smtp-Source: AGHT+IH929JQwsNSgGSBkxIhK+RIwob5nlQIbtaL5qRkICAK1Lr3cP3rZi64B6KP2UmB6qayZLa4bwp8NgrFACHDJiU= X-Received: by 2002:a05:6102:942:b0:4af:3ded:f9bc with SMTP id ada2fe7eead31-4af44a9fe44mr10291770137.27.1732813096051; Thu, 28 Nov 2024 08:58:16 -0800 (PST) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Thu, 28 Nov 2024 16:58:04 +0000 Message-ID: Subject: [PHP-DEV] opcache_is_script_cached(...) for file cache To: PHP internals Content-Type: text/plain; charset="UTF-8" From: sam@melroseandco.uk (Samuel Melrose) Hello, I'd like to propose a version of `opcache_is_script_cached(...)` that supports checking the file cache, rather than just SHM. This would be useful when paired with `opcache.file_cache_read_only`, as it would allow us to more easily check the cache is being used at runtime. It'll also allow us to more easily write automated tests against the file based opcache, which I'd like to do retroactively for my `opcache.file_cache_read_only` PR. An example PR for this change is here: https://github.com/php/php-src/pull/16979 I'd initially considered changing the function definition to `opcache_is_script_cached(string $filename, bool $file_cache = false)`, adding a new parameter, `bool $file_cache = false`, but defaulting to `false` so the default / existing behaviour remains the same: when the second parameter is true, it'll check JUST the file cache, not SHM. @Ilija Tovilo has suggested that it might be less confusing to make it its own function, which I'm happy to do. Does anyone want to weigh in on what you think of this functionality, and if/how you'd like to see it implemented? Regards, Samuel Melrose