Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify init #288

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

simplify init #288

wants to merge 1 commit into from

Conversation

fain182
Copy link
Collaborator

@fain182 fain182 commented Aug 19, 2022

I am not sure about this one, the different includes seems redundant, without this code the CI is green...
Any additional test we can make to check if this is useful?

@AlessandroMinoccheri
Copy link
Member

Did you try to generate the phar file without those lines and verify that it works fine?
Can we automate this check?

  • Generate phar
  • using phar with some rule with some files

@AlessandroMinoccheri AlessandroMinoccheri added the enhancement New feature or request label Aug 19, 2022
@fain182
Copy link
Collaborator Author

fain182 commented Aug 19, 2022

I tried to generate the phar (with make phar) but it failed, even on the main branch..

But if I understand correctly the github action make a smoke test on the phar:
https://github.com/phparkitect/arkitect/blob/main/.github/workflows/build.yml#L116

@AlessandroMinoccheri
Copy link
Member

The smoke test was done for that: test the phar generation.
@micheleorselli what do you think?

@AlessandroMinoccheri
Copy link
Member

Which error do you get @fain182 ?
It's about /tmp/.. permission, right?

}

require PHPARKITECT_COMPOSER_INSTALL;
require __DIR__ . '/../vendor/autoload.php';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK the only thing the above code is supposed to do is setting PHPARKITECT_COMPOSER_INSTALL as a way to say the package was installed via composer 🤔

To me it can be safely removed

On the other hand, I am not totally sure about adding this line: what is it effect?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me seems more like:

  • try to find and autoloader (why? it's always in the same place)
  • setup a warning if composer install has not been executed yet
  • include the autoload

The situation is different if we are searching the autoload of the project ouside of the phar, but I don't think it's this case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are totally right... let's remove it then

@fain182
Copy link
Collaborator Author

fain182 commented Aug 30, 2022

Which error do you get @fain182 ? It's about /tmp/.. permission, right?

the first error is:

bin/box.phar compile -c /tmp/arkitect/box.json
make: bin/box.phar: Permesso negato
make: *** [Makefile:26: phar] Errore 127

If I correct the permission, it says something strange about PHP versions...
Schermata del 2022-08-30 14-33-26

@micheleorselli
Copy link
Contributor

micheleorselli commented Aug 30, 2022

Which error do you get @fain182 ? It's about /tmp/.. permission, right?

the first error is:

bin/box.phar compile -c /tmp/arkitect/box.json
make: bin/box.phar: Permesso negato
make: *** [Makefile:26: phar] Errore 127

If I correct the permission, it says something strange about PHP versions... Schermata del 2022-08-30 14-33-26

If I remember correctly, the Box version we have works fine php 7.1, which is the version we use to generate the phar. Other 7.x version should work, 8.x version will not. More recent Box version will work with php 8, but they dropped the support for php 7.1

Long story short, if you want to generate the phar you need to have php 7

@fain182 fain182 added this to the v1 milestone Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants