# PEAR Build fix

- Thread: https://externals.io/message/39463
- Original archive: https://news-web.php.net/php.internals/39463
- Started by Rasmus Lerdorf on 2008-07-30T14:12:35+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #39463 — Rasmus Lerdorf — 2008-07-30T14:12:35+00:00

URL: https://externals.io/message/39463#39463

Could someone please fix this:

Generating phar.php
Generating phar.phar
Pear package PHP_Archive found: API Version: 1.0.0 (stable).
Pear package PHP_Archive or Archive.php class file not found.
clicommand.inc
directorygraphiterator.inc
directorytreeiterator.inc
invertedregexiterator.inc
pharcommand.inc
phar.inc

Build complete.
Don't forget to run 'make test'.

The problem is that in phar.php it does a

   pear list-files PHP_Archive

This outputs a bunch of filenames ending with:

test /usr/local/lib/php/test/PHP_Archive/tests/test_require.php
test /usr/local/lib/php/test/PHP_Archive/tests/test_tar.tar
test /usr/local/lib/php/test/PHP_Archive/tests/twophars.phpt
php  /usr/local/lib/php/PHP/Archive.php

in phar.php the regex to check if Archive.php exists looks like this:

if (preg_match(",^php[ \t]+([^ 
\t].*pear[\\\\/]PHP[\\\\/]Archive.php)$,", $ent, $matches)) {

which is obviously not going to match that last Archive.php line.  So, 
two fixes here.  First, fix the error message to more accurately 
describe what is going on.  And second, assuming 
/usr/local/lib/php/PHP/Archive.php is the right file here, fix the regex.

-Rasmus

---

## #39523 — Marcus Boerger — 2008-08-01T06:24:59+00:00

URL: https://externals.io/message/39463#39523 · In reply to: #39463

Hello Rasmus,

Wednesday, July 30, 2008, 4:12:35 PM, you wrote:

> Could someone please fix this:

> Generating phar.php
> Generating phar.phar
> Pear package PHP_Archive found: API Version: 1.0.0 (stable).
> Pear package PHP_Archive or Archive.php class file not found.
> clicommand.inc
> directorygraphiterator.inc
> directorytreeiterator.inc
> invertedregexiterator.inc
> pharcommand.inc
> phar.inc

> Build complete.
> Don't forget to run 'make test'.

> The problem is that in phar.php it does a

>    pear list-files PHP_Archive

> This outputs a bunch of filenames ending with:

> test /usr/local/lib/php/test/PHP_Archive/tests/test_require.php
> test /usr/local/lib/php/test/PHP_Archive/tests/test_tar.tar
> test /usr/local/lib/php/test/PHP_Archive/tests/twophars.phpt
> php  /usr/local/lib/php/PHP/Archive.php

> in phar.php the regex to check if Archive.php exists looks like this:

> if (preg_match(",^php[ \t]+([^ 
> \t].*pear[\\\\/]PHP[\\\\/]Archive.php)$,", $ent, $matches)) {

> which is obviously not going to match that last Archive.php line.  So, 
> two fixes here.  First, fix the error message to more accurately 
> describe what is going on.  And second, assuming 
> /usr/local/lib/php/PHP/Archive.php is the right file here, fix the regex.

  thanks! & fixed.

marcus





Best regards,
 Marcus
