Code Duplication    Length = 25-25 lines in 2 locations

class/utility.php 1 location

@@ 346-370 (lines=25) @@
343
         * @param $server
344
         * @param $id
345
         */
346
        public static function planetGetPing($server, $id)
347
        {
348
            if (is_array($server)) {
349
                foreach ($server as $serv) {
350
                    PlanetUtility::planetGetPing($serv, $id);
351
                }
352
            }
353
            require_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/class-IXR.php';
354
355
            // using a timeout of 3 seconds should be enough to cover slow servers
356
            $client            = new IXR_Client($server, false);
357
            $client->timeout   = 3;
358
            $client->useragent .= ' -- XOOPS Article/' . XOOPS_VERSION;
359
360
            // when set to true, this outputs debug messages by itself
361
            $client->debug = false;
362
363
            $blogname = xoops_utf8_encode($GLOBALS['xoopsModule']->getVar('name'));
364
            $home     = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/';
365
            $rss2_url = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/xml.php' . URL_DELIMITER . 'rss2.0/' . $id;
366
367
            if (!$client->query('weblogUpdates.extendedPing', $blogname, $home, $rss2_url)) { // then try a normal ping
368
                $client->query('weblogUpdates.ping', $blogname, $home);
369
            }
370
        }
371
372
        /**
373
         * Function to respond to a trackback

include/functions.php 1 location

@@ 339-363 (lines=25) @@
336
     * @param $server
337
     * @param $id
338
     */
339
    function planetGetPing($server, $id)
340
    {
341
        if (is_array($server)) {
342
            foreach ($server as $serv) {
343
                planetGetPing($serv, $id);
344
            }
345
        }
346
        require_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/class-IXR.php';
347
348
        // using a timeout of 3 seconds should be enough to cover slow servers
349
        $client            = new IXR_Client($server, false);
350
        $client->timeout   = 3;
351
        $client->useragent .= ' -- XOOPS Article/' . XOOPS_VERSION;
352
353
        // when set to true, this outputs debug messages by itself
354
        $client->debug = false;
355
356
        $blogname = xoops_utf8_encode($GLOBALS['xoopsModule']->getVar('name'));
357
        $home     = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/';
358
        $rss2_url = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/xml.php' . URL_DELIMITER . 'rss2.0/' . $id;
359
360
        if (!$client->query('weblogUpdates.extendedPing', $blogname, $home, $rss2_url)) { // then try a normal ping
361
            $client->query('weblogUpdates.ping', $blogname, $home);
362
        }
363
    }
364
365
    /**
366
     * Function to respond to a trackback