Update of /cvsroot/phpmp/phpMP
In directory sc8-pr-cvs1:/tmp/cvs-serv26596
Modified Files:
modules.php
Log Message:
Began work on the module interface. Made some improvements to my (rather crappy) regex implementation.
Index: modules.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/modules.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** modules.php 17 May 2003 07:50:16 -0000 1.16
--- modules.php 19 May 2003 23:39:59 -0000 1.17
***************
*** 24,27 ****
// Module handler.
!
?>
--- 24,72 ----
// Module handler.
! class Module
! {
!
! // The following two functions manage module variables, allowing the
! // module author to easily maintain variable data from point to point.
! // All modules, in order to meet compliance, should fully utilize these
! // functions.
! function setVar($varkey, $varval = false)
! {
! if(is_array( $varkey ))
! {
! foreach( $userkey as $key => $val )
! {
! if( preg_match('/[^a-z][a-z0-9_-]/', $key) )
! {
! $this->_keydata[$key] = $val;
! }
! }
! }
! elseif( (!empty($varkey)) && (preg_match('/[^a-z][a-z0-9_-]/', $varkey)) && (!empty($varval)) )
! {
! $this->_data[$userkey] = $userval;
! return true;
! }
! else
! {
! return false;
! }
! }
!
! function getVar($varkey)
! {
! if( !empty($this->_data[$varkey]) )
! {
! return $this->_data[$varkey];
! }
! else
! {
! return false;
! }
! }
!
! function loadHook( $hookname, $hookjob )
! {
! }
! }
?>
|