[geeklog-cvs] MVCnPHP ArrayLoader.class.php,1.1.1.1,1.2 BaseCommand.class.php,1.1.1.1,1.2 BaseLoader.class.php,1.2,1.3 BaseView.class.php,1.1.1.1,1.2 CHANGELOG,1.3,1.4 CommandFactory.class.php,1.1.1.1,1.2 Constants.php,1.2,1.3 Controller.class.php,1.4,1.5 Form.class.php,1.2,1.3 LoaderFactory.class.php,1.2,1.3 MVC_Base.class.php,1.1.1.1,1.2 MVC_XMLParser.class.php,1.2,1.3 Mapping.class.php,1.1.1.1,1.2 QF_View.class.php,1.3,1.4 README.txt,1.4,1.5 Validator.class.php,1.2,1.3 ViewFactory.class.php,1.1.1.1,1.2 XMLLoader.class.php,1.3,1.4

geeklog-cvs-admin at lists.geeklog.net geeklog-cvs-admin at lists.geeklog.net
Wed Aug 27 21:31:25 EDT 2003


Update of /usr/cvs/geeklog/MVCnPHP
In directory geeklog_prod:/tmp/cvs-serv25633

Modified Files:
	ArrayLoader.class.php BaseCommand.class.php 
	BaseLoader.class.php BaseView.class.php CHANGELOG 
	CommandFactory.class.php Constants.php Controller.class.php 
	Form.class.php LoaderFactory.class.php MVC_Base.class.php 
	MVC_XMLParser.class.php Mapping.class.php QF_View.class.php 
	README.txt Validator.class.php ViewFactory.class.php 
	XMLLoader.class.php 
Log Message:
Massive Updates as result of progress at work

Index: ArrayLoader.class.php
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/ArrayLoader.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2

Index: BaseCommand.class.php
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/BaseCommand.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2

Index: BaseLoader.class.php
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/BaseLoader.class.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** BaseLoader.class.php	14 Jul 2003 16:39:27 -0000	1.2
--- BaseLoader.class.php	28 Aug 2003 01:31:22 -0000	1.3
***************
*** 74,78 ****
          }
          $mapping->setBaseURL($baseURL);
!         $mapping->setForwards($this->_getForwards($name));
          
          return $mapping;
--- 74,78 ----
          }
          $mapping->setBaseURL($baseURL);
!         $mapping->setForwards($this->_getForwards($name, $mapping->getType()));
          
          return $mapping;
***************
*** 105,114 ****
      * @access private
      * @param string $name Name of model to get forwards for
      * @return array Forwards for given model
      *
      */
!     function _getForwards($name)
      {
!         return $this->_arrayData[MVC_MODELS][$name][MVC_FORWARDS];
      }
      
--- 105,119 ----
      * @access private
      * @param string $name Name of model to get forwards for
+     * @param string $type Type of object (command or view)
      * @return array Forwards for given model
      *
      */
!     function _getForwards($name, $type)
      {
!         if ($type == 'view') {
!             return $this->_arrayData[MVC_VIEWS][$name][MVC_FORWARDS];
!         } else {
!             return $this->_arrayData[MVC_COMMANDS][$name][MVC_FORWARDS];
!         }
      }
      

Index: BaseView.class.php
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/BaseView.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2

Index: CHANGELOG
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/CHANGELOG,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CHANGELOG	14 Jul 2003 17:03:32 -0000	1.3
--- CHANGELOG	28 Aug 2003 01:31:22 -0000	1.4
***************
*** 10,13 ****
  - Fixed bug with QuickForm example that was caused because the Controller::ProcessRequest() method expects
    all commands. (02 May 2003)
! - Now assume that MVCnPHP folder is in PHP's include_path. Also changed some terminology in config files 
!   (XML and .php) to avoid confusion (15 June 2003)
--- 10,12 ----
  - Fixed bug with QuickForm example that was caused because the Controller::ProcessRequest() method expects
    all commands. (02 May 2003)
! - Now assume that MVCnPHP folder is in PHP's include_path. Also changed some terminology in config files (XML and .php) to avoid confusion (15 June 2003)

Index: CommandFactory.class.php
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/CommandFactory.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2

Index: Constants.php
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/Constants.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Constants.php	14 Jul 2003 16:39:57 -0000	1.2
--- Constants.php	28 Aug 2003 01:31:22 -0000	1.3
***************
*** 46,50 ****
  define('MVC_TARGET', 'target');
  define('MVC_TYPE', 'type');
! define('MVC_MESSAGE', 'mvc_message');
  define('MVC_ERRORS', 'mvc_errors');
  define('MVC_PRINT', 1);
