]> git.mxchange.org Git - friendica.git/commitdiff
can no longer avoid recording the curl response code
authorMike Macgirvin <mike@macgirvin.com>
Thu, 14 Oct 2010 05:01:23 +0000 (22:01 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Thu, 14 Oct 2010 05:01:23 +0000 (22:01 -0700)
boot.php
include/notifier.php
mod/photos.php

index 5016db820064a5a56b55832562da9e9b56b15ed1..296ae13c3a30fa956a091f3a1566e91a67538787 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -100,6 +100,8 @@ class App {
        private $baseurl;
        private $db;
 
+       private $curl_code;
+
        function __construct() {
 
                $this->config = array();
@@ -185,6 +187,14 @@ class App {
                ));
        }
 
+       function set_curl_code($code) {
+               $this->curl_code = $code;
+       }
+
+       function get_curl_code() {
+               return $this->curl_code;
+       }
+
 }}
 
 // retrieve the App structure
@@ -347,6 +357,9 @@ function fetch_url($url,$binary = false) {
                curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
 
        $s = curl_exec($ch);
+       $info = curl_getinfo($ch);
+       $a = get_app();
+       $a->set_curl_code($info['http_code']);
        curl_close($ch);
        return($s);
 }}
@@ -376,6 +389,9 @@ function post_url($url,$params) {
        }
 
        $s = curl_exec($ch);
+       $info = curl_getinfo($ch);
+       $a = get_app();
+       $a->set_curl_code($info['http_code']);
        curl_close($ch);
        return($s);
 }}
index ce4e5fed4abe54b67489b9576799860981802661..9866c02325d15b01d2283e48e732bf5702902452 100644 (file)
        if((strlen($hub)) && ($notify_hub)) {
                $params = 'hub.mode=publish&hub.url=' . urlencode($a->get_baseurl() . '/dfrn_poll/' . $owner['nickname'] );
                post_url($hub,$params);
+               if($debugging) {
+                       file_put_contents('pubsub.out', "\n\n" . "Pinged hub at " . datetime_convert() . "\n" . "Hub returned " . $a->get_curl_code() . "\n\n" , FILE_APPEND);
+               }
        }
 
        killme();
index 052f3c1857e1679d05eac243a9bfd6c91d68cd16..35b03845d7703ef18b8600f366f4b879eb0c6c50 100644 (file)
@@ -46,11 +46,10 @@ function photos_init(&$a) {
 function photos_post(&$a) {
 
 
-        if(! local_user()) {
-                notice( t('Permission denied.') . EOL );
-                killme();
-        }
-
+       if(! local_user()) {
+               notice( t('Permission denied.') . EOL );
+               killme();
+       }
 
 
        $r = q("SELECT `contact`.* `user`.`nickname` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid`