aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-20 08:16:24 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-20 08:16:24 +0000
commit468f0f9406c22a54a109028131d5f7cb56bd0f4e (patch)
tree9a76d153ef3846c9ef5793241e7e87d01e76a71c
parent51f2b120faf78b7224a42b769cb99c2620ae9030 (diff)
downloadelgg-468f0f9406c22a54a109028131d5f7cb56bd0f4e.tar.gz
elgg-468f0f9406c22a54a109028131d5f7cb56bd0f4e.tar.bz2
Fixes #2473: removes initialise_entity_cache()
git-svn-id: http://code.elgg.org/elgg/trunk@7365 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/classes/ElggEntity.php6
-rw-r--r--engine/lib/entities.php17
-rw-r--r--engine/tests/objects/entities.php4
3 files changed, 3 insertions, 24 deletions
diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php
index 693b333cb..0cf3da8fa 100644
--- a/engine/classes/ElggEntity.php
+++ b/engine/classes/ElggEntity.php
@@ -84,8 +84,6 @@ abstract class ElggEntity extends ElggData implements
protected function initializeAttributes() {
parent::initializeAttributes();
- initialise_entity_cache();
-
$this->attributes['guid'] = "";
$this->attributes['type'] = "";
$this->attributes['subtype'] = "";
@@ -655,8 +653,8 @@ abstract class ElggEntity extends ElggData implements
*
* @param int $user_guid The user.
* @param string $type The type of entity we're looking to write
- * @param string $subtype The subtype of the entity we're looking to write
- *
+ * @param string $subtype The subtype of the entity we're looking to write
+ *
* @return bool
*/
public function canWriteToContainer($user_guid = 0, $type = 'all', $subtype = 'all') {
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 3ba416453..cac2e2959 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -13,7 +13,7 @@
* @global array $ENTITY_CACHE
* @access private
*/
-$ENTITY_CACHE = NULL;
+$ENTITY_CACHE = array();
/**
* Cache subtypes and related class names once loaded.
@@ -24,21 +24,6 @@ $ENTITY_CACHE = NULL;
$SUBTYPE_CACHE = NULL;
/**
- * Initialise the entity cache.
- *
- * @return void
- * @todo remove this.
- * @access private
- */
-function initialise_entity_cache() {
- global $ENTITY_CACHE;
-
- if (!$ENTITY_CACHE) {
- $ENTITY_CACHE = array();
- }
-}
-
-/**
* Invalidate this class's entry in the cache.
*
* @param int $guid The entity guid
diff --git a/engine/tests/objects/entities.php b/engine/tests/objects/entities.php
index 954b4947f..24c6859b1 100644
--- a/engine/tests/objects/entities.php
+++ b/engine/tests/objects/entities.php
@@ -138,10 +138,6 @@ class ElggCoreEntityTest extends ElggCoreUnitTest {
public function testElggEntityCache() {
global $ENTITY_CACHE;
- $ENTITY_CACHE = NULL;
-
- $this->assertNull($ENTITY_CACHE);
- initialise_entity_cache();
$this->assertIsA($ENTITY_CACHE, 'array');
}