static function getInstance($szName) { switch ($szName) { case 'fs': return DAO_FileSystem::getInstance(); break; case 'image': return DAO_Image::getInstance(); break; default: trigger_error('DAO::getInstance. instance `' . htmlspecialchars($szName) . '` not found', E_USER_ERROR); break; } }
public static function getInstance() { if (!is_object(self::$instance)) { self::$instance = new DAO_Image(); } return self::$instance; }