forked from pear2/Net_RouterOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextrasetup.php
53 lines (48 loc) · 1.5 KB
/
extrasetup.php
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
<?php
/**
* File extrasetup.php for PEAR2_Net_RouterOS.
*
* PHP version 5.3
*
* @category Net
* @package PEAR2_Net_RouterOS
* @author Vasil Rangelov <[email protected]>
* @copyright 2011 Vasil Rangelov
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version GIT: $Id$
* @link http://pear2.php.net/PEAR2_Net_RouterOS
*/
$extrafiles = array();
$phpDir = Pyrus\Config::current()->php_dir;
$packages = array(
'PEAR2/Autoload',
'PEAR2/Cache/SHM',
'PEAR2/Console/CommandLine',
'PEAR2/Console/Color',
'PEAR2/Net/Transmitter'
);
//Quick&dirty workaround for Console_CommandLine's xmlschema.rng file.
$extrafiles['data/pear2.php.net/PEAR2_Console_CommandLine/xmlschema.rng']
= Pyrus\Config::current()->data_dir . DIRECTORY_SEPARATOR .
'pear2.php.net/PEAR2_Console_CommandLine/xmlschema.rng';
$oldCwd = getcwd();
chdir($phpDir);
foreach ($packages as $pkg) {
if (is_dir($pkg)) {
foreach (new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(
$pkg,
RecursiveDirectoryIterator::UNIX_PATHS
| RecursiveDirectoryIterator::SKIP_DOTS
),
RecursiveIteratorIterator::LEAVES_ONLY
) as $path) {
$extrafiles['src/' . $path->getPathname()] = $path->getRealPath();
}
}
if (is_file($pkg . '.php')) {
$extrafiles['src/' . $pkg . '.php']
= $phpDir . DIRECTORY_SEPARATOR . $pkg . '.php';
}
}
chdir($oldCwd);