From 4af8915edaa0e25d651b819590c802b18ea1fb67 Mon Sep 17 00:00:00 2001 From: marcus Date: Thu, 7 Aug 2008 16:42:33 +0000 Subject: Refs #174: Introducing the ElggDummy class which returns false for all methods and set variables called on it. This is what the logged out $_SESSION['user'] is set to and is also what page_owner_entity will return if page_owner is invalid. This means that calls to things like $_SESSION['user']->getGUID() are now safe and will no longer cause a parsing error. Please report any issues. git-svn-id: https://code.elgg.org/elgg/trunk@1770 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/dummy.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 engine/lib/dummy.php (limited to 'engine/lib/dummy.php') diff --git a/engine/lib/dummy.php b/engine/lib/dummy.php new file mode 100644 index 000000000..a7f8760e0 --- /dev/null +++ b/engine/lib/dummy.php @@ -0,0 +1,29 @@ +name don't cause a WSoD. + * + * @package Elgg + * @subpackage Core + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Marcus Povey + * @copyright Curverider Ltd 2008 + * @link http://elgg.org/ + */ + + /** + * Dummy class. + * For every function call, get and set this function returns false. + */ + class ElggDummy { + + public function __call($method, $args) { + return false; + } + + function __get($name) { return false; } + + function __set($name, $value) { return false; } + } +?> \ No newline at end of file -- cgit v1.2.3