RE: [PHP] Structuring large PHP programs

From: Date: Fri, 16 Feb 2001 03:31:06 +0000
Subject: RE: [PHP] Structuring large PHP programs
Groups: php.general 
Request: Send a blank email to php-general+get-40087@lists.php.net to get a copy of this message
A large application should be a set of well organized files having one single include at the top. And in that include you do all kind of things. Of course auto_prepend works always better /... but not always possible, right... use classes, reuse files ... libraries etc ... Cheers, Maxim Maletsky -----Original Message----- From: John McCreesh [mailto:john.mccreesh@nospam.cwcom.net] Sent: Thursday, February 15, 2001 5:25 AM To: php-general@lists.php.net Subject: [PHP] Structuring large PHP programs What is the best practice for structuring a PHP program which is becoming too large to manage as a single file? Should it be broken into a number of includes, e.g.: switch ($whatever) { case 0: include('case0.php'); break; case 1: include('case1.php'); break; case 2: include('case2.php'); break; } or a number of functions: require('mylib'); switch ($whatever) { case 0: case0(); break; case 1: case1(); break; case 2: case3(); break; } Any thoughts, references to articles (couldn't find anything in PHPBuilder), etc gratefully received... Thanks - John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#40087) next »