• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP fastcgi_finish_request函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中fastcgi_finish_request函数的典型用法代码示例。如果您正苦于以下问题:PHP fastcgi_finish_request函数的具体用法?PHP fastcgi_finish_request怎么用?PHP fastcgi_finish_request使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了fastcgi_finish_request函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _start

 static function _start()
 {
     if (self::_flushOutputBuffers()) {
         if (function_exists('fastcgi_finish_request')) {
             fastcgi_finish_request();
         } else {
             flush();
         }
     }
     ob_start(self::$class . '_checkOutputBuffer');
     self::register(self::$class . '_end');
 }
开发者ID:nicolas-grekas,项目名称:Patchwork,代码行数:12,代码来源:ShutdownHandler.php


示例2: stop

 function stop()
 {
     if (function_exists('fastcgi_finish_request')) {
         fastcgi_finish_request();
     }
     $last_error = error_get_last();
     if (is_array($last_error)) {
         call_user_func_array(array(PHPIO::$hooks['Error'], '_error_handler'), $last_error);
     }
     ini_set("aop.enable", "0");
     $this->start = false;
 }
开发者ID:sysuyc,项目名称:phpio,代码行数:12,代码来源:Log.php


示例3: start

 public function start($option = [])
 {
     if ($this->session instanceof Session) {
         $this->session->start();
     }
     $jobs = [];
     try {
         $option['job'] = function ($job) use(&$jobs) {
             $jobs[] = $job;
         };
         $this->main($option);
     } catch (Redirect $e) {
         $this->response->redirect($e->getLocation(), $e->getCode());
     } catch (Error $e) {
         $this->respondError($e);
     } catch (\Exception $e) {
         $this->respondError(new Error(500, [], $e));
     } finally {
         if ($this->session instanceof Session) {
             $this->session->clear();
             $this->session->writeClose();
         }
     }
     flush();
     if (function_exists('fastcgi_finish_request')) {
         fastcgi_finish_request();
     }
     foreach ($jobs as $job) {
         $job();
     }
 }
开发者ID:noframework,项目名称:noframework,代码行数:31,代码来源:Application.php


示例4: log_error

