Code Search for Developers
 
 
  

lib.php from Astrum Futura at Krugle


Show lib.php syntax highlighted

<?php

function af_checkMinPhpVersion()
{
	if(version_compare(PHP_VERSION, '5.2.0', '>='))
	{
		return true;
	}
	
	return false;
}

/**
 * This gets the available languages from the lang folder
 *
 * @name af_getLanguageDir()
 * @returns array
 */
function af_getLanguageDir()
{
	$dirIt = new DirectoryIterator('./lang');
	$languages = array();
	
	/**
	 * @todo Need to check what the key and current returns
	 *         So that the directories can be recorded.
	 */
	foreach($dirIt as $key => $current)
	{
		var_dump($key);
		echo "<br />\n";
		var_dump($current);
	}
	
	return $languages;
}

/**
 * This gets the language from the URL and returns it for the front
 * controller
 *
 * @name af_getLanguageUrl()
 * @returns string
 */
function af_getLanguageUrl()
{
	if(isset($_GET['lang']) && preg_match("/^[a-zA-Z-]+$/i", $_GET['lang']))
	{
		return $_GET['lang'];
	}
	
	return 'en';
}

/**
 * The step returned is an integer which is for the front controller. The range is
 * from 0-N and only needs to have a file in the lang language folder to be valid.
 * The validation of the step is done in another function.
 *
 * @name af_getStep()
 * @returns int
 */
function af_getStep()
{
	if(!isset($_GET['step']) || (is_numeric($_GET['step']) && $_GET['step'] == 0))
	{
		return (int) 0;
	}
	else if(is_numeric($_POST['step']))
	{
		return (int) $_POST['step'];
	}
	
	return 0;
}

function af_isStepValid()
{
	
}



See more files for this project here

Astrum Futura

Multiplayer space strategy game written in PHP5 with the Zend Framework. User interface uses Javascript/AJAX for dynamic interaction. Players compete across a hexagonal map of 10,000 sectors, planets, stars and other locations through trade and combat.

Project homepage: http://sourceforge.net/projects/astrumfutura
Programming language(s): PHP,XML
License: other

  lang/
    de/
      step_0.tpl.html
      step_1.tpl.html
      step_2.tpl.html
    en/
      step_0.tpl.html
      step_1.tpl.html
      step_2.tpl.html
  index.php
  lib.php