src/GreenCape/JoomlaCLI/Driver/Factory.php
private function loadVersion($basePath)
	{
		static $locations = array(
			'/libraries/cms/version/version.php',
			'/libraries/joomla/version.php',
		);

		define('_JEXEC', 1);

		foreach ($locations as $location)
		{
			if (file_exists($basePath . $location))
			{
				$code = file_get_contents($basePath . $location);
				$code = str_replace("defined('JPATH_BASE')", "defined('_JEXEC')", $code);
				eval('?>' . $code);

				return new \JVersion;
			}
		}
		throw new \RuntimeException('Unable to locate version information');
	}
private function loadVersion($basePath)
	{
		static $locations = array(
			'/libraries/cms/version/version.php',
			'/libraries/joomla/version.php',
		);

		define('_JEXEC', 1);

		foreach ($locations as $location)
		{
			if (file_exists($basePath . $location))
			{
				$code = file_get_contents($basePath . $location);
				$code = str_replace("defined('JPATH_BASE')", "defined('_JEXEC')", $code);
				eval('?>' . $code);

				return new \JVersion;
			}
		}
		throw new \RuntimeException('Unable to locate version information');
	}
private function loadVersion ( $ basePath ) { static $ locations = array ( '/libraries/cms/version/version.php' , '/libraries/joomla/version.php' , ) ; define ( '_JEXEC' , 1 ) ; foreach ( $ locations as $ location ) { if ( file_exists ( $ basePath . $ location ) ) { $ code = file_get_contents ( $ basePath . $ location ) ; $ code = str_replace ( "defined('JPATH_BASE')" , "defined('_JEXEC')" , $ code ) ; eval ( '?>' . $ code ) ; return new \ JVersion ; } } throw new \ RuntimeException ( 'Unable to locate version information' ) ; }
Load the Joomla version

@param   string $basePath  The Joomla base path (same as JPATH_BASE within Joomla)

@return  \JVersion

@throws  \RuntimeException
Load the Joomla version