forked from gocom/MassPlugCompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompile
More file actions
executable file
·71 lines (57 loc) · 1.34 KB
/
compile
File metadata and controls
executable file
·71 lines (57 loc) · 1.34 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
#!/usr/bin/php
<?php
/**
* Command-line wrapper-interface for rah_plugcompiler
*
* @package rah_plugcompiler
* @author Jukka Svahn
* @copyright (c) 2011 Jukka Svahn
* @license GNU GPLv2
* @link https://github.com/gocom/MassPlugCompiler
*
* Copyright (c) 2011 Jukka Svahn <http://rahforum.biz>
* Licensed under GNU Genral Public License version 2
* http://www.gnu.org/licenses/gpl-2.0.html
*
* Requires PHP 5.2.0
*/
while (1) {
if ($argc <= 1) {
echo "Source directory:\n";
$handle = fopen('php://stdin', 'r');
$path = trim(fgets($handle));
} else {
$path = $argv[1];
}
if (empty($path)) {
$path = dirname(__FILE__);
}
if (!file_exists($path) ||
!is_dir($path) ||
!is_readable($path)
) {
echo "Is not valid directory\n";
exit;
}
$rundir = dirname(__FILE__);
include_once $rundir . '/rah_plugcompile.php';
$cache = $rundir . '/packages';
if (!empty($argv[2])) {
$cache = $argv[2];
} elseif (!file_exists($cache)) {
mkdir($cache);
}
rah_plugcompile::instance()
->set('cache', $cache);
echo rah_plugcompile::instance()
->set('source', $path)
->package()
->get();
rah_plugcompile::instance()
->write();
if ($argc > 1) {
exit;
}
}
exit;
?>