Download the PHP package utrodus/malaysia-public-holiday without Composer
On this page you can find all versions of the php package utrodus/malaysia-public-holiday. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package malaysia-public-holiday
π²πΎ Malaysia Public Holiday
Malaysia Public Holiday is a PHP library to fetch official public holiday data for all Malaysian states by scraping Office Holidays.
Itβs best for HR applications, attendance systems, logistics planning, calendars, and any system that needs accurate holiday information.
β¨ Features
- π Get national and regional holidays in Malaysia
- π Support for all Malaysian states and federal territories
- π Filter holidays by year, month, or state
- π Supports alias names for states (e.g.,
KL,Johore,Malacca) - βοΈ Easily integrable with any PHP project
πΌ Use Cases
- Employee attendance and HR systems
- Delivery scheduling & logistics
- Custom calendar generation
- Event planning & automation
- Working-day calculations
π Requirements
- PHP >= 8.1
- Composer
π οΈ Tech Stack
| Tool | Purpose |
|---|---|
| PHP >= 8.1 | Core programming language |
| Guzzle | HTTP requests |
| Symfony BrowserKit | Web scraping (HTML crawling) |
| PHPUnit | Unit testing |
| GitHub Actions | Continuous integration |
π¦ Installation
β‘ Usage
I have included code examples to try this library in each file within the examples folder. Please see below:
| Use Case | Example File | Description |
|---|---|---|
| Get holidays for a specific state | examples/get_holidays_for_specific_state.php |
Retrieves holidays for a particular state in the current year. |
| Get holidays for a specific state and year | examples/get_holidays_for_specific_state_and_year.php |
Fetches holidays for a state in a specific year. |
| Get holidays for all states | examples/get_holidays_for_all_states.php |
Retrieves holidays for all Malaysian states in the current year. |
| Get holidays for all states and a specific year | examples/get_holidays_for_all_states_and_year.php |
Fetches holidays for all states in a given year. |
| Filter holidays by month | examples/get_holidays_for_state_filtered_by_month.php |
Filters holidays for a state in a specific month. |
| Group holidays by month | examples/get_holidays_for_state_grouped_by_month.php |
Groups holidays for a state by month. |
| Handling invalid regions | examples/handling_invalid_region.php |
Demonstrates how the library handles invalid region inputs. |
| Using alternative region names | examples/using_alternative_region_name.php |
Shows support for alias state names. |
π§ͺ Running Tests
π¬ Contributing
Pull requests and suggestions are welcome! If you find bugs or have a feature request, feel free to open an issue.
π License
This project is open-source and available under the MIT License.
All versions of malaysia-public-holiday with dependencies
symfony/browser-kit Version ^7.2
symfony/http-client Version ^7.2
symfony/css-selector Version ^7.2