Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 30 lines (26 sloc) 0.982 kB
1a00a19 adding a simpler script for making the phar file
Jonthan Moss authored
1 <?php
2cf0fae making the make_phar.php script a little friendlier
Jonthan Moss authored
2
3 if (ini_get('phar.readonly')) {
4 echo "You must set the php.ini option 'phar.readonly = 0' to enable phar creation";
5 die();
6 }
7
1a00a19 adding a simpler script for making the phar file
Jonthan Moss authored
8 $filename = 'Morph.phar';
9 $base_dir = dirname(__FILE__);
10 $src_dir = $base_dir . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'morph' . DIRECTORY_SEPARATOR;
11 $metadata = array(
12 'Author' => 'Jonathan Moss <xirisr@gmail.com>',
13 'Decription' => 'The Morph package provides a high level framework for working with MongoDB',
14 'Copyright' => 'Jonathan Moss (c) 2008-' . date('Y'),
15 'Build' => time(),
16 'Created Date' => date('Y-m-d H:I:S'),
17 );
18
19 if (file_exists($filename)) {
2cf0fae making the make_phar.php script a little friendlier
Jonthan Moss authored
20 echo "Deleteing the old phar file\n";
1a00a19 adding a simpler script for making the phar file
Jonthan Moss authored
21 unlink($filename);
22 }
23
2cf0fae making the make_phar.php script a little friendlier
Jonthan Moss authored
24 echo "Creating phar file...\n";
1a00a19 adding a simpler script for making the phar file
Jonthan Moss authored
25 $phar = new Phar($filename, 0, 'Morph');
26 $phar->buildFromDirectory($src_dir);
27 $phar->setStub(file_get_contents($src_dir . '..' . DIRECTORY_SEPARATOR . 'bootstrap.php'));
2cf0fae making the make_phar.php script a little friendlier
Jonthan Moss authored
28 $phar->setMetadata($metadata);
29 $phar->compressFiles(Phar::GZ);
7713f90 adding a fetchByObjectId function
Jonthan Moss authored
30 echo "All done!\n";
Something went wrong with that request. Please try again.