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

php: whitespace and cleanup #8374

Closed
wants to merge 26 commits into from

Conversation

iefdev
Copy link
Contributor

@iefdev iefdev commented Sep 9, 2020

Description

commit 1

php: whitespace and cleanup

  • Clean up the whitespace
  • Make sure the intendation is correct throughout
    the file
commit 2

php: fix postgresql variants

  • Reformat the variants for better readability
  • Cut long lines to < 100, etc
commit 3

php-apache2handler: req mpms_shared_all instead of preforkmpm

  • req mpms_shared_all instead of preforkmpm
  • apache2: add +mpms_shared_all to default_variants

When installing the php-apache2handler it requires the preforkmpm to
be installed, which prevents the use of the other variant on the server
due to conflicts. That was what the mpms_shared_all variant was added
for, to be able to use all different mpms on the same apache2 install -
to be able to set up and run different virtualhosts with different mpms
&/or php versions.

So, it's better to require mpms_shared_all, and then add to the notes
they need to run the php-apache2handler in a preforkmpm mode.

Type(s)
  • enhancement
Tested on

macOS 10.7.5 11G63
Xcode 4.6.3 4H1503

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL?
  • checked your Portfile with port lint?
  • tried a full install with sudo port -vst install php74-postgresql +postgresql95?
Notes

This is a PR I've wanted to do for some time now. And after the update yesterday I thought it was a good opportunity to do it now when I already had it open. It's quite a lot, but it's also a 2000+ lines file. (also see the trac ticket)

First commit is really a mess to look at in the diff, since it's moving part/blocks all around beacause of the change of intendetion. And it looks a lot more than it really is. It's easier to just look at the files side-by-side to follow along. Perhaps using GUI like Meld could be better - to spot the whitespace changes, etc.

2'nd commit I'm really pleased with, and I've made a test install to make sure it worked (php74-postgresql +postgresql95).

3'rd one is a small change I personally need to be able to upgrade/change my custom server to MP. It doesn't change anything, just makes it more flexible to use (see commit msg)

Hopefully it'll be a bit easier to both read and manage the file now. 🤞

@macportsbot
Copy link

Notifying maintainers:
@ryandesign for port php, apache2.
@Schamschula for port apache2.

@iefdev iefdev changed the title Php whitespace and cleanup php: whitespace and cleanup Sep 9, 2020
@macportsbot
Copy link

Travis Build #13910 Passed.

Lint results
--->  Verifying Portfile for php
--->  0 errors and 0 warnings found.
--->  Verifying Portfile for apache2
--->  0 errors and 0 warnings found.

