Advertisement
Guest User

Untitled

a guest
Dec 15th, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. <?php
  2.  
  3. function hello_world ()
  4. {
  5.     $current_dir = getcwd ();
  6.     echo "Hello, World: $current_dir\n";
  7.     $result = test_ssl ();
  8.     if ($result == false)
  9.         echo "Very poor\n";
  10. }
  11.  
  12. function test_ssl ()
  13. {
  14.     $ch = curl_init ();
  15.     curl_setopt ($ch, CURLOPT_URL, "https://api.twitter.com");
  16.     curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, true);
  17.     curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 2);
  18.     curl_setopt ($ch, CURLOPT_CAINFO, getcwd () . "/api.twitter.com");
  19.     curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
  20.     $result = curl_exec ($ch);
  21.     curl_close ($ch);
  22.     return $result;
  23. }
  24.  
  25. hello_world();
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement