php_runtime.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:Deploy_XXNET_Server 作者: jzp820927 项目源码 文件源码
def handle(self, environ, start_response, url_map, match, request_id,
             request_type):
    """Serves a request by displaying an error page.

    Args:
      environ: An environ dict for the request as defined in PEP-333.
      start_response: A function with semantics defined in PEP-333.
      url_map: An appinfo.URLMap instance containing the configuration for the
          handler matching this request.
      match: A re.MatchObject containing the result of the matched URL pattern.
      request_id: A unique string id associated with the request.
      request_type: The type of the request. See instance.*_REQUEST module
          constants.

    Yields:
      A sequence of strings containing the body of the HTTP response.
    """
    start_response('500 Internal Server Error',
                   [('Content-Type', 'text/html')])
    yield '<html><head><title>Invalid PHP Configuration</title></head>'
    yield '<body>'
    yield '<title>Invalid PHP Configuration</title>'
    if isinstance(self._exception, _PHPEnvironmentError):
      yield '<b>The PHP interpreter specified with the --php_executable_path '
      yield ' flag (&quot;%s&quot;) is not compatible with the App Engine ' % (
          self._php_executable_path)
      yield 'PHP development environment.</b><br>'
      yield '<br>'
      yield '<pre>%s</pre>' % self._exception
    else:
      yield '<b>%s</b>' % cgi.escape(str(self._exception))

    yield '</body></html>'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号