Last active
April 25, 2017 23:59
-
-
Save eriktorsner/f68f89c6bdf293dc90dcc2169bf3754f to your computer and use it in GitHub Desktop.
Snippet from hello-bootstrap.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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