Port php74 success on xcode10.3. Log
Port php success on xcode10.3. Log
Port php52 success on xcode10.3. Log
Port php52-calendar success on xcode10.3. Log
Port php52-cgi success on xcode10.3. Log
Port php52-curl success on xcode10.3. Log
Port php52-dba success on xcode10.3. Log
Port php52-exif success on xcode10.3. Log
Port php52-ftp success on xcode10.3. Log
Port php52-gd success on xcode10.3. Log
Port php52-gettext success on xcode10.3. Log
Port php52-gmp success on xcode10.3. Log
Port php52-iconv success on xcode10.3. Log
Port php52-imap success on xcode10.3. Log
Port php52-ipc success on xcode10.3. Log
Port php52-ldap success on xcode10.3. Log
Port php52-mbstring success on xcode10.3. Log
Port php52-mcrypt success on xcode10.3. Log
Port php74 success on xcode9.4. Log
Port php success on xcode9.4. Log
Port php52 success on xcode9.4. Log
Port php52-calendar success on xcode9.4. Log
Port php52-cgi success on xcode9.4. Log
Port php52-curl success on xcode9.4. Log
Port php52-dba success on xcode9.4. Log
Port php52-exif success on xcode9.4. Log
Port php52-ftp success on xcode9.4. Log
Port php52-gd success on xcode9.4. Log
Port php52-gettext success on xcode9.4. Log
Port php52-gmp success on xcode9.4. Log
Port php52-iconv success on xcode9.4. Log
Port php52-imap success on xcode9.4. Log
Port php52-ipc success on xcode9.4. Log
Port php52-ldap success on xcode9.4. Log
Port php52-mbstring success on xcode9.4. Log
Port php52-mcrypt success on xcode9.4. Log
Port php74 success on xcode8.3. Log
Port php success on xcode8.3. Log
Port php52 success on xcode8.3. Log
Port php52-calendar success on xcode8.3. Log
Port php52-cgi success on xcode8.3. Log
Port php52-curl success on xcode8.3. Log
Port php52-dba success on xcode8.3. Log
Port php52-exif success on xcode8.3. Log
Port php52-ftp success on xcode8.3. Log
Port php52-gd success on xcode8.3. Log
Port php52-gettext success on xcode8.3. Log
Port php52-gmp success on xcode8.3. Log
Port php52-iconv success on xcode8.3. Log
Port php52-imap success on xcode8.3. Log
Port php52-ipc success on xcode8.3. Log
Port php52-ldap success on xcode8.3. Log
Port php52-mbstring success on xcode8.3. Log
Port php52-mcrypt success on xcode8.3. Log
Port php74 success on xcode7.3. Log
Port php success on xcode7.3. Log
Port php52 success on xcode7.3. Log
Port php52-calendar success on xcode7.3. Log
Port php52-cgi success on xcode7.3. Log
Port php52-curl success on xcode7.3. Log
Port php52-dba success on xcode7.3. Log
Port php52-exif success on xcode7.3. Log
Port php52-ftp success on xcode7.3. Log
Port php52-gd success on xcode7.3. Log
Port php52-gettext success on xcode7.3. Log
Port php52-gmp success on xcode7.3. Log
Port php52-iconv success on xcode7.3. Log
Port php52-imap success on xcode7.3. Log
Port php52-ipc success on xcode7.3. Log
Port php52-ldap success on xcode7.3. Log
Port php52-mbstring success on xcode7.3. Log
Port php52-mcrypt success on xcode7.3. Log
Port php52-mssql success on xcode7.3. Log
Port php52-mysql success on xcode7.3. Log
Port php52-odbc success on xcode7.3. Log
Port php52-openssl success on xcode7.3. Log

The build timed out.

