Installation

Requirements

Puli requires PHP 5.3.9 or higher.

Installing the Puli CLI

To use Puli, you first need to install the Puli Command Line Interface (CLI). This is usually done only once on a system.

You can install the Puli CLI in one of three ways:

As a Global Composer Dependency

If you prefer to install tools like PHPUnit as global Composer dependencies, you can do the same for Puli. Install Composer and enter the following command in a terminal:

$ composer global require puli/cli:^1.0

As a Composer Dependency

If you want to explicitly document which version of the Puli CLI is required by your project, you can add it to your Composer dependencies. Install Composer and enter the following command in a terminal:

$ composer require --dev puli/cli:^1.0

OS X Only: Using Homebrew

If you are on OS X, you can also install Puli through Homebrew:

$ brew install puli

Note: This command requires Homebrew PHP to be installed.

Unix Only: Disable Glob Expansion

By default, Unix shells like Bash expand glob arguments before passing them to the called command. Look at this short example for a demonstration:

# What you type
$ command *.js

# What the command receives by the shell
$ command script1.js script2.js ...

If you use Puli on a Unix system, you should disable glob expansion for the puli command. If you use Bash, add the following lines to ~/.bashrc:

# Disable glob expansion for Puli
alias puli='set -f;puli';puli(){ command puli "$@";set +f;}

Apply the changes with the source command:

$ source ~/.bashrc

If you use a different shell than Bash, see this answer on StackOverflow for instructions.

Next Steps

Read The Repository Component to learn how to register your resources with Puli.