Download the PHP package emarref/namer without Composer

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

Namer

This is a simple library for determining whether or not a given name is available for use, and generating a new name based on a strategy if it is not.

For example, when saving a file to a filesystem, use the Namer to determine an available filename to use that will not clash with other files on the filesystem.

Scrutinizer Code Quality Code Coverage Build Status SensioLabsInsight

Install

Composer

Add the following configuration to your composer.json file.

then run php ./composer.phar update emarref/namer.

Usage

The detector is optional, but must be passed as the second argument to the Namer#getName() method if it is omitted when instantiating the namer. This is useful when your namer is configured in your DI container, but you need to use a different detector. For example:

Using the Symfony2 Dependency Injection Container

You can then use the namer by accessing the namer service in the container.

Strategies

The strategy is the class that generates a new name, based on an iteration index. It must implement the interface Emarref\Namer\Strategy\StrategyInterface. There are currently two strategies available for use. HashStrategy and SuffixStrategy.

HashStrategy

Returns a hashed representation of the name concatenated with the index. sha1 and md5 are supported.

SuffixStrategy

A simple strategy that returns the name untouched on iteration 0, returns the name with suffix appended on iteration 1, and returns the name with suffix and iteration appended thereafter.

e.g. Name, Name copy, Name copy 2, Name copy 3 etc

The Suffix can also be inserted before the file extension using SuffixStrategy::setIgnoreExtension(false).

Detectors

The detector is the class that determines whether or not a name is available to use. A detector must implement the interface Emarref\Namer\Detector\DetectorInterface. There are currently two simple detectors available for use. ArrayDetector and FilesystemDetector.

ArrayDetector

Detects the existence of a value in an array.

FilesystemDetector

Detects the existence of a file on a filesystem.

GaufretteDetector

Detects the existence of a file using a Gaufrette Adapter, e.g. Gaufrette\Adapter\Local


All versions of namer 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 emarref/namer contains the following files

Loading the files please wait ....