Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method for unregistering PHP classes #13

Open
bergie opened this issue Jun 23, 2010 · 1 comment
Open

Method for unregistering PHP classes #13

bergie opened this issue Jun 23, 2010 · 1 comment

Comments

@bergie
Copy link
Member

bergie commented Jun 23, 2010

When Midgard is used together with the Runtime, all execution for the site is done in a single PHP AppServer process. This means classes are loaded only once.

This is however an issue when we think of users editing their PHP snippets using the MVC code editor. As the classes are loaded, and stay loaded, the only way to get their code changes to register is by restarting the server.

If we had a method for unregistering classes then this wouldn't be necessary, class could just be unregistered and registered again as part of cache invalidation MVC does.

@indeyets
Copy link
Member

this should, probably, be enough for this:

zend_hash_del(CG(class_table), class_name, class_name_length+1) 

but this should be seriously tested and limited:

  • we, probably, want to unregister only limited subset of classes
  • noone knows what would happen if we remove the class, but there are still objects of that class instantiated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants