Download the PHP package northern/common without Composer

On this page you can find all versions of the php package northern/common. 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 common

PHP Common

Build Status

PHP Common is a PHP library containing a set of common functionality.

To run tests use:

composer install -v

vendor/bin/phpunit

Find PHP Common on Packagist:

ArrayUtil

To use ArrayUtil you need to import it.

get

To get a value from an array use get:

You can specify a default value in case the key you're trying to retrieve doesn't exists:

To get a nested value from an array you can specify a path:

If required, you can use an alternate delimiter:

set

To set a value or nested value use the set method:

If the key or path not already exist, it will be created.

insert

With insert you can create a new value at a path or key, however, the path will only be created if it does not yet exists.

delete

It's also possible to delete a key or path:

Or to delete multiple paths or keys at once:

Or with an alternate delimiter:

exists

To test if a key or path exists use:

prefix

If you need to prefix all the values in an array, use the prefix method:

postfix

If you need to postfix all the values in an array, use the postfix method:

flatten

Sometimes you need to "flatten" an array, i.e. glueing the keys and values together with a symbol or character:

Or use a different 'glue' character from the default '=':

keys

Returns the keys of an array in the same way the array_keys function works, however, keys allows you to specifiy a prefix:

values

Returns the values of an array in the same way the array_values function works, however, values allows you to specify a prefix:

contains

Tests if the values of one array exist in another. E.g:

The above tests if the values of the first array (needle) exist in the second array (haystack), which in the above example is true.

extract

Returns a value from an array and deletes the key in the array.

The above example returns the value for foo from the array and deletes the foo key from the array.


All versions of common with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
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 northern/common contains the following files

Loading the files please wait ....