Download the PHP package totten/pogo without Composer
On this page you can find all versions of the php package totten/pogo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package pogo
PHP On the Go (pogo
)
Pogo allows you to write small PHP scripts which use PHP libraries (courtesy
of composer
/packagist
)... but it doesn't require you setup a
special-purpose folder, project, or repository. To use a dependency, simply
add a small pragma into your script. For example:
This makes it easier to use PHP libraries for glue-scripts, throw-away scripts, quick experiments, etc.
Example
Let's pick a small task that requires a few libraries -- suppose we want
to generate a pretty PDF from a source-code file (*.php
, *.json
, etc).
We'll need a pretty-printer (scrivo/highlight.php)
and a PDF generator (dompdf/dompdf).
Skimming the README for each library, one finds a few introductory snippets.
I took these, added the #!require
pragmas, and improvised a little on the
$html
variable. This becomes a small script, code2pdf.php
:
To run this script in the CLI, just use:
Of course, this script expects some content as input (e.g. myfile.yml
) and produces a PDF as output (e.g. myfile.pdf
), so a more realistic command would be
That's it!
More examples
The Robo. Each example is an executable program.
Motivation
Most of my day-to-day work is in PHP, JS, and bash. From time-to-time, one needs a bit of glue-code for one-offs, and
I find myself avoiding PHP for that task... because using a library in PHP still requires bits of administrativa.
pogo
is an experiment to reduce that administrativa. Just create a .php
file and run it.
Documentation
- Installation: System requirements and install steps
- Composer integration: How
pogo
works withcomposer
- Execution: Ways to invoke scripts via
pogo
- Compile to PHAR: How to create a
phar
usingpogo
- FAQ: Frequently asked questions
- Pragmas: List of all supported pragmas
- Todo: Misc things that should be done
Related
- Clippy: A variant of
symfony/console
optimized for scripting.
All versions of pogo with dependencies
lesser-evil/shell-verbosity-is-evil Version ~1.0
symfony/console Version ~4.0
symfony/yaml Version ~4.0
civicrm/composer-downloads-plugin Version ~3.0
symfony/filesystem Version ~4.0