php / systems

Hooks and Cronjobs for PHP Infrastructure
http://php.net
51 stars 29 forks source link

Index reserved keywords for better user experience #19

Open fredden opened 1 year ago

fredden commented 1 year ago

URLs like https://www.php.net/strpos or https://php.net/implode render the expected documentation page. Some URLs are specifically configured to redirect to the expected documentation page, like https://php.net/_GET or https://www.php.net/foreach.

However URLs for language features such as yield (https://php.net/yield) and endif (https://php.net/endif) redirect to a function search page which claims that the feature does not exist.

This pull request adds some logic to read the list of reserved keywords from the relevant page of documentation and updates the index to include these results. This means that all the URLs in this description should work as expected.

Note that if https://github.com/php/web-php/pull/804 gets merged before this, we can probably re-assess if this is necessary. There are some comments in the code about refactoring this to read from phd directly or to have phd generate a search database itself.

fredden commented 3 months ago

Is this still relevant?

Possibly. What's the plan for keeping the list introduced in https://github.com/php/web-php/pull/804 up-to-date? This change adds functionality with very little burden of maintenance as far as I can tell.