當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。