Download the PHP package thefredfox/cakephp-ip-type without Composer

On this page you can find all versions of the php package thefredfox/cakephp-ip-type. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cakephp-ip-type

IpType plugin for CakePHP

Description

An Ip Type for the Database Framework of CakePHP, which converts raw ip addresses represented as human readable strings (127.0.0.1, ::1) to byte strings with inet_pton to store them into a database.

The final converted value for the database is meant to be stored as a LOB value. I used a VARBINARY with 16 bytes. It is long enough for also IPv6 addresses.

The class was written for an application for InnoGames GmbH. The permission was given to make this class public.

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

After that you have to load the plugin in your application's bootstrap file and map the type for the database as follows:

In the Table class itself you have to tell the column to be this type:

Configuration

The default function for encoding and decoding is 'inet_pton' resp. 'inet_ntop'. However it is possible to set the encode (toDatabase) and decode (toPHP) methods as callables.

Is the variable not a callable an will be thrown with the message: 'Could not decode the value, IpType::_decode has to be a callable.' resp. '... encode ... IpType::_encode ...'.

Method Strings

Custom Functions

Static Functions of a Class

Non Static Functions of a Class via Wrapper Function

Database

The final converted value for the database is meant to be stored as a LOB value. I used a VARBINARY with 16 bytes. It is long enough for also IPv6 addresses.


All versions of cakephp-ip-type with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.16
cakephp/cakephp Version ~3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package thefredfox/cakephp-ip-type contains the following files

Loading the files please wait ...