当前位置: 首页>>代码示例>>PHP>>正文


PHP Handler::handle方法代码示例

本文整理汇总了PHP中Handler::handle方法的典型用法代码示例。如果您正苦于以下问题:PHP Handler::handle方法的具体用法?PHP Handler::handle怎么用?PHP Handler::handle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Handler的用法示例。


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

示例1: handle

 /**
  * Handle the request. 
  * 
  * This approach by using a template method pattern ensures you that 
  * each subclass will not forget to call the successor. Beside, the returned
  * boolean value indicates you if the request have been processed or not.
  *
  * @param Request $req
  *
  * @return bool
  */
 public final function handle(Request $req)
 {
     $req->forDebugOnly = get_called_class();
     $processed = $this->processing($req);
     if (!$processed) {
         // the request has not been processed by this handler => see the next
         if (!is_null($this->successor)) {
             $processed = $this->successor->handle($req);
         }
     }
     return $processed;
 }
开发者ID:calvincanas,项目名称:DesignPatternsPHP,代码行数:23,代码来源:Handler.php

示例2: main

/**
 * @param $isHashHost Boolean Is this host a router
 * @param $hostNumber Number How many host there
 * @param $packImages Boolean make a zip pack for images?
 */
function main($isHashHost, $hostNumber, $packImages)
{
    $url = isset($_GET['url']) ? $_GET['url'] : '';
    # URL given
    if ($url) {
        # it's an image url
        if (Input::isImageUrl($url)) {
            Output::redirect($url);
        } elseif ($isHashHost) {
            Router::route($url, $hostNumber);
        } else {
            $mc = new mc();
            Input::loadMemcached($mc);
            Output::loadMemcached($mc);
            Handler::loadMemcached($mc);
            Handler::handle($url, $packImages);
        }
    } else {
        exit_script('Hello Tumblr!');
    }
}
开发者ID:gonejack,项目名称:tumblr-images-memcached,代码行数:26,代码来源:main.php

示例3: docopt

/**
 * API compatibility with python docopt
 */
function docopt($doc, $params = array())
{
    $argv = array();
    if (isset($params['argv'])) {
        $argv = $params['argv'];
        unset($params['argv']);
    }
    $h = new Handler($params);
    return $h->handle($doc, $argv);
}
开发者ID:korial29,项目名称:fusioninventory-for-glpi,代码行数:13,代码来源:docopt.php

示例4: handle

                "label": "created",
                "field": "TtSampleDatum.created"
            },
            {
                "label": "modified",
                "field": "TtSampleDatum.modified"
            }
        ],
        "query" : "SELECT * FROM tt_sample_data"
    }
}';
//$_POST['body'] = $json;
//$_POST['method'] = 'deleteReport';
$Handler = new Handler();
$Handler->setPost($_POST);
$Handler->handle();
class Handler
{
    public function handle()
    {
        header('Content-Type: application/json');
        print_r($this->response);
    }
    public function setPost($post)
    {
        $this->method = $post['method'];
        $this->body = $post['body'];
        $this->client = new Client();
        switch ($this->method) {
            case 'createReport':
                $this->client->setData($this->body);
开发者ID:casank25,项目名称:reporting_demo,代码行数:31,代码来源:service.php


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