[Phplib-users] change of parameter location
Brought to you by:
nhruby,
richardarcher
From: Dennis G. <ge...@cv...> - 2003-04-08 18:57:01
|
right now, as I see it, the following things have to be done to configure PHPLIB: ----------------------------------------------------------- 1/ Extend any classes. 2/ Put them in the prepend file 3/ Alternatively, put the extensions in local 4/ In the session class hand write in the container class. 5/ In the open page statment, give the extended class names. If it were being redone from scratch, I'd do it like this: ---------------------------------------------------------- 1/ Make page an object, call it phplib_page, in phplib_page.class.php. 2/ Do away with local, prepend, page files, (phplib_page.php would take their place) 3/ Create a global array called $PHPLIBCFG at the top of phplib_page.class.php with slots, 's' => array( 'file'=>'session.inc' , 'class'=>'Session' ), 'u' => array( 'file'=>'user.inc', 'class'=>'User' ), 'a' => array( 'file'=>'auth.inc', 'class'=>'Auth' ), 'p' => array( 'file'=>'perm.inc', 'class'=>'Permission' ), and possibley I would also make the user/auth/perm be a form of phpgacl, (look it up on web) 4/ Use separate files for extending each of the class types, sess/user/auth/perm. 6/ to use the library, however it was configured, would be simple, just include 'phplib_page.class.php' or the file for whatever class you had for extending phplib_page. Pass a string for whatever functinality you wanted in the application, i.e. 's', 'u', 'a', 'p'. So if I wanted sessions only, I'd create an instance: $my_page = new phplib_page( 's' ); for session and user variables, $my_page = new phplib_page( 'su' ); etc. 7/ The constructor would assign references to instantiations of sess/user/auth/perm objects to class/object variables. Then it would assign class functions to the PHP native session handlers. 8/ All public functions would return either TRUE, or an error string. NO output would go to the screen. |