function log_error($param)
{
    $logdir = APP_ROOT . APP_DIR . '/webroot/data/logs/';
    if (!is_dir($logdir)) {
        return;
    }
    $error = error_get_last();
    function_exists('fastcgi_finish_request') && fastcgi_finish_request();
    if (!is_array($error) || !in_array($error['type'], array(E_ERROR, E_COMPILE_ERROR, E_CORE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR))) {
        return;
    }
    $error = '';
    $error .= date('Y-m-d H:i:s') . '--';
    //$error .= 'Type:' . $error['type'] . '--';
    $error .= 'Msg:' . $error['message'] . '--';
    $error .= 'File:' . $error['file'] . '--';
    $error .= 'Line:' . $error['line'] . '--';
    $error .= 'Ip:' . (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0') . '--';
    $error .= 'Uri:' . (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '') . '--';
    $error .= empty($_SERVER['CONTENT_TYPE']) ? '' : 'Content-Type:' . $_SERVER['CONTENT_TYPE'] . '--';
    $error .= $_SERVER['REQUEST_METHOD'] . $_SERVER['REQUEST_URI'];
    $error .= '<br/>';
    $size = file_exists($file) ? @filesize($file) : 0;
    file_put_contents($logdir . $param['file'], $error, $size < $param['maxsize'] ? FILE_APPEND : null);
}
开发者ID:justlikeheaven,项目名称:buxun,代码行数:25,代码来源:log.php


示例5: send

 public function send()
 {
     Hook::triggerAction('response.before_send', array(&$this));
     $this->sendHeaders();
     $this->sendContent();
     if (function_exists('fastcgi_finish_request')) {
         fastcgi_finish_request();
     } elseif ('cli' !== PHP_SAPI) {
         // ob_get_level() never returns 0 on some Windows configurations, so if
         // the level is the same two times in a row, the loop should be stopped.
         $previous = null;
         $obStatus = ob_get_status(1);
         while (($level = ob_get_level()) > 0 && $level !== $previous) {
             $previous = $level;
             if ($obStatus[$level - 1]) {
                 if (version_compare(PHP_VERSION, '5.4', '>=')) {
                     if (isset($obStatus[$level - 1]['flags']) && $obStatus[$level - 1]['flags'] & PHP_OUTPUT_HANDLER_REMOVABLE) {
                         ob_end_flush();
                     }
                 } else {
                     if (isset($obStatus[$level - 1]['del']) && $obStatus[$level - 1]['del']) {
                         ob_end_flush();
                     }
                 }
             }
         }
         flush();
     }
     Hook::triggerAction('response.after_send', array(&$this));
     return $this;
 }
开发者ID:wave-framework,项目名称:wave,代码行数:31,代码来源:Response.php


示例6: startExecution

 public function startExecution(Executable $manager)
 {
     if (function_exists('fastcgi_finish_request')) {
         fastcgi_finish_request();
     }
     parent::startExecution($manager);
 }
开发者ID:lstrojny,项目名称:procrastinator,代码行数:7,代码来源:PhpFpmExecutorDecorator.php


示例7: call

 /**
  * Call
  */
 public function call()
 {
     $this->next->call();
     //Fetch status, header, and body
     list($status, $headers, $body) = $this->app->response->result();
     //Send headers
     if (headers_sent() === false) {
         if ('cli' == $this->app->sapi_type) {
             header(sprintf('Status: %s', $status));
         } else {
             header(sprintf('HTTP/%s %s', '1.1', $status));
         }
         foreach ($headers as $name => $value) {
             $hValues = explode("\n", $value);
             foreach ($hValues as $hVal) {
                 header("{$name}: {$hVal}", false);
             }
         }
     }
     echo $this->app->view->format($body);
     //fastcgi
     if (function_exists('fastcgi_finish_request')) {
         fastcgi_finish_request();
     }
     $module = $this->app->module;
     if ($module && method_exists($module, 'asyncJob')) {
         $module->asyncJob();
     }
 }
开发者ID:WickyLeo,项目名称:bobcat,代码行数:32,代码来源:PrettyResultHandler.class.php


示例8: install_shutdown

 /**
  * Single shot defer handeler install
  */
 protected static function install_shutdown()
 {
     if (static::$inited_shutdown) {
         return;
     }
     // Disable time limit
     set_time_limit(0);
     // HHVM support
     if (function_exists('register_postsend_function')) {
         register_postsend_function(function () {
             Event::trigger('core.shutdown');
         });
     } else {
         if (function_exists('fastcgi_finish_request')) {
             register_shutdown_function(function () {
                 fastcgi_finish_request();
                 Event::trigger('core.shutdown');
             });
         } else {
             register_shutdown_function(function () {
                 Event::trigger('core.shutdown');
             });
         }
     }
     static::$inited_shutdown = true;
 }
开发者ID:caffeina-core,项目名称:core,代码行数:29,代码来源:Work.php


示例9: handleRequest

 public function handleRequest()
 {
     ini_set('display_errors', '0');
     $as = new \FutoIn\RI\ScopedSteps();
     $as->add(function ($as) {
         $reqinfo = $this->getBaseRequestInfo($as);
         $this->configureRequestInfo($as, $reqinfo);
         $as->reqinfo = $reqinfo;
         $this->process($as);
         $as->add(function ($as) {
             $reqinfo = $as->reqinfo;
             $reqinfo_info = $reqinfo->info();
             if (!is_null($reqinfo_info->{RequestInfo::INFO_RAW_RESPONSE})) {
                 header('Content-Type: application/futoin+json');
                 echo $reqinfo_info->{RequestInfo::INFO_RAW_RESPONSE};
             }
             if (function_exists('fastcgi_finish_request')) {
                 fastcgi_finish_request();
             }
             $as->success();
         });
     }, function ($as, $err) {
         error_log("{$err}: " . $as->error_info);
         http_response_code(500);
         header('Content-Type: application/futoin+json');
         echo '{"e":"InvalidRequest"}';
     });
     $as->run();
 }
开发者ID:futoin,项目名称:core-php-ri-executor,代码行数:29,代码来源:Executor.php


示例10: generateAndMatchMidi

 public function generateAndMatchMidi(Request $request)
 {
     echo 'true';
     // =======这部分是将输出内容刷新到用户浏览器并断开和浏览器的连接=====
     // 如果使用的是php-fpm
     if (function_exists('fastcgi_finish_request')) {
         // 刷新buffer
         ob_flush();
         flush();
         // 断开浏览器连接
         fastcgi_finish_request();
     }
     // ========下面是后台要继续执行的内容========
     // 查看midi是否已经存在
     $midi_exists = self::midiExists($request);
     Log::info('[查询 midi是否生成] ' . $midi_exists);
     // 若midi不存在,执行wav转midi, 否则执行匹配midi
     if ($midi_exists == 'false') {
         Log::info('[转换 midi] ' . $request->uid . '/' . $request->pid . '/' . $request->wav);
         // wav转midi
         $this->midiIsGenerated($request);
     } else {
         Log::info('[匹配 midi] ' . $request->uid . '/' . $request->pid . '/' . $request->wav);
         // 匹配midi
         self::matchMidi($request);
     }
 }
开发者ID:WangWeigao,项目名称:m1,代码行数:27,代码来源:AutoTestController.php


示例11: track

 public function track()
 {
     $url = 'www.google-analytics.com';
     $page = '/collect';
     $googleip = $this->memcacheget('googleip');
     if (empty($googleip)) {
         $googleip = gethostbyname($url);
         $this->memcacheset('googleip', $googleip, 3600);
     }
     //set POST variables
     if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
         $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
     }
     $fields = array('v' => '1', 'tid' => $this->GA_ID, 'cid' => $this->gaParseCookie(), 't' => 'pageview', 'cm' => $_GET["api_key"], 'dr' => $this->project_url, 'cs' => $this->project, 'dh' => 'webservice.fanart.tv', 'dp' => $this->ttype . '/' . $this->tid, 'uip' => $_SERVER['REMOTE_ADDR'], 'ua' => $_SERVER['HTTP_USER_AGENT']);
     $fields_string = http_build_query($fields);
     //die($this->myfunc_getIP($url));
     $fp = fsockopen($googleip, 80, $errno, $errstr, 5);
     //$fp = fsockopen($url, 80, $errno, $errstr, 5);
     stream_set_blocking($fp, 0);
     stream_set_timeout($fp, 5);
     $output = "POST http://" . $url . $page . " HTTP/1.1\r\n";
     $output .= "Host: {$url}\r\n";
     $output .= "Content-Length: " . strlen($fields_string) . "\r\n";
     $output .= "Connection: close\r\n\r\n";
     $output .= $fields_string;
     //die($output);
     fastcgi_finish_request();
     $sentData = 0;
     $toBeSentData = strlen($output);
     while ($sentData < $toBeSentData) {
         $sentData += fwrite($fp, $output);
     }
     fclose($fp);
 }
