This repository was archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphar.php
More file actions
80 lines (63 loc) · 2.01 KB
/
phar.php
File metadata and controls
80 lines (63 loc) · 2.01 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
echo "Building...\n\r";
$f = "amonite.phar";
if( file_exists( $f ) )
unlink( $f );
$p = new Phar( $f );
define( "LIB", __DIR__ . "/libraries/" );
$files = array(
// INTERFACES
LIB . "Answerable.interface.php",
LIB . "Model.interface.php",
LIB . "Row.interface.php",
// FUNCTIONS
LIB . "Main.function.php",
// CLASSES
LIB . "Backup.class.php",
LIB . "Component.class.php",
LIB . "Constants.class.php",
LIB . "Content.class.php",
LIB . "Controller.class.php",
LIB . "CustomException.class.php",
LIB . "Document.class.php",
LIB . "DownloadFile.class.php",
LIB . "Email.class.php",
LIB . "File.class.php",
LIB . "HttpCode.class.php",
LIB . "ModelBSON.class.php",
LIB . "ModelPDO.class.php",
LIB . "Observer.class.php",
LIB . "Request.class.php",
LIB . "Response.class.php",
LIB . "RowBSON.class.php",
LIB . "RowPDO.class.php"
);
foreach( $files as $file ) {
$p->addFile( $file, basename( $file ) );
}
$p->setStub( '<?php
/** @SECURITY Anti-DDOS system */
time_nanosleep( 0 , 1 );
defined( "ROOT" ) or define( "ROOT", realpath( __DIR__ ) );
$pharname = basename( __FILE__ );
/** @SECURITY Catch errors */
require_once "phar://$pharname/CustomException.class.php";
Amonite\CustomException::set_error_handler();
Amonite\CustomException::set_fatal_handler();
/** @APPLICATION Function, Content, Database */
require_once "phar://$pharname/Main.function.php";
require_once "phar://$pharname/Request.class.php";
require_once "phar://$pharname/Response.class.php";
require_once "phar://$pharname/Controller.class.php";
require_once "phar://$pharname/RowBSON.class.php";
require_once "phar://$pharname/RowPDO.class.php";
require_once "phar://$pharname/Component.class.php";
require_once "phar://$pharname/Document.class.php";
require_once "phar://$pharname/DownloadFile.class.php";
/** If you need... */
require_once "phar://$pharname/Backup.class.php";
require_once "phar://$pharname/Email.class.php";
__HALT_COMPILER();
?>' );
echo "Phar build !\n\r";
echo "Version: " . round( microtime( true ) * 1000 ) . "\n\r";