From a5efac3bd05e30fe9d2066d6f356b9a4bbfe24b1 Mon Sep 17 00:00:00 2001
From: dongsheng <dongsheng>
Date: Wed, 9 Jul 2008 02:44:44 +0000
Subject: [PATCH] MDL-15488, fix bugs of curl class.

---
 repository/curl.class.php | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/repository/curl.class.php b/repository/curl.class.php
index 5d9a7b58be..6c02ae3605 100644
--- a/repository/curl.class.php
+++ b/repository/curl.class.php
@@ -19,6 +19,7 @@
 
 class curl {
     private $options;
+    public  $cache    = false;
     private $debug    = false;
     private $cookie   = false;
     public  $version  = '0.2 dev';
@@ -35,14 +36,15 @@ class curl {
         if(!empty($options['debug'])) {
             $this->debug = true;
         }
-        $this->debug = false;
         if(!empty($options['cookie'])) {
             if(file_exists($options['cookie'])) {
                 $this->cookie = $options['cookie'];
             }
         }
         if(!empty($options['cache'])) {
-            $this->cache = new repository_cache;
+            if(class_exists('repository_cache')) {
+                $this->cache = new repository_cache;
+            }
         }
         $this->resetopt();
     }
@@ -314,7 +316,7 @@ class curl {
     /**
      * HTTP TRACE method
      */
-    public function trace($url){
+    public function trace($url, $options = array()){
         $options['CURLOPT_CUSTOMREQUEST'] = 'TRACE';
         $ret = $this->request($url, $options);
         return $ret;
@@ -322,7 +324,7 @@ class curl {
     /**
      * HTTP OPTIONS method
      */
-    public function options($url){
+    public function options($url, $options = array()){
         $options['CURLOPT_CUSTOMREQUEST'] = 'OPTIONS';
         $ret = $this->request($url, $options);
         return $ret;
-- 
2.39.5