From 1fb1fe65a43ddbb17d33ea205307607881a54fe4 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Mon, 9 Oct 2017 17:08:11 +0200 Subject: [PATCH] Refactor README.md and contributing information Contributing information has been joined from multiple text files into a single CONTRIBUTING.md file for convenience. The README.GIT-RULES file has been also used as a root indicator in two other files when building and is now changed to CONTRIBUTING.md instead. The CONTRIBUTING.md file is probably also the correct indicator for that instead. Other minor occurrences of the README.GIT-RULES file exist in the wiki pages which shouldn't be too complicated to refactor and point into the CONTRIBUTING.md file instead. README.md file now includes short description of the php-src repository, some links to Git repository and GitHub mirror and short installation information. When creating windows builds, instead of the install.txt file the README.md file is attached instead as readme.txt for simplest possible opening and reading without too much Markdown syntax bariers. And some other minor fixes here and there: - https://git.php.net instead of http://git.php.net - Paragraph mentioning lxr and bonsai has been removed --- CONTRIBUTING.md | 278 +++++++++++++++++++++++++++++++++----- INSTALL | 3 - README.GIT-RULES | 138 ------------------- README.RELEASE_PROCESS | 16 +-- README.SUBMITTING_PATCH | 194 -------------------------- README.WIN32-BUILD-SYSTEM | 6 - README.md | 44 +++--- configure.ac | 24 ++-- win32/build/confutils.js | 119 ++++++++-------- win32/build/mkdist.php | 28 ++-- 10 files changed, 359 insertions(+), 491 deletions(-) delete mode 100644 INSTALL delete mode 100644 README.GIT-RULES delete mode 100644 README.SUBMITTING_PATCH delete mode 100644 README.WIN32-BUILD-SYSTEM diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8ab4e87417b74..abe1b56f0b3cd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,13 +1,50 @@ # Contributing to PHP Anybody who programs in PHP can be a contributing member of the community that -develops and deploys it; the task of deploying PHP, documentation and -associated websites is a never ending one. With every release, or release -candidate comes a wave of work, which takes a lot of organization and -co-ordination. +develops and deploys it; the task of deploying PHP, documentation and associated +websites is a never ending one. With every release, or release candidate comes a +wave of work, which takes a lot of organization and co-ordination. + +You don't need any login accounts or special access to download, build, debug +and begin submitting PHP or PECL code, tests or documentation. Once you've +followed this document and had several patches accepted, commit privileges are +often quickly granted. + +PHP and most PECL packages use Git for revision control. Some PECL packages use +Subversion (SVN). Read http://www.php.net/git.php for help on using Git to get +and build PHP source code. We recommend to look at our +[workflow](https://wiki.php.net/vcs/gitworkflow) and our +[Git FAQ](https://wiki.php.net/vcs/gitfaq). + +## Reporting bugs + +Bugs can be filed on the [PHP bug tracker](https://bugs.php.net/). If this is +the first time you've filed a bug, we suggest reading the +[guide to reporting a bug](https://bugs.php.net/how-to-report.php). Where possible, +please include a self-contained reproduction case. + +## Feature requests + +New feature requests are generally submitted in the form of +[Requests for Comments](https://wiki.php.net/rfc/howto), ideally accompanied by +[pull requests](#pull-requests). You can find the extremely large list of RFCs +that have been previously considered on the [PHP Wiki](https://wiki.php.net/rfc). + +You may want to read +[The Mysterious PHP RFC Process](https://blogs.oracle.com/opal/entry/the_mysterious_php_rfc_process) +for additional notes on the best way to approach submitting an RFC. ## Pull requests +The preferred way to propose a PHP patch is sending a pull request from +[GitHub](https://github.com/php/php-src). + +Simply fork the official PHP repository and send a pull request. A notification +will be sent to the pull request mailing list. Sending a note to +[PHP Internals list](mailto:internals@lists.php.net) may help getting more +feedback and quicker turnaround. You can also add pull requests to bug reports +at [bugs.php.net](http://bugs.php.net/). + PHP welcomes pull requests to [add tests](#writing-tests), fix bugs and to implement RFCs. Please be sure to include tests as appropriate! @@ -15,46 +52,25 @@ If you are fixing a bug, then please submit your PR against the lowest actively supported branch of PHP that the bug affects (only green branches on [the supported version page](http://php.net/supported-versions.php) are supported). For example, at the time of writing in mid-2017, the lowest supported version is -PHP 7.0, which corresponds to the `PHP-7.0` branch in Git. Please also make sure you -add a link to the PR in the bug on [the bug tracker](https://bugs.php.net/). +PHP 7.0, which corresponds to the `PHP-7.0` branch in Git. Please also make sure +you add a link to the PR in the bug on [the bug tracker](https://bugs.php.net/). -Pull requests implementing RFCs should be submitted against `master`. +Pull requests implementing RFCs should be submitted against `master` branch. -Pull requests should *never* be submitted against `PHP-x.y.z` branches, as -these are only used for release management. +Pull requests should *never* be submitted against `PHP-x.y.z` branches, as these +are only used for release management when tagging the releases, hence they are +closed to the general public. If your pull request exhibits conflicts with the base branch, please resolve them by using `git rebase` instead of `git merge`. -## Filing bugs - -Bugs can be filed on the [PHP bug tracker](https://bugs.php.net/). If this is -the first time you've filed a bug, we suggest reading the -[guide to reporting a bug](https://bugs.php.net/how-to-report.php). - -Where possible, please include a self-contained reproduction case! - -## Feature requests - -Feature requests are generally submitted in the form of -[Requests for Comment](https://wiki.php.net/rfc/howto), ideally accompanied by -[pull requests](#pull-requests). You can find the extremely large list of RFCs -that have been previously considered on the -[PHP Wiki](https://wiki.php.net/rfc). - -You may want to read -[The Mysterious PHP RFC Process](https://blogs.oracle.com/opal/entry/the_mysterious_php_rfc_process) -for additional notes on the best way to approach submitting an RFC. - ## Writing tests We love getting new tests! PHP is a huge project and improving code coverage is a huge win for every PHP user. -[Our QA site includes a page detailing how to write test cases.](http://qa.php.net/write-test.php) -Please note that the section on submitting pull requests is outdated: in -addition to the process listed there, you can also -[submit pull requests](#pull-requests). +Our QA site includes a page detailing +[how to write test cases](http://qa.php.net/write-test.php). ## Writing documentation @@ -65,6 +81,173 @@ can check the XML source out from Subversion and edit that and build it Patches created that way should be sent to the [documentation mailing list](mailto:phpdoc@lists.php.net). +If you are fixing incorrect PHP documentation first create a bug or identify an +existing [bug](http://bugs.php.net/). A bug can be used to track the patch +progress and prevent your changes getting lost in the PHP mail archives. + +If your change is large, then first discuss it with the mail list +phpdoc@lists.php.net. Subscription is explained on +http://php.net/mailing-lists.php. + +Attach the patch to the PHP bug and consider sending a notification email about +the change to phpdoc@lists.php.net. Explain what has been fixed/added/changed by +your patch. + +## Git rules + +We'll assume you're basically familiar with [Git](http://git-scm.com/), but feel +free to post your questions on the mailing list. + +PHP is developed through the efforts of a large number of people. Collaboration +is a Good Thing(tm), and Git lets us do this. Thus, following some basic rules +with regards to Git usage will: + +* Make everybody happier, especially those responsible for maintaining PHP itself. +* Keep the changes consistently well documented and easily trackable. +* Prevent some of those *Oops* moments. +* Increase the general level of good will on planet Earth. + +Having said that, here are the organizational rules: + +* Respect other people working on the project. +* Discuss any significant changes on the list before committing and get + confirmation from the release manager for the given branch. +* Look at [EXTENSIONS](/EXTENSIONS) file to see who is the primary maintainer of + the code you want to contribute to. +* If you "strongly disagree" about something another person did, don't start + fighting publicly - take it up in private email. +* If you don't know how to do something, ask first! +* Test your changes before committing them. To do so use `make test` and write + tests. Submitting test scripts helps us to understand what functionality has + changed. It is important for the stability and maintainability of PHP that + tests are comprehensive. +* For development use the `--enable-debug` switch to avoid memory leaks and the + `--enable-maintainer-zts` switch to ensure your code handles TSRM correctly and + doesn't break for those who need that. Check the PHP and web server error logs + after running your PHP tests. +* Update Git source from upstream before testing and submitting your patch. +* Review the patch once more just before submitting it. + +The next few rules are more of a technical nature: + +* Follow [CODING_STANDARDS](/CODING_STANDARDS) before you start working. +* As explained above, all changes should first go to the lowest supported branch + and then get merged up to all other branches. If a change is not needed for + later branches (i.e. fixes for features which were dropped from later branches) + an empty merge should be done. +* All news updates intended for public viewing, such as new features, bug fixes, + improvements, etc., should go into the `NEWS` file of *any stable release* + version with the given change. In other words, news about a bug fix which went + into PHP-7.1, PHP-7.2 and master should be noted in PHP-7.1/NEWS and PHP-7.2/NEWS + but not master, which is not a public released version yet. When you change + the `NEWS` file for a bug fix, then please keep the bugs sorted in decreasing + order under the fixed version. Unless you have commit access and you are going + to commit it yourself, you shouldn't include the `NEWS` entry as it will + probably create conflicts for the person merging it. +* Do not commit multiple files and dump all messages in one commit. If you + modified several unrelated files, commit each group separately and provide a + nice commit message for each one. See example below. +* Do write your commit message in such a way that it makes sense even without the + corresponding diff. One should be able to look at it, and immediately know what + was modified. Definitely include the function name in the message as shown below. +* In your commit messages, keep each line shorter than 80 characters. And try to + align your lines vertically, if they wrap. It looks bad otherwise. +* If you modified a function that is callable from PHP, prepend PHP to the + function name. +* Add in-line comments and/or have external documentation ready. + +The format of the commit messages is pretty simple. + +``` +\n +\n + +\n +``` + +An example from the git project (commit 2b34e486bc): + +``` +pack-objects: Fix compilation with NO_PTHREDS + +It looks like commit 99fb6e04 (pack-objects: convert to use +parse_options(), 2012-02-01) moved the #ifdef NO_PTHREDS around but +hasn't noticed that the 'arg' variable no longer is available. +``` + +If you fix some bugs, you should note the bug ID numbers in your commit message. +Bug ID should be prefixed by `#`. + +Example: + +``` +Fixed bug #14016 (pgsql notice handler double free crash bug.) +``` + +You can use [GitHub](https://github.com/php) and [gitweb](https://git.php.net/) +to look at PHP Git repositories in various ways. + +An excellent article to read is also +[Less Whining, More Coding](http://phpadvent.org/2008/less-whining-more-coding-by-elizabeth-smith). + +## PHP source code + +If you are fixing broken functionality in PHP C source code first create a bug +or identify an existing bug at http://bugs.php.net/. A bug can be used to track +the patch progress and prevent your changes getting lost in the PHP mail archives. + +Information on PHP internal C functions is at http://php.net/internals. Various +external resources can be found on the web. See https://wiki.php.net/internals +for some references. A standard printed reference is the book "Extending and +Embedding PHP" by Sara Golemon. Lot of useful information is available also in +the [PHP Internals Book](http://www.phpinternalsbook.com/). + +## Patches + +If you are not using GitHub, you can also create patch files for PHP source code, +PHP documentation or PECL and attach your patch to a PHP bug and consider sending +a notification email about the change to a their dedicated mailing list. If the +bug is for an extension, also CC the extension maintainer. Explain what has been +changed by your patch. Test scripts should be included. + +In this case please make the mail subject prefix `[PATCH]`. If attaching a patch, +ensure it has a file extension of `.txt`. This is because only MIME attachments +of type `text/*` are accepted. + +After testing is finished, create a patch file using the command: + +``` +git diff > your_patch.txt +``` + +For ease of review and later troubleshooting, submit individual patches for each +bug or feature. + +## PECL + +If you are fixing broken functionality in a [PECL extension](http://pecl.php.net/) +then create a bug or identify an existing bug at http://bugs.php.net/. A bug can +be used to track the patch progress and prevent your changes getting lost in the +PHP mail archives. + +If your change is large then create a [Request For Comment (RFC) page](http://wiki.php.net/rfc), +discuss it with the extension maintainer, and discuss it on the development mail +list pecl-dev@lists.php.net. PECL mail list subscription is explained on +http://pecl.php.net/support.php. RFC Wiki accounts can be requested on +http://wiki.php.net/start?do=register. + +Update any open bugs and add a link to the source of your patch. Send the patch +or pointer to the bug to pecl-dev@lists.php.net. Also CC the extension maintainer. +Explain what has been changed by your patch. Test scripts should be included. + +## PEAR + +[PEAR](http://pear.php.net/) (PHP Extension and Application Repository) is a +framework and distribution system for reusable PHP components. Information on +contributing to PEAR is available at +* http://pear.php.net/manual/en/developers-newmaint.php and +* http://pear.php.net/manual/en/guide-developers.php + ## Getting help If you are having trouble contributing to PHP, or just want to talk to a human @@ -74,5 +257,30 @@ about what you're working on, you can contact us via the issues. Although not a formal channel, you can also find a number of core developers on -the #php.pecl channel on [EFnet](http://www.efnet.org/). Similarly, many -documentation writers can be found on #php.doc. +the `#php.pecl` channel and similarly documentation writers can be found on +`#php.doc` on [EFnet](http://www.efnet.org/). For windows related discussions +there is also `#winphp-dev` on FreeNode. + +### What happens after submitting your PHP, PHP documentation or PECL patch? + +If your pull request or patch is easy to review and obviously has no side-effects, +it might be committed relatively quickly. + +Because PHP is a volunteer-driven effort more complex patches will require +patience on your side. If you do not receive feedback in a few days, consider +resubmitting the patch. Before doing this think about these questions: + +* Did I send the patch to the right mailing list? +* Did I review the mail list archives to see if these kind of changes had been + discussed before? +* Did I explain my patch clearly? +* Is my patch too hard to review? Because of what factors? + +### What happens when your patch is applied? + +Your name will likely be included in the Git commit log. If your patch affects +end users, a brief description and your name might be added to the `NEWS` file. + +Thank you for patching PHP! Happy hacking, + +PHP Team diff --git a/INSTALL b/INSTALL deleted file mode 100644 index d2f4f42a99830..0000000000000 --- a/INSTALL +++ /dev/null @@ -1,3 +0,0 @@ -For installation of PHP, please refer to the online documentation available at: - - http://php.net/install diff --git a/README.GIT-RULES b/README.GIT-RULES deleted file mode 100644 index 6ee3585931eed..0000000000000 --- a/README.GIT-RULES +++ /dev/null @@ -1,138 +0,0 @@ -==================== - Git Commit Rules -==================== - -This is the first file you should be reading when contributing code via Git. -We'll assume you're basically familiar with Git, but feel free to post -your questions on the mailing list. Please have a look at -http://git-scm.com/ for more detailed information on Git. - -PHP is developed through the efforts of a large number of people. -Collaboration is a Good Thing(tm), and Git lets us do this. Thus, following -some basic rules with regards to Git usage will:: - - a. Make everybody happier, especially those responsible for maintaining - PHP itself. - - b. Keep the changes consistently well documented and easily trackable. - - c. Prevent some of those 'Oops' moments. - - d. Increase the general level of good will on planet Earth. - -Having said that, here are the organizational rules:: - - 1. Respect other people working on the project. - - 2. Discuss any significant changes on the list before committing and get - confirmation from the release manager for the given branch. - - 3. Look at EXTENSIONS file to see who is the primary maintainer of - the code you want to contribute to. - - 4. If you "strongly disagree" about something another person did, don't - start fighting publicly - take it up in private email. - - 5. If you don't know how to do something, ask first! - - 6. Test your changes before committing them. We mean it. Really. - To do so use "make test". - - 7. For development use the --enable-debug switch to avoid memory leaks - and the --enable-maintainer-zts switch to ensure your code handles - TSRM correctly and doesn't break for those who need that. - -Currently we have the following branches in use:: - - master The active development branch. - - PHP-7.1 Is used to release the PHP 7.1.x series. This is a prerelease - version. - - PHP-7.0 Is used to release the PHP 7.0.x series. This is a current - stable version and is open for bugfixes only. - - PHP-5.6 Is used to release the PHP 5.6.x series. This is a current - stable version and is open for bugfixes only. - - PHP-5.5 This branch is closed. - - PHP-5.4 This branch is closed. - - PHP-5.3 This branch is closed. - - PHP-5.2 This branch is closed. - - PHP-5.1 This branch is closed. - - PHP-4.4 This branch is closed. - - PHP-X.Y.Z These branches are used for the release managers for tagging - the releases, hence they are closed to the general public. - -The next few rules are more of a technical nature:: - - 1. All changes should first go to the lowest branch (i.e. 5.6) and then - get merged up to all other branches. If a change is not needed for - later branches (i.e. fixes for features which were dropped from later - branches) an empty merge should be done. - - 2. All news updates intended for public viewing, such as new features, - bug fixes, improvements, etc., should go into the NEWS file of *any - stable release* version with the given change. In other words, - news about a bug fix which went into PHP-5.4, PHP-5.5 and master - should be noted in both PHP-5.4/NEWS and PHP-5.5/NEWS but - not master, which is not a public released version yet. - - 3. Do not commit multiple files and dump all messages in one commit. If you - modified several unrelated files, commit each group separately and - provide a nice commit message for each one. See example below. - - 4. Do write your commit message in such a way that it makes sense even - without the corresponding diff. One should be able to look at it, and - immediately know what was modified. Definitely include the function name - in the message as shown below. - - 5. In your commit messages, keep each line shorter than 80 characters. And - try to align your lines vertically, if they wrap. It looks bad otherwise. - - 6. If you modified a function that is callable from PHP, prepend PHP to - the function name as shown below. - - -The format of the commit messages is pretty simple. - -\n -\n - -\n - -An Example from the git project (commit 2b34e486bc): - -pack-objects: Fix compilation with NO_PTHREDS - -It looks like commit 99fb6e04 (pack-objects: convert to use -parse_options(), 2012-02-01) moved the #ifdef NO_PTHREDS around but -hasn't noticed that the 'arg' variable no longer is available. - -If you fix some bugs, you should note the bug ID numbers in your -commit message. Bug ID should be prefixed by "#" for easier access to -bug report when developers are browsing CVS via LXR or Bonsai. - -Example: - -Fixed bug #14016 (pgsql notice handler double free crash bug.) - -When you change the NEWS file for a bug fix, then please keep the bugs -sorted in decreasing order under the fixed version. - -You can use OpenGrok (http://lxr.php.net/) and gitweb (http://git.php.net/) -to look at PHP Git repository in various ways. - - -For further information on the process and further details please refer to -https://wiki.php.net/vcs/gitworkflow and https://wiki.php.net/vcs/gitfaq - -Happy hacking, - -PHP Team diff --git a/README.RELEASE_PROCESS b/README.RELEASE_PROCESS index c735d5e2631d1..1e2afb6278a8a 100644 --- a/README.RELEASE_PROCESS +++ b/README.RELEASE_PROCESS @@ -32,7 +32,7 @@ team (Bjori) on hand. 6. Verify the tags to be extra sure everything was tagged properly. 7. Moving extensions from/to PECL requires write access to the destination. -Most developers should have this. +Most developers should have this. Moving extensions from php-src to PECL - Checkout the pecl directory, most likely you want a sparse-root checkout @@ -125,7 +125,7 @@ Getting the non stable release (alpha/beta/RC) announced b. ``$PHP_x_RC_DATE`` = "06 September 2007" -3. Add a short notice to phpweb stating that there is a new release, and +3. Add a short notice to phpweb stating that there is a new release, and highlight the major important things (security fixes) and when it is important to upgrade. @@ -140,7 +140,7 @@ to upgrade. *Wait for web and qa sites to update with new information before sending announce* -5. Send an email **To** ``internals@lists.php.net`` and ``php-general@lists.php.net`` +5. Send an email **To** ``internals@lists.php.net`` and ``php-general@lists.php.net`` lists pointing out "the location of the release" and "the possible release date of either the next RC, or the final release". Include in this information the verification information output by ``gen_verify_stub``. @@ -156,9 +156,6 @@ Derick) run the following commands for you: ``sudo -u ezmlm ezmlm-sub ~ezmlm/primary-qa-tester/mod moderator-email-address`` -7. For the first RC, write the doc team (phpdoc@lists.php.net) about updating the -INSTALL and win32/install.txt files which are generated from the PHP manual sources. - Rolling a stable release ------------------------ @@ -193,7 +190,7 @@ Check if the pear files are updated (phar). ``gpg -u YOUREMAIL --armor --detach-sign php-X.Y.Z.tar.xxx`` 11. Commit and push all the tarballs and signature files to web/php-distributions.git, - then update the git submodule reference in web/php.git: + then update the git submodule reference in web/php.git: ``git submodule init; git submodule update; cd distributions; @@ -263,7 +260,7 @@ f.e. ``ChangeLog-5.php`` from the NEWS file IV. ``s/Fixed PECL bug #\([0-9]\+\)//`` V. ``s/FR #\([0-9]\+\)/FR /`` - + e. You may want to try php-web/bin/news2html to automate this task 6. Add a short notice to phpweb stating that there is a new release, and @@ -360,7 +357,7 @@ New Release Manager Checklist one or more of the previous RMs sign your key. Publish your public key to pgp.mit.edu with: `gpg --keyserver pgp.mit.edu --send-keys $KEYID` -3. Request karma to eding main/php_version.h. Possibly karma for other restricted parts of +3. Request karma to eding main/php_version.h. Possibly karma for other restricted parts of php-src might come in question. 4. Request karma for web/qa.git and web/php.git for publishing release announcements. @@ -368,4 +365,3 @@ New Release Manager Checklist 5. Request moderation access to announce@php.net and primary-qa-tester@lists.php.net lists, to be able to moderate your release announcements. All the announcements should be sent from the @php.net alias. - diff --git a/README.SUBMITTING_PATCH b/README.SUBMITTING_PATCH deleted file mode 100644 index bdd46a22f8384..0000000000000 --- a/README.SUBMITTING_PATCH +++ /dev/null @@ -1,194 +0,0 @@ -Submitting Enhancements and Patches to PHP -========================================== - -This document describes how to submit an enhancement or patch for PHP. -It's easy! - -You don't need any login accounts or special access to download, -build, debug and begin submitting PHP or PECL code, tests or -documentation. Once you've followed this README and had several -patches accepted, commit privileges are often quickly granted. - -An excellent article to read first is: -http://phpadvent.org/2008/less-whining-more-coding-by-elizabeth-smith - - -Online Forums -------------- -There are several IRC channels where PHP developers are often -available to discuss questions. They include #php.pecl and #php.doc -on the EFNet network and #winphp-dev on FreeNode. - - -PHP Patches ------------ -If you are fixing broken functionality in PHP C source code first -create a bug or identify an existing bug at http://bugs.php.net/. A -bug can be used to track the patch progress and prevent your changes -getting lost in the PHP mail archives. - -If your change is large then create a Request For Comment (RFC) page -on http://wiki.php.net/rfc, discuss it with the extension maintainer, -and discuss it on the development mail list internals@lists.php.net. -RFC Wiki accounts can be requested on -http://wiki.php.net/start?do=register. PHP extension maintainers can -be found in the EXTENSIONS file in the PHP source. Mail list -subscription is explained on http://php.net/mailing-lists.php. - -Information on PHP internal C functions is at -http://php.net/internals, though this is considered incomplete. -Various external resources can be found on the web. See -https://wiki.php.net/internals for some references. A standard -printed reference is the book "Extending and Embedding PHP" by Sara -Golemon. - -The preferred way to propose PHP patch is sending pull request from -GitHub: https://github.com/php/php-src - -Fork the official PHP repository and send a pull request. A -notification will be sent to the pull request mailing list. Sending a -note to PHP Internals list (internals@lists.php.net) may help getting -more feedback and quicker turnaround. You can also add pull requests -to bug reports at http://bugs.php.net/. - -If you are not using GitHub, attach your patch to a PHP bug and -consider sending a notification email about the change to -internals@lists.php.net. If the bug is for an extension, also CC the -extension maintainer. Explain what has been changed by your patch. -Test scripts should be included. - -Please make the mail subject prefix "[PATCH]". If attaching a patch, -ensure it has a file extension of ".txt". This is because only MIME -attachments of type 'text/*' are accepted. - - - -PHP Documentation Patches -------------------------- -If you are fixing incorrect PHP documentation first create a bug or -identify an existing bug at http://bugs.php.net/. A bug can be used -to track the patch progress and prevent your changes getting lost in -the PHP mail archives. - -If your change is large, then first discuss it with the mail list -phpdoc@lists.php.net. Subscription is explained on -http://php.net/mailing-lists.php. - -Information on contributing to PHP documentation is at -http://php.net/dochowto and http://wiki.php.net/doc/howto - -Attach the patch to the PHP bug and consider sending a notification -email about the change to phpdoc@lists.php.net. Explain what has been -fixed/added/changed by your patch. - -Please make the mail subject prefix "[PATCH]". Include the bug id(s) -which can be closed by your patch. If attaching a patch, ensure it -has a file extension of ".txt". This is because only MIME attachments -of type 'text/*' are accepted. - - -PECL Extension Patches: http://pecl.php.net/ --------------------------------------------- -If you are fixing broken functionality in a PECL extension then create -a bug or identify an existing bug at http://bugs.php.net/. A bug -can be used to track the patch progress and prevent your changes -getting lost in the PHP mail archives. - -If your change is large then create a Request For Comment (RFC) page -on http://wiki.php.net/rfc, discuss it with the extension maintainer, -and discuss it on the development mail list pecl-dev@lists.php.net. -PECL mail list subscription is explained on -http://pecl.php.net/support.php. RFC Wiki accounts can be requested -on http://wiki.php.net/start?do=register - -Information on PHP internal C functions is at -http://www.php.net/internals, though this is considered incomplete. -Various external resources can be found on the web. A standard -printed reference is the book "Extending and Embedding PHP" by Sara -Golemon. - -Update any open bugs and add a link to the source of your patch. Send -the patch or pointer to the bug to pecl-dev@lists.php.net. Also CC -the extension maintainer. Explain what has been changed by your -patch. Test scripts should be included. - -Please make the mail subject prefix "[PATCH] ...". Include the patch -as an attachment with a file extension of ".txt". This is because -only MIME attachments of type 'text/*' are accepted. - - -PEAR Package Patches: http://pear.php.net/ ------------------------------------------- -Information on contributing to PEAR is available at -http://pear.php.net/manual/en/developers-newmaint.php and -http://pear.php.net/manual/en/guide-developers.php - - -How to create your PHP, PHP Documentation or PECL patch -------------------------------------------------------- -PHP and most PECL packages use Git for revision control. Some PECL -packages use Subversion (SVN) Read http://www.php.net/git.php for help -on using Git to get and build PHP source code. We recommend to look -at our workflow on https://wiki.php.net/vcs/gitworkflow and our FAQ -https://wiki.php.net/vcs/gitfaq. - -Generally we ask that bug fix patches work on the current stable PHP -development branches and on "master". New PHP features only need to -work on "master". - -Read CODING_STANDARDS before you start working. - -After modifying the source see README.TESTING and -http://qa.php.net/write-test.php for how to test. Submitting test -scripts helps us to understand what functionality has changed. It is -important for the stability and maintainability of PHP that tests are -comprehensive. - -After testing is finished, create a patch file using the command: - - git diff > your_patch.txt - -For ease of review and later troubleshooting, submit individual -patches for each bug or feature. - - -Checklist for submitting your PHP or PECL code patch ----------------------------------------------------- - - Update git source just before running your final 'diff' and - before testing. - - Add in-line comments and/or have external documentation ready. - Use only "/* */" style comments, not "//". - - Create test scripts for use with "make test". - - Run "make test" to check your patch doesn't break other features. - - Rebuild PHP with --enable-debug (which will show some kinds of - memory errors) and check the PHP and web server error logs after - running your PHP tests. - - Rebuild PHP with --enable-maintainer-zts to check your patch - compiles on multi-threaded web servers. - - Review the patch once more just before submitting it. - - -What happens after submitting your PHP, PHP Documentation or PECL patch ------------------------------------------------------------------------ -If your patch is easy to review and obviously has no side-effects, -it might be committed relatively quickly. - -Because PHP is a volunteer-driven effort more complex patches will -require patience on your side. If you do not receive feedback in a -few days, consider resubmitting the patch. Before doing this think -about these questions: - - - Did I send the patch to the right mail list? - - Did I review the mail list archives to see if these kind of - changes had been discussed before? - - Did I explain my patch clearly? - - Is my patch too hard to review? Because of what factors? - - -What happens when your PHP or PECL patch is applied ---------------------------------------------------- -Your name will likely be included in the Git commit log. If your -patch affects end users, a brief description and your name might be -added to the NEWS file. - -Thank you for patching PHP! diff --git a/README.WIN32-BUILD-SYSTEM b/README.WIN32-BUILD-SYSTEM deleted file mode 100644 index d7d6e5c2b34ca..0000000000000 --- a/README.WIN32-BUILD-SYSTEM +++ /dev/null @@ -1,6 +0,0 @@ -The Win32 Build System. - -See http://wiki.php.net/internals/windows/stepbystepbuild - -vim:tw=78:sw=1:ts=1:et - diff --git a/README.md b/README.md index 6080dc4adf8ef..0d01289750c57 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,28 @@ -The PHP Interpreter -=================== - -This is the github mirror of the official PHP repository located at -http://git.php.net. +# The PHP Interpreter [![Build Status](https://secure.travis-ci.org/php/php-src.svg?branch=master)](http://travis-ci.org/php/php-src) [![Build status](https://ci.appveyor.com/api/projects/status/meyur6fviaxgdwdy?svg=true)](https://ci.appveyor.com/project/php/php-src) -Pull Requests -============= -PHP accepts pull requests via github. Discussions are done on github, but -depending on the topic can also be relayed to the official PHP developer -mailing list internals@lists.php.net. +PHP is a popular general-purpose scripting language that is especially suited to +web development. + +Official PHP Git repository is located at https://git.php.net. A repository mirror +is available at https://github.com/php/php-src. + +## Installation + +For installation of PHP, please refer to the online documentation at +http://php.net/install. -New features require an RFC and must be accepted by the developers. -See https://wiki.php.net/rfc and https://wiki.php.net/rfc/voting for more -information on the process. +## Guidelines for contributors + +PHP accepts pull requests via GitHub. Discussions are done on GitHub, but +depending on the topic can also be relayed to the official PHP developer mailing +list internals@lists.php.net. + +New features require an RFC and must be accepted by the developers. See +https://wiki.php.net/rfc and https://wiki.php.net/rfc/voting for more information +on the process. Bug fixes **do not** require an RFC, but require a bugtracker ticket. Always open a ticket at https://bugs.php.net and reference the bug id using #NNNNNN. @@ -27,14 +34,13 @@ open a ticket at https://bugs.php.net and reference the bug id using #NNNNNN. the magic_quotes behavior and therefore should not raise a warning at any time. The patch removes this warning -We do not merge pull requests directly on github. All PRs will be -pulled and pushed through http://git.php.net. +We do not merge pull requests directly on GitHub. All PRs will be pulled and +pushed through https://git.php.net. +See further documents located in the PHP repository for more information about +contributing: -Guidelines for contributors -=========================== +- [CONTRIBUTING.md](/CONTRIBUTING.md) - [CODING_STANDARDS](/CODING_STANDARDS) -- [README.GIT-RULES](/README.GIT-RULES) - [README.MAILINGLIST_RULES](/README.MAILINGLIST_RULES) - [README.RELEASE_PROCESS](/README.RELEASE_PROCESS) - diff --git a/configure.ac b/configure.ac index 6ba8b798bf3ac..aea5a70897061 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,7 @@ dnl Basic autoconf + automake initialization, generation of config.nice. dnl ------------------------------------------------------------------------- AC_PREREQ(2.59) -AC_INIT(README.GIT-RULES) +AC_INIT(CONTRIBUTING.md) ifdef([AC_PRESERVE_HELP_ORDER], [AC_PRESERVE_HELP_ORDER], []) PHP_CONFIG_NICE(config.nice) @@ -159,7 +159,7 @@ if test -n "$with_apxs2filter" && test -n "$with_apxs2"; then AC_MSG_ERROR([--with-apxs2filter and --with-apxs2 cannot be used together]) fi - + dnl Settings we want to make before the checks. dnl ------------------------------------------------------------------------- @@ -688,7 +688,7 @@ dnl Check for getaddrinfo, should be a better way, but... dnl Also check for working getaddrinfo AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo, [AC_TRY_LINK([#include ], - [struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);], + [struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);], AC_TRY_RUN([ #include #include @@ -710,7 +710,7 @@ int main(void) { } pai = ai; - + while (pai) { if (pai->ai_family != AF_INET) { /* 127.0.0.1/NUMERICHOST should only resolve ONE way */ @@ -769,7 +769,7 @@ if test "$PHP_GCOV" = "yes"; then if test "$GCC" != "yes"; then AC_MSG_ERROR([GCC is required for --enable-gcov]) fi - + dnl Check if ccache is being used case `$php_shtool path $CC` in *ccache*[)] gcc_ccache=yes;; @@ -779,7 +779,7 @@ if test "$PHP_GCOV" = "yes"; then if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.]) fi - + dnl min: 1.5 (i.e. 105, major * 100 + minor for easier comparison) ltp_version_min="105" dnl non-working versions, e.g. "1.8 1.18"; @@ -812,7 +812,7 @@ if test "$PHP_GCOV" = "yes"; then fi ]) else - ltp_msg="To enable code coverage reporting you must have LTP installed" + ltp_msg="To enable code coverage reporting you must have LTP installed" AC_MSG_ERROR([$ltp_msg]) fi @@ -902,7 +902,7 @@ fi AC_MSG_CHECKING([where to scan for configuration files]) PHP_ARG_WITH(config-file-scan-dir,, [ --with-config-file-scan-dir=PATH - Set the path where to scan for configuration files], DEFAULT, no) + Set the path where to scan for configuration files], DEFAULT, no) if test "$PHP_CONFIG_FILE_SCAN_DIR" = "DEFAULT"; then PHP_CONFIG_FILE_SCAN_DIR= fi @@ -1000,7 +1000,7 @@ dnl ------------------------------------------------------------------------- PHP_HELP_SEPARATOR([Extensions: --with-EXTENSION=[shared[,PATH]] - + NOTE: Not all extensions can be build as 'shared'. Example: --with-foobar=shared,/usr/local/foobar/ @@ -1087,13 +1087,13 @@ if test "$PHP_PEAR" != "no"; then dnl PEAR dependancies dnl if test "$PHP_XML" = "no"; then - pear_error_msg="$pear_error_msg + pear_error_msg="$pear_error_msg PEAR requires XML to be enabled. Add --enable-xml to the configure line. (or --without-pear)" fi dnl dnl if test "$PHP_XMLRPC" = "no"; then -dnl pear_error_msg="$pear_error_msg +dnl pear_error_msg="$pear_error_msg dnl PEAR requires XML-RPC to be enabled. Add --with-xmlrpc to the configure line. (or --without-pear)" dnl fi dnl @@ -1206,7 +1206,7 @@ if test -z "$EXTENSION_DIR"; then if test "$enable_maintainer_zts" = "yes"; then extbasedir=$extbasedir-zts fi - + if test "$PHP_DEBUG" = "1"; then extbasedir=$extbasedir-debug fi diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 33f03d0b30a32..e112029de2052 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -46,7 +46,7 @@ var PHP_TEST_INI_EXT_EXCLUDE = ""; var PHP_MAKEFILE_FRAGMENTS = PHP_SRC_DIR + "\\Makefile.fragments.w32"; -/* Care also about NTDDI_VERSION and _WIN32_WINNT in config.w32.h.in +/* Care also about NTDDI_VERSION and _WIN32_WINNT in config.w32.h.in and manifest. */ var WINVER = "0x0601"; /* 7/2008r2 */ @@ -90,7 +90,7 @@ if (MODE_PHPIZE) { WScript.Quit(10); } } else { - if (!FSO.FileExists("README.GIT-RULES")) { + if (!FSO.FileExists("CONTRIBUTING.md")) { STDERR.WriteLine("Must be run from the root of the php source"); WScript.Quit(10); } @@ -99,7 +99,7 @@ if (MODE_PHPIZE) { var CWD = WshShell.CurrentDirectory; if (typeof(CWD) == "undefined") { - CWD = FSO.GetParentFolderName(FSO.GetAbsolutePathName("README.GIT-RULES")); + CWD = FSO.GetParentFolderName(FSO.GetAbsolutePathName("CONTRIBUTING.md")); } /* defaults; we pick up the precise versions from configure.ac */ @@ -113,7 +113,7 @@ var PHP_VERSION_STRING = "7.3.0"; function get_version_numbers() { var cin = file_get_contents("configure.ac"); - + if (cin.match(new RegExp("PHP_MAJOR_VERSION=(\\d+)"))) { PHP_VERSION = RegExp.$1; } @@ -215,7 +215,7 @@ function condense_path(path) /* on a different drive */ break; } - + return path; } @@ -230,7 +230,7 @@ function ConfigureArg(type, optname, helptext, defval) this.arg = "--" + type + "-" + optname; this.imparg = "--" + opptype + "-" + optname; } - + this.optname = optname; this.helptext = helptext; this.defval = defval; @@ -277,7 +277,7 @@ function word_wrap_and_indent(indent, text, line_suffix, indent_char) if (text == null) { return ""; } - + var words = text.split(new RegExp("\\s+", "g")); var i = 0; var ret_text = ""; @@ -297,7 +297,7 @@ function word_wrap_and_indent(indent, text, line_suffix, indent_char) for (i = 0; i < indent; i++) { space += indent_char; } - + for (i = 0; i < words.length; i++) { if (this_line.length) { t = this_line + " " + words[i]; @@ -336,7 +336,7 @@ function conf_process_args() var analyzed = false; var nice = "cscript /nologo configure.js "; var disable_all = false; - + args = WScript.Arguments; for (i = 0; i < args.length; i++) { arg = args(i); @@ -465,7 +465,7 @@ can be built that way. \ analyzed = analyze_arg(arg.defval); shared = analyzed[0]; argval = analyzed[1]; - + // Don't trust a default "yes" answer for a non-core module // in a snapshot build if (PHP_SNAPSHOT_BUILD != "no" && argval == "yes" && !shared) { @@ -494,7 +494,7 @@ can be built that way. \ } } } - + if (PHP_SNAPSHOT_BUILD != "no" && argval == "no") { force = true; for (j = 0; j < snapshot_build_exclusions.length; j++) { @@ -782,7 +782,7 @@ function CHECK_LIB(libnames, target, path_to_check, common_name) var i, j, k, libname; var location = false; var path = path_to_check.split(';'); - + for (i = 0; i < libnames.length; i++) { libname = libnames[i]; @@ -855,7 +855,7 @@ function OLD_CHECK_LIB(libnames, target, path_to_check) } else { target = "_" + target.toUpperCase(); } - + if (path_to_check == null) { path_to_check = php_usual_lib_suspects; } else { @@ -934,7 +934,7 @@ function CHECK_FUNC_IN_HEADER(header_name, func_name, path_to_check, add_to_flag return c; } STDOUT.WriteLine("No"); - return false; + return false; } function GREP_HEADER(header_name, regex, path_to_check) @@ -956,7 +956,7 @@ function GREP_HEADER(header_name, regex, path_to_check) if (typeof(p) == "string") { c = file_get_contents(p); } - } + } if (!c) { return false; } @@ -976,7 +976,7 @@ function GREP_HEADER(header_name, regex, path_to_check) function CHECK_HEADER_ADD_INCLUDE(header_name, flag_name, path_to_check, use_env, add_dir_part, add_to_flag_only) { var dir_part_to_add = ""; - + if (use_env == null) { use_env = true; } @@ -994,7 +994,7 @@ function CHECK_HEADER_ADD_INCLUDE(header_name, flag_name, path_to_check, use_env } else { path_to_check += ";" + php_usual_include_suspects; } - + var p = search_paths(header_name, path_to_check, use_env ? "INCLUDE" : null); var have = 0; var sym; @@ -1011,7 +1011,7 @@ function CHECK_HEADER_ADD_INCLUDE(header_name, flag_name, path_to_check, use_env if (typeof(p) == "string" && add_dir_part) { ADD_FLAG(flag_name, '/I "' + p + dir_part_to_add + '" '); } - } + } have = p ? 1 : 0 sym = header_name.toUpperCase(); @@ -1131,15 +1131,15 @@ function generate_version_info_resource(makefiletarget, basename, creditspath, s MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": $(PHP_DIR)\\build\\template.rc"); MFO.WriteLine("\t$(RC) /I $(PHP_DIR)/include /n /fo $(BUILD_DIR)\\" + resname + logo + debug + ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"' - + makefiletarget + '\\"" /d URL="\\"' + project_url + - '\\"" /d INTERNAL_NAME="\\"' + internal_name + versioning + + + makefiletarget + '\\"" /d URL="\\"' + project_url + + '\\"" /d INTERNAL_NAME="\\"' + internal_name + versioning + '\\"" /d THANKS_GUYS="\\"' + thanks + '\\"" $(PHP_DIR)\\build\\template.rc'); } else { MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": win32\\build\\template.rc"); MFO.WriteLine("\t$(RC) /n /fo $(BUILD_DIR)\\" + resname + logo + debug + ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"' - + makefiletarget + '\\"" /d URL="\\"' + project_url + - '\\"" /d INTERNAL_NAME="\\"' + internal_name + versioning + + + makefiletarget + '\\"" /d URL="\\"' + project_url + + '\\"" /d INTERNAL_NAME="\\"' + internal_name + versioning + '\\"" /d THANKS_GUYS="\\"' + thanks + '\\"" win32\\build\\template.rc'); } MFO.WriteBlankLines(1); @@ -1199,7 +1199,7 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir) resname = generate_version_info_resource(makefiletarget, sapiname, configure_module_dirname, true); manifest_name = generate_version_info_manifest(makefiletarget); - + MFO.WriteLine(makefiletarget + ": $(BUILD_DIR)\\" + makefiletarget); MFO.WriteLine("\t@echo SAPI " + sapiname_for_printing + " build complete"); if (MODE_PHPIZE) { @@ -1219,7 +1219,7 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir) ldflags = "$(LDFLAGS)"; manifest = "-@$(_VC_MANIFEST_EMBED_EXE)"; } - + if (PHP_SANITIZER == "yes") { if (CLANG_TOOLSET) { add_asan_opts("CFLAGS_" + SAPI, "LIBS_" + SAPI, (is_lib ? "ARFLAGS_" : "LDFLAGS_") + SAPI); @@ -1259,7 +1259,7 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir) if (manifest) { MFO.WriteLine("\t" + manifest); } - + DEFINE('CFLAGS_' + SAPI + '_OBJ', '$(CFLAGS_' + SAPI + ')'); if (configure_module_dirname.match("pecl")) { @@ -1279,7 +1279,7 @@ function ADD_DIST_FILE(filename) } else { ADD_FLAG("PHP_EXTRA_DIST_FILES", filename); } -} +} function file_get_contents(filename) { @@ -1382,7 +1382,7 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir) if (force_all_shared()) { shared = true; eval("PHP_" + EXT + "_SHARED = true;"); - } else { + } else { eval("shared = PHP_" + EXT + "_SHARED;"); } } else { @@ -1412,7 +1412,7 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir) MFO.WriteBlankLines(1); ADD_SOURCES(configure_module_dirname, file_list, extname, obj_dir); - + MFO.WriteBlankLines(1); if (shared) { @@ -1460,7 +1460,7 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir) MFO.WriteLine(dllname + ": $(BUILD_DIR)\\" + dllname); MFO.WriteLine("\t@echo EXT " + extname + " build complete"); MFO.WriteBlankLines(1); - + DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_' + EXT + ')'); } else { ADD_FLAG("STATIC_EXT_OBJS", "$(" + EXT + "_GLOBAL_OBJS)"); @@ -1497,9 +1497,9 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir) } } } - + extension_module_ptrs += '\tphpext_' + extname + '_ptr,\r\n'; - + DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_PHP) $(CFLAGS_' + EXT + ')'); } if (MODE_PHPIZE && FSO.FileExists(PHP_DIR + "/include/main/config.pickle.h")) { @@ -1560,7 +1560,7 @@ function ADD_SOURCES(dir, file_list, target, obj_dir) var _tmp = src.split("\\"); var filename = _tmp.pop(); - + // build the obj out dir and use it as a key var dirname = _tmp.join("\\"); @@ -1586,7 +1586,7 @@ function ADD_SOURCES(dir, file_list, target, obj_dir) var build_dir = (dirname ? obj_dir + "\\" + dirname : obj_dir).replace(new RegExp("^..\\\\"), ""); } - obj = sub_build + build_dir + "\\" + filename.replace(re, ".obj"); + obj = sub_build + build_dir + "\\" + filename.replace(re, ".obj"); if (i > 0) { srcs_line += " " + dir + "\\" + src; @@ -1601,7 +1601,7 @@ function ADD_SOURCES(dir, file_list, target, obj_dir) if (!srcs_by_dir.hasOwnProperty(build_dir)) { srcs_by_dir[build_dir] = []; - } + } /* storing the index from the file_list */ srcs_by_dir[build_dir].push(i); @@ -1631,7 +1631,7 @@ function ADD_SOURCES(dir, file_list, target, obj_dir) if (PHP_ANALYZER == "clang") { var analyzer_base_args = X64 ? "-m64" : "-m32"; var analyzer_base_flags = ""; - + analyzer_base_args += " --analyze"; var vc_ver; @@ -1651,7 +1651,7 @@ function ADD_SOURCES(dir, file_list, target, obj_dir) } else { analyzer_base_flags += " -D _MSC_VER=" + probe_binary(PATH_PROG('cl', null)); } - + if (X64) { analyzer_base_flags += " -D _M_X64 -D _WIN64"; } else { @@ -1672,7 +1672,7 @@ function ADD_SOURCES(dir, file_list, target, obj_dir) "--library=win32\\build\\cppcheck.cfg " + "--library=" + cppcheck_lib + " " + /* "--rule-file=win32\build\cppcheck_rules.xml " + */ - " --std=c89 --std=c++11 " + + " --std=c89 --std=c++11 " + "--quiet --inconclusive --template=vs "; var cppcheck_build_dir = get_define("CPPCHECK_BUILD_DIR"); @@ -1692,9 +1692,9 @@ function ADD_SOURCES(dir, file_list, target, obj_dir) MFO.WriteLine("\t@$(CC) $(" + flags + ") $(CFLAGS) $(" + bd_flags_name + ") /c " + dir + "\\" + src + " /Fo" + sub_build + d + obj); if ("clang" == PHP_ANALYZER) { - MFO.WriteLine("\t@\"$(CLANG_CL)\" " + analyzer_base_args + " $(" + flags + "_ANALYZER) $(CFLAGS_ANALYZER) $(" + bd_flags_name + "_ANALYZER) " + dir + "\\" + src); + MFO.WriteLine("\t@\"$(CLANG_CL)\" " + analyzer_base_args + " $(" + flags + "_ANALYZER) $(CFLAGS_ANALYZER) $(" + bd_flags_name + "_ANALYZER) " + dir + "\\" + src); } else if ("cppcheck" == PHP_ANALYZER) { - MFO.WriteLine("\t\"@$(CPPCHECK)\" " + analyzer_base_args + " $(" + flags + "_ANALYZER) $(CFLAGS_ANALYZER) $(" + bd_flags_name + "_ANALYZER) " + analyzer_base_flags + " " + dir + "\\" + src); + MFO.WriteLine("\t\"@$(CPPCHECK)\" " + analyzer_base_args + " $(" + flags + "_ANALYZER) $(CFLAGS_ANALYZER) $(" + bd_flags_name + "_ANALYZER) " + analyzer_base_flags + " " + dir + "\\" + src); }else if (PHP_ANALYZER == "pvs") { MFO.WriteLine("\t@\"$(PVS_STUDIO)\" --cl-params $(" + flags + ") $(CFLAGS) $(" + bd_flags_name + ") /c " + dir + "\\" + src + " --source-file " + dir + "\\" + src + " --cfg PVS-Studio.conf --errors-off \"V122 V117 V111\" "); @@ -1719,8 +1719,8 @@ function ADD_SOURCES(dir, file_list, target, obj_dir) DEFINE(sym, tv); - /* Generate the object response file and define it to the Makefile. This can be - useful when getting the "command line too long" linker errors. + /* Generate the object response file and define it to the Makefile. This can be + useful when getting the "command line too long" linker errors. TODO pack this into a function when response files are used for other kinds of info. */ var obj_lst_fh = null; if (!FSO.FileExists(obj_lst_fn)) { @@ -1764,11 +1764,11 @@ function generate_internal_functions() var indata; STDOUT.WriteLine("Generating main/internal_functions.c"); - + infile = FSO.OpenTextFile("main/internal_functions.c.in", 1); indata = infile.ReadAll(); infile.Close(); - + indata = indata.replace("@EXT_INCLUDE_CODE@", extension_include_code); indata = indata.replace("@EXT_MODULE_PTRS@", extension_module_ptrs); @@ -1944,7 +1944,7 @@ function generate_tmp_php_ini() if ("shared" != extensions_enabled[i][1]) { continue; } - + var directive = "extension"; if ("opcache" == extensions_enabled[i][0]) { directive = "zend_extension"; @@ -2174,11 +2174,11 @@ function generate_config_h() prefix = PHP_PREFIX.replace(new RegExp("\\\\", "g"), "\\\\"); STDOUT.WriteLine("Generating main/config.w32.h"); - + infile = FSO.OpenTextFile("win32/build/config.w32.h.in", 1); indata = infile.ReadAll(); infile.Close(); - + outfile = FSO.CreateTextFile("main/config.w32.h", true); indata = indata.replace(new RegExp("@PREFIX@", "g"), prefix); @@ -2220,7 +2220,7 @@ function generate_config_h() pieces += '" "'; } } - + outfile.WriteLine("#define " + keys[i] + " " + pieces); } @@ -2231,7 +2231,7 @@ function generate_config_h() outfile.WriteLine("#define HAVE_ATANH 1"); } - + outfile.Close(); } @@ -2247,7 +2247,7 @@ function generate_phpize() var MF = FSO.CreateTextFile(dest + "/phpize.js", true); var DEPS = FSO.CreateTextFile(dest + "/ext_deps.js", true); - + prefix = get_define("PHP_PREFIX"); prefix = prefix.replace(new RegExp("/", "g"), "\\"); prefix = prefix.replace(new RegExp("\\\\", "g"), "\\\\"); @@ -2369,7 +2369,7 @@ function handle_analyzer_makefile_flags(fd, key, val) } val = new_val; - if ("clang" == PHP_ANALYZER) { + if ("clang" == PHP_ANALYZER) { val = val.replace(/\/FD /, "") .replace(/\/Fp.+? /, "") .replace(/\/Fo.+? /, "") @@ -2433,7 +2433,7 @@ function generate_makefile() /* \s+\/ eliminates extra whitespace caused when using \ for string continuation, whereby \/ is the start of the next compiler switch */ var val = trim(configure_subst.Item(keys[i])).replace(/\s+\//gm, " /"); - + MF.WriteLine(keys[i] + "=" + val + " "); MF.WriteBlankLines(1); @@ -2461,7 +2461,7 @@ function generate_makefile() MF.WriteLine(" @for %D in ($(INSTALL_HEADERS_DIR)) do @if not exist $(BUILD_DIR_DEV)\\include\\%D mkdir $(BUILD_DIR_DEV)\\include\\%D >nul"); for (i in headers_install) { if (headers_install[i][2] != "") { - MF.WriteLine(" @if not exist $(BUILD_DIR_DEV)\\include\\" + headers_install[i][2] + " mkdir $(BUILD_DIR_DEV)\\include\\" + + MF.WriteLine(" @if not exist $(BUILD_DIR_DEV)\\include\\" + headers_install[i][2] + " mkdir $(BUILD_DIR_DEV)\\include\\" + headers_install[i][2] + ">nul"); MF.WriteLine(" @copy " + headers_install[i][0] + " " + "$(BUILD_DIR_DEV)\\include\\" + headers_install[i][2] + " /y >nul"); } @@ -2539,7 +2539,7 @@ function generate_makefile() FSO.DeleteFile(PHP_MAKEFILE_FRAGMENTS, true); } - MF.Close(); + MF.Close(); } function ADD_FLAG(name, flags, target) @@ -2554,7 +2554,7 @@ function ADD_FLAG(name, flags, target) /* Prefix with a space, thus making sure the current flag is not a substring of some other. It's still not a complete check if - some flags with spaces got added. + some flags with spaces got added. TODO rework to use an array, so direct match can be done. This will also @@ -2563,7 +2563,7 @@ function ADD_FLAG(name, flags, target) if (curr_flags.indexOf(" " + flags) >= 0 || curr_flags.indexOf(flags + " ") >= 0) { return; } - + flags = curr_flags + " " + flags; configure_subst.Remove(name); } @@ -2640,7 +2640,7 @@ function copy_and_subst(srcname, destname, subst_array) content = content.replace(re, rep); } - + var f = FSO.CreateTextFile(destname, true); f.Write(content); f.Close(); @@ -2661,14 +2661,14 @@ function glob(path_pattern) if (FSO.FileExists(path_pattern)) { return new Array(path_pattern); } - + // first, build as much as possible that doesn't have a pattern for (p = 0; p < path_parts.length; p++) { if (path_parts[p].match(is_pat_re)) break; if (p) base += "\\"; - base += path_parts[p]; + base += path_parts[p]; } return _inner_glob(base, p, path_parts); @@ -3035,7 +3035,7 @@ function toolset_is_64() return null != full.match(/x86_64/);*/ /* Even executed within an environment setup with vcvars32.bat, - clang-cl doesn't recognize the arch toolset. But as it needs + clang-cl doesn't recognize the arch toolset. But as it needs the VS environment, checking the arch of cl.exe is correct. */ return probe_binary(PATH_PROG('cl', null), 64); } else if (ICC_TOOLSET) { @@ -3470,4 +3470,3 @@ function add_asan_opts(cflags_name, libs_name, ldflags_name) ADD_FLAG(ldflags_name, "/libpath:\"" + get_clang_lib_dir() + "\\windows\""); } } - diff --git a/win32/build/mkdist.php b/win32/build/mkdist.php index bf91b8b36093e..45dccdc31bfcc 100644 --- a/win32/build/mkdist.php +++ b/win32/build/mkdist.php @@ -68,13 +68,13 @@ function get_depends($module) "api-ms-win-crt-.+\.dll", ); global $build_dir, $extra_dll_deps, $ext_targets, $sapi_targets, $pecl_targets, $phpdll, $per_module_deps, $pecl_dll_deps; - + $bd = strtolower(realpath($build_dir)); $is_pecl = in_array($module, $pecl_targets); - + $cmd = "$GLOBALS[build_dir]\\deplister.exe \"$module\" \"$GLOBALS[build_dir]\""; - $proc = proc_open($cmd, + $proc = proc_open($cmd, array(1 => array("pipe", "w")), $pipes); @@ -106,7 +106,7 @@ function get_depends($module) continue; } } - + if ($is_pecl) { if (!in_array($dep, $pecl_dll_deps)) { $pecl_dll_deps[] = $dep; @@ -199,7 +199,7 @@ function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */ $hdr['size'] = octdec(trim($hdr['size'])); echo "File: $hdr[filename] $hdr[size]\n"; - + if ($filename == $hdr['filename']) { echo "Found the file we want\n"; $dest = fopen($destfilename, 'wb'); @@ -208,14 +208,14 @@ function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */ echo "Wrote $x bytes into $destfilename\n"; break; } - + /* skip body of the file */ $size = 512 * ceil((int)$hdr['size'] / 512); echo "Skipping $size bytes\n"; gzseek($fp, gztell($fp) + $size); - + } while (!$done); - + } /* }}} */ @@ -247,7 +247,7 @@ function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */ $text_files = array( "LICENSE" => "license.txt", "NEWS" => "news.txt", - "INSTALL" => "install.txt", + "README.md" => "readme.txt", "README.REDIST.BINS" => "readme-redist-bins.txt", "php.ini-development" => "php.ini-development", "php.ini-production" => "php.ini-production" @@ -323,9 +323,9 @@ function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */ } /* TODO: -add sanity check and test if all required DLLs are present, per version +add sanity check and test if all required DLLs are present, per version This version works at least for 3.6, 3.8 and 4.0 (5.3-vc6, 5.3-vc9 and HEAD). -Add ADD_DLLS to add extra DLLs like dynamic dependencies for standard +Add ADD_DLLS to add extra DLLs like dynamic dependencies for standard deps. For example, libenchant.dll loads libenchant_myspell.dll or libenchant_ispell.dll */ @@ -451,7 +451,7 @@ function copy_test_dir($directory, $dest) } } - closedir($directory_list); + closedir($directory_list); } function make_phar_dot_phar($dist_dir) @@ -537,7 +537,7 @@ function make_phar_dot_phar($dist_dir) extract_file_from_tarball('Archive_Tar', 'Archive/Tar.php', "$dist_dir/PEAR/go-pear-bundle"); extract_file_from_tarball('Console_Getopt', 'Console/Getopt.php', "$dist_dir/PEAR/go-pear-bundle"); } - + /* add extras from the template dir */ if (file_exists($snapshot_template)) { $items = glob("$snapshot_template/*"); @@ -567,7 +567,7 @@ function make_phar_dot_phar($dist_dir) } } } - + /* copy c++ runtime */ $items = glob("$snapshot_template/dlls/*.CRT");