collector tool attempts to automate the process of splitting the
Illuminate\Support\Collection component from the Laravel code-base. It strives to solve this issue: https://github.com/tightenco/collect/issues/2. The output of this utility can be viewed at https://github.com/JohnathonKoster/collector-output-test (it is not recommended to use the releases within the
collector-output-test repository directly; instead, use Tighten Co's repository).
- Download and Installation
- Environment Configuration
- git Configuration
- Tests Configuration
- Split Configuration
- Using the
- Using the
- Using the
- Clearing the Caches
Download and Installation
The easiest way to download the Collector utility is just to clone the repository:
git clone https://github.com/JohnathonKoster/collector.git
After you have obtained the source, you must install the Composer dependencies using
composer install. Composer will install things such as the Symfony console and process components, a PHP Parser, a GitHub API and some filesystem testing utilities.
All of Collector's configuration files live within the
config/ directory. There are three main groups of configuration items:
- git: These settings control the exact git commands that will be ran when the Collector needs to retrieve a version of the Laravel framework, when it needs to commit and tag new split components and when it needs to push the split components to the destination repository.
- split: These settings control various aspects of the Collector utility itself. Things such as the particular versions of the Laravel framework to target, and what class should be split from the code-base can be found here.
- tests: By default, Collector will ensure that all the unit tests pass for the split component before it is published to the destination repository. The PHPUnit command to issue can be configured here.
To make it easier to run the Collector utility across different environments, the Collector utility uses the DotEnv PHP library to make it easier to manage configuration values for different environments.
.env.example file shows all of the environment variables that must be set in order for the Collector utility to run. Create a copy of the
.env.example file and rename it
.env and supply the correct values for your environment.
There are only three git settings that need to be configured. Each of them are important to ensure the successful split of the Illuminate Collection component.
config/git.php config file) or
clone setting is used to specify the command that is used to clone versions of the
laravel/framework for the Collector utility. You can customize this command to suite your specific environment, but it must accomplish the following tasks:
- Clone the requested framework version into the correct temporary directory.
The following example is the default setting that can be found in the
GIT_CLONE="git clone -b \"@version@\" --single-branch --depth 1 https://github.com/laravel/framework.git \"@source@\""
You may notice that the command contains placeholder variables (surrounded by the
@ sigil). These placeholders will be replaced by the Collector utility to provide your command with the corresponding values. The following placeholders can be used when constructing your own command: