forked from iron-io/iron_cache_php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.php
34 lines (27 loc) · 857 Bytes
/
build.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
28
29
30
31
32
33
34
<?php
/**
* This script creates .phar archive with all required dependencies.
* Archive usage:
* include("phar://iron_cache.phar");
* or
* include("phar://".dirname(__FILE__)."/iron_cache.phar");
*/
@unlink('iron_cache.phar');
$phar = new Phar('iron_cache.phar');
# Loader
$phar->setStub('<?php
Phar::mapPhar("iron_cache.phar");
if (!class_exists("IronCore")){
require "phar://iron_cache.phar/IronCore.class.php";
}
require "phar://iron_cache.phar/IronCache.class.php";
__HALT_COMPILER(); ?>');
# Files
$phar->addFile('../iron_core_php/IronCore.class.php','IronCore.class.php');
$phar->addFile('IronCache.class.php');
$phar->addFile('LICENSE', 'LICENSE');
echo "\ndone - ".(round(filesize('iron_cache.phar')/1024,2))." KB\n";
# Verification
require "phar://iron_cache.phar";
$cache = new IronCache();
echo "Build finished successfully\n";