--- 46,50 ----
  define('MVC_TARGET', 'target');
  define('MVC_TYPE', 'type');
! define('MVC_MESSAGES', 'mvc_messages');
  define('MVC_ERRORS', 'mvc_errors');
  define('MVC_PRINT', 1);

Index: Controller.class.php
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/Controller.class.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Controller.class.php	14 Jul 2003 16:40:14 -0000	1.4
--- Controller.class.php	28 Aug 2003 01:31:22 -0000	1.5
***************
*** 233,236 ****
--- 233,242 ----
      * Process a request (or forward)
      *
+     * NOTE this now supports the concept of a global forward for
+     * descendants of the validator class.  A global forward is a
+     * slick way for validators to return control to the calling
+     * command or view without having define a bunch of them in
+     * the configuration file.
+     *
      * @author Tony Bibbs <tony at geeklog.net>
      * @access public
***************
*** 253,256 ****
--- 259,268 ----
                  $this->_forwardControl($retval);
              }
+             $tmpArray = explode(':', $retval);
+             
+             if ($tmpArray[0] = 'doForward') {
+                 $this->_mapping = &$this->_mapLoader->getMapping($tmpArray[1], $this->_viewDir, $this->_commandDir, $this->_baseURL);
+                 $this->processRequest();
+             }
              if (!$view->printView()) {
                  return $retval;
***************
*** 261,266 ****
--- 273,291 ----
              $strForward = $tmp->execute();
              // This IF is required to avoid errors using quickform
+             
              if ($this->_isForward($strForward)) {
                  $this->_forwardControl($strForward);
+             }
+ 
+             $tmpArray = explode(':', $strForward);
+             
+             if ($tmpArray[0] = 'doForward') {
+                 $this->_mapping = &$this->_mapLoader->getMapping($tmpArray[1], $this->_viewDir, $this->_commandDir, $this->_baseURL);
+                 $this->processRequest();
+             }
+             
+             // OK if we got here then we got an undefined forward of some kind
+             if (!empty($strForward)) {
+                 return PEAR::raiseError('Unexpected return from MVC command or MVC view.  Got ' . $strForward);
              }
          }

Index: Form.class.php
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/Form.class.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3

Index: LoaderFactory.class.php
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/LoaderFactory.class.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3

Index: MVC_Base.class.php
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/MVC_Base.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2

Index: MVC_XMLParser.class.php
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/MVC_XMLParser.class.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MVC_XMLParser.class.php	14 Jul 2003 16:40:54 -0000	1.2
--- MVC_XMLParser.class.php	28 Aug 2003 01:31:22 -0000	1.3
***************
*** 102,106 ****
          
          // Lets expat know this class will handle the parsing
!         xml_set_object($this->_parser, &$this);
          xml_set_element_handler($this->_parser, '_handleStartElement', '_handleEndElement');
          xml_set_character_data_handler($this->_parser, '_handleData');
--- 102,106 ----
          
          // Lets expat know this class will handle the parsing
!         xml_set_object($this->_parser, $this);
          xml_set_element_handler($this->_parser, '_handleStartElement', '_handleEndElement');
          xml_set_character_data_handler($this->_parser, '_handleData');
***************
*** 138,141 ****
--- 138,143 ----
              $attributes['PARENT'] = $this->_level;
          }
+         $this->_numSiblings = $this->_getNumSiblings($attributes['PARENT']);
+         //$attributes['NUMSIBLINGS'] = $this->_numSiblings;
          $this->_level++;
          $this->_elements[] = $name;
***************
*** 158,162 ****
      {
          $this->_level--;
!         $this->_curElement--;
      }
      
--- 160,164 ----
      {
          $this->_level--;
!         $this->_curElement = $this->_curElement - ($this->_numSiblings + 1);
      }
      
***************
*** 177,180 ****
--- 179,194 ----
          if (empty($this->_curElement) OR !trim($data)) return;
          $this->_values[$this->_curElement] = $data;
+     }
+     
+     function _getNumSiblings($parent)
+     {
+         if ($parent == 1) return 0;
+         $numSiblings = 0;
+         foreach ($this->_attributes as $curAtt) {
+             if ($curAtt['PARENT'] == $parent) {
+                 $numSiblings++;
+             }
+         }
+         return $numSiblings;
      }
      

Index: Mapping.class.php
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/Mapping.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2

Index: QF_View.class.php
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/QF_View.class.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4

Index: README.txt
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/README.txt,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** README.txt	14 Jul 2003 17:02:55 -0000	1.4
--- README.txt	28 Aug 2003 01:31:22 -0000	1.5
***************
*** 45,49 ****
  you are a Java purist and insist on a 100% Struts compatible version you may
  feel welcome to rework what I have here OR check out the Phrame project at
