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

Related tags

Command Line patrol
Overview

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.

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

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

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

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

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

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

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

πŸƒ 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

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

Comments
  • Unable to launch a new process.

    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.

    bug good first issue 
    opened by stayallive 3
  • Output only found security vulnerabilities?

    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.

    opened by kristapsk 1
  • Patrol can not find anything in definitely vulnerable file

    Patrol can not find anything in definitely vulnerable file

    Introduction

    In my case, patrol can not check any dependencies, even with security vulnerabilities. I hope, author of tool fix this behavior at near future. definitely vurnelable file for scan image

    My versions

    $ uname -a
    Linux WhiteBlockAtCorner 5.15.0-33-generic #34-Ubuntu SMP Wed May 18 13:34:26 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
    $ php --version
    PHP 8.1.2 (cli) (built: Apr  7 2022 17:46:26) (NTS)
    Copyright (c) The PHP Group
    Zend Engine v4.1.2, Copyright (c) Zend Technologies
        with Zend OPcache v8.1.2, Copyright (c), by Zend Technologies
    $ patrol --version
    Patrol 1.1.0
    

    https://gist.github.com/elzekool/0bcda55400a12bae43710fbda0430af9

    Steps to reproduce

    $ cd ~/Downloads
    $ wget --output-document=composer.lock https://gist.githubusercontent.com/elzekool/0bcda55400a12bae43710fbda0430af9/raw/deb2d2ba5d4e3fb34af9ff02a997961ed4630017/composer.lock
    [...]
    Length: 89930 (88K) [text/plain]
    Saving to: β€˜composer.lock’
    $ cd /path/to/patrol
    

    image image

    Conclusion:

    I can not directly scan target file, I must give as argument parent folder of it. But even when patrol scan file, then as output: "no problems".

    opened by sv-atoslav 0
  • Fix Windows Support

    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.

    opened by gerpo 0
Owner
Nuno Maduro
Software engineer at @laravel β€” working on Laravel, Forge, and Vapor. Created @pestphp, @laravel-zero, collision, larastan, php insights, and more.
Nuno Maduro
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.

Snicco 5 Oct 7, 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.

Richard van Laak 1 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.

Matthias Glaub 722 Dec 30, 2022
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

Yo-An Lin 428 Dec 13, 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. ??

Nuno Maduro 32 Dec 26, 2022
πŸ‘¨πŸ»β€πŸš€ 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

Nuno Maduro 11 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. ?? Quick start Requires PHP 7.4+ # First, install: c

Nuno Maduro 101 Sep 16, 2022
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.

null 8 Nov 3, 2022
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

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

Simple command-line tool to access HiWeb account information.

Milad Nekofar 2 Dec 26, 2022