Download the PHP package php-kit/tools without Composer

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

PHP-Kit Tools

A toolkit of utility functions for general use

What is PHP-Kit Tools?

PHP-Kit Tools is an attempt to create a toolkit of general purpose helper / utility functions that can be reused between projects.

This toolkit provides missing functionality from the standard library and adds miscellaneous generic, low-level, foundational functions for making your code clearer and more succinct, reducing boilerplate and copy-paste.

Why PHP-Kit Tools?

There are some recurring functions and patterns that are needed frequently when developing any PHP project. So, developers frequently copy-paste the same own-made utility / helper functions over and over, from project to project.

The problem

PHP-Kit Tools is a solution

Usable on any PHP project

A consistent set of tools at your disposal, ready for use, on any project.
All developers on a team/project can share the same functions and write code in a similar way.

Framework independant

Work with any framework, always using the same set of base functions.
Make your code easier to reuse.
Make it easier to switch to projects made with other frameworks, keeping the way-you-work.

Some frameworks even use PHP-Kit Tools on their own code.

Documented

Most functions already have a doc-block (inline documentation), so your IDE should give you inline documentation and parameter validation and autocompletion.

Nevertheless, additional documentation (to be displayed on this Readme or on the project's Wiki) is still being written, whenever we find the time for it.

Are you in a hurry? You can volunteer for writing documentation. We welcome your pull requests ;-)

Tested

Automated tests are not implemented yet, but they're comming soon.

Nevertheless, this library is battle-tested on many real-world projects.

Supported

Both the project creators and the community will keep this library updated, apply bug-fixes and implement new features, when needed.

Evolving

New functions may be added from time to time, or existing functions may be improved, or even removed (if we reach the conclusion that they are not useful enough for the majority of developers and use cases).

The library will not grow endlessly to contain every possible utility/helper function in existence! We only want the best / most useful / most needed functions here!

But still stable enough

Don't worry about the possibility of your code breaking due to changes on this library. Just make sure you require a specific version of it on your project's composer.json file.

Do not use dev-master as your version constraint on composer.json!

Usage

Installation

On the command-line, type:

Runtime requirements

Code organization

On the project's src folder you'll find a separate file for each group of functions, grouped by theme / purpose / scope.

All functions are global, i.e. they have no namespace and they are always accessible anywhere on your application.

Most functions on this library have names that make them seem just like another predefined PHP function, thereby complementing the standard API with the missing functions we wished were there.

For instance, array functions have the array_ prefix, string functions have the str_ prefix, and so on.

FAQ

Why are all functions global?

As these are helper / utility / general purpose functions, they can (and will) be used anywhere on the host application, and very frequently.

The library is compatible with PHP 5.4, which means there is no easy way to import the functions into a file's namespace, and there is no autoloading capability (it only works for classes).

Either we transform these functions into class static methods, which will make calling then more verbose (and destroy the illusion of them being just an extension to the standard PHP global functions), or we raise the PHP version requirement to 5.6.

Even when using PHP >= 5.6, always having to import each and every single function using use statements at the top of each source code file, is not the most practical / productive solution.

Aren't globals bad?

Yes, globals have some problems.

The main disadvantage of using globals is that they pollute the global namespace and increase the probability of identifier collisions with functions from other libraries.

Nevertheless, PHP is known for having no shame in polluting the global namespace with thousands of functions, classes, variables and constants. So, we just keep the tradition, and extend it a little more. ;-)

Do note that many of our functions are named with a common prefix. For instance, array functions have the array_ prefix, string functions have the str_ prefix, and so on. This also reduces the probability of name collisions.

Also, some functions are wrapped in if blocks so that, if a function with the same name is already defined, no error will occur and the original function will be kept unmodified. Of course, in that case, you'll not be able to use the new function with the same name, but at least it will not prevent you from using other functions from this library.

This conditional definition is, currently, reserved to functions with very common names, though (ex. get).

License

This library is open-source software licensed under the MIT license.

Copyright © 2015 Impactwave, Lda.


All versions of tools with dependencies

PHP Build Version
Package Version
No informations.
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 php-kit/tools contains the following files

Loading the files please wait ....