Patrol is an elegant command-line tool that keeps your PHP Project's dependencies in check.

Last update: May 6, 2022

Patrol logo

Patrol

Total Downloads License


Patrol is an elegant command-line tool that keeps your PHP Project's dependencies in check.

Installation / Usage

Requires PHP 8.0+

First, install Patrol via the Composer package manager:

composer require nunomaduro/patrol --dev

Then, use the patrol binary:

./vendor/bin/patrol

You may also specify the directory that should be inspected:

./vendor/bin/patrol inspect ../another/project-directory

Patrol Sponsors

We would like to extend our thanks to the following sponsors for funding Patrol development. If you are interested in becoming a sponsor, please visit the Nuno Maduro's Sponsors page.

Premium Sponsors

License

Patrol is an open-sourced software licensed under the MIT license.

GitHub

https://github.com/nunomaduro/patrol
You might also like...

💥 Collision is a beautiful error reporting tool for command-line applications

💥 Collision is a beautiful error reporting tool for command-line applications

Collision was created by, and is maintained by Nuno Maduro, and is a package designed to give you beautiful error reporting when interacting with your

May 26, 2022

Takeout is a CLI tool for spinning up tiny Docker containers, one for each of your development environment dependencies.

Takeout is a CLI tool for spinning up tiny Docker containers, one for each of your development environment dependencies.

Takeout Takeout is a CLI tool for spinning up tiny Docker containers, one for each of your development environment dependencies. It's meant to be pair

May 13, 2022

Lovely PHP wrapper for using the command-line

ShellWrap What is it? It's a beautiful way to use powerful Linux/Unix tools in PHP. Easily and logically pipe commands together, capture errors as PHP

May 3, 2022

A PHP library for command-line argument processing

GetOpt.PHP GetOpt.PHP is a library for command-line argument processing. It supports PHP version 5.4 and above. Releases For an overview of the releas

May 24, 2022

Twitter raffles in the command line, with PHP and minicli

Twitter raffles in the command line, with PHP and minicli

Rafflebird Rafflebird is a highly experimental CLI application for giveaways / raffles on Twitter, built in PHP with Minicli. Disclaimer: The recent s

May 14, 2022

Command-line control panel for Nginx Server to manage WordPress sites running on Nginx, PHP, MySQL, and Let's Encrypt

Command-line control panel for Nginx Server to manage WordPress sites running on Nginx, PHP, MySQL, and Let's Encrypt

EasyEngine v4 EasyEngine makes it greatly easy to manage nginx, a fast web-server software that consumes little memory when handling increasing volume

May 22, 2022

Generic PHP command line flags parse library

Generic PHP command line flags parse library

