Download the PHP package jpi/utils without Composer

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

Utilities

CodeFactor Latest Stable Version Total Downloads Latest Unstable Version License GitHub last commit (branch)

A tiny library that provides very simple utility classes.

This provides a simple singleton trait to go on classes, URL builder class and a few different classes/traits around collections.

Dependencies

Installation

Use Composer

Usage

Singleton

Simply add \JPI\Utils\Singleton to any class, this will make the constructor protected so the class can't be instantiated outside the singleton getter, also provides a get method which handles the class being singleton.

URL

\JPI\Utils\URL provides 5 static helper methods (which should be self-explanatory):

\JPI\Utils\URL as a class instance provides building a URL, the class has a single optional string argument, which you can pass if you know what the starting URL should be. You then have the following methods to build on top of this starting URL:

They all come with equivalent getter methods:

Also, a getQuery: string|null method which transforms the query params to an encoded query string to be used in a URL (minus the ?).

Lastly, the class implements \Stringable so you can cast the instance to a string or can manually call build method to get the URL as a string.

Collections

Here we have \JPI\Utils\Collection, \JPI\Utils\Collection\Immutable & \JPI\Utils\Collection\Paginated.

A collection works like a normal array as it implements \ArrayAccess, \Countable & \IteratorAggregate just with some extra methods (all should be self-explanatory):

The Collection class also has the following methods (these exist on Immutable and Paginated but will throw an exception)

A Paginated instance has the following additional methods:

We also have interfaces in case you want to create your own versions, \JPI\Utils\CollectionInterface, \JPI\Utils\Collection\ImmutableInterface & \JPI\Utils\Collection\PaginatedInterface (which extends ImmutableInterface). If you do create your own collection classes, and want to make an immutable or paginated version see \JPI\Utils\Collection\ImmutableTrait and \JPI\Utils\Collection\PaginatedTrait.

Support

If you found this library interesting or useful please spread the word about this library: share on your socials, star on GitHub, etc.

If you find any issues or have any feature requests, you can open an issue or email me @ jahidulpabelislam.com :smirk:.

Authors

Licence

This module is licensed under the General Public Licence - see the licence file for details.


All versions of utils with dependencies

PHP Build Version
Package Version
Requires php Version ^8.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 jpi/utils contains the following files

Loading the files please wait ...