PHP Changelog Fetcher

This project is a PHP script designed to fetch and compile the changelog of PHP functions from the official PHP documentation website. The changelogs are consolidated into a single HTML file for easy reference.

Features

  • Fetches changelogs for all PHP functions listed in the PHP manual.
  • Generates a structured HTML file with a table of changelogs.
  • Allows continuation from a specific function title if the process is interrupted.

Prerequisites

  • PHP 7.0 or higher
  • cURL extension enabled
  • simple_html_dom library

Installation

  1. Clone the repository:

    git clone https://github.com/denizvatan/php-changelog-fetcher.git
    cd php-changelog-fetcher
  2. Install the dependencies: Make sure you have the simple_html_dom.php file in your project directory. You can download it from here.

Usage

  1. Run the script:

    php changelog_fetcher.php
  2. Continue from a specific function title (if needed): If the process is interrupted and you need to continue from a specific function, you can modify the script to call continueFromTitle method with the desired function title.

Example

Here's an example of how to use the continueFromTitle method:

$baseUrl = 'https://www.php.net/manual/en/';
$outputFile = 'phpChangelog.html';

$changelogFetcher = new ChangelogFetcher($baseUrl, $outputFile);
$changelogFetcher->fetch();

// If interrupted, continue from a specific function title:
$changelogFetcher->continueFromTitle($baseUrl . 'indexes.functions.php', 'IntlDateFormatter::create');

Function Report Generator

This PHP script generates an HTML report of function usages in a specified folder by parsing an HTML file containing function names. The script fetches the content from a given URL, extracts function names from <h1> tags, searches for their usages in the provided folder, and creates an HTML report.

Prerequisites

  • PHP 7.4 or later
  • Ripgrep (for searching function usages)

Installation

  1. Clone the repository (if applicable):
    git clone https://github.com/yourusername/function-report-generator.git
    cd function-report-generator
    
  2. Ensure Ripgrep is installed:

Follow the installation instructions for your operating system.

Code Structure

  • ChangelogFetcher.php: Contains the ChangelogFetcher class which handles fetching and compiling the changelogs.
  • simple_html_dom.php: The simple_html_dom library for parsing HTML.
  • phpChangelog.html: The output file generated by the script.
  • search-changes.php: Contains the FunctionReportGenerator class which generates an HTML report of function usages in a specified folder.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Feel free to submit issues and enhancement requests.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a pull request

Acknowledgements

Contact

Deniz Vatan Buyorük - denizvtn@gmail.com

Project Link: https://github.com/denizvatan/php-changelog-fetcher