]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #2473: removes initialise_entity_cache()
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 20 Nov 2010 08:16:24 +0000 (08:16 +0000)
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 20 Nov 2010 08:16:24 +0000 (08:16 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7365 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/classes/ElggEntity.php
engine/lib/entities.php
engine/tests/objects/entities.php

index 693b333cb44247befac5e74be208288c2fec838a..0cf3da8fa3c9797915d4412eafd867df96678163 100644 (file)
@@ -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') {
index 3ba4164533248cf35731345298f8fc35813f9f09..cac2e2959fefe32d1e4f2b1c035b402e76826b75 100644 (file)
@@ -13,7 +13,7 @@
  * @global array $ENTITY_CACHE
  * @access private
  */
-$ENTITY_CACHE = NULL;
+$ENTITY_CACHE = array();
 
 /**
  * Cache subtypes and related class names once loaded.
@@ -23,21 +23,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.
  *
index 954b4947f4a04fb69c47568838b0bf185528ff89..24c6859b11e24b481e3d7e26e7bc96689a520ee3 100644 (file)
@@ -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');
        }