-
-
Notifications
You must be signed in to change notification settings - Fork 688
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
PHAR alternative - build PrefixedRector #449
Conversation
Great job 👍 I can handle regulars, if that's pain for you. It looks like wrong screenshot, since it replaces classes. |
It is not wrong screen I wanted to make simple preview it is already somehow working:D Notice I run that under build directory. |
As of regular expressions I had to use perl instead sed as I was unable to get that working with sed. |
I see. Yesterday we talked about
|
@@ -0,0 +1,14 @@ | |||
-----BEGIN PUBLIC KEY----- | |||
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxKi/ABhiCMn7hqH9/W0x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHP Scoper should be a dependnecy in composer.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In docs it is not recommended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs is not a dog, nor God :)
Still, should be dependency in composer.json
. Without that we have to maintain phar manually.
What advantages do you see?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conflict avoidance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bamarni/composer-bin-plugin or phive can both help out there (see this article)[https://medium.com/@tfidry/managing-your-dependencies-in-php-321d584441ab]. But I advise against relying on committing the PHAR:
- it's really heavy on the Git history
- it's much harder to cherry-pick a branch to try a bugfix or something
If you want to go that way nonetheless, I recommend to mark the public key as a binary file as well in .gitattributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So phar seems as the best option for the time being. It doesn't evolve much and the php-parser 4 + better reflectoin is main blocker there, so missing update-ability won't be such a problem.
This pull request is not about |
Oh, the image it not for the PR you provided, but for the tool it generated. I get it now |
@mssimi what about doing that in PHP-Scoper directly? I think it would be more interesting to have it able to scope a Symfony application out of the box rather than requiring every user to meddle with regexes |
What exactly do you mean by this? |
I mean instead of trying to modify the YAML service files like that, a support could be added to PHP-Scoper to be able to change the YAML files directly |
I see, that's more clear, thanks. I can look on that later. At the moment I'd like skip How to do that? I found only Whitelist: https://github.com/humbug/php-scoper#whitelist: return [
'whitelist' => [
'PHPUnit\Framework\TestCase',
],
]; but it seems only accepts fully class names only. We need: return [
'whitelist' => [
'Rector\*',
],
]; |
Yes for now. We need to find an easier way to whitelist stuff (see humbug/php-scoper#192 (comment)) and extend it to constants and functions as well (potentially way more tricky). |
I used RobotLoader for now. |
rectorphp/rector-src@e3f0952 github-actions: declare timeout for job execution (#449)
the default of 6h is way to long and produced a overlong queue in case of endless loop bugs Co-authored-by: Markus Staab <[email protected]>
It is not complete, but already got working proof of concept:)
I'm taking a little break now that regular expressions killing me:)
What is missing: