Instantly share code, notes, and snippets.

Embed
What would you like to do?
Snippet from hello-bootstrap.php
<?php
/**
* The main plugin function. Checks php version
* and initialize our classes
*/
function helloTestableBootstrap()
{
$pluginVersion = '0.1.0';
if (defined('DOING_AJAX') && DOING_AJAX) {
return;
}
if (version_compare(PHP_VERSION, '5.3.9', '>=')) {
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/src/RuntimeProvider.php';
if (!defined('HELLO_TESTABLE_VERSION')) {
define('HELLO_TESTABLE_VERSION', $pluginVersion);
}
$app = new helloTestable\Pimple\Container();
$app->register(new helloTestable\RuntimeProvider());
$helloTestable = $app['helloTestable'];
add_action('init', array($helloTestable, 'init'));
} else {
register_activation_hook(__FILE__, 'hello_testable_php_version_too_low');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment