codeigniter4 / CodeIgniter4

Open Source PHP Framework (originally from EllisLab)
https://codeigniter.com/
MIT License
5.35k stars 1.9k forks source link

Bug: Problem when compiled vendor as PHAR file #2623

Closed enix-app closed 4 years ago

enix-app commented 4 years ago

Describe the bug I tried to compile all vendor dir into PHAR file as vendor.phar for example. The problem, codeigniter4/framework package shown errors because in codeigniter/framework/system/bootstrap.php use realpath() function and PHAR file doesn't support it. PHP docs says:

The function realpath() will not work for a file which is inside a Phar as such path would be a virtual path, not a real one.

CodeIgniter 4 version Target version 4.1.x

Affected module(s) vendor/codeigniter4/framework/system/bootstrap.php

Expected behavior, and steps to reproduce if appropriate I believe most of packages/vendor of composer doesn't use this function. I think, move system/bootstrap.php to app directory (app/Config/Boot/bootstrap.php) can solve this.

MGatner commented 4 years ago

Support for compiling the framework files is not a give. I am not opposed to looking into this but would consider it a feature and an addition, and I would like to see it brought up on the forums first. Alternatively you could submit a PR for review, but I would recommend ways around using realpath rather than moving bootstrap which, IMO, should not normally be modified be developers.