-
Notifications
You must be signed in to change notification settings - Fork 117
/
extrasetup.php
48 lines (44 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
<?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
*/
$packages = array(
'pear2.php.net' => array(
'PEAR2_Autoload',
'PEAR2_Cache_SHM',
'PEAR2_Net_Transmitter',
'PEAR2_Console_CommandLine',
'PEAR2_Console_Color'
)
);
$extrafiles = array();
$config = Pyrus\Config::current();
$registry = $config->registry;
$phpDir = $config->php_dir;
$dataDir = $config->data_dir;
foreach ($packages as $channel => $channelPackages) {
foreach ($channelPackages as $package) {
foreach ($registry->toPackage($package, $channel)->installcontents
as $file => $info) {
if (strpos($file, 'php/') === 0 || strpos($file, 'src/') === 0) {
$filename = substr($file, 4);
$extrafiles['src/' . $filename]
= realpath($phpDir . DIRECTORY_SEPARATOR . $filename);
} elseif (strpos($file, 'data/') === 0) {
$filename = substr($file, 5);
$extrafiles["data/{$channel}/{$package}/{$filename}"]
= realpath($dataDir . DIRECTORY_SEPARATOR . $channel . DIRECTORY_SEPARATOR . $package . DIRECTORY_SEPARATOR . $filename);
}
}
}
}