承接 pastuhov/php-exec-command 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pastuhov/php-exec-command

Composer 安装命令:

composer require pastuhov/php-exec-command

包简介

Simple php command executor with param binding.

README 文档

README

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 kirill@pastukhov.su instead of using the issue tracker.

Credits

License

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

统计信息

  • 总下载量: 206.04k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 25
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 25
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2015-06-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固