begin process at 2012 05 27 17:58:01
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Class et Objet ( POO )

 > [PHP5] COLLECTION UTILISATEURS - LES ITERATEURS EN PHP

[PHP5] COLLECTION UTILISATEURS - LES ITERATEURS EN PHP


 Information sur la source

Note :
10 / 10 - par 1 personne
10,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Class et Objet ( POO ) Classé sous :spl, collection, modules, iterator, itérateurs Niveau :Expert Date de création :21/11/2006 Date de mise à jour :21/11/2006 13:51:16 Vu / téléchargé :7 227 / 270

Auteur : malalam

Ecrire un message privé
Site perso
Commentaire sur cette source (3)
Ajouter un commentaire et/ou une note

 Description

Dans le cadre de ma croisade pour faire connaitre les itérateurs, voici un package utilisant l'idée de FhX dans son package de gestion des modules :
http://www.phpcs.com/codes/PHP5-GESTION-MODULES -OBJET_40315.aspx

J'ai utilisé le même squelette, en ajoutant quelques niveaux, en transformant les modules en utilisateurs, et en ajoutant  des possibilités offertes par les itérateurs.

Mon idée de base était la gestion d'une collection d'instances possedant, elles, des modules (d'où la profondeur supplémentaire). Pour faire simple, j'ai pris comme instances des classes utilisateurs, et pour modules de ces instances, leurs propriétés : ID, EMAIL, NOM...

Je crée ma collection d'utilisateurs dans la classe abstraite oCore, et je l'utilise via oSystem.
oSystem permet de traverser ma collection comme je le veux.
Comme mon package précédent, SMARTDIR, j'utilise des filtres pour traverser à ma guise ma collection.

Je pense que l'exemple est assez clair. Si vous voulez plus d'explication...demandez-moi :-)

