note 87864 deleted from language.oop5.autoload by danbrown

From: Date: Thu, 01 Jan 2009 00:59:32 +0000
Subject: note 87864 deleted from language.oop5.autoload by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-148738@lists.php.net to get a copy of this message
Note Submitter: zack_gold at yahoo dot com ---- I found out a neat way to centralize one single class which will give accessibility to other classes. [php]<?php class Bot { private $classes = array ( 'Socket' => "connection/class.Socket.php", 'Input' => "io/class.Input.php", 'Output' => "io/class.Output.php", 'Parse' => "io/parse/class.Parse.php" ); public $Socket, $Input, $Output, $Parse; // Accessible by other classes public function __construct(){ foreach($this->classes as $class => $path){ require($path); $this->$class = new $class($this); } } } ?>[/php]

« previous php.notes (#148738) next »