Skip to content

PharPackageTask wrong format of path in webstub and/or clistub when building on Windows #809

Closed
@gfaust-qb

Description

The documentation describes webstub and clistub in PharPackageTask as relative path in the phar-archive.
When building on a windows system this path is build in the windows-format with \ as directory separator. Using this phar-archive in a linux-environment fails with the message: src\cli.php not found.
In the generated stub.php (nearly) all paths have / as directory separator except the entries for webstub and clistub (or are replaced by OS-independent constant DIRECTORY_SEPARATOR).
Example:
<pharpackage basedir="./" destfile="./build/${phing.project.name}.phar" webstub="./src/web.php" clistub="src/cli.php">

Result (affected lines and correct lines from generated stub.php):
$web = 'src\web.php';
...
const START = 'src\sftp_sync.php';
...
if (!file_exists($temp . DIRECTORY_SEPARATOR . md5_file(__FILE__))) { self::_removeTmpFiles($temp, getcwd()); @mkdir($temp, 0777, true); @file_put_contents($temp . '/' . md5_file(__FILE__), '');

Edit: This affects all versions at least from 2.12.0

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions