Changeset 487 for trunk/lib/App.inc.php


Ignore:
Timestamp:
Aug 20, 2014 11:56:27 AM (10 years ago)
Author:
anonymous
Message:

Added Validator::fileUploadSize(), phpIniGetBytes(), and fixed php version error checking.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/App.inc.php

    r484 r487  
    4242class App {
    4343
     44    // Minimum version of PHP required for this version of the Codebase.
     45    const CODEBASE_MIN_PHP_VERSION = '5.3.0';
     46
    4447    // A place to keep an object instance for the singleton pattern.
    4548    protected static $instance = null;
     
    179182        $this->timer = new ScriptTimer();
    180183        $this->timer->start('_app');
    181 
    182         // The codebase now requires a minimum PHP version.
    183         $codebase_minimum_php_version = '5.3.0';
    184         if (version_compare(PHP_VERSION, $codebase_minimum_php_version, '<')) {
    185             $this->logMsg(sprintf('Codebase minimum PHP version of %s not satisfied (you have %s). ', $codebase_minimum_php_version, phpversion()), LOG_NOTICE, __FILE__, __LINE__);
    186         }
    187184    }
    188185
     
    382379        // Set the version of the codebase we're using.
    383380        $codebase_version_file = dirname(__FILE__) . '/../docs/version.txt';
     381        $codebase_version = '';
    384382        if (is_readable($codebase_version_file)) {
    385383            $codebase_version = trim(file_get_contents($codebase_version_file));
     
    388386                header('X-Codebase-Version: ' . $codebase_version);
    389387            }
     388        }
     389
     390        if (version_compare(PHP_VERSION, self::CODEBASE_MIN_PHP_VERSION, '<')) {
     391            $this->logMsg(sprintf('PHP %s required for Codebase %s, using %s; some things will break.', self::CODEBASE_MIN_PHP_VERSION, $codebase_version, PHP_VERSION), LOG_NOTICE, __FILE__, __LINE__);
    390392        }
    391393
Note: See TracChangeset for help on using the changeset viewer.