PHP Flag Generic PHP command line flags parse library Features Generic CLI options and arguments parser. Support set value data type(int,string,bool,a

Mar 2, 2022

🍃 In short, it's like Tailwind CSS, but for the PHP command-line applications.

🍃 In short, it's like Tailwind CSS, but for the PHP command-line applications.

Termwind Termwind allows you to build unique and beautiful PHP command-line applications, using the Tailwind CSS API. In short, it's like Tailwind CSS

May 27, 2022

php command line script to DCA crypto from Coinbase Pro

dca.php A simple php script designed to be run via the command line via a cron job. This will connect to coinbase pro and buy the crypto coins specifi

Oct 22, 2021
Comments
  • 1. Unable to launch a new process.

    This error occurs when running patrol, I'm not sure where to start debugging, -vvv did not give much more output but just the stack trace which might tell you something :D

    simulise git:develop ❯ patrol inspect -vvv   
    
    In Process.php line 350:
                                                              
      [Symfony\Component\Process\Exception\RuntimeException]  
      Unable to launch a new process.                                                                                   
    
    Exception trace:
      at /Users/alexbouma/.composer/vendor/symfony/process/Process.php:350
     Symfony\Component\Process\Process->start() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Support/ComposerBinary.php:141
     NunoMaduro\Patrol\Support\ComposerBinary->NunoMaduro\Patrol\Support\{closure}() at n/a:n/a
     array_map() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Support/Collection.php:169
     NunoMaduro\Patrol\Support\Collection->map() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Support/ComposerBinary.php:144
     NunoMaduro\Patrol\Support\ComposerBinary->run() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Support/ComposerBinary.php:90
     NunoMaduro\Patrol\Support\ComposerBinary->why() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Repositories/Composer.php:106
     NunoMaduro\Patrol\Repositories\Composer->mutate() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Repositories/Composer.php:65
     NunoMaduro\Patrol\Repositories\Composer->all() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Handlers/Score.php:53
     NunoMaduro\Patrol\Handlers\Score->__invoke() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Commands/InspectCommand.php:70
     NunoMaduro\Patrol\Commands\InspectCommand->NunoMaduro\Patrol\Commands\{closure}() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Support/Collection.php:142
     NunoMaduro\Patrol\Support\Collection->each() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Commands/InspectCommand.php:70
     NunoMaduro\Patrol\Commands\InspectCommand->execute() at /Users/alexbouma/.composer/vendor/symfony/console/Command/Command.php:288
     Symfony\Component\Console\Command\Command->run() at /Users/alexbouma/.composer/vendor/symfony/console/Application.php:974
     Symfony\Component\Console\Application->doRunCommand() at /Users/alexbouma/.composer/vendor/symfony/console/Application.php:291
     Symfony\Component\Console\Application->doRun() at /Users/alexbouma/.composer/vendor/symfony/console/Application.php:167
     Symfony\Component\Console\Application->run() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/bin/patrol:35
     {closure}() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/bin/patrol:36
    
    inspect [--min MIN] [--] [<directory>]
    

    PHP:

    PHP 8.0.7 (cli) (built: Jun  4 2021 03:56:55) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v4.0.7, Copyright (c) Zend Technologies
        with Zend OPcache v8.0.7, Copyright (c), by Zend Technologies
        with blackfire v1.59.2~mac-x64-non_zts80, https://blackfire.io, by Blackfire
    

    Composer:

    Composer version 2.1.3 2021-06-09 16:31:20
    

    I installed patrol globally by doing composer global require nunomaduro/patrol, and for good measure also did a composer global update to make sure everything is up-to-date.

    Reviewed by stayallive at 2021-06-16 20:54
  • 2. Output only found security vulnerabilities?

    Is there a way to run patrol to just output found security vulnerabilities, if there are any, otherwise be quiet? Would be useful for automatic checks from crontab, which would send e-mail only if there is security updates that should be applied.

    Reviewed by kristapsk at 2021-07-02 00:13
  • 3. Fix Windows Support

    Fixes #2 on Windows machines.

    The reason for the error was that instead of returning the JSON formatted packages from composer the content of the composer.BAT file was returned, resulting in a DivisionbyZeroError down the line.

    The fix checks if PHP is running on Windows and the omitting the PHP executable and just using the composer.BAT file to run the commands.

    Reviewed by gerpo at 2021-06-16 14:07
Related tags
BetterWPCLI - a small, zero-dependencies, PHP library that helps you build enterprise WordPress command-line applications.
BetterWPCLI - a small, zero-dependencies, PHP library that helps you build enterprise WordPress command-line applications.

BetterWPCLI - a small, zero-dependencies, PHP library that helps you build enterprise WordPress command-line applications.

May 3, 2022
Skeleton for creating a new Command Line Interface application with a minimum of dependencies.

Skeleton for creating a new Command Line Interface application with a minimum of dependencies.

Jan 17, 2022
A CLI tool to check whether a specific composer package uses imported symbols that aren't part of its direct composer dependencies

A CLI tool to analyze composer dependencies and verify that no unknown symbols are used in the sources of a package. This will prevent you from using "soft" dependencies that are not defined within your composer.json require section.

May 17, 2022
A powerful command line application framework for PHP. It's an extensible, flexible component, You can build your command-based application in seconds!
A powerful command line application framework for PHP. It's an extensible, flexible component, You can build your command-based application in seconds!

CLIFramework CLIFramework is a command-line application framework, for building flexiable, simple command-line applications. Commands and Subcommands

May 17, 2022
PHP Interminal is a command-line tool that gives you access to PHP Internals discussions in your terminal.
PHP Interminal is a command-line tool that gives you access to PHP Internals discussions in your terminal.

PHP Interminal is a command-line tool that gives you access to PHP Internals discussions in your terminal. ??

Dec 12, 2021
👨🏻‍🚀 A command-line tool that gives you the Alpine Day 2021 schedule in your timezone. 🚀
👨🏻‍🚀 A command-line tool that gives you the Alpine Day 2021 schedule in your timezone. 🚀

Alpine Day Schedule a command-line tool that gives you the Alpine Day 2021 schedule in your timezone. ?? Quick start Requires PHP 7.4+ # First, instal

Jun 10, 2021
Laracon Schedule a command-line tool that gives you the Laracon Online schedule in your timezone.
Laracon Schedule a command-line tool that gives you the Laracon Online schedule in your timezone.

Laracon Schedule a command-line tool that gives you the Laracon Online schedule in your timezone. ?? Quick start Requires PHP 7.4+ # First, install: c

Dec 13, 2021
A PHP command line tool used to install shlink
A PHP command line tool used to install shlink

Shlink installer A PHP command line tool used to install shlink. Installation Install this tool using composer.

Jan 10, 2022
A simple command-line tool whose aim is to facilitate the continous delivery of PHP apps
A simple command-line tool whose aim is to facilitate the continous delivery of PHP apps

Deployer Simple command-line tool that aims to facilitate the continous delivery of PHP apps, particularly Laravel apps. Imagine you want to update yo

Sep 8, 2021
Simple command-line tool to access HiWeb account information

Simple command-line tool to access HiWeb account information.

Nov 17, 2021