PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.4.11
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.4.11
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
visualizer / vendor / markbaker / matrix / buildPhar.php

buildPhar.php in Visualizer – Tables & Charts Manager with Built-in AI Generator 3.4.11, at vendor/markbaker/matrix/buildPhar.php

63 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 # required: PHP 5.3+ and zlib extension
4
5 // ini option check
6 if (ini_get('phar.readonly')) {
7 echo "php.ini: set the 'phar.readonly' option to 0 to enable phar creation\n";
8 exit(1);
9 }
10
11 // output name
12 $pharName = 'Matrix.phar';
13
14 // target folder
15 $sourceDir = __DIR__ . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR;
16
17 // default meta information
18 $metaData = array(
19 'Author' => 'Mark Baker <mark@lange.demon.co.uk>',
20 'Description' => 'PHP Class for working with Matrix numbers',
21 'Copyright' => 'Mark Baker (c) 2013-' . date('Y'),
22 'Timestamp' => time(),
23 'Version' => '0.1.0',
24 'Date' => date('Y-m-d')
25 );
26
27 // cleanup
28 if (file_exists($pharName)) {
29 echo "Removed: {$pharName}\n";
30 unlink($pharName);
31 }
32
33 echo "Building phar file...\n";
34
35 // the phar object
36 $phar = new Phar($pharName, null, 'Matrix');
37 $phar->buildFromDirectory($sourceDir);
38 $phar->setStub(
39 <<<'EOT'
40 <?php
41 spl_autoload_register(function ($className) {
42 include 'phar://' . $className . '.php';
43 });
44
45 try {
46 Phar::mapPhar();
47 } catch (PharException $e) {
48 error_log($e->getMessage());
49 exit(1);
50 }
51
52 include 'phar://functions/sqrt.php';
53
54 __HALT_COMPILER();
55 EOT
56 );
57 $phar->setMetadata($metaData);
58 $phar->compressFiles(Phar::GZ);
59
60 echo "Complete.\n";
61
62 exit();
63