# How to abort MINIT?

- Thread: https://externals.io/message/37785
- Original archive: https://news-web.php.net/php.internals/37785
- Started by Michael B Allen on 2008-05-21T21:45:08+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #37785 — Michael B Allen — 2008-05-21T21:45:08+00:00

URL: https://externals.io/message/37785#37785

I provide an INI property to stop my extension from loading fully like:

    if (strcmp(sapi_module.name, "cli") == 0 &&
                INI_STR("plexcel.sapi.cli") &&
                INI_BOOL("plexcel.sapi.cli") == 0) {
        return;
    }

But the extension is still loaded. It's just not initialized.

Is there any way to abort within PHP_MINIT_FUNCTION or call a function
to remove the extension from the runtime such that calling
extension_loaded('plexcel') returns FALSE?

Mike

-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/

---

## #37789 — Stanislav Malyshev — 2008-05-22T04:04:31+00:00

URL: https://externals.io/message/37785#37789 · In reply to: #37785

Hi!

> I provide an INI property to stop my extension from loading fully like:
> 
>     if (strcmp(sapi_module.name, "cli") == 0 &&
>                 INI_STR("plexcel.sapi.cli") &&
>                 INI_BOOL("plexcel.sapi.cli") == 0) {
>         return;
>     }
> 
> But the extension is still loaded. It's just not initialized.

if you return FAILURE, it will not be loaded, but it will produce 
E_CORE_ERROR. If you don't like that I'd recommend to keep extension 
loaded but not register any functions, etc and write some descriptive 
stuff in `phpinfo()`.
-- 
Stanislav Malyshev, Zend Software Architect
stas@zend.com   http://www.zend.com/
(408)253-8829   MSN: stas@zend.com
