Download the PHP package matthewpatterson/carpenter without Composer

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

Carpenter

A PHP library for setting up database fixtures, heavily inspired by FactoryGirl.

Build Status Analytics

Installation

Add the following to a composer.json file:

Then, run composer install.

Usage

Defining Factories

Factories are free-form classes, allowing for a lot of flexibility in their definition. All you need to make a class a factory is the @Factory annotation. For example, consider this factory that won't really do much of anything:

Factories can exist anywhere in your code base. However, you will need to call Carpenter\Factory::discoverFactories() prior to using them, for example in a testing bootstrap script.

Using Factories

There are two ways to use a factory: build() and create(). Both will give you an instance of the fixture you're looking for; the difference is that create() will also persist the fixture to a data store.

When invoking build() or create(), you must supply, at a minimum, the name of the factory to use. The name of the factory is derived from factory's unqualified classname. For example, \Project\Fixture\UserFactory becomes User.

A Basic Factory

The most basic thing you can do with a factory is to define properties with static values. Simple define a public instance property, and every fixture will have the value you assign to it.

Overriding Properties

A UserFactory is all well and good, but what if you want our user to have a slightly different status? You can provide an array of overrides when building and creating the fixture.

Dynamic Properties

Property values can also be generated dynamically, making it easy to generate random data with a tool such as Faker. All you need is a public instance property and a public instance method of the same name. Of course, you can still supply override values if needed.

Modifiers

Modifiers (similar to FactoryGirl traits) define a group of properties and are especially useful for complex domain models. To create a modifier, simply add the @Modifier annotation to a public instance method. Modifiers act by mutating the instance of the class. When calling build() or create(), you can specify modifiers which will be applied in the order given.

Adapters

Adapters build the correct fixture and persist it to a data store. Currently, there are two adapters available:

Configuration

The following values should be set prior to using Carpenter. You can do this, for example, in a testing bootstrap script.

Contributions

This project is in its very early stages. As such, pull requests and isues are always welcome via Github.


All versions of carpenter with dependencies

PHP Build Version
Package Version
Requires doctrine/annotations Version 1.2.*@stable
symfony/finder Version 2.5.*@stable
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 matthewpatterson/carpenter contains the following files

Loading the files please wait ....