[pLog-svn] r3162 - in plog/trunk: . templates/wizard

mark at devel.lifetype.net mark at devel.lifetype.net
Thu Mar 30 18:03:52 GMT 2006


Author: mark
Date: 2006-03-30 18:03:52 +0000 (Thu, 30 Mar 2006)
New Revision: 3162

Modified:
   plog/trunk/templates/wizard/checks.template
   plog/trunk/wizard.php
Log:
Add two news requirement checkings:

1. gd or gd2
2. file_uploads

Modified: plog/trunk/templates/wizard/checks.template
===================================================================
--- plog/trunk/templates/wizard/checks.template	2006-03-30 17:14:27 UTC (rev 3161)
+++ plog/trunk/templates/wizard/checks.template	2006-03-30 18:03:52 UTC (rev 3162)
@@ -1,7 +1,7 @@
 {include file="wizard/header.template" title="1 Preinstallation Checks" step=1 mode=$mode}
  <form name="databaseInfo" action="wizard.php" method="post">
   <fieldset class="inputField">
-   <legend>Output</legend>  
+   <legend>Requirements Checking</legend>  
    {if $viewIsError || !$ok}
     <div class="wizardError">
      <img src="imgs/admin/icon_error-16.png" alt="Error" class="wizardInfoIcon" />

Modified: plog/trunk/wizard.php
===================================================================
--- plog/trunk/wizard.php	2006-03-30 17:14:27 UTC (rev 3161)
+++ plog/trunk/wizard.php	2006-03-30 18:03:52 UTC (rev 3162)
@@ -226,39 +226,39 @@
         }
     }
     
-    class WizardWritableFileValidator extends WizardValidator
+    class WizardPhpVersionValidator extends WizardValidator
     {
-        var $_file;
-        
-        function WizardWritableFileValidator( $file )
+        function WizardPhpVersionValidator( $minVersion = MIN_PHP_VERSION )
         {
-            $this->WizardValidator( "Checking if file/folder <b>$file</b> is writable", 
-                                    "Please make sure that the file is writable by the web server",
+            $this->WizardValidator( "Checking if the installed <b>PHP</b> version is at least $minVersion", 
+                                    "Please upgrade your version of PHP to $minVersion or newer",
                                     true );
-            $this->_file = $file;
+            $this->_minVersion = $minVersion;
         }
     
         function validate()
         {
-            $this->_valid = File::isWritable( $this->_file );
-            return( parent::validate());
+            $this->_valid = version_compare( phpversion(), $this->_minVersion ) >= 0;
+            return( parent::validate());            
         }
     }
     
-    class WizardPhpVersionValidator extends WizardValidator
+    class WizardWritableFileValidator extends WizardValidator
     {
-        function WizardPhpVersionValidator( $minVersion = MIN_PHP_VERSION )
+        var $_file;
+        
+        function WizardWritableFileValidator( $file )
         {
-            $this->WizardValidator( "Checking if the installed <b>PHP</b> version is at least $minVersion", 
-                                    "Please upgrade your version of PHP to $minVersion or newer",
+            $this->WizardValidator( "Checking if file/folder <b>$file</b> is writable", 
+                                    "Please make sure that the file is writable by the web server",
                                     true );
-            $this->_minVersion = $minVersion;
+            $this->_file = $file;
         }
     
         function validate()
         {
-            $this->_valid = version_compare( phpversion(), $this->_minVersion ) >= 0;
-            return( parent::validate());            
+            $this->_valid = File::isWritable( $this->_file );
+            return( parent::validate());
         }
     }
     
@@ -362,7 +362,7 @@
         function WizardIconvFunctionsAvailableValidator()
         {
             $this->WizardValidator( "Checking if <b>iconv</b> functions are available", 
-                                    "LifeType requires support for some resource metadata conversion.",
+                                    "LifeType requires support for some resource metadata conversion and some LifeType plugins requires support for multi-byte language encoding/decoding.",
                                     true );
         }
     
@@ -387,25 +387,60 @@
             $this->_valid = function_exists( "mb_convert_encoding" );
             return( parent::validate());                            
         }        
-    }       
+    }
+
+    class WizardGdFunctionsAvailableValidator extends WizardValidator
+    {
+        function WizardGdFunctionsAvailableValidator()
+        {
+            $this->WizardValidator( "Checking if <b>gd</b> or <b>gd2</b> functions are available", 
+                                    "LifeType requires support for generating image thumbnail.",
+                                    false );
+        }
     
+        function validate()
+        {
+            $this->_valid = function_exists( "imagecopyresampled" ) &&
+            				function_exists( "imagecopyresized" );
+            return( parent::validate());                            
+        }        
+    }
+    
+    class WizardFileUploadsValidator extends WizardValidator
+    {
+        function WizardFileUploadsValidator()
+        {
+            $this->WizardValidator( "Checking if <b>file_uploads</b> is enabled", 
+                                    "LifeType requires support for uploading resources.",
+                                    true );
+        }    
+    
+        function validate()
+        {
+            $this->_valid = (ini_get( "file_uploads" ) == 1);
+            return( parent::validate());    
+        }
+    }             
+    
     class WizardChecks extends Action
     {        
         function perform()
         {
             // build the array with checks
             $checks = Array(
+               "php" => new WizardPhpVersionValidator(),
                "writeConfigFile" => new WizardWritableFileValidator( "config/config.properties.php" ),
                "writeTmpFolder" => new WizardWritableFileValidator( "tmp" ),
                "writeGalleryFolder" => new WizardWritableFileValidator( "gallery" ),
-               "php" => new WizardPhpVersionValidator(),
                "sessions" => new WizardSessionFunctionsAvailableValidator(),
                "sessionSettings" => new WizardSessionSettingsValidator(),
                "mysql" => new WizardMySQLFunctionsAvailableValidator(),
                "xml" => new WizardXmlFunctionsAvailableValidator(),
                "safemode" => new WizardSafeModeValidator(),
                "iconv" => new WizardIconvFunctionsAvailableValidator(),
-               "mbstring" => new WizardMbstringFunctionsAvailableValidator
+               "mbstring" => new WizardMbstringFunctionsAvailableValidator(),
+               "gd" => new WizardGdFunctionsAvailableValidator(),
+               "fileUploads" => new WizardFileUploadsValidator()
             );
             
             // run the checks



More information about the pLog-svn mailing list