Download the PHP package ayesh/case-insensitive-array without Composer

On this page you can find all versions of the php package ayesh/case-insensitive-array. 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 case-insensitive-array

Case Insensitive Array

Latest Stable Version GitHub license CI codecov SensioLabsInsight PHP versions

Synopsis

A class implementing ArrayAccess, Countable, and Iterator interfaces, and allows you to set, get, count, iterate, and validate while enforcing the keys to be case insensitive.

For example, suppose you have to store a set of HTTP headers. By definition, HTTP headers are case insensitive. With this class, you can peacefully set the same array key-pair combination any number as you feel fit, but the data set will remain consistent.

From the example above, notice how the array values are set two times with two keys with different case. In the echo line, the value is accessed in CamelCase, but you get the same value regardless of your querying keys case.

Prerequisites

Installing

The simplest way would be to install using composer.

composer require ayesh/case-insensitive-array

If, for some reason, you can't use Composer, or don't want to (Come on!), you can integrate the class with your current PSR-4 autoloader by mapping Ayesh\CaseInsensitiveArray namespace to the repository's src folder.

Usage

This class aims to take away the fact that you are using an object. Simply use it as an array.

Initialize with an array

This is optional, but if you already have an array that you need to "import", instantiate the class with that array.

Iterate

You can iterate the array object using foreach(). The exact key and value will be returned.

You can also iterate the array with the same Iterator methods. For a near-perfect array imitation, what we need is ArrayIterator. However, it is not implemented in the current version. I would gladly work with you if you'd like to help. As of now, my scope is to have 2 classes, Strict and Union that gives basic array access, and foreach() compatibility.

Development and tests

All issues are PRs are welcome. Travis CI and PHPUnit tests are included. If you are adding new features, please make sure to add the test coverage.

Credits

By Ayesh Karunaratne.


All versions of case-insensitive-array with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
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 ayesh/case-insensitive-array contains the following files

Loading the files please wait ....