Эх сурвалжийг харах

remove unneeded destruct methods as GC has higher performance (#6631)

Co-authored-by: Tim Fry <[email protected]>
frytimo 2 жил өмнө
parent
commit
56c0d0ba70

+ 0 - 10
core/authentication/resources/classes/authentication.php

@@ -23,16 +23,6 @@ class authentication {
 
 	}
 
-	/**
-	 * Called when there are no references to a particular object
-	 * unset the variables used in the class
-	 */
-	public function __destruct() {
-		foreach ($this as $key => $value) {
-			unset($this->$key);
-		}
-	}
-
 	/**
 	 * validate uses authentication plugins to check if a user is authorized to login
 	 * @return array [plugin] => last plugin used to authenticate the user [authorized] => true or false

+ 0 - 10
core/dashboard/resources/classes/dashboard.php

@@ -61,16 +61,6 @@ if (!class_exists('dashboard')) {
 				$this->location = 'dashboard.php';
 		}
 
-		/**
-		 * called when there are no references to a particular object
-		 * unset the variables used in the class
-		 */
-		public function __destruct() {
-			foreach ($this as $key => $value) {
-				unset($this->$key);
-			}
-		}
-
 		/**
 		 * delete rows from the database
 		 */

+ 0 - 10
core/databases/resources/classes/databases.php

@@ -53,16 +53,6 @@ if (!class_exists('databases')) {
 
 		}
 
-		/**
-		 * called when there are no references to a particular object
-		 * unset the variables used in the class
-		 */
-		public function __destruct() {
-			foreach ($this as $key => $value) {
-				unset($this->$key);
-			}
-		}
-
 		/**
 		 * delete records
 		 */

+ 0 - 10
core/default_settings/resources/classes/default_settings.php

@@ -60,16 +60,6 @@ if (!class_exists('default_settings')) {
 				$this->location = 'default_settings.php';
 		}
 
-		/**
-		 * called when there are no references to a particular object
-		 * unset the variables used in the class
-		 */
-		public function __destruct() {
-			foreach ($this as $key => $value) {
-				unset($this->$key);
-			}
-		}
-
 		/**
 		 * delete rows from the database
 		 */

+ 0 - 10
core/domain_settings/resources/classes/domain_settings.php

@@ -63,16 +63,6 @@ if (!class_exists('domain_settings')) {
 
 		}
 
-		/**
-		 * called when there are no references to a particular object
-		 * unset the variables used in the class
-		 */
-		public function __destruct() {
-			foreach ($this as $key => $value) {
-				unset($this->$key);
-			}
-		}
-
 		/**
 		 * delete records
 		 */

+ 0 - 10
core/events/resources/classes/events.php

@@ -54,16 +54,6 @@ class events {
 			$this->required['headers'][] = "user_uuid";
 	}
 
-	/**
-	 * Called when there are no references to a particular object
-	 * unset the variables used in the class
-	 */
-	public function __destruct() {
-		foreach ($this as $key => $value) {
-			unset($this->$key);
-		}
-	}
-
 	/**
 	 * This function will load all available plugins into the memory
 	 * Rules:

+ 0 - 10
core/install/resources/classes/install.php

@@ -24,16 +24,6 @@ if (!class_exists('install')) {
 			$this->app_uuid = '75507e6e-891e-11e5-af63-feff819cdc9f';
 		}
 
-		/**
-		 * called when there are no references to a particular object
-		 * unset the variables used in the class
-		 */
-		public function __destruct() {
-			foreach ($this as $key => $value) {
-				unset($this->$key);
-			}
-		}
-
 		/**
 		 * <p>Used to create the config.conf file.</p>
 		 * <p>BSD /usr/local/etc/fusionpbx</p>

+ 0 - 10
core/user_logs/resources/classes/user_logs.php

@@ -59,16 +59,6 @@ if (!class_exists('user_logs')) {
 				$this->location = 'user_logs.php';
 		}
 
-		/**
-		 * called when there are no references to a particular object
-		 * unset the variables used in the class
-		 */
-		public function __destruct() {
-			foreach ($this as $key => $value) {
-				unset($this->$key);
-			}
-		}
-
 		/**
 		 * add user_logs
 		 */

+ 0 - 10
core/user_settings/resources/classes/user_settings.php

@@ -62,16 +62,6 @@ if (!class_exists('user_settings')) {
 
 		}
 
-		/**
-		 * called when there are no references to a particular object
-		 * unset the variables used in the class
-		 */
-		public function __destruct() {
-			foreach ($this as $key => $value) {
-				unset($this->$key);
-			}
-		}
-
 		/**
 		 * delete records
 		 */

+ 0 - 10
core/users/resources/classes/users.php

@@ -59,16 +59,6 @@ if (!class_exists('users')) {
 				$this->location = 'users.php';
 		}
 
-		/**
-		 * called when there are no references to a particular object
-		 * unset the variables used in the class
-		 */
-		public function __destruct() {
-			foreach ($this as $key => $value) {
-				unset($this->$key);
-			}
-		}
-
 		/**
 		 * delete rows from the database
 		 */

+ 0 - 10
resources/classes/cache.php

@@ -17,16 +17,6 @@ class cache {
 		//place holder
 	}
 
-	/**
-	 * Called when there are no references to a particular object
-	 * unset the variables used in the class
-	 */
-	public function __destruct() {
-		foreach ($this as $key => $value) {
-			unset($this->$key);
-		}
-	}
-
 	/**
 	 * Add a specific item in the cache
 	 * @var string $key		the cache id

+ 0 - 10
resources/classes/captcha.php

@@ -43,16 +43,6 @@ class captcha {
 
 	}
 
-	/**
-	 * Called when there are no references to a particular object
-	 * unset the variables used in the class
-	 */
-	public function __destruct() {
-		foreach ($this as $key => $value) {
-			unset($this->$key);
-		}
-	}
-
 	/**
 	 * Create the captcha image
 	 * @var string $code

+ 0 - 10
resources/classes/config.php

@@ -30,16 +30,6 @@ class config {
 		//place holder
 	}
 
-	/**
-	 * Called when there are no references to a particular object
-	 * unset the variables used in the class
-	 */
-	public function __destruct() {
-		foreach ($this as $key => $value) {
-			unset($this->$key);
-		}
-	}
-
 	/**
 	 * Determine whether the config.php exists
 	 * @var string $db_type - type of database

+ 0 - 10
resources/classes/database.php

@@ -383,16 +383,6 @@
 				}
 			}
 
-			/**
-			 * Called when there are no references to a particular object
-			 * unset the variables used in the class
-			 */
-			public function __destruct() {
-				foreach ($this as $key => $value) {
-					unset($this->$key);
-				}
-			}
-
 			/**
 			 * <p>Connect to the database.</p>
 			 * <p>Database driver must be set before calling connect.</p>

+ 0 - 10
resources/classes/domains.php

@@ -61,16 +61,6 @@ if (!class_exists('domains')) {
 				$this->location = 'domains.php';
 		}
 
-		/**
-		 * called when there are no references to a particular object
-		 * unset the variables used in the class
-		 */
-		public function __destruct() {
-			foreach ($this as $key => $value) {
-				unset($this->$key);
-			}
-		}
-
 		/**
 		 * delete rows from the database
 		 */

+ 0 - 10
resources/classes/email.php

@@ -66,16 +66,6 @@ if (!class_exists('email')) {
 			$this->read_confirmation = false;
 		}
 
-		/**
-		 * called when there are no references to a particular object
-		 * unset the variables used in the class
-		 */
-		public function __destruct() {
-			foreach ($this as $key => $value) {
-				unset($this->$key);
-			}
-		}
-
 		/**
 		 * parse raw emails
 		 */

+ 0 - 10
resources/classes/file.php

@@ -20,16 +20,6 @@ class file {
 		//place holder
 	}
 
-	/**
-	 * Called when there are no references to a particular object
-	 * unset the variables used in the class
-	 */
-	public function __destruct() {
-		foreach ($this as $key => $value) {
-			unset($this->$key);
-		}
-	}
-
 	/**
 	 * Glob search for a list of files
 	 * @var string $dir			this is the directory to scan

+ 0 - 10
resources/classes/groups.php

@@ -55,16 +55,6 @@ if (!class_exists('groups')) {
 				$this->app_uuid = '2caf27b0-540a-43d5-bb9b-c9871a1e4f84';
 		}
 
-		/**
-		 * called when there are no references to a particular object
-		 * unset the variables used in the class
-		 */
-		public function __destruct() {
-			foreach ($this as $key => $value) {
-				unset($this->$key);
-			}
-		}
-
 		/**
 		 * delete rows from the database
 		 */

+ 0 - 10
resources/classes/menu.php

@@ -59,16 +59,6 @@ if (!class_exists('menu')) {
 				$this->location = 'menus.php';
 		}
 
-		/**
-		 * called when there are no references to a particular object
-		 * unset the variables used in the class
-		 */
-		public function __destruct() {
-			foreach ($this as $key => $value) {
-				unset($this->$key);
-			}
-		}
-
 		/**
 		 * delete rows from the database
 		 */

+ 0 - 10
resources/classes/switch_settings.php

@@ -19,16 +19,6 @@ if (!class_exists('switch_settings')) {
 
 		}
 
-		/**
-		 * Called when there are no references to a particular object
-		 * unset the variables used in the class
-		 */
-		public function __destruct() {
-			foreach ($this as $key => $value) {
-				unset($this->$key);
-			}
-		}
-
 		/**
 		 * settings Set switch directories in default settings
 		 */

+ 0 - 6
resources/classes/template.php

@@ -65,12 +65,6 @@
 				}
 			}
 
