I have been working on a PHP web application. I used the new datagrid from gurrido.net and it worked fine on the local computer, but when I upload it to the server, I get the following error:
Fatal error: Unable to create the static method Base :: getClassName () static in the Singletons class in /var/www/reskb/phpinc/Singletons.class.php on line 84
In my old version, where I did not use the grid, I got it working. Here is my singletons.class.php file code:
<? class Singletons extends Base { var $objects = array(); function getClassName() { return 'Singletons'; } function _instance() { static $_instance = NULL; if ($_instance == NULL) { $className = Singletons::getClassName(); $_instance = new $className(); } return $_instance; } function put($object) { $self = Singletons::_instance(); $className = $object->getClassName(); $self->objects[$className] = $object; } function get($className) { $self = Singletons::_instance(); if(!empty($self->objects[$className])) return $self->objects[$className]; else return ''; } } Singletons::_instance(); ?>
source share