applications/dashboard/controllers/class.setupcontroller.php
private function _CheckPrerequisites() {
      // Make sure we are running at least PHP 5.1
      if (version_compare(phpversion(), ENVIRONMENT_PHP_VERSION) < 0)
         $this->Form->AddError(sprintf(T('You are running PHP version %1$s. Vanilla requires PHP %2$s or greater. You must upgrade PHP before you can continue.'), phpversion(), ENVIRONMENT_PHP_VERSION));

      // Make sure PDO is available
      if (!class_exists('PDO'))
         $this->Form->AddError(T('You must have the PDO module enabled in PHP in order for Vanilla to connect to your database.'));

      if (!defined('PDO::MYSQL_ATTR_USE_BUFFERED_QUERY'))
         $this->Form->AddError(T('You must have the MySQL driver for PDO enabled in order for Vanilla to connect to your database.'));

      // Make sure that the correct filesystem permissions are in place
		$PermissionProblem = FALSE;

      // Make sure the appropriate folders are writeable.
      $ProblemDirectories = array();
      if (!is_readable(PATH_CONF) || !IsWritable(PATH_CONF))
         $ProblemDirectories[] = PATH_CONF;
         
      if (!is_readable(PATH_UPLOADS) || !IsWritable(PATH_UPLOADS))
         $ProblemDirectories[] = PATH_UPLOADS;
         
      if (!is_readable(PATH_CACHE) || !IsWritable(PATH_CACHE))
         $ProblemDirectories[] = PATH_CACHE;

      if (count($ProblemDirectories) > 0) {
         $PermissionProblem = TRUE;
         
         $PermissionError = T(
            'Some folders don\'t have correct permissions.',
            '<p>Some of your folders do not have the correct permissions.</p><p>Using your ftp client, or via command line, make sure that the following permissions are set for your vanilla installation:</p>');

         $PermissionHelp = '<pre>chmod -R 777 '.implode("\nchmod -R 777 ", $ProblemDirectories).'</pre>';

         $this->Form->AddError($PermissionError.$PermissionHelp);
      }
      
      // Make sure the config folder is writeable
      if (!$PermissionProblem) {
         $ConfigFile = PATH_CONF.'/config.php';
         if (!file_exists($ConfigFile))
            file_put_contents($ConfigFile, '');
         
         // Make sure the config file is writeable
         if (!is_readable($ConfigFile) || !IsWritable($ConfigFile)) {
            $this->Form->AddError(sprintf(T('Your configuration file does not have the correct permissions. PHP needs to be able to read and write to this file: <code>%s</code>'), $ConfigFile));
				$PermissionProblem = TRUE;
         }
      }

      // Make sure the cache folder is writeable
      if (!$PermissionProblem) {
         if (!file_exists(PATH_CACHE.'/Smarty')) mkdir(PATH_CACHE.'/Smarty');
         if (!file_exists(PATH_CACHE.'/Smarty/cache')) mkdir(PATH_CACHE.'/Smarty/cache');
         if (!file_exists(PATH_CACHE.'/Smarty/compile')) mkdir(PATH_CACHE.'/Smarty/compile');
      }
			
      return $this->Form->ErrorCount() == 0 ? TRUE : FALSE;
   }
private function _CheckPrerequisites() {
      // Make sure we are running at least PHP 5.1
      if (version_compare(phpversion(), ENVIRONMENT_PHP_VERSION) < 0)
         $this->Form->AddError(sprintf(T('You are running PHP version %1$s. Vanilla requires PHP %2$s or greater. You must upgrade PHP before you can continue.'), phpversion(), ENVIRONMENT_PHP_VERSION));

      // Make sure PDO is available
      if (!class_exists('PDO'))
         $this->Form->AddError(T('You must have the PDO module enabled in PHP in order for Vanilla to connect to your database.'));

      if (!defined('PDO::MYSQL_ATTR_USE_BUFFERED_QUERY'))
         $this->Form->AddError(T('You must have the MySQL driver for PDO enabled in order for Vanilla to connect to your database.'));

      // Make sure that the correct filesystem permissions are in place
		$PermissionProblem = FALSE;

      // Make sure the appropriate folders are writeable.
      $ProblemDirectories = array();
      if (!is_readable(PATH_CONF) || !IsWritable(PATH_CONF))
         $ProblemDirectories[] = PATH_CONF;
         
      if (!is_readable(PATH_UPLOADS) || !IsWritable(PATH_UPLOADS))
         $ProblemDirectories[] = PATH_UPLOADS;
         
      if (!is_readable(PATH_CACHE) || !IsWritable(PATH_CACHE))
         $ProblemDirectories[] = PATH_CACHE;

      if (count($ProblemDirectories) > 0) {
         $PermissionProblem = TRUE;
         
         $PermissionError = T(
            'Some folders don\'t have correct permissions.',
            '<p>Some of your folders do not have the correct permissions.</p><p>Using your ftp client, or via command line, make sure that the following permissions are set for your vanilla installation:</p>');

         $PermissionHelp = '<pre>chmod -R 777 '.implode("\nchmod -R 777 ", $ProblemDirectories).'</pre>';

         $this->Form->AddError($PermissionError.$PermissionHelp);
      }
      
      // Make sure the config folder is writeable
      if (!$PermissionProblem) {
         $ConfigFile = PATH_CONF.'/config.php';
         if (!file_exists($ConfigFile))
            file_put_contents($ConfigFile, '');
         
         // Make sure the config file is writeable
         if (!is_readable($ConfigFile) || !IsWritable($ConfigFile)) {
            $this->Form->AddError(sprintf(T('Your configuration file does not have the correct permissions. PHP needs to be able to read and write to this file: <code>%s</code>'), $ConfigFile));
				$PermissionProblem = TRUE;
         }
      }

      // Make sure the cache folder is writeable
      if (!$PermissionProblem) {
         if (!file_exists(PATH_CACHE.'/Smarty')) mkdir(PATH_CACHE.'/Smarty');
         if (!file_exists(PATH_CACHE.'/Smarty/cache')) mkdir(PATH_CACHE.'/Smarty/cache');
         if (!file_exists(PATH_CACHE.'/Smarty/compile')) mkdir(PATH_CACHE.'/Smarty/compile');
      }
			
      return $this->Form->ErrorCount() == 0 ? TRUE : FALSE;
   }
