Req #75062 [NEW]: Unload classes / reset php status
| From: | tomi dot po at koodia dot com | Date: | Fri, 11 Aug 2017 06:40:36 +0000 |
| Subject: | Req #75062 [NEW]: Unload classes / reset php status | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-210593@lists.php.net to get a copy of this message | ||
From: tomi dot po at koodia dot com
Operating system: All
PHP version: Next Major Version
Package: Dynamic loading
Bug Type: Feature/Change Request
Bug description:Unload classes / reset php status
Description:
------------
I am proposing a functions "unload_all_classes()",
"unload_included_files()" or "reset_php()"
Basically the idea is to reset the PHP back to the status when the
program started, yet continue from the next line of code after the
function call.
Scenario: legacy system A, new system B, both systems need to run
concurrently, it depends on condition C, which system need to be
executed to handle the request. This condition C, is something that can
be determined only inside the code.
In this scenario I thought that maybe if I start the request and execute
system B, but if it determines that this request is not intended for
that, it'll simply fold - reset back to its status, and run legacy
system A to handle the request. The point is to ease the migration
pains.
Further developement could return a "savepoint", so that you could get
back to the original state. Something like this:
"Savepoint function reset_php( Savepoint $savepoint = null )"
"If savepoint is null, resets back to the original state (in which the
php started) and returns the old state (savepoint).
If savepoint is not null, and is legitimate savepoint it will reset the
php status to this savepoint, and returns the old savepoint - otherwise
returns FALSE.
In either case the execution continues from the next line.
"
--
Edit bug report at https://bugs.php.net/bug.php?id=75062&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75062&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75062&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75062&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75062&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75062&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75062&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75062&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75062&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75062&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75062&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75062&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75062&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75062&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75062&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75062&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75062&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75062&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75062&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75062&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75062&r=mysqlcfg