-			public function __destruct() {
-				foreach ($this as $key => $value) {
-					unset($this->$key);
-				}
-			}
-
 			public function assign($key, $value) {
 				if ($this->engine === 'smarty') {
 					$this->object->assign($key, $value);

+ 0 - 10
resources/classes/text.php

@@ -50,16 +50,6 @@ class text {
 			}
 	}
 
-	/**
-	 * Called when there are no references to a particular object
-	 * unset the variables used in the class
-	 */
-	public function __destruct() {
-		if (is_array($this)) foreach ($this as $key => $value) {
-			unset($this->$key);
-		}
-	}
-
 	/**
 	 * Get a specific item from the cache
 	 * @var string $language_code	examples: en-us, es-cl, fr-fr, pt-pt

+ 0 - 10
resources/classes/token.php

@@ -43,16 +43,6 @@ class token {
 
 	}
 
-	/**
-	 * Called when there are no references to a particular object
-	 * unset the variables used in the class
-	 */
-	public function __destruct() {
-		foreach ($this as $key => $value) {
-			unset($this->$key);
-		}
-	}
-
 	/**
 	 * Create the token
 	 * @var string $key

+ 0 - 10
resources/classes/vcard.php

@@ -62,16 +62,6 @@ class vcard {
 		return true;
 	}
 
-	/**
-	 * Called when there are no references to a particular object
-	 * unset the variables used in the class
-	 */
-	public function __destruct() {
-		foreach ($this as $key => $value) {
-			unset($this->$key);
-		}
-	}
-
 	/*
 	build() method checks all the values, builds appropriate defaults for
 	missing values, generates the vcard data string.