Download the PHP package fofx/utility without Composer
On this page you can find all versions of the php package fofx/utility. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package utility
Utility
A PHP library with a few practical helpers. Uses jeremykendall/php-domain-parser for domain parsing.
get_tables()- List database tables for the current connectiondownload_public_suffix_list()- Ensure the Public Suffix List exists locallyextract_registrable_domain()- Extract a registrable domain from a URLis_valid_domain()- Validate if a domain has a valid registrable domain and suffixextract_canonical_url()- Extract the canonical URL from HTML contentlist_embedded_json_selectors()- List CSS selectors for JSON script tags found in HTMLextract_embedded_json_blocks()- Extract JSON blocks from HTML with additional metadatafilter_json_blocks_by_selector()- Filter JSON blocks by selector ID, with optional 'json' key selectionsave_json_blocks_to_file()- Save extracted JSON blocks to a file with optional filtering by selector ID
Installation
Usage
See usage examples in:
- docs/usage.md
- docs/usage-json-to-columns.md
- docs/usage-FiverrSitemapImporter.md
- docs/usage-FiverrJsonImporter.md
- docs/usage-AmazonProductPageParser.md
- docs/usage-AmazonBrowseNodeImporter.md
- docs/usage-tracking.md
- docs/wordpress-php-sdk.md
Extracting and Filtering Embedded JSON from HTML
You can use filter_json_blocks_by_selector() with extract_embedded_json_blocks() to extract embedded JSON from an HTML file, and filter it.
Importing Fiverr Sitemap Data (Categories and Tags)
See docs/usage-FiverrSitemapImporter.md
JSON to Columns
Helpers for working with JSON data and converting it to database columns.
See docs/usage-json-to-columns.md
This gives you hints about the column types. Using __ delimiter, which is friendly for column names. Partial output:
Testing and Development
To run the PHPUnit test suite through composer:
To use PHPStan for static analysis:
To run PHPStan on the tests folder:
To use PHP-CS-Fixer for code style:
Test and the PSL file
Since tests use temporary storage, to avoid network calls during tests. public_suffix_list.dat (download here) must be saved to to local/resources/.
Tests then copy this file into temporary storage. If it is missing, tests are skipped.
License
MIT
All versions of utility with dependencies
laravel/framework Version ^12.22
fofx/helper Version ^1.2
jeremykendall/php-domain-parser Version ^6.4
symfony/dom-crawler Version ^7.3
symfony/css-selector Version ^7.3
fakerphp/faker Version ^1.24
madeitbelgium/wordpress-php-sdk Version ^1.7
phpseclib/phpseclib Version ^3.0