List Info

Thread: Controller.php




Controller.php
user name
2006-12-05 22:53:14
Update of
/var/cvs/Geeklog-2.x/Geeklog-2.x/system/libraries/Geeklog/MV
CnPHP
In directory
iowaoutdoors:/tmp/cvs-serv16739/system/libraries/Geeklog/MVC
nPHP

Modified Files:
	Controller.php 
Log Message:


Index: Controller.php
============================================================
=======
RCS file:
/var/cvs/Geeklog-2.x/Geeklog-2.x/system/libraries/Geeklog/MV
CnPHP/Controller.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Controller.php	16 Nov 2006 17:44:43 -0000	1.1
--- Controller.php	5 Dec 2006 22:53:12 -0000	1.2
***************
*** 221,225 ****
          
          if (empty($options['configFileDirectory'])) {
!             $this->configFileDirectory = false;
          } else {
              $this->configFileDirectory =
$options['configFileDirectory'];
--- 221,225 ----
          
          if (empty($options['configFileDirectory'])) {
!         	throw new Exception('You must specify the
configFileDirectory option');           
          } else {
              $this->configFileDirectory =
$options['configFileDirectory'];
***************
*** 364,368 ****
              // Think of is a TTL expiration OR someone
cleared shared memory using the APC 
              // admin tool
!             if (!$this->internalConfiguration) {
              	if ($this->doCompileChecks) {
                  	$this->compile();
--- 364,368 ----
              // Think of is a TTL expiration OR someone
cleared shared memory using the APC 
              // admin tool
!             if
(is_array($this->internalConfiguration)	) {
              	if ($this->doCompileChecks) {
                  	$this->compile();
***************
*** 379,383 ****
                  }
              } else {
!             	// Found it in memory now check if is
out-of-date (if requested)
              	if ($this->doCompileChecks)
$this->compile();
              }
--- 379,390 ----
                  }
              } else {
!             	// Uh, OK, the configuration isn't in memory
even though they gave APC options...
!             	// try pulling it from the file
!             	$arrayFileName =
$this->configFileDirectory . DIRECTORY_SEPARATOR . 
'Geeklog_MVCnPHP_Config.php';
! 	            if (is_file($arrayFileName)) {
! 	            	require $arrayFileName;	            	
! 	            }
! 	            	            
!             	// K, now let's do the compile check.
              	if ($this->doCompileChecks)
$this->compile();
              }
***************
*** 533,537 ****
      protected function compile()
      {
-         //$configCleared = false;
          $forceBuild = false;
          
--- 540,543 ----
***************
*** 549,559 ****
  	        	$fd = opendir($curDir);
  	            while (($curFile = readdir($fd))) {
! 	            	$filename = $curDir . $curFile;
  	            	// We should not have a handle to a
directory here
! 	            	if (is_dir($filename)) continue;
  	                clearstatcache();
! 	                if (fileatime($filename) >
$lastBuildTime) {
  	                    // Only clear the internal
configuration once, please 
! 	                    echo "<pre>The file,
$filename, is either new or has changed.  Must rebuild the
entire MVCnPHP Configuration<pre>";
  	                    $this->internalConfiguration =
array();
  	                    $forceBuild = true;
--- 555,566 ----
  	        	$fd = opendir($curDir);
  	            while (($curFile = readdir($fd))) {
! 	            	$fileToCheck = $curDir . $curFile;
  	            	// We should not have a handle to a
directory here
! 	            	if (is_dir($fileToCheck)) continue;
  	                clearstatcache();
! 	                if (filemtime($fileToCheck) >
$lastBuildTime) {
  	                    // Only clear the internal
configuration once, please 
! 	                    echo "<pre>The file,
$fileToCheck, is either new or has changed.  Must rebuild
the entire MVCnPHP Configuration<pre>";
! 	                    echo "<pre>    filemtime:
" . filemtime($fileToCheck) . " last build: "
. $lastBuildTime . '</pre>';
  	                    $this->internalConfiguration =
array();
  	                    $forceBuild = true;
***************
*** 588,598 ****
          // Now that we are done, set the last build time.
          if ($forceBuild) {
!         	echo "<pre>Setting LASTBUILD time for
this MVC build</pre>";
!             $this->internalConfiguration['LASTBUILD'] =
time();
              // See if we should load this stuff into
shared memory.  Note we assume if they gave us
              // APC options that they have APC actually
installed and configured.  Also if they are
              // using APC we ignore their request to write
to disk as there is no point.
              if ($this->apcOptions) {
!             	echo "<pre>Storing configuration
in memory</pre>";
                  if
(is_numeric($this->apcOptions['apc_ttl'])) {
                     
apc_store($this->apcOptions['apc_index'],
$this->internalConfiguration,
--- 595,606 ----
          // Now that we are done, set the last build time.
          if ($forceBuild) {
!         	$newBuildTime = time();
!         	echo '<pre>Setting LASTBUILD time for this
MVC build to </pre>' . $newBuildTime;
!             $this->internalConfiguration['LASTBUILD'] =
$newBuildTime;
              // See if we should load this stuff into
shared memory.  Note we assume if they gave us
              // APC options that they have APC actually
installed and configured.  Also if they are
              // using APC we ignore their request to write
to disk as there is no point.
              if ($this->apcOptions) {
!             	echo '<pre>Storing configuration in
memory</pre>';
                  if
(is_numeric($this->apcOptions['apc_ttl'])) {
                     
apc_store($this->apcOptions['apc_index'],
$this->internalConfiguration,
***************
*** 601,611 ****
                     
apc_store($this->apcOptions['apc_index'],
$this->internalConfiguration);
                  }
!             } else {
!                 if (!empty($this->configFileDirectory))
{
!                 	echo "<pre>Saving
configuration to
$this->configFileDirectory</pre>";
!                    
file_put_contents($this->configFileDirectory .
DIRECTORY_SEPARATOR . 'Geeklog_MVCnPHP_Config.php', 
!                         '<?php
$this->internalConfiguration = ' .
var_export($this->internalConfiguration, true) . ';
?>');
!                 }
!             }       
              
          	echo '<h2>MVC Build
Done</h2><p>Here is the resulting configuration:
<br/><pre>' .
var_export($this->internalConfiguration, true) .
'</pre></p>';
--- 609,619 ----
                     
apc_store($this->apcOptions['apc_index'],
$this->internalConfiguration);
                  }
!             }
!              
!             if (!empty($this->configFileDirectory)) {
!             	echo "<pre>Saving configuration to
$this->configFileDirectory</pre>";
!                
file_put_contents($this->configFileDirectory .
DIRECTORY_SEPARATOR . 'Geeklog_MVCnPHP_Config.php', 
!                     '<?php
$this->internalConfiguration = ' .
var_export($this->internalConfiguration, true) . ';
?>');
!             }
              
          	echo '<h2>MVC Build
Done</h2><p>Here is the resulting configuration:
<br/><pre>' .
var_export($this->internalConfiguration, true) .
'</pre></p>';
***************
*** 684,690 ****
          
          //print_R($parentClass . "nn" .
$codeToEval);
!         eval($parentClass . "nn" .
$codeToEval);        
!         
!         //$tmpObject = new $objectClassName;
          echo "<pre>    Found class
$objectClassName in $fileToConfigure</pre>";
          
--- 692,701 ----
          
          //print_R($parentClass . "nn" .
$codeToEval);
!         if (eval($parentClass . "nn" .
$codeToEval) === false) {
!         	echo '<h2><font
color="red">Parse error found during code
evaluation</font></h2>';
!         	echo 'Code evaluated: <pre>' . $parentClass
. "nn" . $codeToEval . '</pre>';
!         	exit;
!         }
!                 
          echo "<pre>    Found class
$objectClassName in $fileToConfigure</pre>";
          
***************
*** 721,725 ****
          }
          
-         
          // Process the forwards
          if (!empty($objectForwards)) {
--- 732,735 ----

_______________________________________________
geeklog2-cvs mailing list
geeklog2-cvslists.geeklog.net
http://lists.geeklog.net/mailman/listinfo/geeklog2-cvs

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )