File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ public function int_callback(){
63
63
64
64
if (!empty ($ results ) && !empty ($ results ['access_token ' ])){
65
65
$ me = $ this ->me ($ results ['access_token ' ]);
66
-
66
+
67
67
$ this ->auth = array (
68
68
'provider ' => 'Facebook ' ,
69
69
'uid ' => $ me ->id ,
@@ -129,4 +129,26 @@ private function me($access_token){
129
129
return json_decode ($ me );
130
130
}
131
131
}
132
+
133
+ /**
134
+ * Simple server-side HTTP request with file_get_contents
135
+ * Reluctant to use any more advanced transport like cURL for the time being
136
+ * to not having to set cURL as being a requirement.
137
+ *
138
+ * @param $url string Full URL to load
139
+ * @param $options array Stream context options (http://php.net/stream-context-create)
140
+ * @param $responseHeaders string Response headers after HTTP call. Useful for error debugging.
141
+ * @return string Content resulted from request, without headers
142
+ */
143
+ private static function httpRequest ($ url , $ options = null , &$ responseHeaders = null ){
144
+ $ context = null ;
145
+ if (!empty ($ options ) && is_array ($ options )){
146
+ $ context = stream_context_create ($ options );
147
+ }
148
+
149
+ $ content = @file_get_contents ($ url , false , $ context );
150
+ $ responseHeaders = implode ("\r\n" , $ http_response_header );
151
+
152
+ return $ content ;
153
+ }
132
154
}
You can’t perform that action at this time.
0 commit comments