ShellWrapPHP 命令行包装器
ShellWrap 可以让你在PHP代码里使用强大的 Linux/Unix 命令行工具
示例代码:
<?php require_once 'vendor/autoload.php'; use MrRio\ShellWrap as sh; // List all files in current dir echo sh::ls(); // Checkout a branch in git sh::git('checkout', 'master'); // You can also pipe the output of one command, into another // This downloads example.com through cURL, follows location, then pipes through grep to // filter for 'html' echo sh::grep('html', sh::curl('http://example.com', array( 'location' => true ))); // Touch a file to create it sh::touch('file.html'); // Remove file sh::rm('file.html'); // Remove file again (this fails, and throws an exception because the file doesn't exist) try { sh::rm('file.html'); } catch (ShellWrapException $e) { echo 'Caught failing sh::rm() call'; } // This throws an exception, as 'invalidoption' is not a valid argument try { echo sh::ls(array('invalidoption' => true)); } catch (ShellWrapException $e) { echo 'Caught failing sh::ls() call'; } // Commands can be written multiple ways sh::git('reset', array('hard' => true), 'HEAD'); sh::git('reset', '--hard', 'HEAD'); sh::git(array('reset', '--hard', 'HEAD')); // Arguments passed in are automatically escaped, this expands to // date --date '2012-10-10 10:00:00' echo sh::date(array( 'date' => '2012-10-10 10:00:00' )); // If arg keys are one letter, is assumes one dash prefixing it // date -d '2012-10-10 10:00:00' echo sh::date(array( 'd' => '2012-10-10 10:00:00' )); ?>
评论
react-native-motion-managerCMMotionManager包装器
react-native-motion-manager是CMMotionManager对react-native的封装,是ReactNative的动力传感器(加速计,陀螺计,磁力计)组件。添加到你的项
react-native-motion-managerCMMotionManager包装器
0
SqliteCPPC++ SQLite3 包装器
CppSQLite(最近版本为CppSQLite3)是对SQLite进行二次封装后的C++类库。SQLite是一个超轻量级的开源数据库,但从官网上下载的source是一个用c写的文件,在C++(VC
SqliteCPPC++ SQLite3 包装器
0
lunchylaunchctl 简易化包装器
lunchy是 OSX launchctl(OSX系统进程控制器)的友好使用包装器,OSX的launchctl需要精确的文件路径和文件名,这似乎过于冗长了。而Lunchy提供简单的操作来包装laun
lunchylaunchctl 简易化包装器
0
PyKerberosKerberos 操作高级包装器
PyKerberos 包是Kerberos(GSSAPI)操作的高级包装器,目标是避免构建一个包装整个Kerberos.framework的模块,而是提供一组有限的函数来完成客户端/服务器Kerber
PyKerberosKerberos 操作高级包装器
0
LocationManager (Swift)CLLocationManager包装器
CLLocationManager 是使用 Swift 编写的,使用 Apple 和 Google
LocationManager (Swift)CLLocationManager包装器
0
LocationManager (Swift)CLLocationManager包装器
CLLocationManager是使用Swift编写的,使用Apple和Google服务进行位置更新,地理编码和反向地理编码。
LocationManager (Swift)CLLocationManager包装器
0
wxSQLite3SQLite 3.x 数据库的C++包装器
wxSQLite3是一个围绕SQLite3.x数据库的C++包装器,专门用于基于wxWidgets库的程序。wxSQLite3不会尝试隐藏底层数据库,相反,几乎支持当前SQLite3版本的所有特殊功能
wxSQLite3SQLite 3.x 数据库的C++包装器
0