Skip to content

v1.0.1

Compare
Choose a tag to compare
@futureweb futureweb released this 20 Nov 12:44
· 15 commits to main since this release
b0bd486

New Feature: Direct CLI Output

This release introduces the ability for the script to output the calculated IP prefixes directly to the CLI when executed from the command line.

What's New?

  • When the script is run via CLI (php google_ip_prefix_diff.php), it now outputs the resulting IP prefixes (CIDR blocks) line by line.
  • This makes it easier to redirect the output to a file for caching or further processing:
    php google_ip_prefix_diff.php > cached_ip_ranges.txt

Benefits:

  • Automation-Friendly: Enables easy integration with cron jobs or other automation tools.
  • Improved Usability: Users no longer need to manually handle the returned array when running the script via CLI.

Example CLI Usage:

php google_ip_prefix_diff.php

Output:

8.8.8.0/24
8.8.4.0/24
203.0.113.0/25
php google_ip_prefix_diff.php > cached_ip_ranges.txt

This saves the output to cached_ip_ranges.txt, which can be reused in your application.