Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@eriktorsner
Last active April 25, 2017 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eriktorsner/f68f89c6bdf293dc90dcc2169bf3754f to your computer and use it in GitHub Desktop.
Save eriktorsner/f68f89c6bdf293dc90dcc2169bf3754f to your computer and use it in GitHub Desktop.
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