Download the PHP package kaleidpixel/geoipallow without Composer
On this page you can find all versions of the php package kaleidpixel/geoipallow. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kaleidpixel/geoipallow
More information about kaleidpixel/geoipallow
Files in kaleidpixel/geoipallow
Package geoipallow
Short Description A streamlined tool designed to generate .htaccess configurations, allowing web access exclusively from IP addresses of a specified country. Enhance your site's security and target your audience more effectively.
License MIT
Informations about the package geoipallow
Geo IP Allow
A streamlined tool designed to generate .htaccess configurations, allowing web access exclusively from IP addresses of a specified country. Enhance your site's security and target your audience more effectively.
Document
Coding is quite simple. The options are only simple, so you won't get lost.
Options
Option | Description |
---|---|
server default: apache |
Apache or Nginx |
ipv default: 0 |
Specify the version of the IP Address with a single digit (4 or 6). |
country default: US |
Specify the name of the country using the ISO code (Alpha-2 code) as defined in the ISO 3166 international standard. |
output_path default: empty |
File path including the name of the file to output the results. |
add_before_str default: empty |
. |
add_after_str default: empty |
. |
Methods
Method | Parameter | Description |
---|---|---|
read() | bool $echo = false bool $force = false |
Create a list of IP addresses. If already created, cache it for one day. |
delete() | none | Delete the IP address added with the read method. |
ipListEndPoints() | none | Wrapper method for the constant IP_LIST_ENDPOINTS. |
getCIDRRangeIPv4() | int $range = 0 | Calculate CIDR. |
is_cli() | none | Check if the type of interface between the web server and PHP is CLI. |
curl_get_content() | string $url = '' array $header = [] string $method = 'GET' array $data = [] |
Retrieve the HTTP code and content of the specified URL. |
download() | string $file_path = '' string $mime_type = null |
Output the header in the web browser to download the file and initiate the file download. |
Basic markup
What follows is the simplest coding.
Example 1
Example 2
The source code shown above will work on the built-in web server. It also operates in CLI, so choose whichever you prefer.
If you want to run it on the built-in web server, execute the command shown below and then access it with a web browser.
If you want to run it in CLI, execute the command shown below. The path where the file is outputted will be displayed as a result.
License
MIT License
Copyright (c) 2023 Kaleid Pixel
All versions of geoipallow with dependencies
ext-intl Version *
ext-mbstring Version *
ext-curl Version *
ext-json Version *
ext-fileinfo Version *