开发者ID:KodeStar,项目名称:pro-api,代码行数:34,代码来源:Rest.php


示例12: xhprof_shutdown

function xhprof_shutdown()
{
    global $xhprofMainConfig;
    $xhprof_data = xhprof_disable();
    if (function_exists('fastcgi_finish_request')) {
        fastcgi_finish_request();
    }
    try {
        require_once __DIR__ . '/../xhprof/classes/data.php';
        $xhprof_data_obj = new \ay\xhprof\Data($xhprofMainConfig['pdo']);
        $xhprof_data_obj->save($xhprof_data);
    } catch (Exception $e) {
        // old php versions don't like Exceptions in shutdown functions
        // -> log them to have some usefull info in the php-log
        if (PHP_VERSION_ID < 504000) {
            if (function_exists('log_exception')) {
                log_exception($e);
            } else {
                error_log($e->__toString());
            }
        }
        // re-throw to show the caller something went wrong
        throw $e;
    }
}
开发者ID:sugarops,项目名称:xhprof.io,代码行数:25,代码来源:prepend.php


示例13: finishExecution

 public static function finishExecution()
 {
     if (function_exists('fastcgi_finish_request')) {
         fastcgi_finish_request();
     } else {
         exit(0);
     }
 }
开发者ID:wake-up-neo,项目名称:php-xframework,代码行数:8,代码来源:SystemExit.php


