Skip to content

Instantly share code, notes, and snippets.

@janich
Created October 3, 2013 12:42
Show Gist options
  • Save janich/6809206 to your computer and use it in GitHub Desktop.
Save janich/6809206 to your computer and use it in GitHub Desktop.
Include version specific integration
<?php
$jversion = new JVersion();
$version = $jversion->RELEASE;
do {
$file = 'integration-j'. str_replace('.', '', $version);
if (file_exists($file)) {
require_once $file;
define('INTEGRATION_SUCESS', 1);
}
$position = strpos($version, '.');
$version = substr($version, 0, $position);
}
while (false !== $position);
defined('INTEGRATION_SUCESS') or die('No integration found for your version');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment