Explorar o código

Update the constructor in the vcard class.

markjcrane %!s(int64=9) %!d(string=hai) anos
pai
achega
ca86567ef7
Modificáronse 1 ficheiros con 15 adicións e 5 borrados
  1. 15 5
      resources/classes/vcard.php

+ 15 - 5
resources/classes/vcard.php

@@ -13,10 +13,10 @@ class vcard {
 	var $revision_date;
 	var $card;
 
-	/*
-	The class constructor. You can set some defaults here if desired.
-	*/
-	function vcard() {
+	/**
+	 * Called when the object is created
+	 */
+	public function __construct() {
 	$this->log = "New vcard() called<br />";
 	$this->data = array(
 		"display_name"=>null
@@ -59,7 +59,17 @@ class vcard {
 		,"sort_string"=>null
 		,"note"=>null
 		);
-	return true;
+		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);
+		}
 	}
 
 	/*