处理成功

@param string $msg
@param string $url
@param string $data
@param number $wait
@return mixed
979408
protected function success($msg = '', $url = '', $data = '', $wait = 3)
    {
        return $this->jump(1, $msg, $url, $data, $wait);
    }
668557
public function get($url, array $data = [])
    {
        $this->resetAndAssociateUrl($url);

        $this->addFields($data);

        return new Parser($this->ch);
    }
29670
public function post($url, array $data, array $headers = null)
    {
        $headers = is_null($headers) ? ['Content-Type: application/json; charset=utf-8'] : $headers;
        return $this->sendRequest('POST', $url, $headers, $data);
    }
1210601
private function _alert( $type, $msg , $url  ) {
			$messages = CakeSession::read('Alerts');
		if ($messages === null){
			$messages = array();
		}
		
		$messages[] = array('type' => $type , 'msg' => $msg );
		CakeSession::write('Alerts',$messages);
		if($url){
			return $this->controller->redirect($url);
		}		
		
	//	$this->setFlash( $msg , $element , array( 'class' => $class ,'global'=> $global ) );

    }
291696
public static function output($data = null, $msg = '', $code = 0)
    {
        if (!$code) {
            echo json_encode([
                'code' => 0,
                'msg' => $msg,
                'data' => $data,
            ], JSON_UNESCAPED_UNICODE);
        } else {
            echo json_encode([
                'code' => $code,
                'msg' => $msg ? $msg : '未知错误',
            ], JSON_UNESCAPED_UNICODE);
        }
    }
8240
protected function success($msg, $url = null)
    {
        return $this->msg($msg, self::MSG_GOOD, $url);
    }
1245175
function post($url, $data, $callback = null)
    {
        $ret = new CoURLResult($url, $callback, $this->handle);
        $ret->method = self::METHOD_POST;
        $ret->data = $data;
        $this->requests[$ret->id] = $ret;
        return $ret;
    }
953788
public function requestAsync($url, $method = 'GET', $data = [])
    {

        $stack = HandlerStack::create();
        $stack->push(ApiMiddleware::auth());
        $client = new Client(['handler' => $stack]);

        $promise = $client->requestAsync($method, $url, [
            'headers' => [
                'Authorization' => 'Bearer ' . $this->token
            ],
            'json' => $data,
            'content-type' => 'application/json'
        ]);

        return $promise;

    }
677995
public function receiveRequest($wait = self::WAIT)
    {
        return $this->getSocket()->recv(($wait ? 0 : \ZMQ::MODE_DONTWAIT));
    }
1060249
protected function redirect($url,$params=array(),$delay=0,$msg='') {
        $url    =   U($url,$params);
        redirect($url,$delay,$msg);
    }
538231
public function post($url, $data = '', array $headers = [])
    {
        return $this->executor->execute(
            $url,
            [
                CURLOPT_POST => true,
                CURLOPT_HTTPHEADER => $headers,
                CURLOPT_POSTFIELDS => $data,
            ]
        );
    }
41836
public function response_json($code, $msg, $data, $http_num = 200)
    {

        return response()->json([
            'error' => $code,
            'msg' => $msg,
            'data' => $data,
        ], $http_num);
    }
690453
protected function receiveMessageBatch($maxCount = 1,
                                           $wait = null,
                                           $visibilityTimeout = null,
                                           $metas = [],
                                           $messageAttributes = [])
    {
        if ($maxCount > 10 || $maxCount < 1) {
            throw new \InvalidArgumentException("Max count for SQS message receiving is 10");
        }
        
        $messageAttributes[] = self::SERIALIZATION_FLAG;
        
        $args = [
            "QueueUrl"              => $this->getQueueUrl(),
            "MaxNumberOfMessages"   => $maxCount,
            'MessageAttributeNames' => $messageAttributes,
        ];
        if ($wait !== null && is_int($wait)) {
            $args['WaitTimeSeconds'] = $wait;
        }
        if ($visibilityTimeout !== null && is_int($visibilityTimeout)) {
            $args['VisibilityTimeout'] = $visibilityTimeout;
        }
        if ($metas && is_array($metas)) {
            $args['AttributeNames'] = $metas;
        }
        
        $result   = $this->client->receiveMessage($args);
        $messages = $result['Messages'];
        if (!$messages) {
            return [];
        }
        
        $ret = [];
        foreach ($messages as $data) {
            $msg   = new SqsReceivedMessage($data);
            $ret[] = $msg;
        }
        
        return $ret;
    }
299778
function recv($length = 65535, $waitall = 0)
    {
        if ($waitall) $waitall = MSG_WAITALL;
        $ret = socket_recvfrom($this->sock, $data, $length, $waitall, $this->remote_host, $this->remote_port);
        if ($ret === false) {
            $this->set_error();
            //重试一次，这里为防止意外，不使用递归循环
            if ($this->errCode == 4) {
                socket_recvfrom($this->sock, $data, $length, $waitall, $this->remote_host, $this->remote_port);
            } else {
                return false;
            }
        }
        return $data;
    }
553286
function requestWithoutWaiting($url, array $params = array())
    {
        $post = array();

        foreach($params as $index => $val)
        {
            $post[] = $index . '=' . urlencode($val);
        }

        $post = implode('&', $post);

        $request = parse_url($url);

        // SUPPORT FOR RELATIVE GENERATOR URL
        if(!isset($request['host']))
        {
            $request['host'] = $_SERVER['HTTP_HOST'];
        }

        if(!isset($request['port']))
        {
            $request['port'] = $_SERVER['SERVER_PORT'];
        }

        // SEND REQUEST WITHOUT WAITING
        $protocol = isset($_SERVER['HTTPS']) ? 'ssl://' : '';
        $safePort = isset($_SERVER['HTTPS']) ? 443 : 80;

        // HTTPS WORKAROUND
        if($request['port'] == 80 && $safePort == 443)
        {
            $request['port'] = $safePort;
        }

        $fp = fsockopen($protocol . $request['host'], $request['port'], $errNo, $errStr, 60);

        $command  = "POST " . $request['path'] . " HTTP/1.1\r\n";
        $command .= "Host: " . $request['host'] . "\r\n";
        $command .= "Content-Type: application/x-www-form-urlencoded\r\n";
        $command .= "Content-Length: " . strlen($post) . "\r\n";
        $command .= "Connection: Close\r\n\r\n";

        if($post)
        {
            $command .= $post;
        }

        fwrite($fp, $command);
        fclose($fp);
    }
1371539
public function url($msg)
    {
        if(strlen(trim($this->_value)) > 0 && filter_var($this->_value, FILTER_VALIDATE_URL) === FALSE) {
            $this->_errors[] = $msg;
        }
        return $this;
    }
831848
protected function msg($msg, $type, $url = null)
    {
        $this->sessionMessage($msg, $type);
        if ($url) {
            return $this->Controller()->redirect($url);
        }
        return $this->Controller()->redirectBack();
    }