release v4.1.3
[pharext/pharext] / bin / pharext.update
1 #!/usr/bin/php -dphar.readonly=0
2 <?php
3
4 /**
5 * The installer updater stub for extension phars
6 */
7
8 namespace pharext;
9
10 spl_autoload_register(function($c) {
11 return include strtr($c, "\\_", "//") . ".php";
12 });
13
14 set_include_path('phar://' . __FILE__ .":". get_include_path());
15
16 if (!extension_loaded("Phar")) {
17 fprintf(STDERR, "ERROR: Phar extension not loaded\n\n");
18 fprintf(STDERR, "\tPlease load the phar extension in your php.ini\n".
19 "\tor rebuild PHP with the --enable-phar flag.\n\n");
20 exit(1);
21 }
22
23 if (ini_get("phar.readonly")) {
24 fprintf(STDERR, "ERROR: Phar is configured read-only\n\n");
25 fprintf(STDERR, "\tPlease specify phar.readonly=0 in your php.ini\n".
26 "\tor run this command with php -dphar.readonly=0\n\n");
27 exit(1);
28 }
29
30 \Phar::interceptFileFuncs();
31 \Phar::mapPhar();
32
33 $updater = new Updater();
34 $updater->run($argc, $argv);
35
36 __HALT_COMPILER(); ?>
37 Ê\ e