更新时重新声明类
在重新声明课程时我遇到了一个小问题。我创建了一个更新函数,它调用远程服务器,获取文件/类,并在当前服务器上更新它。问题是我必须使用已经声明的类,因为新类包含已更新的功能。
我一直在尝试取消设置该类,但这不起作用,而且我没有找到删除文件的 require_once() 然后重新包含的方法。
那么有没有一种方法可以让我重新声明一个类并让它在本地运行而不是在全局范围内运行?
I am having a small problem when it comes to redeclaring a class. I made an update function that calls to a remote server, gets the files/classes, and updates it on the current server. The problem is I have to use a class the has been declared already because the new class contains features that have been updated.
I've been trying to unset the class but that does not work and I don't see a way of removing the require_once() of the file and then re including.
So is there a way where I can redeclare a class and have it run locally and not on the global scope?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 runkit 扩展:
runkit-import
< /a>You can use the runkit extension:
runkit-import