Example #1
0
function curlExec($url, $data = false, $method = 'GET')
{
    //global $JWT;
    // global $_SITE;
    if (!function_Exists('curl_init')) {
        return false;
    }
    // $parseUrl = parse_url($url);
    // if(!isset($parseUrl['scheme'])) {
    //     $url = $_SITE['CLIENT']['API'].$url;
    // }
    //$auth = $JWT->decode(SECURITY_TOKEN, SERVER_KEY);
    $auth = "";
    $headers = array("Accept: application/json", "Content-type: application/json");
    $headers[] = "Authorization: NLAuth " . implode(', ', $auth);
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($curl, CURLOPT_HEADER, 0);
    curl_setopt($curl, CURLOPT_VERBOSE, 1);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
    $output = curl_exec($curl);
    $info = curl_getinfo($curl);
    $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
    curl_close($curl);
    return array('output' => $output, 'status' => $status, 'info' => $info);
}
Example #2
0
 public function testPHPModulesExist()
 {
     $this->assertTrue((bool) (version_compare(PHP_VERSION, '5.2.6') !== -1), "You must be running PHP version 5.2.6 or greater (very soon to be 5.3), your version is: " . PHP_VERSION);
     foreach ($this->_modulesList as $moduleFunc => $module) {
         $this->assertTrue((bool) (function_Exists($moduleFunc) | class_exists($moduleFunc)), "Module: {$module} must be installed.");
     }
 }
 public function testPHPModulesExist()
 {
     foreach ($this->_modulesList as $moduleFunc => $module) {
         $this->assertTrue((bool) (function_Exists($moduleFunc) | class_exists($moduleFunc)), "Module: {$module} must be installed.");
         //$this->assertTrue(function_exists($moduleFunc),"Module  {$module} must be installed.");
     }
 }
 function testimonial($atts, $content = null)
 {
     global $vibe_options;
     extract(shortcode_atts(array('id' => '', 'length' => 100), $atts));
     if ($id == 'random') {
         $args = array('post_type' => 'testimonials', 'orderby' => 'rand', 'posts_per_page' => '1', 'fields=ids');
         $testimonials = new WP_Query($args);
         while ($testimonials->have_posts()) {
             $testimonials->the_post();
             $postdata = get_post(get_the_ID());
         }
         wp_reset_postdata();
     } else {
         $postdata = get_post($id);
     }
     if (function_Exists('thumbnail_generator')) {
         $return = thumbnail_generator($postdata, 'testimonial', 3, $length, 0, 0);
     }
     return $return;
 }
Example #5
0
 function readfile($file)
 {
     $content = '';
     if (!file_exists($file)) {
         return '';
     }
     if (function_Exists('file_get_contents')) {
         @($content = file_get_contents($file));
     } else {
         $fp = fopen($file, 'r');
         $fcode = fread($fp, filesize($fp));
         fclose($fp);
         $content = $fcode;
     }
     return $content;
 }