private function _CheckPrerequisites ( ) { // Make sure we are running at least PHP 5.1 if ( version_compare ( phpversion ( ) , ENVIRONMENT_PHP_VERSION ) < 0 ) $ this -> Form -> AddError ( sprintf ( T ( 'You are running PHP version %1$s. Vanilla requires PHP %2$s or greater. You must upgrade PHP before you can continue.' ) , phpversion ( ) , ENVIRONMENT_PHP_VERSION ) ) ; // Make sure PDO is available if ( ! class_exists ( 'PDO' ) ) $ this -> Form -> AddError ( T ( 'You must have the PDO module enabled in PHP in order for Vanilla to connect to your database.' ) ) ; if ( ! defined ( 'PDO::MYSQL_ATTR_USE_BUFFERED_QUERY' ) ) $ this -> Form -> AddError ( T ( 'You must have the MySQL driver for PDO enabled in order for Vanilla to connect to your database.' ) ) ; // Make sure that the correct filesystem permissions are in place $ PermissionProblem = FALSE ; // Make sure the appropriate folders are writeable. $ ProblemDirectories = array ( ) ; if ( ! is_readable ( PATH_CONF ) || ! IsWritable ( PATH_CONF ) ) $ ProblemDirectories [ ] = PATH_CONF ; if ( ! is_readable ( PATH_UPLOADS ) || ! IsWritable ( PATH_UPLOADS ) ) $ ProblemDirectories [ ] = PATH_UPLOADS ; if ( ! is_readable ( PATH_CACHE ) || ! IsWritable ( PATH_CACHE ) ) $ ProblemDirectories [ ] = PATH_CACHE ; if ( count ( $ ProblemDirectories ) > 0 ) { $ PermissionProblem = TRUE ; $ PermissionError = T ( 'Some folders don\'t have correct permissions.' , '<p>Some of your folders do not have the correct permissions.</p><p>Using your ftp client, or via command line, make sure that the following permissions are set for your vanilla installation:</p>' ) ; $ PermissionHelp = '<pre>chmod -R 777 ' . implode ( "\nchmod -R 777 " , $ ProblemDirectories ) . '</pre>' ; $ this -> Form -> AddError ( $ PermissionError . $ PermissionHelp ) ; } // Make sure the config folder is writeable if ( ! $ PermissionProblem ) { $ ConfigFile = PATH_CONF . '/config.php' ; if ( ! file_exists ( $ ConfigFile ) ) file_put_contents ( $ ConfigFile , '' ) ; // Make sure the config file is writeable if ( ! is_readable ( $ ConfigFile ) || ! IsWritable ( $ ConfigFile ) ) { $ this -> Form -> AddError ( sprintf ( T ( 'Your configuration file does not have the correct permissions. PHP needs to be able to read and write to this file: <code>%s</code>' ) , $ ConfigFile ) ) ; $ PermissionProblem = TRUE ; } } // Make sure the cache folder is writeable if ( ! $ PermissionProblem ) { if ( ! file_exists ( PATH_CACHE . '/Smarty' ) ) mkdir ( PATH_CACHE . '/Smarty' ) ; if ( ! file_exists ( PATH_CACHE . '/Smarty/cache' ) ) mkdir ( PATH_CACHE . '/Smarty/cache' ) ; if ( ! file_exists ( PATH_CACHE . '/Smarty/compile' ) ) mkdir ( PATH_CACHE . '/Smarty/compile' ) ; } return $ this -> Form -> ErrorCount ( ) == 0 ? TRUE : FALSE ; }
Check minimum requirements for Garden.

@since 2.0.0
@access private
@return bool Whether platform passes requirement check.
Check minimum requirements for Garden .