示例14: fork

 /**
  * Try to create a zombie.
  *
  * @return  bool
  */
 public static function fork()
 {
     if (true !== static::test()) {
         throw new Exception('This program must run behind PHP-FPM to create a zombie.', 0);
     }
     fastcgi_finish_request();
     return true;
 }
开发者ID:Grummfy,项目名称:Central,代码行数:13,代码来源:Zombie.php


示例15: run

 /**
  * 处理器入口
  *
  * @access public static
  * @return void
  */
 public static function run($ini, $url, $post = null)
 {
     $dsp = new self($ini);
     $dsp->dispach($url, $post);
     if (empty($GLOBALS['__in_debug_tools']) && function_exists('fastcgi_finish_request')) {
         fastcgi_finish_request();
     }
 }
开发者ID:ray-dong,项目名称:Myfox-load-module,代码行数:14,代码来源:dispatcher.php


示例16: finish

 function finish()
 {
     Assert::isFalse($this->isFinished, 'already finished');
     $this->isFinished = true;
     // http://php-fpm.anight.org/extra_features.html
     // TODO: cut out this functionality to the outer class descendant (e.g., PhpFpmResponse)
     if (function_exists('fastcgi_finish_request')) {
         fastcgi_finish_request();
     }
 }
开发者ID:phoebius,项目名称:ajax-example,代码行数:10,代码来源:WebResponse.class.php


示例17: send

 public function send()
 {
     $this->sendHeaders();
     $this->sendBody();
     if (function_exists('fastcgi_finish_request')) {
         fastcgi_finish_request();
     } elseif ('cli' !== PHP_SAPI) {
         static::closeOutputBuffers(0, true);
     }
     return $this;
 }
开发者ID:johninchina,项目名称:mvc-frame,代码行数:11,代码来源:Response.php


示例18: __construct

 public function __construct($config = [])
 {
     parent::__construct($config);
     register_shutdown_function(function () {
         if ($this->_promises) {
             if (function_exists('\\fastcgi_finish_request')) {
                 \fastcgi_finish_request();
             }
             P\inspect_all($this->_promises);
         }
     });
 }
开发者ID:weiyiyi,项目名称:base,代码行数:12,代码来源:PromiseBehavior.php


示例19: call

 /**
  * call event when you need.
  */
 public static function call()
 {
     if (!SsdPHP::isDebug()) {
         $ISCGI = 0 === strpos(PHP_SAPI, 'cgi') || false !== strpos(PHP_SAPI, 'fcgi') ? true : false;
         /* 冲刷(flush)所有响应的数据给客户端并结束请求。 这使得客户端结束连接后,需要大量时间运行的任务能够继续运行 */
         $ISCGI && fastcgi_finish_request();
     }
     foreach (self::$_events as $event) {
         $callback = array_shift($event);
         call_user_func_array($callback, $event);
     }
 }
开发者ID:ssdphp,项目名称:ssdphp,代码行数:15,代码来源:RegShutdownEvent.php


示例20: register

 /**
  * Register function for exit.
  *
  * @return void
  */
 public static function register()
 {
     static::$_isRegistered = true;
     register_shutdown_function(function () {
         if (static::$_promise) {
             if (function_exists('\\fastcgi_finish_request')) {
                 \fastcgi_finish_request();
             }
             \GuzzleHttp\Promise\inspect_all(static::$_promises);
         }
     });
 }
开发者ID:mole-chen,项目名称:yii2,代码行数:17,代码来源:Promise.php



注:本文中的fastcgi_finish_request函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP fastimagecopyresampled函数代码示例发布时间:2022-05-15
下一篇:
PHP farray函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap