Your IP : 216.73.216.68


Current Path : /home/sunflowe/www2/j15/administrator/components/com_easycaptcha/helpers/
Upload File :
Current File : /home/sunflowe/www2/j15/administrator/components/com_easycaptcha/helpers/version.php

<?php
/**
 * @version $Id: version.php 629 2008-03-16 16:59:39Z snipersister $
 * @package    EasyCaptcha
 * @link http://www.easy-joomla.org
 * @license    GNU/GPL
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

jimport( 'joomla.application.component.helper' );

class EasyCaptchaHelperVersion extends JObject {
	var $_current;
	var $_link = '/components/com_versions/directinfo.php?catid=4';
	
	function __construct()
	{
		$this->_loadVersion();
	}
	
	function _loadVersion()
	{
		require_once( JPATH_COMPONENT.DS.'libraries'.DS.'httpclient.class.php' );
		$client = new HttpClient('www.easy-joomla.org');
		
			if (!$client->get($this->_link)) {
				$this->setError($client->getError());
				return false;
			}
		
		$this->_current = $client->getContent();
		return true;
	}
	
	function checkVersion($version)
	{
		if($version == $this->_current)
		{
			return 1;
		}
		elseif($this->getErrors())
		{
			return -2;
		}
		else
		{
			return -1;
		}
		
	}
	
	function getVersion()
	{
		return $this->_current;
	}
	
}
?>