[李景山php]每天TP5-20170119|thinkphp5-Process.php-1

<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2015 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: yunwuxin <[email protected]>
// +----------------------------------------------------------------------

namespace think;
//主要的 命名空间
use think\process\exception\Failed as ProcessFailedException;// 异常失败
use think\process\exception\Timeout as ProcessTimeoutException;// 时间异常
use think\process\pipes\Pipes;// 打包
use think\process\Utils;// 外部引入
use think\process\pipes\Unix as UnixPipes;// unix 打包
use think\process\pipes\Windows as WindowsPipes;// window 打包

class Process
{// 类似于 进程管理的 这样的概念
    // 静态属性
    const ERR = ‘err‘;// 错误
    const OUT = ‘out‘;// 输出

    const STATUS_READY      = ‘ready‘;// 状态 就绪
    const STATUS_STARTED    = ‘started‘;// 状态 开始
    const STATUS_TERMINATED = ‘terminated‘;// 状态 终止

    const STDIN  = 0;// 输入
    const STDOUT = 1;// 输出
    const STDERR = 2;// 异常

    const TIMEOUT_PRECISION = 0.2;// 时间溢出等级

    // 私有 属性
    private $callback;// 回调函数
    private $commandline;// 命令行
    private $cwd;// 未知
    private $env;// 环境
    private $input;// 输入
    private $starttime;// 开始时间
    private $lastOutputTime;// 最后输出时间
    private $timeout;// 溢出时间
    private $idleTimeout;// 不知道是什么溢出时间
    private $options;// 选项
    private $exitcode;// 退出代码
    private $fallbackExitcode;// 回调函数 退出代码
    private $processInformation;// 处理信息
    private $outputDisabled               = false;// 输出 允许状态
    private $stdout;// 标准 输出流
    private $stderr;// 标准 错误
    private $enhanceWindowsCompatibility  = true;// 加强 windows 容错能力
    private $enhanceSigchildCompatibility;// 加强 子菜单 容错能力
    private $process;// 处理
    private $status                       = self::STATUS_READY;// 就绪状态
    private $incrementalOutputOffset      = 0;// 增加 输出 偏移量
    private $incrementalErrorOutputOffset = 0;// 错误 输出 偏移量
    private $tty;// 类似于 标志位
    private $pty;// 同上 未知

    private $useFileHandles = false;// 使用文件处理 句柄

    /** @var Pipes */
    private $processPipes;// 管道符 参数

    private $latestSignal;// 最后的 参数

    private static $sigchild;// 子元素
时间: 2024-07-31 05:34:13

[李景山php]每天TP5-20170119|thinkphp5-Process.php-1的相关文章

[李景山php]每天TP5-20170124|thinkphp5-Process.php-6

/**  * 返回导致子进程终止其执行的数.  * @return int  */ public function getTermSignal() {// 返回 子进程 终止其执行的数     $this->requireProcessIsTerminated(__FUNCTION__);// 确认 进程 函数 已经终止,否则 抛出异常     if ($this->isSigchildEnabled()) {// 确认是否 子进程         throw new \RuntimeExce

[李景山php]每天TP5-20170123|thinkphp5-Process.php-5

    /**      * 开启从底层过程获取输出和错误输出.      * @return Process      * @throws \RuntimeException      */     public function enableOutput()     {// enableOutput         if ($this->isRunning()) {// 如果 运行             throw new \RuntimeException('Enabling outpu

[李景山php]每天TP5-20170122|thinkphp5-Process.php-4

/**  * 获取PID  * @return int|null  * @throws \RuntimeException  */ public function getPid() {// 获取进程 ID     if ($this->isSigchildEnabled()) {         throw new \RuntimeException('This PHP has been compiled with --enable-sigchild. The process identifie

[李景山php]每天TP5-20161221|thinkphp5-jump.php

<?php /**  * 用法:  * load_trait('controller/Jump');  * class index  * {  *     use \traits\controller\Jump;  *     public function index(){  *         $this->error();  *         $this->redirect();  *     }  * }  */ namespace traits\controller; use

[李景山php]每天TP5-20170120|thinkphp5-Process.php-2

/**  * @var array  */ public static $exitCodes = [// 异常退出 代码     0   => 'OK',// 正常退出     1   => 'General error',// 一般性错误     2   => 'Misuse of shell builtins', // 缺少脚本     126 => 'Invoked command cannot execute',// 执行命令错误     127 => 'Comman

[李景山php]每天laravel-20160912|FileSystem-3

    /**      * Copy a file to a new location.      *      * @param  string  $path      * @param  string  $target      * @return bool      */     public function copy($path, $target)     {         return copy($path, $target);     }// wrap a copy funct

[李景山php]每天TP5-20170125|thinkphp5-Process.php-7

    /**      * 获取输入      * @return null|string      */     public function getInput()     {         return $this->input;     }// 获取输入信息     /**      * 设置输入      * @param mixed $input      * @return self      */     public function setInput($input)   

[李景山php]每天laravel-20161131|BelongsToMany.php-3

    /**      * Save a new model and attach it to the parent model.      *      * @param  \Illuminate\Database\Eloquent\Model  $model      * @param  array  $joining      * @param  bool   $touch      * @return \Illuminate\Database\Eloquent\Model      *

安装TP5(thinkphp5)Composer

1.下载 composer.phar (http:\\www.cnblogs.com/JANCHAN/7735882.html),把composer.phar放入php中(例如php-5.4.45) 再建一个composer.bat放在php中(放在同级的文件夹中)---在里面写    @php "%~dp0composer.phar" %* 2.去网站根目录中的  配置  php.ini 改openssl.dll和fileinfo.dll去掉分号(按ctrl+F搜索) 3.写环境变量