Download the PHP package camelot/common without Composer

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

Camelot Common

This library provides utility functions to help simplify menial tasks.

The Camelot team believes the PHP error reporting system is a mistake. Many built-in functions utilize it, leading to inconsistent results and head scratching.

This library provides some wrappers around some of these functions. Our code should always throw exceptions instead of triggering errors/warnings/notices (excluding deprecation warnings).

Table of Contents:


Assert

Additional assertions built on Webmozart\Assert

isArrayAccessible

Throws InvalidArgumentException if $value is not an array or object implementing ArrayAccess.

isInstanceOfAny

Throws InvalidArgumentException if $value is not an instance of one of the given classes/interfaces.

isIterable

Throws InvalidArgumentException if $value is not an iterable. Same as isTraversable(), just a better name.

Deprecated

Helper methods for triggering deprecation warnings.

warn

Shortcut for triggering a deprecation warning for something.

Examples:

method

Shortcut for triggering a deprecation warning for a method.

$suggest can be a sentence describing what to use instead. Or it can be a method name or class::method which will be converted to a sentence.

$method defaults to the method/function it was called from.

Example:

cls

Shortcut for triggering a deprecation warning for a class.

$suggest can be a sentence describing what to use instead. Or it can be a class name which will be converted to a sentence.

Examples:

Ini

Handles setting and retrieving values from PHP's configuration.

has

Checks whether the key exists.

getStr

Get a string value. The default is returned if the key does not exist or the value is empty.

getBool

Get a boolean value. False is returned if the key does not exist or the value is empty.

getNumeric

Get a numeric value. The default is returned if the key does not exist or the value is empty.

getBytes

Get a memory size value, such as memory_limit, and convert it to an integer. The default is returned if the key does not exist or the value is empty.

set

Set a new value for the given key. Throws RuntimeException if the key does not exist, it is not editable, or something goes wrong.

Json

Handles JSON parsing/dumping with error handling.

parse

Parses JSON string to array or scalar. Throws ParseException if anything goes wrong.

We use seld/jsonlint to determine why the parsing failed and include it in the exception message.

dump

Dumps mixed to JSON string. Throws DumpException if anything goes wrong.

If input contains invalid UTF-8 characters we try to convert these for you before failing.

test

Returns whether the string is valid JSON.

Serialization

Handles PHP serialization parsing/dumping with error handling.

parse

Parses PHP serialized string.

Throws ParseException if a serialized class cannot be found or anything else goes wrong.

Note: $options parameter is ignored on PHP 5.

See unserialize() for details.

dump

Dumps anything to a PHP serialized string.

Throws DumpException if the input is not serializable or anything else goes wrong.

Str

Common string methods.

replaceFirst

Replaces the first occurrence of the $search text on the $subject.

replaceLast

Replaces the last occurrence of the $search text on the $subject.

removeFirst

Removes the first occurrence of the $search text on the $subject.

removeLast

Removes the last occurrence of the $search text on the $subject.

splitFirst

Splits a $subject on the $delimiter and returns the first part.

splitLast

Splits a $subject on the $delimiter and returns the last part.

endsWith

Returns whether the subjects ends with the search string.

className

Returns the class name without the namespace, of a string FQCN, or object.

humanize

Converts a string from camel case and snake case to a human readable string.

camelCase

Converts a string from snake case to camel case.

snakeCase

Converts a string from camel case to snake case.


All versions of common with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-json Version *
camelot/thrower Version ^1.0
seld/jsonlint Version ^1.4
webmozart/assert Version ^1.10
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 camelot/common contains the following files

Loading the files please wait ....