Location: PHPKode > projects > Entier Studio > entierstudio/classes/proc.HostRequirements.php
<?php
/**
 * Entier Studio
 *
 * LICENSE
 *
 *	Copyright 2006 Entier Studio team.
 *
 *	Licensed under the Apache License, Version 2.0 (the "License");
 *	you may not use this file except in compliance with the License.
 *	You may obtain a copy of the License at
 *
 *		http://www.apache.org/licenses/LICENSE-2.0
 *
 *	Unless required by applicable law or agreed to in writing, software
 *	distributed under the License is distributed on an "AS IS" BASIS,
 *	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *	See the License for the specific language governing permissions and
 *	limitations under the License.
 *
 * @package    entier.studio
 * @copyright  Copyright (c) 2006 Entier Studio team. All rights reserved.
 * @version	   $Id: proc.HostRequirements.php 104 2008-02-07 21:30:22Z yannromefort $
 */
//-----------------------------------------------------------------------------
//	namespace
if (!defined("DefHostRequirements")) {
    //-------------------------------------------------------------------------
    //	Define
    define("DefHostRequirements", "1");
    //-------------------------------------------------------------------------
    //	Class
    class HostRequirements {
        //---------------------------------------------------------------------
        //	Attributes
        
        /**
         * RequiredPHP
         *
         * @var	boolean
         */
        var $m_RequiredPHP = true;
        /**
         * PHPVersion
         *
         * @var	string
         */
        var $m_PHPVersion = "";
        /**
         * SQLVersion
         *
         * @var	string
         */
        var $m_SQLVersion = "";
        /**
         * PHPModules
         *
         * @var	array
         */
        var $m_PHPModules = array();
        /**
         * Dir install
         *
         * @var	array
         */
        var $m_DirInstall = array();
        //---------------------------------------------------------------------
        //	Constructor
        
        /**
         * HostRequirements constructor.
         *
         * @access	public
         */
        function HostRequirements() {
            //
            $this->m_PHPVersion = @phpversion();
            $this->m_RequiredPHP = @version_compare($this->m_PHPVersion, "4.3.5", ">=");
            //
            $this->m_SQLVersion = @mysql_get_client_info();
            //
            $this->m_PHPModules["mysql"] = @extension_loaded("mysql");
            //
            if (@version_compare($this->m_PHPVersion, '5', '>='))
				$this->m_PHPModules["xslt"] = @extension_loaded("xsl");
            else
				$this->m_PHPModules["xslt"] = @extension_loaded("xslt");
            //
            $this->m_PHPModules["ftp"] = @extension_loaded("ftp");
            //
            $this->m_DirInstall["include"] = @is_dir(dirname(__FILE__) . "/../config");
            $this->m_DirInstall["install"] = @is_dir(dirname(__FILE__) . "/../install");
            $this->m_DirInstall["instaldb"] = @file_exists(dirname(__FILE__) . "/../install/entierstudio.sql");
            $this->m_DirInstall["configdb"] = (!@file_exists(dirname(__FILE__) . "/../config/cfg.config.db.test.php") || @is_writable(dirname(__FILE__) . "/../config/cfg.config.db.test.php"));
        }
        //---------------------------------------------------------------------
        //	Properties
        
        /**
         *
         * @return	boolean PHPRequired
         */
        function RequiredPHP() {
            //
            return ($this->m_RequiredPHP);
        }
        /**
         *
         * @return	string PHPVersion
         */
        function PHPVersion() {
            //
            return ($this->m_PHPVersion);
        }
        /**
         *
         * @return	string	SQLVersion
         */
        function SQLVersion() {
            //
            return ($this->m_SQLVersion);
        }
        /**
         *
         * @return	boolean	PHPModules
         */
        function PHPModule($module) {
            //
            if(isset($this->m_PHPModules[$module]))
				return ($this->m_PHPModules[$module]);
			return(false);
        }
        /**
         *
         * @return	boolean	DirInstall
         */
        function DirInstall($install) {
            //
            return ($this->m_DirInstall[$install]);
        }
        //---------------------------------------------------------------------
        //	Methods
        /*
        *
        * @access	public
        * @return	boolean
        */
        function checkRequirements() {
            //
            if ($this->m_RequiredPHP == false) return (false);
            //
            if ($this->m_PHPModules["mysql"] == false) return (false);
            //
            if ($this->m_PHPModules["xslt"] == false) return (false);
            //
            if ($this->m_DirInstall["include"] == false) return (false);
            //
            if ($this->m_DirInstall["install"] == false) return (false);
            //
            if ($this->m_DirInstall["configdb"] == false) return (false);
            //
            if ($this->m_DirInstall["instaldb"] == false) return (false);
            //
            return (true);
        }
    };
    //	Class
    //-------------------------------------------------------------------------
    
}
//	namespace
//-----------------------------------------------------------------------------
?>
Return current item: Entier Studio