Source

  • <?php
  • if (!class_exists ('RecursiveArrayIterator')) { // PHP5 < 5.1
  • class RecursiveArrayIterator extends ArrayIterator implements RecursiveIterator {
  • private $ref;
  • function hasChildren () {
  • return is_array ($this -> current ());
  • }
  • function getChildren () {
  • if ($this -> current () instanceof self) {
  • return $this -> current ();
  • }
  • if (empty ($this -> ref)) {
  • $this -> ref = new ReflectionClass ($this);
  • }
  • return $this -> ref -> newInstance($this -> current ());
  • }
  • }
  • }
  • class myFilter extends FilterIterator {
  • private $oIt = null;
  • private $mFilter = null;
  • private $mSubFilter = null;
  • public function __construct ($oIt, $mFilter = null, $mSubFilter = null) {
  • parent::__construct ($oIt);
  • $this -> oIt = $oIt;
  • $this -> mFilter = $mFilter;
  • $this -> mSubFilter = $mSubFilter;
  • }
  • public function accept () {
  • if (is_string ($this -> mFilter)) {
  • if ($this -> oIt -> key () === $this -> mFilter && $this -> oIt -> getDepth () === 1) {
  • return true;
  • }
  • if ($this -> oIt -> key () !== $this -> mFilter && $this -> oIt -> getDepth () === 1) {
  • return false;
  • }
  • if ($this -> oIt -> getDepth () > 1 && $this -> oIt -> getSubIterator (1) -> key () === $this -> mFilter) {
  • if (!is_null ($this -> mSubFilter)) {
  • if ($this -> key () === $this -> mSubFilter) {
  • return true;
  • }
  • return false;
  • }
  • return true;
  • }
  • return false;
  • }
  • return true;
  • }
  • }
  • abstract class oCore extends RecursiveArrayIterator {
  • private static $aRef = array ();
  • private $mFilter = null;
  • private $mSubFilter = null;
  • private $aCanBeSet = array (
  • 'FILTER',
  • 'SUBFILTER'
  • );
  • const ERROR_USER_ALREADY_EXISTS = '{__USER__} has already been instanciated';
  • const ERROR_USER_NOT_EXISTS = '{__USER__} is not an existing User';
  • const ERROR_NOT_SETABLE = '{__PROP__} is not a setable property';
  • const ERROR_ID_IS_NULL = 'Cannot collect a user with a null ID';
  • public function __construct () {
  • if (is_null ($this -> iUserId)) {
  • throw new Exception (self::ERROR_ID_IS_NULL);
  • }
  • if (array_key_exists ($this -> iUserId, self::$aRef)) {
  • throw new Exception (str_replace ('{__USER__}', $this -> iUserId, self::ERROR_USER_ALREADY_EXISTS));
  • }
  • self::$aRef[$this -> iUserId] = $this -> aFields;
  • }
  • public function getProps () {
  • if (!is_null ($this -> mFilter)) {
  • if (is_string ($this -> mFilter)) {
  • return new myFilter (new RecursiveIteratorIterator (new RecursiveArrayIterator (self::$aRef), true), $this -> mFilter, $this -> mSubFilter);
  • }
  • if (is_int ($this -> mFilter)) {
  • if (!isset (self::$aRef[$this -> mFilter])) {
  • throw new Exception (str_replace ('{__USER__}', $this -> iUserId, self::ERROR_USER_NOT_EXISTS));
  • }
  • return new RecursiveIteratorIterator (new RecursiveArrayIterator(self::$aRef[$this -> mFilter]), true);
  • }
  • }
  • return new RecursiveIteratorIterator (new RecursiveArrayIterator (self::$aRef), true);
  • }
  • public function __destruct() {
  • self::$aRef[$this -> iUserId] = null;
  • }
  • public function __set ($sProp, $mVal) {
  • if (!in_array ($sProp, $this -> aCanBeSet)) {
  • throw new Exception (str_replace ('{__PROP__}', $sProp, self::ERROR_NOT_SETABLE));
  • }
  • switch ($sProp) {
  • case 'FILTER' :
  • $this -> mFilter = $mVal;
  • break;
  • case 'SUBFILTER' :
  • $this -> mSubFilter = $mVal;
  • break;
  • }
  • }
  • }
  • class oSystem extends oCore {
  • private static $oInstance = null;
  • public function __construct () {
  • }
  • public static function getInstance () {
  • if (!isset(self::$oInstance)) {
  • self::$oInstance = new self;
  • }
  • return self::$oInstance;
  • }
  • public function __destruct () {
  • self::$oInstance = null;
  • }
  • }
  • class oUser extends oCore {
  • protected $aFields = array ();
  • private $oDB = null;
  • protected $iUserId;
  • const ERROR_NO_DB_OBJECT = 'variable passed is not an object';
  • const ERROR_WRONG_SET_PROP = '{__PROP__} is not a valid setable property';
  • const ERROR_WRONG_GET_PROP = '{__PROP__} is not a valid getable property';
  • const ERROR_ID_NOT_INTEGER = '{__VAL__} is not a valid value por USER_ID : must be an integer';
  • private $aUserCanBeGet = array (
  • 'NO_DB_OBJECT',
  • 'USER_ID'
  • );
  • private $aUserCanBeSet = array (
  • 'FIELD',
  • 'USER_ID'
  • );
  • public function __construct ($oDB = null) {
  • /*
  • if (!is_object ($oDB)) {
  • throw new Exception (self::ERROR_NO_DB_OBJECT);
  • }
  • */
  • }
  • public function collect () {
  • parent::__construct ();
  • }
  • public function __get ($sProp) {
  • if (!in_array ($sProp, $this -> aUserCanBeGet)) {
  • throw new Exception (str_replace ('{__PROP__}', $sProp, self::ERROR_WRONG_GET_PROP));
  • }
  • switch ($sProp) {
  • case 'NO_DB_OBJECT' :
  • case 'WRONG_PROP' :
  • return $this -> aExceptions[$sProp];
  • break;
  • default :
  • return false;
  • break;
  • }
  • }
  • public function __set ($sProp, $mVal) {
  • if (!in_array ($sProp, $this -> aUserCanBeSet) && false === array_key_exists($sProp, $this -> aFields)) {
  • throw new Exception (str_replace ('{__PROP__}', $sProp, self::ERROR_WRONG_SET_PROP));
  • }
  • switch ($sProp) {
  • case 'FIELD' :
  • $this -> aFields[$mVal] = true;
  • break;
  • case 'USER_ID' :
  • if (!is_int ($mVal)) {
  • throw new Exception (str_replace ('{__VAL__}', $mVal, self::ERROR_ID_NOT_INTEGER));
  • }
  • $this -> iUserId = $mVal;
  • break;
  • default :
  • $this -> aFields[$sProp] = $mVal;
  • break;
  • }
  • }
  • }
  • /**
  • * EXEMPLES
  • */
  • try {
  • $a = new oUser;
  • $a -> USER_ID = 666;
  • $a -> FIELD = 'EMAIL';
  • $a -> FIELD = 'NOM';
  • $a -> FIELD = 'PRENOM';
  • $a -> EMAIL = array ('VALUE' => 'a.a@a.com', 'TYPE' => 'STRING', 'PATTERN' => 'EMAIL');
  • $a -> NOM = array ('VALUE' => 'Durand', 'TYPE' => 'STRING','PATTERN' => 'TEXT');
  • $a -> PRENOM = array ('VALUE' => 'Paul', 'TYPE' => 'STRING', 'PATTERN' => 'TEXT');
  • $a -> collect ();
  • } catch (Exception $e) {
  • echo $e -> getMessage (), ' => ', $e -> getLine ();
  • }
  • try {
  • $b = new oUser;
  • $b -> USER_ID = 999;
  • $b -> FIELD = 'EMAIL';
  • $b -> FIELD = 'NOM';
  • $b -> FIELD = 'PRENOM';
  • $b -> EMAIL = array ('VALUE' => 'b.b@b.com', 'TYPE' => 'STRING', 'PATTERN' => 'EMAIL');
  • $b -> NOM = array ('VALUE' => 'Dubois', 'TYPE' => 'STRING','PATTERN' => 'TEXT');
  • $b -> PRENOM = array ('VALUE' => 'René', 'TYPE' => 'STRING', 'PATTERN' => 'TEXT');
  • $b -> collect ();
  • } catch (Exception $e) {
  • echo $e -> getMessage (), ' => ', $e -> getLine ();
  • }
  • try {
  • $oSys = new oSystem;
  • } catch (Exception $e) {
  • echo $e -> getMessage (), ' => ', $e -> getLine ();
  • }
  • echo '<strong>All Properties</strong><br />';
  • try {
  • $iIt = $oSys -> getProps ();
  • foreach ($iIt as $sK => $sV) {
  • echo str_repeat ('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $iIt -> getDepth ()), $sK, ' => ', $sV, '<br />';
  • }
  • } catch (Exception $e) {
  • echo $e -> getMessage (), ' => ', $e -> getLine ();
  • }
  • echo '<br /><br /><strong>All Emails</strong><br />';
  • try {
  • $oSys -> FILTER = 'EMAIL';
  • $iIt = $oSys -> getProps ();
  • foreach ($iIt as $sK => $sV) {
  • echo str_repeat ('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $iIt -> getDepth () - 1), $sK, ' => ', $sV, '<br />';
  • //echo $sK, ' => ', $sV, '<br />'; PHP 5 < 5.1
  • }
  • } catch (Exception $e) {
  • echo $e -> getMessage (), ' => ', $e -> getLine ();
  • }
  • echo '<br /><br /><strong>All Emails Value</strong><br />';
  • try {
  • $oSys -> FILTER = 'EMAIL';
  • $oSys -> SUBFILTER = 'VALUE';
  • $iIt = $oSys -> getProps ();
  • foreach ($iIt as $sK => $sV) {
  • echo str_repeat ('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $iIt -> getDepth () - 1), $sK, ' => ', $sV, '<br />';
  • //echo $sK, ' => ', $sV, '<br />'; // PHP 5 < 5.1
  • }
  • } catch (Exception $e) {
  • echo $e -> getMessage (), ' => ', $e -> getLine ();
  • }
  • echo '<br /><br /><strong>Only user ID 666</strong><br />';
  • try {
  • $oSys -> FILTER = 666;
  • $oSys -> SUBFILTER = null;
  • $iIt = $oSys -> getProps ();
  • foreach ($iIt as $sK => $sV) {
  • echo str_repeat ('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $iIt -> getDepth ()), $sK, ' => ', $sV, '<br />';
  • }
  • } catch (Exception $e) {
  • echo $e -> getMessage (), ' => ', $e -> getLine ();
  • }
  • ?>
<?php
if (!class_exists ('RecursiveArrayIterator')) { // PHP5 < 5.1
	class RecursiveArrayIterator extends ArrayIterator implements RecursiveIterator {

		private $ref;

		function hasChildren () {
			return is_array ($this -> current ());
		}

		function getChildren () {
			if ($this -> current () instanceof self) {
				return $this -> current ();
			}
			if (empty ($this -> ref)) {
				$this -> ref = new ReflectionClass ($this);
			}
		return $this -> ref -> newInstance($this -> current ());
		}
	}
}

class myFilter extends FilterIterator  {

	private $oIt = null;
	private $mFilter = null;
	private $mSubFilter = null;

    public function __construct ($oIt, $mFilter = null, $mSubFilter = null) {
        parent::__construct ($oIt);
        $this -> oIt = $oIt;
        $this -> mFilter = $mFilter;
        $this -> mSubFilter = $mSubFilter;
    }

    public function accept () {
        if (is_string ($this -> mFilter)) {
        	if ($this -> oIt -> key () === $this -> mFilter && $this -> oIt -> getDepth () === 1) {
        		return true;
        	}
        	if ($this -> oIt -> key () !== $this -> mFilter && $this -> oIt -> getDepth () === 1) {
				return false;
        	}
        	if ($this -> oIt -> getDepth () > 1 && $this -> oIt -> getSubIterator (1) -> key () === $this -> mFilter) {
        		if (!is_null ($this -> mSubFilter)) {
        			if ($this -> key () === $this -> mSubFilter) {
        				return true;
        			}
        			return false;
        		}
        		return true;
        	}
        	return false;
        }
        return true;
    }

}

abstract class oCore extends RecursiveArrayIterator {

	private static $aRef = array ();
	private $mFilter = null;
	private $mSubFilter = null;
	private $aCanBeSet = array (
	'FILTER',
	'SUBFILTER'
	);

	const ERROR_USER_ALREADY_EXISTS = '{__USER__} has already been instanciated';
	const ERROR_USER_NOT_EXISTS = '{__USER__} is not an existing User';
	const ERROR_NOT_SETABLE = '{__PROP__} is not a setable property';
	const ERROR_ID_IS_NULL = 'Cannot collect a user with a null ID';

	public function __construct () {
		if (is_null ($this -> iUserId)) {
			throw new Exception (self::ERROR_ID_IS_NULL);
		}
		if (array_key_exists ($this -> iUserId, self::$aRef)) {
			throw new Exception (str_replace ('{__USER__}', $this -> iUserId, self::ERROR_USER_ALREADY_EXISTS));
		}
		self::$aRef[$this -> iUserId] = $this -> aFields;
	}


	public function getProps () {
		if (!is_null ($this -> mFilter)) {
			if (is_string ($this -> mFilter)) {
				return new myFilter (new RecursiveIteratorIterator (new RecursiveArrayIterator (self::$aRef), true), $this -> mFilter, $this -> mSubFilter);
			}
			if (is_int ($this -> mFilter)) {
				if (!isset (self::$aRef[$this -> mFilter])) {
					throw new Exception (str_replace ('{__USER__}', $this -> iUserId, self::ERROR_USER_NOT_EXISTS));
				}
				return new RecursiveIteratorIterator (new RecursiveArrayIterator(self::$aRef[$this -> mFilter]), true);
			}
		}
		return new RecursiveIteratorIterator (new RecursiveArrayIterator (self::$aRef), true);
	}

	public function __destruct() {
		self::$aRef[$this -> iUserId] = null;
	}

	public function __set ($sProp, $mVal) {
		if (!in_array ($sProp, $this -> aCanBeSet)) {
			throw new Exception (str_replace ('{__PROP__}', $sProp, self::ERROR_NOT_SETABLE));
		}
		switch ($sProp) {
			case 'FILTER' :
				$this -> mFilter = $mVal;
				break;
			case 'SUBFILTER' :
				$this -> mSubFilter = $mVal;
				break;
		}
	}

}

class oSystem extends oCore {

	private static $oInstance = null;

	public function __construct () {

	}

	public static function getInstance () {
		if (!isset(self::$oInstance)) {
			self::$oInstance = new self;
		}
		return self::$oInstance;
	}

	public function __destruct () {
		self::$oInstance = null;
	}

}

class oUser extends oCore {

	protected $aFields = array ();

	private $oDB = null;

	protected $iUserId;

	const ERROR_NO_DB_OBJECT = 'variable passed is not an object';
	const ERROR_WRONG_SET_PROP = '{__PROP__} is not a valid setable property';
	const ERROR_WRONG_GET_PROP = '{__PROP__} is not a valid getable property';
	const ERROR_ID_NOT_INTEGER = '{__VAL__} is not a valid value por USER_ID : must be an integer';

	private $aUserCanBeGet = array (
		'NO_DB_OBJECT',
		'USER_ID'
	);

	private $aUserCanBeSet = array (
		'FIELD',
		'USER_ID'
	);

	public function __construct ($oDB = null) {
		/*
		if (!is_object ($oDB)) {
			throw new Exception (self::ERROR_NO_DB_OBJECT);
		}
		*/
	}

	public function collect () {
		parent::__construct ();
	}

	public function __get ($sProp) {
		if (!in_array ($sProp, $this -> aUserCanBeGet)) {
			throw new Exception (str_replace ('{__PROP__}', $sProp, self::ERROR_WRONG_GET_PROP));
		}
		switch ($sProp) {
			case 'NO_DB_OBJECT' :
			case 'WRONG_PROP' :
				return $this -> aExceptions[$sProp];
				break;
			default :
				return false;
				break;
		}
	}

	public function __set ($sProp, $mVal) {
		if (!in_array ($sProp, $this -> aUserCanBeSet) && false === array_key_exists($sProp, $this -> aFields)) {
			throw new Exception (str_replace ('{__PROP__}', $sProp, self::ERROR_WRONG_SET_PROP));
		}
		switch ($sProp) {
			case 'FIELD' :
				$this -> aFields[$mVal] = true;
				break;
			case 'USER_ID' :
				if (!is_int ($mVal)) {
					throw new Exception (str_replace ('{__VAL__}', $mVal, self::ERROR_ID_NOT_INTEGER));
				}
				$this -> iUserId = $mVal;
				break;
			default :
				$this -> aFields[$sProp] = $mVal;
				break;
		}
	}
}
/**
 * EXEMPLES
 */
try {
	$a = new oUser;
	$a -> USER_ID = 666;
	$a -> FIELD = 'EMAIL';
	$a -> FIELD = 'NOM';
	$a -> FIELD = 'PRENOM';
	$a -> EMAIL = array ('VALUE' => 'a.a@a.com', 'TYPE' => 'STRING', 'PATTERN' => 'EMAIL');
	$a -> NOM = array ('VALUE' => 'Durand', 'TYPE' => 'STRING','PATTERN' => 'TEXT');
	$a -> PRENOM = array ('VALUE' => 'Paul', 'TYPE' => 'STRING', 'PATTERN' => 'TEXT');
	$a -> collect ();
} catch (Exception $e) {
	echo $e -> getMessage (), ' => ', $e -> getLine ();
}

try {
	$b = new oUser;
	$b -> USER_ID = 999;
	$b -> FIELD = 'EMAIL';
	$b -> FIELD = 'NOM';
	$b -> FIELD = 'PRENOM';
	$b -> EMAIL = array ('VALUE' => 'b.b@b.com', 'TYPE' => 'STRING', 'PATTERN' => 'EMAIL');
	$b -> NOM = array ('VALUE' => 'Dubois', 'TYPE' => 'STRING','PATTERN' => 'TEXT');
	$b -> PRENOM = array ('VALUE' => 'René', 'TYPE' => 'STRING', 'PATTERN' => 'TEXT');
	$b -> collect ();
} catch (Exception $e) {
	echo $e -> getMessage (), ' => ', $e -> getLine ();
}

try {
	$oSys = new oSystem;
} catch (Exception $e) {
	echo $e -> getMessage (), ' => ', $e -> getLine ();
}

echo '<strong>All Properties</strong><br />';
try {
	$iIt = $oSys -> getProps ();
	foreach ($iIt as $sK => $sV) {
		echo str_repeat ('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $iIt -> getDepth ()), $sK, ' => ', $sV, '<br />';
	}
} catch (Exception $e) {
	echo $e -> getMessage (), ' => ', $e -> getLine ();
}

echo '<br /><br /><strong>All Emails</strong><br />';
try {
	$oSys -> FILTER = 'EMAIL';
	$iIt = $oSys -> getProps ();
	foreach ($iIt as $sK => $sV) {
		echo str_repeat ('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $iIt -> getDepth () - 1), $sK, ' => ', $sV, '<br />';
		//echo $sK, ' => ', $sV, '<br />'; PHP 5 < 5.1
	}
} catch (Exception $e) {
	echo $e -> getMessage (), ' => ', $e -> getLine ();
}

echo '<br /><br /><strong>All Emails Value</strong><br />';
try {
	$oSys -> FILTER = 'EMAIL';
	$oSys -> SUBFILTER = 'VALUE';
	$iIt = $oSys -> getProps ();
	foreach ($iIt as $sK => $sV) {
		echo str_repeat ('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $iIt -> getDepth () - 1), $sK, ' => ', $sV, '<br />';
		//echo $sK, ' => ', $sV, '<br />'; // PHP 5 < 5.1
	}
} catch (Exception $e) {
	echo $e -> getMessage (), ' => ', $e -> getLine ();
}

echo '<br /><br /><strong>Only user ID 666</strong><br />';
try {
	$oSys -> FILTER = 666;
	$oSys -> SUBFILTER = null;
	$iIt = $oSys -> getProps ();
	foreach ($iIt as $sK => $sV) {
		echo str_repeat ('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $iIt -> getDepth ()), $sK, ' => ', $sV, '<br />';
	}
} catch (Exception $e) {
	echo $e -> getMessage (), ' => ', $e -> getLine ();
}
?>


 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip


 Historique

21 novembre 2006 13:51:16 :
Optimisation et ajout d'une compatibilité avec les versions de PHP5 < PHP5.1

 Sources du même auteur

Source avec Zip ASTUCES/HACK PHP
SQUELETTE DE GESTION DES DROITS
[PHP 5.1] CLASS STRING : NOUVEL EXEMPLE SUR LA SPL
Source avec Zip Source avec une capture [PHP 5.1] PHOTOPHOP (PHPDRAW 2)
Source avec Zip Source avec une capture [PHP5.1] O-LOC : CLASSE ET BACKOFFICE D'INTERNATIONALISATION

 Sources de la même categorie

Source avec Zip GÉNÉRATION AUTOMATIQUE DE FICHIER .CLASS.PHP EN FONCTION D'U... par ig3
CLASSE D'OBJET DE CRYPTAGE ET DÉCRYPTAGE DE CHAINES DE CARAC... par 8Tnerolf8
Source avec Zip MY.DEVIANTART API par inwebo
CLASSE DE GESTION DE "VARIABLES GLOBALES D'ENVIRONNEMENT" par pifou25
Source avec Zip COLLECTION.CLASS.MIN.PHP par thunderhunter

 Sources en rapport avec celle ci

Source avec Zip COLLECTION.CLASS.MIN.PHP par thunderhunter
Source avec Zip GESTION DE FICHIERS AVEC LA SPL par alphanono
Source avec Zip HASHMAP EN PHP AVEC LA SPL par dorian91
[PHP 5.1] CLASS STRING : NOUVEL EXEMPLE SUR LA SPL par malalam
Source avec Zip [PHP5] PACKAGE USERS - GESTION UTILISATEURS - LES ITERATEURS... par malalam

Commentaires et avis

Commentaire de FhX le 22/11/2006 22:23:59

J'adore :p

Commentaire de malalam le 23/11/2006 08:12:14 administrateur CS

m'étonne pas ;-) C'est de la poo, et y a des exceptions et des try catch partout ;-)

En tous cas, ce code prouve que ta gestion de module marche à merveille, et s'adapte facilement. Le principe que j'ai utilisé est rigoureusement le même que le tien, je l'ai juste adapté à mes envies du moment.

Commentaire de jean84 le 24/11/2006 19:34:36

En 1 mot : impressionnant !
J'ai pas encore tout capte mais j'etudie avec attention. Vraiment impressionnant (quand je pense que certains dise que php est un lanaguage trop facile, je le ferais lire ta source tiens !)

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

[SPL] Une variable objet comme clé de l'interface Iterator [ par LocalStone ] Salut à tous, Alors voilà ma question : est-il possible d'utiliser l'interface Iterator (ou tout interface qui permettent le parcours d'un objet avec Interface Iterator et problème de conception. [ par LocalStone ] Salut à tous, Alors voilà ... Un nouveau post, un nouveau problème ! Mais par contre, on continue avec l'interface Iterator.Pour un projet, j'ai du c Besoin d'aide pour un système de pointage [ par tibecreator1 ] Besoin d'aide pour un système de pointage. Je vous demande pas de le faire mais de me montrer comment a .htaccess supprimé mais accès impossible [ par ThunderDog ] Bonjour ....Voilà, j'ai un site en PHPnuke-Platinium pour mon clan de jeu en réseau ....Tout tournait bien jusqu'au jour ou je me suis fait hacker un Comment inclure un fichier sans qu'il ait accès aux variables ? [ par antoineherault ] Bonjour !Je suis actuellement en train d'essayer de faire un script évolutif fonctionnant gràce à un système de modules.Ce système doit être sécurisé PHP5 -> SPL , tri sur DirectoryIterator [ par stailer ] Bonjour, J'utilise la classe DirectoryIterator pour lister tous les répertoires et fichiers d'un chemin. Grâce à isFile je peux lister uniquement les Architecture Réseau Social [ par WhiteDwarf ] Bonjour,Je suis développeur amateur et me suis lancé il y a quelques mois dans la réalisation d'un réseau social.Je ne suis pas mauvais en développeme Avis sur la façon de procéder ? [ par g_barthe ] Bonjour,Je me suis mis il y a déjà quelques mois à développer un outils de gestion de collections (BD, CD, étiquettes de vins...) pour les collectionn Récupérer par session [ par bibo06 ] Bonjour, J'ai posé une question sur un forum on l'on pas mal avancé, mais on est resté bloqué sur un petit problème, peut être pourriez vous me filer programme [ par arfaauto ] &lt;!--script du formulaire principale--&gt;   &lt;form name="form1" method="post" action="sauvegarder.php3"&gt;idinsription:&lt;br&gt;&lt;in


Nos sponsors


Sondage...

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,310 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales