| @@ 975-983 (lines=9) @@ | ||
| 972 | // XXX tempolary |
|
| 973 | self::$lastModified = $response->getHeader('Last-Modified'); |
|
| 974 | $data = self::httpData($response->getBody(), $options['dataType'], $options); |
|
| 975 | if (isset($options['success']) && $options['success']) |
|
| 976 | PhpQuery::callbackRun( |
|
| 977 | $options['success'], |
|
| 978 | array( |
|
| 979 | $data, |
|
| 980 | $response->getStatus(), |
|
| 981 | $options |
|
| 982 | ) |
|
| 983 | ); |
|
| 984 | if ($options['global']) |
|
| 985 | PhpQueryEvents::trigger( |
|
| 986 | $documentID, |
|
| @@ 994-1002 (lines=9) @@ | ||
| 991 | ) |
|
| 992 | ); |
|
| 993 | } else { |
|
| 994 | if (isset($options['error']) && $options['error']) |
|
| 995 | PhpQuery::callbackRun( |
|
| 996 | $options['error'], |
|
| 997 | array( |
|
| 998 | $client, |
|
| 999 | $response->getStatus(), |
|
| 1000 | $response->getMessage() |
|
| 1001 | ) |
|
| 1002 | ); |
|
| 1003 | if ($options['global']) |
|
| 1004 | PhpQueryEvents::trigger( |
|
| 1005 | $documentID, |
|
| @@ 1042-1049 (lines=8) @@ | ||
| 1039 | ||
| 1040 | protected static function httpData($data, $type, $options) |
|
| 1041 | { |
|
| 1042 | if (isset($options['dataFilter']) && $options['dataFilter']) |
|
| 1043 | $data = self::callbackRun( |
|
| 1044 | $options['dataFilter'], |
|
| 1045 | array( |
|
| 1046 | $data, |
|
| 1047 | $type |
|
| 1048 | ) |
|
| 1049 | ); |
|
| 1050 | if (is_string($data)) { |
|
| 1051 | if ($type == "json") { |
|
| 1052 | if (isset($options['_jsonp']) && $options['_jsonp']) { |
|