Home News Bugs Downloads Docs Forum CVS Stats
Information
|
|
Details
I had some trouble with PHPBeans server quietly dying on startup and found that it was choking on non-bean files in the obj/ directory.
Here's an alternate onStart method that ensures only *.php files are loaded:
function onStart () {
$this->uptime = date ('Y-m-d H:i:s');
$olddir = getcwd();
chdir('obj');
$files = glob('*.php');
chdir($olddir);
foreach($files as $file) {
include_once ($file);
$class = 'Bean_' . str_replace ('.php', '', $file);
$this->register[$tmp->namespace] =& new $class ($this);
}
}
Comments
Add Comment
You must be logged in to comment.
Whoops... The line that reads:
$this->register[$tmp->namespace] =& new $class ($this);
should be replaced by:
$tmp = new $class ($this);
$this->register[$tmp->namespace] =& $tmp;
unset ($tmp);