From d67689517b2c3a100a41118ea7f9ffff18e3c379 Mon Sep 17 00:00:00 2001 From: Dave Hall Date: Tue, 3 May 2011 03:17:04 +1000 Subject: [PATCH 1/7] change private methods to protected to allow extension of class --- bc-mapi.php | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/bc-mapi.php b/bc-mapi.php index fd91f2b..563a83a 100644 --- a/bc-mapi.php +++ b/bc-mapi.php @@ -62,20 +62,20 @@ class BCMAPI public $page_size = NULL; public $total_count = NULL; - private $api_calls = 0; - private $bit32 = FALSE; - private $media_delivery = 'default'; - private $secure = FALSE; - private $show_notices = FALSE; - private $timeout_attempts = 100; - private $timeout_current = 0; - private $timeout_delay = 1; - private $timeout_retry = FALSE; - private $token_read = NULL; - private $token_write = NULL; - private $url_read = 'api.brightcove.com/services/library?'; - private $url_write = 'api.brightcove.com/services/post'; - private $valid_types = array( + protected $api_calls = 0; + protected $bit32 = FALSE; + protected $media_delivery = 'default'; + protected $secure = FALSE; + protected $show_notices = FALSE; + protected $timeout_attempts = 100; + protected $timeout_current = 0; + protected $timeout_delay = 1; + protected $timeout_retry = FALSE; + protected $token_read = NULL; + protected $token_write = NULL; + protected $url_read = 'api.brightcove.com/services/library?'; + protected $url_write = 'api.brightcove.com/services/post'; + protected $valid_types = array( 'playlist', 'video' ); @@ -1166,7 +1166,7 @@ public function sef($name) * @param string [$type] The type of URL to retrieve, read or write * @return string The appropriate API URL */ - private function getUrl($type = 'read') + protected function getUrl($type = 'read') { if($this->secure) { @@ -1196,7 +1196,7 @@ private function getUrl($type = 'read') * @param string [$default] The default API parameter if only 1 provided * @return string The complete API request URL */ - private function appendParams($method, $params = NULL, $default = NULL) + protected function appendParams($method, $params = NULL, $default = NULL) { $url = $this->getUrl('read') . 'token=' . $this->token_read . '&command=' . $method; @@ -1223,7 +1223,7 @@ private function appendParams($method, $params = NULL, $default = NULL) * @param string [$url] The complete API request URL * @return object An object containing all API return data */ - private function getData($url) + protected function getData($url) { if(class_exists('BCMAPICache')) { @@ -1311,7 +1311,7 @@ private function getData($url) * @param bool [$return_json] Whether we should return any data or not * @return object An object containing all API return data */ - private function putData($request, $return_json = TRUE) + protected function putData($request, $return_json = TRUE) { if(!isset($this->token_write)) { @@ -1341,7 +1341,7 @@ private function putData($request, $return_json = TRUE) * @param boolean [$get_request] If false, send POST params * @return void */ - private function curlRequest($request, $get_request = FALSE) + protected function curlRequest($request, $get_request = FALSE) { $curl = curl_init(); @@ -1388,7 +1388,7 @@ private function curlRequest($request, $get_request = FALSE) * @param string [$response] The response from a cURL request * @return string The cleansed string if using a 32-bit machine. */ - private function bit32Clean($response) + protected function bit32Clean($response) { if($this->bit32) { @@ -1404,7 +1404,7 @@ private function bit32Clean($response) * @since 1.0.0 * @param string [$type] The type */ - private function validType($type) + protected function validType($type) { if(!in_array(strtolower($type), $this->valid_types)) { @@ -1555,4 +1555,4 @@ class BCMAPISearchTermsNotProvided extends BCMAPIException{} class BCMAPITokenError extends BCMAPIException{} class BCMAPITransactionError extends BCMAPIException{} -?> \ No newline at end of file +?> From 9fe9c9b36d9acd1f16f3913a6feaa53de1ca750a Mon Sep 17 00:00:00 2001 From: mmicael Date: Fri, 28 Oct 2011 18:58:39 +0300 Subject: [PATCH 2/7] Add curl timeout For not blocking a script if Brightcove API is slow to respond --- bc-mapi.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bc-mapi.php b/bc-mapi.php index fd91f2b..8967f2b 100644 --- a/bc-mapi.php +++ b/bc-mapi.php @@ -1353,7 +1353,8 @@ private function curlRequest($request, $get_request = FALSE) curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $request); } - + // Add curl timeout + curl_setopt($curl, CURLOPT_TIMEOUT, 15); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); From fb21d093c0540a0679fb710c437fedb2cfda6e1c Mon Sep 17 00:00:00 2001 From: mmicael Date: Fri, 28 Oct 2011 19:08:16 +0300 Subject: [PATCH 3/7] add attribute timeout --- bc-mapi.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bc-mapi.php b/bc-mapi.php index 8967f2b..2d8e33a 100644 --- a/bc-mapi.php +++ b/bc-mapi.php @@ -67,6 +67,7 @@ class BCMAPI private $media_delivery = 'default'; private $secure = FALSE; private $show_notices = FALSE; + private $timeout = 15; private $timeout_attempts = 100; private $timeout_current = 0; private $timeout_delay = 1; @@ -1354,7 +1355,7 @@ private function curlRequest($request, $get_request = FALSE) curl_setopt($curl, CURLOPT_POSTFIELDS, $request); } // Add curl timeout - curl_setopt($curl, CURLOPT_TIMEOUT, 15); + curl_setopt($curl, CURLOPT_TIMEOUT, $this->timeout); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); From 54db88a74e57df668206bf6576158592f93523cd Mon Sep 17 00:00:00 2001 From: Jon Williams Date: Wed, 2 May 2012 12:01:23 -0400 Subject: [PATCH 4/7] Modified class / file names to comply with Symfony's autoloader conventions --- bc-mapi.php => BC_MAPI.php | 114 +++++++++++++------------- bc-mapi-cache.php => BC_MAPICache.php | 4 +- README.md | 8 +- 3 files changed, 63 insertions(+), 63 deletions(-) rename bc-mapi.php => BC_MAPI.php (91%) rename bc-mapi-cache.php => BC_MAPICache.php (98%) diff --git a/bc-mapi.php b/BC_MAPI.php similarity index 91% rename from bc-mapi.php rename to BC_MAPI.php index bb4635d..42758f9 100644 --- a/bc-mapi.php +++ b/BC_MAPI.php @@ -41,7 +41,7 @@ * SUPPORT OF ANY KIND IS PROVIDED FOR THE SOFTWARE. */ -class BCMAPI +class BC_MAPI { const ERROR_API_ERROR = 1; const ERROR_DEPRECATED = 99; @@ -82,7 +82,7 @@ class BCMAPI ); /** - * The constructor for the BCMAPI class. + * The constructor for the BC_MAPI class. * @access Public * @since 0.1.0 * @param string [$token_read] The read API token for the Brightcove account @@ -96,7 +96,7 @@ public function __construct($token_read = NULL, $token_write = NULL) } /** - * Sets a property of the BCMAPI class. + * Sets a property of the BC_MAPI class. * @access Public * @since 1.0.0 * @param string [$key] The property to set @@ -109,12 +109,12 @@ public function __set($key, $value) { $this->$key = $value; } else { - throw new BCMAPIInvalidProperty($this, self::ERROR_INVALID_PROPERTY); + throw new BC_MAPIInvalidProperty($this, self::ERROR_INVALID_PROPERTY); } } /** - * Retrieves a property of the BCMAPI class. + * Retrieves a property of the BC_MAPI class. * @access Public * @since 1.0.0 * @param string [$key] The property to retrieve @@ -126,7 +126,7 @@ public function __get($key) { return $this->$key; } else { - throw new BCMAPIInvalidProperty($this, self::ERROR_INVALID_PROPERTY); + throw new BC_MAPIInvalidProperty($this, self::ERROR_INVALID_PROPERTY); } } @@ -248,7 +248,7 @@ public function find($call, $params = NULL) $get_item_count = TRUE; break; default: - throw new BCMAPIInvalidMethod($this, self::ERROR_INVALID_METHOD); + throw new BC_MAPIInvalidMethod($this, self::ERROR_INVALID_METHOD); break; } @@ -372,7 +372,7 @@ public function search($type = 'video', $terms = NULL, $params = NULL) { if(!isset($terms) || !is_array($terms)) { - throw new BCMAPISearchTermsNotProvided($this, self::ERROR_SEARCH_TERMS_NOT_PROVIDED); + throw new BC_MAPISearchTermsNotProvided($this, self::ERROR_SEARCH_TERMS_NOT_PROVIDED); } if(!isset($params)) @@ -451,21 +451,21 @@ public function createMedia($type = 'video', $file = NULL, $meta, $options = NUL { unset($options['encode_to']); - throw new BCMAPIInvalidUploadOption($this, self::ERROR_INVALID_UPLOAD_OPTION); + throw new BC_MAPIInvalidUploadOption($this, self::ERROR_INVALID_UPLOAD_OPTION); } if(isset($options['create_multiple_renditions'])) { $options['create_multiple_renditions'] = 'FALSE'; - throw new BCMAPIInvalidUploadOption($this, self::ERROR_INVALID_UPLOAD_OPTION); + throw new BC_MAPIInvalidUploadOption($this, self::ERROR_INVALID_UPLOAD_OPTION); } if(isset($options['preserve_source_rendition'])) { unset($options['preserve_source_rendition']); - throw new BCMAPIInvalidUploadOption($this, self::ERROR_INVALID_UPLOAD_OPTION); + throw new BC_MAPIInvalidUploadOption($this, self::ERROR_INVALID_UPLOAD_OPTION); } } @@ -473,11 +473,11 @@ public function createMedia($type = 'video', $file = NULL, $meta, $options = NUL { unset($options['H264NoProcessing']); - throw new BCMAPIInvalidUploadOption($this, self::ERROR_INVALID_UPLOAD_OPTION); + throw new BC_MAPIInvalidUploadOption($this, self::ERROR_INVALID_UPLOAD_OPTION); } } } else { - throw new BCMAPIInvalidType($this, self::ERROR_INVALID_TYPE); + throw new BC_MAPIInvalidType($this, self::ERROR_INVALID_TYPE); } $request = array(); @@ -557,7 +557,7 @@ public function createPlaylist($type = 'video', $meta) $params['playlist'] = $media; $post['method'] = 'create_playlist'; } else { - throw new BCMAPIInvalidType($this, self::ERROR_INVALID_TYPE); + throw new BC_MAPIInvalidType($this, self::ERROR_INVALID_TYPE); } $params['token'] = $this->token_write; @@ -592,7 +592,7 @@ public function createImage($type = 'video', $file = NULL, $meta, $id = NULL, $r { $post['method'] = 'add_image'; } else { - throw new BCMAPIInvalidType($this, self::ERROR_INVALID_TYPE); + throw new BC_MAPIInvalidType($this, self::ERROR_INVALID_TYPE); } foreach($meta as $key => $value) @@ -606,7 +606,7 @@ public function createImage($type = 'video', $file = NULL, $meta, $id = NULL, $r } elseif(isset($ref_id)) { $params[strtolower($type) . '_reference_id'] = $ref_id; } else { - throw new BCMAPIIdNotProvided($this, self::ERROR_ID_NOT_PROVIDED); + throw new BC_MAPIIdNotProvided($this, self::ERROR_ID_NOT_PROVIDED); } if($resize) @@ -661,7 +661,7 @@ public function createOverlay($file = NULL, $meta, $id = NULL, $ref_id = NULL) } elseif(isset($ref_id)) { $params['video_reference_id'] = $ref_id; } else { - throw new BCMAPIIdNotProvided($this, self::ERROR_ID_NOT_PROVIDED); + throw new BC_MAPIIdNotProvided($this, self::ERROR_ID_NOT_PROVIDED); } $params['token'] = $this->token_write; @@ -709,7 +709,7 @@ public function deleteOverlay($id = NULL, $ref_id = NULL, $options = NULL) } elseif(isset($ref_id)) { $params['video_reference_id'] = $ref_id; } else { - throw new BCMAPIIdNotProvided($this, self::ERROR_ID_NOT_PROVIDED); + throw new BC_MAPIIdNotProvided($this, self::ERROR_ID_NOT_PROVIDED); } $post['method'] = strtolower('remove_logo_overlay'); @@ -786,7 +786,7 @@ public function delete($type = 'video', $id = NULL, $ref_id = NULL, $options = N } elseif(isset($ref_id)) { $params['reference_id'] = $ref_id; } else { - throw new BCMAPIIdNotProvided($this, self::ERROR_ID_NOT_PROVIDED); + throw new BC_MAPIIdNotProvided($this, self::ERROR_ID_NOT_PROVIDED); } $post['method'] = strtolower('delete_' . $type); @@ -810,7 +810,7 @@ public function getStatus($type = 'video', $id = NULL, $ref_id = TRUE) { if(!isset($id) && !isset($ref_id)) { - throw new BCMAPIIdNotProvided($this, self::ERROR_ID_NOT_PROVIDED); + throw new BC_MAPIIdNotProvided($this, self::ERROR_ID_NOT_PROVIDED); } $request = array(); @@ -833,7 +833,7 @@ public function getStatus($type = 'video', $id = NULL, $ref_id = TRUE) { $post['method'] = 'get_upload_status'; } else { - throw new BCMAPIInvalidType($this, self::ERROR_INVALID_TYPE); + throw new BC_MAPIInvalidType($this, self::ERROR_INVALID_TYPE); } $post['params'] = $params; @@ -858,7 +858,7 @@ public function shareMedia($type = 'video', $id, $account_ids, $accept = FALSE, { if(!isset($id)) { - throw new BCMAPIIdNotProvided($this, self::ERROR_ID_NOT_PROVIDED); + throw new BC_MAPIIdNotProvided($this, self::ERROR_ID_NOT_PROVIDED); } if(!is_array($account_ids)) @@ -892,7 +892,7 @@ public function shareMedia($type = 'video', $id, $account_ids, $accept = FALSE, $params['video_id'] = $id; $post['method'] = 'share_video'; } else { - throw new BCMAPIInvalidType($this, self::ERROR_INVALID_TYPE); + throw new BC_MAPIInvalidType($this, self::ERROR_INVALID_TYPE); } $post['params'] = $params; @@ -914,7 +914,7 @@ public function removeFromPlaylist($playlist_id, $video_ids) { if(!isset($playlist_id)) { - throw new BCMAPIIdNotProvided($this, self::ERROR_ID_NOT_PROVIDED); + throw new BC_MAPIIdNotProvided($this, self::ERROR_ID_NOT_PROVIDED); } if(!is_array($video_ids)) @@ -933,7 +933,7 @@ public function removeFromPlaylist($playlist_id, $video_ids) if(!isset($playlist)) { - throw new BCMAPIDtoDoesNotExist($this, self::ERROR_DTO_DOES_NOT_EXIST); + throw new BC_MAPIDtoDoesNotExist($this, self::ERROR_DTO_DOES_NOT_EXIST); } foreach($playlist->videoIds as $video) @@ -964,7 +964,7 @@ public function addToPlaylist($playlist_id, $video_ids) { if(!isset($playlist_id)) { - throw new BCMAPIIdNotProvided($this, self::ERROR_ID_NOT_PROVIDED); + throw new BC_MAPIIdNotProvided($this, self::ERROR_ID_NOT_PROVIDED); } if(!is_array($video_ids)) @@ -981,7 +981,7 @@ public function addToPlaylist($playlist_id, $video_ids) if(!isset($playlist)) { - throw new BCMAPIDtoDoesNotExist($this, self::ERROR_DTO_DOES_NOT_EXIST); + throw new BC_MAPIDtoDoesNotExist($this, self::ERROR_DTO_DOES_NOT_EXIST); } foreach($video_ids as $video) @@ -1187,7 +1187,7 @@ protected function getUrl($type = 'read') } elseif(strtolower($type) == 'write') { $url .= $this->url_write; } else { - throw new BCMAPIInvalidType($this, self::ERROR_INVALID_TYPE); + throw new BC_MAPIInvalidType($this, self::ERROR_INVALID_TYPE); } return $url; @@ -1231,9 +1231,9 @@ protected function appendParams($method, $params = NULL, $default = NULL) */ protected function getData($url) { - if(class_exists('BCMAPICache')) + if(class_exists('BC_MAPICache')) { - $cache = BCMAPICache::get($url); + $cache = BC_MAPICache::get($url); if($cache !== FALSE) { @@ -1258,7 +1258,7 @@ protected function getData($url) if(!isset($this->token_read)) { - throw new BCMAPITokenError($this, self::ERROR_READ_TOKEN_NOT_PROVIDED); + throw new BC_MAPITokenError($this, self::ERROR_READ_TOKEN_NOT_PROVIDED); } $response = $this->curlRequest($url, TRUE); @@ -1283,12 +1283,12 @@ protected function getData($url) return $this->getData($url); } else { - throw new BCMAPIApiError($this, self::ERROR_API_ERROR, $response_object); + throw new BC_MAPIApiError($this, self::ERROR_API_ERROR, $response_object); } } else { - if(class_exists('BCMAPICache')) + if(class_exists('BC_MAPICache')) { - $cache = BCMAPICache::set($url, $response_object); + $cache = BC_MAPICache::set($url, $response_object); } if(isset($response_object->items)) @@ -1305,7 +1305,7 @@ protected function getData($url) return $data; } } else { - throw new BCMAPIApiError($this, self::ERROR_API_ERROR); + throw new BC_MAPIApiError($this, self::ERROR_API_ERROR); } } @@ -1321,7 +1321,7 @@ protected function putData($request, $return_json = TRUE) { if(!isset($this->token_write)) { - throw new BCMAPITokenError($this, self::ERROR_WRITE_TOKEN_NOT_PROVIDED); + throw new BC_MAPITokenError($this, self::ERROR_WRITE_TOKEN_NOT_PROVIDED); } $response = $this->curlRequest($request, FALSE); @@ -1332,7 +1332,7 @@ protected function putData($request, $return_json = TRUE) if(!isset($response_object->result)) { - throw new BCMAPIApiError($this, self::ERROR_API_ERROR, $response_object); + throw new BC_MAPIApiError($this, self::ERROR_API_ERROR, $response_object); } return $response_object; @@ -1379,9 +1379,9 @@ protected function curlRequest($request, $get_request = FALSE) { if($get_request) { - throw new BCMAPITransactionError($this, self::ERROR_READ_API_TRANSACTION_FAILED, $curl_error); + throw new BC_MAPITransactionError($this, self::ERROR_READ_API_TRANSACTION_FAILED, $curl_error); } else { - throw new BCMAPITransactionError($this, self::ERROR_WRITE_API_TRANSACTION_FAILED, $curl_error); + throw new BC_MAPITransactionError($this, self::ERROR_WRITE_API_TRANSACTION_FAILED, $curl_error); } } @@ -1415,7 +1415,7 @@ protected function validType($type) { if(!in_array(strtolower($type), $this->valid_types)) { - throw new BCMAPIInvalidType($this, self::ERROR_INVALID_TYPE); + throw new BC_MAPIInvalidType($this, self::ERROR_INVALID_TYPE); } else { return TRUE; } @@ -1457,7 +1457,7 @@ public function time($ms, $seconds = FALSE) */ public function embed($a = NULL, $b = NULL, $c = NULL, $d = NULL, $e = NULL) { - throw new BCMAPIDeprecated($this, self::ERROR_DEPRECATED); + throw new BC_MAPIDeprecated($this, self::ERROR_DEPRECATED); return FALSE; } @@ -1519,17 +1519,17 @@ public function getErrorAsString($error_code) } } -class BCMAPIException extends Exception +class BC_MAPIException extends Exception { /** - * The constructor for the BCMAPIException class + * The constructor for the BC_MAPIException class * @access Public * @since 1.0.0 - * @param object [$obj] A pointer to the BCMAPI class + * @param object [$obj] A pointer to the BC_MAPI class * @param int [$error_code] The error code * @param string [$raw_error] Any additional error information */ - public function __construct(BCMAPI $obj, $error_code, $raw_error = NULL) + public function __construct(BC_MAPI $obj, $error_code, $raw_error = NULL) { $error = $obj->getErrorAsString($error_code); @@ -1549,17 +1549,17 @@ public function __construct(BCMAPI $obj, $error_code, $raw_error = NULL) } } -class BCMAPIApiError extends BCMAPIException{} -class BCMAPIDeprecated extends BCMAPIException{} -class BCMAPIDtoDoesNotExist extends BCMAPIException{} -class BCMAPIIdNotProvided extends BCMAPIException{} -class BCMAPIInvalidFileType extends BCMAPIException{} -class BCMAPIInvalidMethod extends BCMAPIException{} -class BCMAPIInvalidProperty extends BCMAPIException{} -class BCMAPIInvalidType extends BCMAPIException{} -class BCMAPIInvalidUploadOption extends BCMAPIException{} -class BCMAPISearchTermsNotProvided extends BCMAPIException{} -class BCMAPITokenError extends BCMAPIException{} -class BCMAPITransactionError extends BCMAPIException{} +class BC_MAPIApiError extends BC_MAPIException{} +class BC_MAPIDeprecated extends BC_MAPIException{} +class BC_MAPIDtoDoesNotExist extends BC_MAPIException{} +class BC_MAPIIdNotProvided extends BC_MAPIException{} +class BC_MAPIInvalidFileType extends BC_MAPIException{} +class BC_MAPIInvalidMethod extends BC_MAPIException{} +class BC_MAPIInvalidProperty extends BC_MAPIException{} +class BC_MAPIInvalidType extends BC_MAPIException{} +class BC_MAPIInvalidUploadOption extends BC_MAPIException{} +class BC_MAPISearchTermsNotProvided extends BC_MAPIException{} +class BC_MAPITokenError extends BC_MAPIException{} +class BC_MAPITransactionError extends BC_MAPIException{} ?> diff --git a/bc-mapi-cache.php b/BC_MAPICache.php similarity index 98% rename from bc-mapi-cache.php rename to BC_MAPICache.php index 2c08d9c..abd0719 100644 --- a/bc-mapi-cache.php +++ b/BC_MAPICache.php @@ -36,7 +36,7 @@ * SUPPORT OF ANY KIND IS PROVIDED FOR THE SOFTWARE. */ -class BCMAPICache +class BC_MAPICache { public static $extension = NULL; public static $location = NULL; @@ -46,7 +46,7 @@ class BCMAPICache public static $type = NULL; /** - * The constructor for the BCMAPICache class. + * The constructor for the BC_MAPICache class. * @access Public * @since 1.0.0 * @param string [$type] The type of caching method to use, either 'file' or 'memcached' diff --git a/README.md b/README.md index cb1780e..3a51d4a 100644 --- a/README.md +++ b/README.md @@ -36,12 +36,12 @@ Then, after instantiating the core class, you can instantiate the caching extension. // Using flat files - $bc = new BCMAPI(API_READ_TOKEN, API_WRITE_TOKEN); - $bc_cache = new BCMAPICache('file', 600, '/var/www/myWebSite/cache/', '.cache'); + $bc = new BC_MAPI(API_READ_TOKEN, API_WRITE_TOKEN); + $bc_cache = new BC_MAPICache('file', 600, '/var/www/myWebSite/cache/', '.cache'); // Using Memcached - $bc = new BCMAPI(API_READ_TOKEN, API_WRITE_TOKEN); - $bc_cache = new BCMAPICache('memcached', 600, 'localhost', NULL, 11211); + $bc = new BC_MAPI(API_READ_TOKEN, API_WRITE_TOKEN); + $bc_cache = new BC_MAPICache('memcached', 600, 'localhost', NULL, 11211); The parameters for the constructor are: From 38d9cd1090fd3a52dae08d0ef98bb3647a396258 Mon Sep 17 00:00:00 2001 From: Jon Williams Date: Wed, 2 May 2012 17:57:01 -0400 Subject: [PATCH 5/7] moved stuff into subdirectory to comply with PEAR standards --- BC_MAPI.php => BC/MAPI.php | 0 BC_MAPICache.php => BC/MAPICache.php | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename BC_MAPI.php => BC/MAPI.php (100%) rename BC_MAPICache.php => BC/MAPICache.php (100%) diff --git a/BC_MAPI.php b/BC/MAPI.php similarity index 100% rename from BC_MAPI.php rename to BC/MAPI.php diff --git a/BC_MAPICache.php b/BC/MAPICache.php similarity index 100% rename from BC_MAPICache.php rename to BC/MAPICache.php From 059ea99f296de7df4533f1fa16321f7cd15683f3 Mon Sep 17 00:00:00 2001 From: Jon Williams Date: Wed, 2 May 2012 17:57:01 -0400 Subject: [PATCH 6/7] moved stuff into subdirectory to comply with PEAR standards --- BC_MAPI.php => BC/MAPI.php | 0 BC_MAPICache.php => BC/MAPICache.php | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename BC_MAPI.php => BC/MAPI.php (100%) rename BC_MAPICache.php => BC/MAPICache.php (100%) diff --git a/BC_MAPI.php b/BC/MAPI.php similarity index 100% rename from BC_MAPI.php rename to BC/MAPI.php diff --git a/BC_MAPICache.php b/BC/MAPICache.php similarity index 100% rename from BC_MAPICache.php rename to BC/MAPICache.php From f137563fc600742ab381dfd83dc1a1d4d0c31171 Mon Sep 17 00:00:00 2001 From: Jon Williams Date: Mon, 7 May 2012 15:31:12 -0400 Subject: [PATCH 7/7] Don't trigger autoloading with class_exists() --- BC/MAPI.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BC/MAPI.php b/BC/MAPI.php index 42758f9..758aa68 100644 --- a/BC/MAPI.php +++ b/BC/MAPI.php @@ -1231,7 +1231,7 @@ protected function appendParams($method, $params = NULL, $default = NULL) */ protected function getData($url) { - if(class_exists('BC_MAPICache')) + if(class_exists('BC_MAPICache',false)) { $cache = BC_MAPICache::get($url); @@ -1286,7 +1286,7 @@ protected function getData($url) throw new BC_MAPIApiError($this, self::ERROR_API_ERROR, $response_object); } } else { - if(class_exists('BC_MAPICache')) + if(class_exists('BC_MAPICache',false)) { $cache = BC_MAPICache::set($url, $response_object); }