php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57525 Importing classes does not work, using the PHP command line.
Submitted: 2007-02-13 10:22 UTC Modified: 2013-02-26 04:32 UTC
From: info at lucasvd dot nl Assigned:
Status: Not a bug Package: runkit (PECL)
PHP Version: 5.2.0 OS: Windows Vista/Debian
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
24 - 2 = ?
Subscribe to this entry?

 
 [2007-02-13 10:22 UTC] info at lucasvd dot nl
Description:
------------
I'm creating an IRC Bot, with plugins. All my Plugins are classes, so if you made a change to your plugin, you hadd to restart to complete bot, to reload all plugins. But then I met runkit, and it would be the perfect solution.

But, when I ry to reload all my plugins using Runkit, runkit_import returns true, but the classes aren't reloaded. (When I started the bot through the PHP CLI)

Runkit did actually work when I started the bot through my browser.

Reproduce code:
---------------
	public function reload_plugins()
	{
		// Check for runkit extension
		if(!extension_loaded('runkit'))
		{
			// Try to load it
			@dl('runkit');
			if(!extension_loaded('runkit'))
			{
				throw new Exception('Runkit extension not installed!');
			}
		}

		// Loop through all plugins
		foreach($this -> plugins as $name => $instance)
		{
			if(runkit_import($this ->plugin_dir . $name.'/plugin.php', RUNKIT_IMPORT_OVERRIDE | RUNKIT_IMPORT_CLASSES))
			{
				$this -> logger -> add($name.' Succesfully reloaded', IrcEvent::Other);
			}
		}
	}

Expected result:
----------------
Classes are reloaded, without have to restart my bot.

Actual result:
--------------
On the PHP CLI, the classes aren't reloaded.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-09 19:22 UTC] tagyboy at gmail dot com
Does not work on Gentoo neither.
 [2013-02-26 04:32 UTC] pollita@php.net
-Status: Open +Status: Not a bug
 [2013-02-26 04:32 UTC] pollita@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

I'm pretty sure this is fixed at this point, please try newest version in git.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 18:01:30 2024 UTC