Send the link below via email or IMCopy
Present to your audienceStart remote presentation
- Invited audience members will follow you as you navigate and present
- People invited to a presentation do not need a Prezi account
- This link expires 10 minutes after you close the presentation
- A maximum of 30 users can follow your presentation
- Learn more about this feature in our knowledge base article
Do you really want to delete this prezi?
Neither you, nor the coeditors you shared it with will be able to recover it again.
Make your likes visible on Facebook?
You can change this under Settings & Account at any time.
Bldr - The PHP Based Task Runner
Transcript of Bldr - The PHP Based Task Runner
Why Should I Use Bldr?
Unlike Ant, Maven, Grunt and Gulp, Bldr is written in PHP, for PHP. There are no extra dependencies needed for using Bldr.
Bldr was written with configuration in mind. Robo Task Runner, Task, and Artisan/Envoy all have you make tasks with procedural PHP. Bldr uses a config file (Yaml, Json, Xml).
Why Should I Use Bldr?
The other cornerstone of Bldr is extensibility.
Extensions to the core features of Bldr are written in repositories called Blocks. They are basically Symfony Extensions.
There are a couple Blocks built into the core. The biggest external one, is the Frontend Block. The Frontend block aims to replace Grunt/Gulp for frontend developers
There are a lot of task runners out there:
Sample Profile - Run PHPUnit Tests
Let's Get Started!
First, to install Bldr, go to your project and run:
This will create a bldr.phar file in your project directory. You could also move this to your path for global access. To get the list of commands, run:
When running Bldr, you will usually run Profiles (taken from Behat). Profiles will contain a list of Tasks to run, and Tasks are made up of calls.
Calls, at their simplest form, are basically commands to run on the command line.
You can however, just run tasks, or even calls (something Gush is trying to work with).
Given we have a basic Symfony2 skeleton app, lets build a profile for running the basic tests! Create a .bldr.yml file.
This file will describe the profiles, tasks, and calls to run to accomplish your desired tasks.
Configuration can also be done in other formats (json and xml), and for the sake of CVS, you can have .bldr.(yml|json|xml).dist files
This is a basic example of a Bldr configuration that will run your tests. To run this, we use:
The output will look like this
Expanding on Tasks
Lets say you want to clear the cache and logs, and maybe run a lint check on all the PHP and Twig files. How easy is that? Pretty simple.
I'm sure there will be things that people will want to do, but aren't built in to the core of Bldr.
Introducing: Embedded Composer
Bldr can now have its own dependencies. Usually, these dependencies will be other "Blocks". Not including the ones built in (Execute, Filesystem, Miscellaneous, Notify, and Watch).
The best example ofan external block right now, is the Frontend Block.
Installing a Block
Installing a Block is pretty simple. Create a bldr.json file, and just like a composer.json file, add the Packagist package information to the "require" section. Then run ./bldr.phar install.
Then add this to your .bldr.yml
With this, you will be able to do things like compile css/less (not yet sass), minify js and css, and concatenate files!
Who is this dude?
- Senior Software Engineer
Works for SCTR Services
- Doing web stuff.
Co-organizer SDPHP Meetup
Writer of Bldr/Symforium
Contributor on Gush
What the heck is a
A task runner is a tool you would use to run a bunch of commands, or tasks, automatically.
It allows you to take super repetitive tasks, and make them short, simple, and painless.
Introducing - Bldr
The PHP Task Runner