Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Config] FileLocator does not work in a phar #58708

Copy link
Copy link
Closed
@lyrixx

Description

@lyrixx
Issue body actions

Symfony version(s) affected

6.4.13

Description

The code does not work anymore. This is due to 1866ba2#diff-d08f24bd2c3ea5b2215dc3e17072095e89f6f7b05ce634022e5ced0c8d648ac0L87

How to reproduce

In symfony/symfony, on commit 1866ba2 and its parent e39f6a9, add an index.php:

#!/usr/bin/env php
<?php

require __DIR__.'/vendor/autoload.php';

use Symfony\Component\Config\FileLocator;

$locator = new FileLocator();

$x = $locator->locate(__DIR__ . '/index.php');
dump($x);

execute it: ✅

now, use box to make a phar box compile, then execute it ❌:

PHP Fatal error:  Uncaught Symfony\Component\Config\Exception\FileLocatorFileNotFoundException: The file "index.php" does not exist (in: "phar:///home/gregoire/dev/github.com/lyrixx/symfony/index.phar"). in phar:///home/gregoire/dev/github.com/lyrixx/symfony/index.phar/src/Symfony/Component/Config/FileLocator.php:71
Stack trace:
#0 phar:///home/gregoire/dev/github.com/lyrixx/symfony/index.phar/index.php(10): Symfony\Component\Config\FileLocator->locate()
#1 /home/gregoire/dev/github.com/lyrixx/symfony/index.phar(14): require('...')
#2 {main}
  thrown in phar:///home/gregoire/dev/github.com/lyrixx/symfony/index.phar/src/Symfony/Component/Config/FileLocator.php on line 71

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.