@@ -211,7 +211,7 @@ variant eventmpm conflicts preforkmpm workermpm description {Use event MPM (expe
}

if {![variant_isset workermpm] && ![variant_isset eventmpm]} {
default_variants +preforkmpm
default_variants +preforkmpm +mpms_shared_all
Copy link
Contributor

Choose a reason for hiding this comment

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

This will not make +mpms_shared_all a default variant if the user selected +workermpm or +eventmpm. Is that what you intended?

Is there any reason for the mpms_shared_all variant to exist at all -- is there any reason why a user would want to disable that functionality? Why not build it all the time?

(This is the first time I've noticed that this variant was added to the port and I wasn't aware of this apache functionality before.)

If you add a new default variant, you must increase the revision. See https://guide.macports.org/#reference.keywords

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will not make +mpms_shared_all a default variant if the user selected +workermpm or +eventmpm. Is that what you intended?

Ah, ok. I'll remove it then.

Is there any reason for the mpms_shared_all variant to exist at all -- is there any reason why a user would want to disable that functionality? Why not build it all the time

We added it here: #3384. It's a really great function and you don't need to rebuild Apache when you want to change mpm, + you can use all mpms at the same time (i diff vhost though).

Yes, if that's ok, I'd much more prefer that as a default arg. I guess it wouldn't be needed to req any variant for the apache2handler subport since it's already been built, put perhaps not enabled. Just need a note for that, to make sure they use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, with mpms_shared_all as a default arg in the build, one could also add prefork and then remove all the mpm variants. It'll just be a matter of configuring for the user.

--enable-mpms-shared=all \
--with-mpm=prefork \

…will build all 3, and add all 3 to httpd.conf, with the prefork version uncommented.

ui_error "
${subport} @${version} requires ${php} @${version} but you have\
${php} @${php_version}.
"
Copy link
Contributor

Choose a reason for hiding this comment

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

This commit will be extremely difficult to review due to its size, so I'll just start with this "reformatting" of ui_error, which is not merely a reformatting: it changes the output that the user will see (introducing a newline before and after the error message). I don't really want that; that's not something I'm aware of us doing in any other port. Let's leave ui_errors formatted the way they were.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll fix that…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done √

@iefdev iefdev force-pushed the php-whitespace-and-cleanup branch 2 times, most recently from 59a412d to 78b2a19 Compare September 10, 2020 18:57
@macportsbot
Copy link

Travis Build #13930 Passed.

Lint results
--->  Verifying Portfile for php
--->  0 errors and 0 warnings found.
--->  Verifying Portfile for apache2
--->  0 errors and 0 warnings found.

Port php74 success on xcode10.3. Log
Port php success on xcode10.3. Log
Port php52 success on xcode10.3. Log
Port php52-calendar success on xcode10.3. Log
Port php52-cgi success on xcode10.3. Log
Port php52-curl success on xcode10.3. Log
Port php52-dba success on xcode10.3. Log
Port php52-exif success on xcode10.3. Log
Port php52-ftp success on xcode10.3. Log
Port php52-gd success on xcode10.3. Log
Port php52-gettext success on xcode10.3. Log
Port php52-gmp success on xcode10.3. Log
Port php52-iconv success on xcode10.3. Log
Port php52-imap success on xcode10.3. Log
Port php52-ipc success on xcode10.3. Log
Port php52-ldap success on xcode10.3. Log
Port php52-mbstring success on xcode10.3. Log
Port php52-mcrypt success on xcode10.3. Log
Port php74 success on xcode9.4. Log
Port php success on xcode9.4. Log
Port php52 success on xcode9.4. Log
Port php52-calendar success on xcode9.4. Log
Port php52-cgi success on xcode9.4. Log
Port php52-curl success on xcode9.4. Log
Port php52-dba success on xcode9.4. Log
Port php52-exif success on xcode9.4. Log
Port php52-ftp success on xcode9.4. Log
Port php52-gd success on xcode9.4. Log
Port php52-gettext success on xcode9.4. Log
Port php52-gmp success on xcode9.4. Log
Port php52-iconv success on xcode9.4. Log
Port php52-imap success on xcode9.4. Log
Port php52-ipc success on xcode9.4. Log
Port php52-ldap success on xcode9.4. Log
Port php52-mbstring success on xcode9.4. Log
Port php52-mcrypt success on xcode9.4. Log
Port php74 success on xcode8.3. Log
Port php success on xcode8.3. Log
Port php52 success on xcode8.3. Log
Port php52-calendar success on xcode8.3. Log
Port php52-cgi success on xcode8.3. Log
Port php52-curl success on xcode8.3. Log
Port php52-dba success on xcode8.3. Log
Port php52-exif success on xcode8.3. Log
Port php52-ftp success on xcode8.3. Log
Port php52-gd success on xcode8.3. Log
Port php52-gettext success on xcode8.3. Log
Port php52-gmp success on xcode8.3. Log
Port php52-iconv success on xcode8.3. Log
Port php52-imap success on xcode8.3. Log
Port php52-ipc success on xcode8.3. Log
Port php52-ldap success on xcode8.3. Log
Port php52-mbstring success on xcode8.3. Log
Port php52-mcrypt success on xcode8.3. Log
Port php74 success on xcode7.3. Log
Port php success on xcode7.3. Log
Port php52 success on xcode7.3. Log
Port php52-calendar success on xcode7.3. Log
Port php52-cgi success on xcode7.3. Log
Port php52-curl success on xcode7.3. Log
Port php52-dba success on xcode7.3. Log
Port php52-exif success on xcode7.3. Log
Port php52-ftp success on xcode7.3. Log
Port php52-gd success on xcode7.3. Log
Port php52-gettext success on xcode7.3. Log
Port php52-gmp success on xcode7.3. Log
Port php52-iconv success on xcode7.3. Log
Port php52-imap success on xcode7.3. Log
Port php52-ipc success on xcode7.3. Log
Port php52-ldap success on xcode7.3. Log
Port php52-mbstring success on xcode7.3. Log
Port php52-mcrypt success on xcode7.3. Log
Port php52-mssql success on xcode7.3. Log

The build timed out.

@iefdev
Copy link
Contributor Author

iefdev commented Sep 21, 2020

This commit will be extremely difficult to review due to its size, …

Since 3089477 gave a small conflict on this one, which I solved - but I updatded the PR instead, while taking your advice to split up the changes in to smaller ones.

I hope you'll find it easier to go through them now, as the changes doesn't make the code move around as much as before. Tried to keep the indentation changes to 3-4 blocks per commit.

Hm… Don't know why they've been split up in 2 blocks (12 and 2 days ago). I made all last night.

@macportsbot
Copy link

Travis Build #14130 Passed.

Lint results
--->  Verifying Portfile for php
--->  0 errors and 0 warnings found.

Port php74 success on xcode10.3. Log
Port php success on xcode10.3. Log
Port php52 success on xcode10.3. Log
Port php52-calendar success on xcode10.3. Log
Port php52-cgi success on xcode10.3. Log
Port php52-curl success on xcode10.3. Log
Port php52-dba success on xcode10.3. Log
Port php52-exif success on xcode10.3. Log
Port php52-ftp success on xcode10.3. Log
Port php52-gd success on xcode10.3. Log
Port php52-gettext success on xcode10.3. Log
Port php52-gmp success on xcode10.3. Log
Port php52-iconv success on xcode10.3. Log
Port php52-imap success on xcode10.3. Log
Port php52-ipc success on xcode10.3. Log
Port php52-ldap success on xcode10.3. Log
Port php52-mbstring success on xcode10.3. Log
Port php52-mcrypt success on xcode10.3. Log
Port php74 success on xcode9.4. Log
Port php success on xcode9.4. Log
Port php52 success on xcode9.4. Log
Port php52-calendar success on xcode9.4. Log
Port php52-cgi success on xcode9.4. Log
Port php52-curl success on xcode9.4. Log
Port php52-dba success on xcode9.4. Log
Port php52-exif success on xcode9.4. Log
Port php52-ftp success on xcode9.4. Log
Port php52-gd success on xcode9.4. Log
Port php52-gettext success on xcode9.4. Log
Port php52-gmp success on xcode9.4. Log
Port php52-iconv success on xcode9.4. Log
Port php52-imap success on xcode9.4. Log
Port php52-ipc success on xcode9.4. Log
Port php52-ldap success on xcode9.4. Log
Port php52-mbstring success on xcode9.4. Log
Port php52-mcrypt success on xcode9.4. Log
Port php74 success on xcode8.3. Log
Port php success on xcode8.3. Log
Port php52 success on xcode8.3. Log
Port php52-calendar success on xcode8.3. Log
Port php52-cgi success on xcode8.3. Log
Port php52-curl success on xcode8.3. Log
Port php52-dba success on xcode8.3. Log
Port php52-exif success on xcode8.3. Log
Port php52-ftp success on xcode8.3. Log
Port php52-gd success on xcode8.3. Log
Port php52-gettext success on xcode8.3. Log
Port php52-gmp success on xcode8.3. Log
Port php52-iconv success on xcode8.3. Log
Port php52-imap success on xcode8.3. Log
Port php52-ipc success on xcode8.3. Log
Port php52-ldap success on xcode8.3. Log
Port php52-mbstring success on xcode8.3. Log
Port php52-mcrypt success on xcode8.3. Log
Port php74 success on xcode7.3. Log
Port php success on xcode7.3. Log
Port php52 success on xcode7.3. Log
Port php52-calendar success on xcode7.3. Log
Port php52-cgi success on xcode7.3. Log
Port php52-curl success on xcode7.3. Log
Port php52-dba success on xcode7.3. Log
Port php52-exif success on xcode7.3. Log
Port php52-ftp success on xcode7.3. Log
Port php52-gd success on xcode7.3. Log
Port php52-gettext success on xcode7.3. Log
Port php52-gmp success on xcode7.3. Log
Port php52-iconv success on xcode7.3. Log
Port php52-imap success on xcode7.3. Log
Port php52-ipc success on xcode7.3. Log
Port php52-ldap success on xcode7.3. Log
Port php52-mbstring success on xcode7.3. Log
Port php52-mcrypt success on xcode7.3. Log
Port php52-mssql success on xcode7.3. Log
Port php52-mysql success on xcode7.3. Log
Port php52-odbc success on xcode7.3. Log

The build timed out.

@kencu
Copy link
Contributor

kencu commented Oct 6, 2020

Only person who will commit this one is Ryan, so you'll negotiate it with him, @iefdev

@iefdev
Copy link
Contributor Author

iefdev commented Oct 6, 2020

@kencu: Only person who will commit this one is Ryan, so you'll negotiate it with him

Yes, I know - and he knows: #8374 (comment)

Looks like I have a few conflicts to solve now.

@iefdev
Copy link
Contributor Author

iefdev commented Oct 6, 2020

Solved the conflicts and repushed.

@macportsbot
Copy link

Travis Build #14404 Passed.

Lint results
--->  Verifying Portfile for php
--->  0 errors and 0 warnings found.

Port php74 success on xcode10.3. Log
Port php success on xcode10.3. Log
Port php52 success on xcode10.3. Log
Port php52-calendar success on xcode10.3. Log
Port php52-cgi success on xcode10.3. Log
Port php52-curl success on xcode10.3. Log
Port php52-dba success on xcode10.3. Log
Port php52-exif success on xcode10.3. Log
Port php52-ftp success on xcode10.3. Log
Port php52-gd success on xcode10.3. Log
Port php52-gettext success on xcode10.3. Log
Port php52-gmp success on xcode10.3. Log
Port php52-iconv success on xcode10.3. Log
Port php52-imap success on xcode10.3. Log
Port php52-ipc success on xcode10.3. Log
Port php74 success on xcode9.4. Log
Port php success on xcode9.4. Log
Port php52 success on xcode9.4. Log
Port php52-calendar success on xcode9.4. Log
Port php52-cgi success on xcode9.4. Log
Port php52-curl success on xcode9.4. Log
Port php52-dba success on xcode9.4. Log
Port php52-exif success on xcode9.4. Log
Port php52-ftp success on xcode9.4. Log
Port php52-gd success on xcode9.4. Log
Port php52-gettext success on xcode9.4. Log
Port php52-gmp success on xcode9.4. Log
Port php52-iconv success on xcode9.4. Log
Port php52-imap success on xcode9.4. Log
Port php52-ipc success on xcode9.4. Log
Port php52-ldap success on xcode9.4. Log
Port php52-mbstring success on xcode9.4. Log
Port php52-mcrypt success on xcode9.4. Log
Port php74 success on xcode8.3. Log
Port php success on xcode8.3. Log
Port php52 success on xcode8.3. Log
Port php52-calendar success on xcode8.3. Log
Port php52-cgi success on xcode8.3. Log
Port php52-curl success on xcode8.3. Log
Port php52-dba success on xcode8.3. Log
Port php52-exif success on xcode8.3. Log
Port php52-ftp success on xcode8.3. Log
Port php52-gd success on xcode8.3. Log
Port php52-gettext success on xcode8.3. Log
Port php52-gmp success on xcode8.3. Log
Port php52-iconv success on xcode8.3. Log
Port php52-imap success on xcode8.3. Log
Port php52-ipc success on xcode8.3. Log
Port php52-ldap success on xcode8.3. Log
Port php52-mbstring success on xcode8.3. Log
Port php52-mcrypt success on xcode8.3. Log
Port php74 success on xcode7.3. Log
Port php success on xcode7.3. Log
Port php52 success on xcode7.3. Log
Port php52-calendar success on xcode7.3. Log
Port php52-cgi success on xcode7.3. Log
Port php52-curl success on xcode7.3. Log
Port php52-dba success on xcode7.3. Log
Port php52-exif success on xcode7.3. Log
Port php52-ftp success on xcode7.3. Log
Port php52-gd success on xcode7.3. Log
Port php52-gettext success on xcode7.3. Log
Port php52-gmp success on xcode7.3. Log
Port php52-iconv success on xcode7.3. Log
Port php52-imap success on xcode7.3. Log
Port php52-ipc success on xcode7.3. Log
Port php52-ldap success on xcode7.3. Log
Port php52-mbstring success on xcode7.3. Log
Port php52-mcrypt success on xcode7.3. Log
Port php52-mssql success on xcode7.3. Log

The build timed out.

@kencu
Copy link
Contributor

kencu commented Jan 27, 2021

Eric -- I think all these ports are Ryan's right? If he wanted to commit this, it would have been committed.

Whitespace and cleanup are very personal things -- I think Ryan will undertake that someday if he wants to.

Whaddaya say we just close this and leave this for Ryan to do as he wishes in the ports he maintains?

@kencu
Copy link
Contributor

kencu commented Jan 30, 2021

closing as per above comment

@kencu kencu closed this Jan 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants