<?php

    define( "PLOG_PROJECT_PAGE", "http://www.lifetype.net" );
    
    if ( !defined("DEFAULT_VERSION_FILE") )
      define( "DEFAULT_VERSION_FILE", PLOG_CLASS_PATH . "version.php" );

    /**
     * \ingroup Misc
     *
     * Returns the current version of plog as well as a link to the project page
     */
    class Version  
    {

        /**
         * Returns the current version of pLog, determined by the value of the $version
         * variable in the version.php file.
         * If the file is not available, the result is unknown.
         * @static
         * @return The version identifier.
         */
        function getVersion()
        {
			include_once( PLOG_CLASS_PATH."class/file/file.class.php" );		
            $versionFile = PLOG_CLASS_PATH."version.php";
            if( File::isReadable( $versionFile ))
                include_once( $versionFile );
            else
                $version = "UNKNOWN";

            return $version;
        }

        /**
         * Returns the official page of the project.
         *
         * @return The official project page.
         * @static
         */
        function getProjectPage()
        {
            return PLOG_PROJECT_PAGE;
        }
		
		/**
		 * Compares two LT versions
		 *
		 * @param v1
		 * @param v2
		 * @return 1 if v1>v2, 0 if v1==v2 and -1 if v1<v2
		 * @see http://www.php.net/manual/en/function.version-compare.php
		 * @static
		 */
		function compare( $v1, $v2 )
		{
			return( version_compare( $v1, $v2 ));
		}
    }
?>