-
Notifications
You must be signed in to change notification settings - Fork 3
/
stub.php
27 lines (27 loc) · 917 Bytes
/
stub.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env php
<?php
if (version_compare(phpversion(), '5.3.0', '<')
&& substr(phpversion(), 0, 5) != '5.3.0') {
// this small hack is because of running RCs of 5.3.0
echo "SimpleChannelServer requires PHP 5.3.0 or newer.\n";
exit -1;
}
foreach (array('sqlite3', 'phar', 'spl', 'pcre', 'simplexml') as $ext) {
if (!extension_loaded($ext)) {
echo 'Extension ', $ext, " is required\n";
exit -1;
}
}
function pyrus_autoload($class)
{
$class = str_replace(array('_','\\'), '/', $class);
if (file_exists('phar://' . __FILE__ . '/Pyrus_SimpleChannelServer-@PACKAGE_VERSION@/php/' .
$class . '.php')) {
include 'phar://' . __FILE__ . '/Pyrus_SimpleChannelServer-@PACKAGE_VERSION@/php/' .
$class . '.php';
}
}
spl_autoload_register("pyrus_autoload");
$cli = new \Pyrus\SimpleChannelServer\CLI();
$cli->process();
__HALT_COMPILER();