1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

77 Commits

Author SHA1 Message Date
Ismael Martinez Cisternas
3c99682625 Releases: add missing space to discontinued major versions (#1357) 2025-08-26 11:46:06 -07:00
Andreas Möller
59c070f557 Enhancement: Enable blank_line_after_opening_tag fixer (#875) 2023-12-07 16:57:19 +01:00
Andreas Möller
c093fb5382 Enhancement: Enable trailing_comma_in_multiline fixer (#647)
* Enhancement: Enable and configure trailing_comma_in_multiline fixer

* Fix: Run 'make coding-standards'
2023-12-06 23:16:28 +00:00
Andreas Möller
57f505ed58 Enhancement: Enable and configure concat_space fixer
Closes GH-657.
2022-08-22 19:04:47 +02:00
Andreas Möller
d9bcfed482 Enhancement: Enable array_syntax fixer
Co-authored-by: MathiasReker <mathias@reker.dk>

Closes GH-659.
2022-08-22 18:59:14 +02:00
Andreas Möller
f127de5db9 Enhancement: Enable strict_param fixer
We set strict param to false to ensure current behavior,
except for two cases where it is safe to go with true.

Closes GH-658.
2022-07-15 14:48:44 +02:00
Andreas Möller
0ee0117c6b Fix: Replace weird comment with DocBlock
Closes GH-649.
2022-07-12 14:33:45 +02:00
Andreas Möller
b3c9551c93 Enhancement: Enable no_extra_blank_lines fixer
Closes GH-646.
2022-07-12 14:26:18 +02:00
Andreas Möller
c68e5a9e4a Enhancement: Enable single_space_after_construct fixer
Closes GH-640.
2022-07-12 11:44:23 +02:00
Andreas Möller
f3585d9bdf Enhancement: Enable indentation_type fixer
Closes GH-622.
2022-07-11 20:34:20 +02:00
Ayesh Karunaratne
1b83fd7ab7 Multiple micro-optimizations
* Replace `ob_get_contents();ob_clean()` with `ob_get_clean()`

`ob_get_clean()` is equivalent to `ob_get_contents()` followed by `ob_clean()`.

* Replace `intval()` calls with `(int)` type cast

This is a micro-optimization because `intval()` is a function call, and the type cast is about 6 times fast.

* Replace `preg_replace` call that could be done with an `rtrim()` call

In `./error.php`, there is a `preg_replace('!/+$!', '', $URI);` call that essentially is equivalent to `rtrim()`, that both calls removing trailing slash characters in `$URI`.
The `rtim()` call is more legible and faster.

* Combine consecutive `str_replace` calls to a single `str_replace` call

* Use short ternary operator where possible

Improves code readability.

* Cascade various `else` statements where possible

Cleans up the code by removing unnecessary `else` blocks and moving the code to the parent context if the previous `if` block exits the function by either terminating the script, or with a `return` statement.

* Combine multiple `isset()` calls to a single `isset()`

`isset()` accepts multiple parameters and returns `true` only if all of the parameters are `isset`. It makes sense to combine multiple individual `isset` calls to a single call for better readability.

* Replace `for` loop with a `foreach` loop

* Remove unnecessary character escapes in regular expressions

Regular expression special characters are context-sensitive. For example, special characters such as `.` are not considered special within square braces (`[]`).
This removes several of such instances that certain characters are escaped, but it is not strictly necessary within the context. This improves the readability of the expression.

See more information at [PHP.Watch: Writing better Regular Expressions in PHP](https://php.watch/articles/php-regex-readability#reduce-escape)

* Remove unnecessary break statement

* Remove unnecessary PHP close tags

* Remove redundant JSON_ERROR_NONE check

Remove unnecessary `json_last_error() == JSON_ERROR_NONE` where the decoded object is inspected already.

Closes GH-603.
2022-07-03 12:24:14 +02:00
Andreas Möller
d3876f68ea Fix: Remove unused parameter
* Fix: Remove unused parameter
* Fix: Remove unused local variable

Closes GH-574.
2022-06-28 14:50:11 +02:00
Mathias Reker ⚡️
530b28e95b Add void return types
Add void return type to functions with missing or empty return statements.

Closes GH-535.
2022-06-17 19:16:52 +02:00
Mathias Reker ⚡️
855860ae25 Single blank line at eof
A PHP file without end tag should always end with a single empty line feed.

Closes GH-541.
2022-06-17 16:36:32 +02:00
Renan de Lima
811f3e2807 Add supported versions in json payload (#514) 2022-05-19 10:28:29 -05:00
Sara Golemon
1a4f395d86 Refactor releases/index.php 2019-07-10 21:47:37 -04:00
Sara Golemon
f1cb7e74c4 Swap uses of _SERVER[DOCUMENT_ROOT] for __DIR__
4/4 - Update releases directory.
2019-05-31 12:48:34 -04:00
Christoph M. Becker
b8b8f3dfa0 Bye bye PHP 5 2019-01-31 15:45:22 +01:00
Christoph M. Becker
da85b2579b Consider all releases with the same EOL date
The algorithm to find the two most recently EOL'd versions built an
array where the EOL date is the key.  This can't work for multiple
releases with the same EOL date.  We **hack** around this by increasing
the timestamp to avoid duplicates being overwritten.
2019-01-31 14:33:25 +01:00
Christoph M. Becker
a6ff072737 Remove out-dated info regarding Windows builds 2019-01-31 13:46:20 +01:00
Peter Kokot
190459c766 Refactor each() function to foreach()
The each() function has been deprecated since PHP 7.2 and shouldn't be
used anymore:
- http://php.net/manual/en/function.each.php
2018-11-17 06:40:34 +01:00
zrhoffman
b7231b60cd Fix #72707: Filter releases by minor version
- Rewrite version-specific part of releases API to loop over releases
  only once
- Releases API: filter by minor or patch version, if provided
- Remove unused variable
- Rewrite version_array() to use array_pad(). Intended behavior:
  - If count($versionArray) is less than $length, version_array()
    should pad it with 0s to $length.
  - If count($versionArray) is greater than $length, version_array()
    should slice it to $length.
  - If $length is not set, leave $versionArray as-is after exploding it.
- Remove unused variable
- Still print "Unknown version" if the major version is found but the
  minor or patch version is not.
- Remove excess white space
- Bind array_replace_recursive() result to new variable instead of
  mutating $RELEASES global
- Only set $machineReadable to its first element if $machineReadable is
  not empty.
2018-11-17 06:20:55 +01:00
Peter Kokot
dd8d8bf863 Sync final and leading newlines
This patch adds some missing newlines, trims some multiple redundant
final newlines into a single one, and trims few redundant leading
newlines.

According to POSIX, a line is a sequence of zero or more non-'<newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-17 12:37:26 +02:00
Peter Kokot
0f95b8c709 Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-10-17 07:29:46 +02:00
Sara Golemon
29b6c5f86e Fix formatting when both md5/sha256 are available
This should probably be done more cleanly with CSS,
but this is a quick and dirty good-enough fix.
2017-06-05 22:36:42 -04:00
Sara Golemon
da811c575c Include sha256 checksums on /releases page 2017-06-05 22:13:02 -04:00
Alain Schlesser
7ce6944ae1 Add missing links to PHP 7 ChangeLogs.
Add missing links to PHP 7 change log to two sidebars that reference the 4 & 5 change logs:

- http://php.net/releases/
- http://php.net/sitemap.php
2016-10-18 19:31:14 +02:00
Adam Harvey
75e418c468 Good night and good luck, PHP 5.4. 2015-11-08 15:59:36 +01:00
Ben Ramsey
cd20519de7 Change the paragraphs in the sidebar to a list. 2015-04-06 10:25:58 -05:00
Ben Ramsey
a2106dccfb Adding clarity to the variable names for the JSON/serialized output 2015-04-06 10:17:00 -05:00
Ben Ramsey
bbb58d9d6c Simplify code according to @bjori's comment
See https://github.com/php/web-php/pull/53#discussion-diff-24725253
2015-04-06 10:17:00 -05:00
Ben Ramsey
f051345e2b Remove $PHP_5_3_* variables causing notices
These variables were removed in 470fc09f31, since 5.3 is no longer an
active release.
2015-04-06 10:17:00 -05:00
Márcio Almada
4b1af5f2c6 add json_encode()ded endpoint to PHP releases list + content type adjustments
We usually warn PHP users to avoid unserialize remote or untrusted data but
at the same time php.net only offers a serialized endpoint for PHP
releases. This commit:

- adds a JSON endpoint that can be an option to avoid the serialized endpoint
- sets a proper Content-Type response header for both serialized - `text/plain` -
and json - `application/json` - endpoints
- simplifies URLs exchanging `&serialize=1` and `&json=1` for `&serialize` and
`&json` respectively
2015-04-06 10:17:00 -05:00
Levi Morrison
5c6789c002 Prevent header from covering url fragment target
This way a release can be linked by appending #5.6.3 to the releases
url.
2014-12-26 09:14:14 -07:00
Levi Morrison
da0c299505 Fix minor HTML errors and warnings 2014-12-25 22:48:03 -07:00
Adam Harvey
33d5508c08 Link the supported versions page from some appropriate places. 2014-10-28 09:45:59 -07:00
Adam Harvey
cd0315128d We spel gud. 2014-09-30 16:47:30 -07:00
Michael
5bfef25e70 Kill off XHTML
Long live HTML5! =)
2014-06-04 19:39:27 +02:00
Levi Morrison
e916105a19 Fixed merge conflict. 2013-12-15 11:27:28 -07:00
Hannes Magnusson
e691cc3281 These are now available on museum
Still keeping the last 5.4 and 5.3 release here..
2013-12-04 17:29:38 -08:00
Hannes Magnusson
34ef9c817b Bring back the right column (prettified) and mark the download tab as current 2013-11-21 17:44:06 -08:00
Rasmus Lerdorf
c493016818 No more 5_2 here 2013-10-30 15:56:33 -07:00
Adam Harvey
11628631d5 Add EOL information to the historical releases sidebar. 2012-08-03 10:12:01 +08:00
Adam Harvey
a6b37ba4c0 Quiet a notice on the releases page with the current versions array. 2012-08-02 14:18:38 +08:00
Philip Olson
86f4de2ee5 Fixed bug where 5.2.17 wasn't showing up properly. Bug reported by Ferenc 2011-07-17 18:08:02 +00:00
Philip Olson
20e7bddedf WS 2011-07-17 17:55:33 +00:00
Daniel P. Brown
3eae4c4680 Seems more beneficial - particularly to those who are not native English-speakers - to mention explicitly both VC6 and VC9 are available in PHP 5.3+. 2010-11-18 20:46:24 +00:00
Daniel P. Brown
b2512ad1cc Added note to Windows users RE: VC9 vs. VC6 builds. 2010-11-18 19:18:02 +00:00
Philip Olson
ec1573d5af Removed the uncessassary filewatcher link 2010-10-25 23:34:09 +00:00
Philip Olson
301af3d061 Fixed PHP Bug #51966 - Show all release info - Patch by David Tajchreber (dtajchreber) 2010-06-03 02:53:24 +00:00