All Projects → pastuhov → php-exec-command

pastuhov / php-exec-command

Licence: GPL-2.0 license
Simple php command executor with param binding

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to php-exec-command

z-pot
project overview tool, used to analyze the amount of code, the number of files, code statistics and so on.
Stars: ✭ 18 (-10%)
Mutual labels:  command
Server
The whir.io chat server.
Stars: ✭ 15 (-25%)
Mutual labels:  command
lookpath
The minimum and most straightforward way to check if command exists and where the executable is, without spawning child_process.
Stars: ✭ 49 (+145%)
Mutual labels:  command
vscode-commands
Run commands from Tree View / Status Bar / Quick Pick.
Stars: ✭ 45 (+125%)
Mutual labels:  command
wtfcmd
Run commands by fully custom aliases
Stars: ✭ 16 (-20%)
Mutual labels:  command
project template
Enjoy🌈 web项目启动模板 & 命令行cli启动模板 & 库启动模板
Stars: ✭ 19 (-5%)
Mutual labels:  command
QshOni
The QShell on IBM i library contains useful CL wrapper commands to allow QShell and PASE apps to be called and consumed from regular IBM i jobs via CL, RPG or COBOL programs.
Stars: ✭ 34 (+70%)
Mutual labels:  command
command-flow
A flexible command framework and dispatcher which removes lots of boilerplate code used in commands. While it is used generally on Bukkit it is platform agnostic
Stars: ✭ 103 (+415%)
Mutual labels:  command
lwpkt
Lightweight packet protocol structure for multi-device communication focused on RS-485
Stars: ✭ 71 (+255%)
Mutual labels:  command
tpack
Pack a Go workflow/function as a Unix-style pipeline command
Stars: ✭ 55 (+175%)
Mutual labels:  command
node-evented-command
provides simple command/event handling for evented systems like cqrs
Stars: ✭ 15 (-25%)
Mutual labels:  command
RS232-Monitor-Database
🔌📺 This is a public database for all the known RS232 commands for professionnal screens, monitors and projectors. Feel free to contribute !
Stars: ✭ 22 (+10%)
Mutual labels:  command
vscode-powertools
A swiss army knife with lots of tools, extensions and (scriptable) enhancements for Visual Studio Code.
Stars: ✭ 44 (+120%)
Mutual labels:  command
say-it
TTS in command line -- Pronounce the Chinese and English words you typed in.
Stars: ✭ 19 (-5%)
Mutual labels:  command
csv-cruncher
Treats CSV and JSON files as SQL tables, and exports SQL SELECTs back to CSV or JSON.
Stars: ✭ 32 (+60%)
Mutual labels:  command
laravel-admin
LaravelAdmin是基于PHP开发的基础管理后台系统,做到开箱即用,为新项目开发省去了基础功能开发的步骤;此系统采用前后端分离模式,后端使用Laravel,前端使用vue;主要包含:登录、注销、可视化数据大屏、管理员、角色管理、菜单管理、权限管理、错误日志、登录日志、访问日志、获取服务器CPU使用率、内存使用率等功能。后端主要使用Artisan命令行、Jobs消息队列、 Rules验证规则、Restful API、Composer扩展包、Redis秒杀、Extend自定义扩展类:微信授权、钉钉告警推送、MongoDB、阿里云OSS、七牛云存储、七牛云直播、php-jwt TOKEN、Phpoffice、MySql数据库字典、Elasticsearch等技术。
Stars: ✭ 45 (+125%)
Mutual labels:  command
Asciidots-Cheat-Sheet
My personal Asciidots Cheat Sheet in .jpg .odt .pdf .png and obviously in .txt
Stars: ✭ 17 (-15%)
Mutual labels:  command
gw
A Wrapper of a command to watch any changes in filesystem
Stars: ✭ 16 (-20%)
Mutual labels:  command
fzf-marker
The terminal command tweak from @pindexis/marker
Stars: ✭ 22 (+10%)
Mutual labels:  command
dynamic-cli
A Modern, user-friendly command-line HTTP client for the API testing, and if you're stuck - Search and browse StackOverflow without leaving the CLI
Stars: ✭ 151 (+655%)
Mutual labels:  command

php-exec-command

Build Status Scrutinizer Code Quality Code Coverage Total Downloads StyleCI

Simple php command executor with param binding.

Install

Via Composer

$ composer require pastuhov/php-exec-command

Features

  • light weight
  • param binding
  • throws an exception if return status >0
  • redirect stderr to stdout if needed

Usage

    $output = Command::exec(
        'echo {phrase}',
        [
            'phrase' => 'hello'
        ]
    );
    // $output = 'hello'

or

    $output = Command::exec(
        'echo {phrase}',
        [
            'phrase' => [
                'hello',
                'world'
            ]
        ]
    );
    // $output = 'hello world'

or

    try {
        Command::exec('locate {parody}',
            [
                'parody' => [
                    'pink_unicorn'
                ]
            ]
        );    
        
        echo "unicorn was found!";
    } catch (\pastuhov\Command\CommandException $e) {
        echo "can't find unicorn :(";
    }

By default, all arguments are escaped using escapeshellarg. If you need to pass unescaped arguments, use {!name!}, like so:

Command::exec('echo {!path!}', ['path' => '$PATH']);

Testing

$ composer test

or

$ phpunit

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

GNU General Public License, version 2. Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].