! http://phrame.itsd.ttu.edu/.  
  
  MVC FEATURES
--- 45,49 ----
  you are a Java purist and insist on a 100% Struts compatible version you may
  feel welcome to rework what I have here OR check out the Phrame project at
! http://phrame.itsd.ttu.edu/ 
  
  MVC FEATURES
***************
*** 133,138 ****
  can be easily extended to use other packages for the creation of views.  Furthermore, 
  MVCnPHP includes QF_View.class.php as part of the base distribution so that you could begin
! using HTML QuickForm right out-of-the-box.  To use the example, edit the index.php file and
! change $mvcBase to point to where you installed MVCnPHP.
  
  INSTALLATION FOR GENERAL USE
--- 133,137 ----
  can be easily extended to use other packages for the creation of views.  Furthermore, 
  MVCnPHP includes QF_View.class.php as part of the base distribution so that you could begin
! using HTML QuickForm right out-of-the-box.  
  
  INSTALLATION FOR GENERAL USE
***************
*** 148,156 ****
     application one for each functional area of your application.  Each 
     controller will require it's own configuration settings.
! 3) If you plan to use MVCnPHP in a number of applications, you should consider adding the
!    folder location to your php.ini's include_path.  The sample applications assume this is the 
!    case but, to get around the fact some of you may not be able to edit php.ini we change the 
!    value of include_path at runtime through code.  If you want to do something similar in your
!    code, feel free to borrow those code snippets.
  
  TODO
--- 147,151 ----
     application one for each functional area of your application.  Each 
     controller will require it's own configuration settings.
! 3) ...coming soon
  
  TODO
***************
*** 159,163 ****
  2) Remove dependence on $_SESSION superglobal since not all application may
     use it.
- 3) Branch and port to PHP5
  
  KNOWN BUGS
--- 154,157 ----
***************
*** 170,174 ****
  -------
  
! This package is considered a final release and is supported.  Send any bugs, comments or
  questions to Tony Bibbs, tony at geeklog.net.
  
--- 164,169 ----
  -------
  
! This package is considered a release condidate and is unsupported.  Once it is deemed stable
! we will release a supported package.  Until that time, send any bugs, comments or
  questions to Tony Bibbs, tony at geeklog.net.
  
***************
*** 180,185 ****
  project and a special shout-out to Jason Sweat who is a regular contributor to Phrame.
  
! At one point we had considered combining our efforts but their Phrame project is GPL'd which
! doesn't lend itself for use in proprietary PHP systems. MVCnPHP uses the PHP License which gets
! around this.  For those looking for an MVC implementation be willing to consider both and 
! understand the main differences as it will be an important decision.
--- 175,181 ----
  project and a special shout-out to Jason Sweat who is a regular contributor to Phrame.
  
! At the time of this writing no decision on the future of this project and Phrame has been
! decided.  I am in constant communication with the Phrame developers hoping we can combine 
! what I have built here into some of the Phrame principles that were omitted in this package. 
! By doing so I hope to end up with *the* definitive PHP-MVC package and, at that time, we would
! look at submitting this framework to PEAR.

Index: Validator.class.php
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/Validator.class.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3

Index: ViewFactory.class.php
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/ViewFactory.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2

Index: XMLLoader.class.php
===================================================================
RCS file: /usr/cvs/geeklog/MVCnPHP/XMLLoader.class.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** XMLLoader.class.php	14 Jul 2003 16:41:26 -0000	1.3
--- XMLLoader.class.php	28 Aug 2003 01:31:22 -0000	1.4
***************
*** 106,111 ****
                      } else {
                          if ($parentTag == 'COMMAND') {
!                             $configData[MVC_MODELS][$parentIDAttr][MVC_FORWARDS][$name][MVC_TARGET] = $parser->getValue($curIndex);
!                             $configData[MVC_MODELS][$parentIDAttr][MVC_FORWARDS][$name][MVC_TYPE] = $parser->getAttribute($curIndex, 'type');
                          } else {
                              trigger_error('Hit unexpected XML tag in XMLLoader::_XMLToArray');
--- 106,111 ----
                      } else {
                          if ($parentTag == 'COMMAND') {
!                             $configData[MVC_COMMANDS][$parentIDAttr][MVC_FORWARDS][$name][MVC_TARGET] = $parser->getValue($curIndex);
!                             $configData[MVC_COMMANDS][$parentIDAttr][MVC_FORWARDS][$name][MVC_TYPE] = $parser->getAttribute($curIndex, 'type');
                          } else {
                              trigger_error('Hit unexpected XML tag in XMLLoader::_XMLToArray');





More information about the geeklog-cvs mailing list