承接 daspors/shellphp 相关项目开发

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

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

daspors/shellphp

Composer 安装命令:

composer require daspors/shellphp

包简介

PHP command line tools

README 文档

README

ShellPHP helps you bring the power and ease of installation of PHP to the command line.
It is meant to provide a toolbox for developers that waht or need to develop programs in PHP that will run in bash, not in WebServer environment.

Feature overview

  • Commandline argument handling
  • Process management
  • High level (Sqlite-based) data storage
  • WebInterface (experimental)

\ShellPHP\CmdLine

The commandline handler makes it easy to define flags, options and arguments and even provides the ability to create commands that split your application into logical parts (like apt-get and many others do).

$cli = \ShellPHP\CmdLine\CmdLine::Make("ShellPHP Test Script","Version 0.0.0.2")
	->command('list')
		->opt('-f','none')->map('filter')
		->arrayArg('folder')
		->handler(function($args)
		{
			extract($args);
			var_dump($args);
			var_dump(get_defined_vars());
			echo "\n --> $filter $folder\n\n";
		})
		->end()
	->command('add')
		->opt('-p')->map('path')->text('Local folder to add')
		->handler(function($args)
		{
			extract($args);
			echo "Add --> $path\n\n";
		})
		->end();
$cli->command('remove')->opt('-f');
$cli->go();

\ShellPHP\Process

This is a class that helps you enumerate, find and run processes.

\ShellPHP\Storage

Really powerful yet easy to use Storage. Every application needs to store some data somewhere every now and them.
The Storage class provides a high level interface so that in most cases you wont need to perform any SQL queries.

class MyModel extends \ShellPHP\Storage\StoredObject
{
	public $id = 'int primary autoinc';
	public $name = 'text unique';
	public $desc = 'text';
}
\ShellPHP\Storage\Storage::Make('my_app_database.sqlite');

$obj1 = MyModel::Make(array('name'=>'obj1'));
$obj1->Save();
MyModel::Make()->set('name','obj2')->Save();

var_dump(MyModel::Select()->like('name','obj%')->results());
$obj1->Delete();
var_dump(MyModel::Select()->results());

\ShellPHP\WebInterface

There's a currently experimental feature to provide you with a webinterface.

$webinterface = \ShellPHP\WebInterface\WebInterface::Make()
	->index(__DIR__."/web")
	->handler('list',function($request){ return \ShellPHP\WebInterface\WebResponse::Json(array('hello'=>'world')); } )
	->go();

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: WTFPL
  • 更新时间: 2020-04-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固