Skip to content

Commit e9e205b

Browse files
committed
Made extrasetup.php mode flexible.
1 parent 604f2ef commit e9e205b

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

extrasetup.php

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
11
<?php
22
$extrafiles = array();
3+
34
$phpDir = Pyrus\Config::current()->php_dir . DIRECTORY_SEPARATOR;
5+
$packages = array('PEAR2/Autoload');
46

5-
$PEAR2_Autoload_Path = 'PEAR2/Autoload.php';
6-
$extrafiles = array(
7-
'src/' . $PEAR2_Autoload_Path => $phpDir . $PEAR2_Autoload_Path
8-
);
7+
foreach ($packages as $pkg) {
8+
$prefix = $phpDir . $pkg;
9+
10+
if (is_dir($prefix)) {
11+
foreach (
12+
new RecursiveIteratorIterator(
13+
new RecursiveDirectoryIterator(
14+
$prefix,
15+
RecursiveDirectoryIterator::UNIX_PATHS
16+
),
17+
RecursiveIteratorIterator::LEAVES_ONLY
18+
) as $path
19+
) {
20+
$pathname = $path->getPathname();
21+
$extrafiles['src/' . $pathname] = $pathname;
22+
}
23+
}
24+
25+
if (is_file($prefix . '.php')) {
26+
$extrafiles['src/' . $pkg . '.php'] = $prefix . '.php';
27+
}
28+
}

packagexmlsetup.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
$package->files[$filename] = array_merge_recursive(
116116
$package->files[$filename]->getArrayCopy(), $srcFileTasks
117117
);
118+
118119
if ($hasCompatible) {
119120
$compatibleFilename = str_replace('src/', 'php/', $filename);
120121
$compatible->files[$compatibleFilename] = array_merge_recursive(

0 commit comments

Comments
 (0)