4
4
* A Twitter library in PHP.
5
5
*
6
6
* @package codebird
7
- * @version 2.3.1
7
+ * @version 2.3.2
8
8
* @author J.M. <me@mynetx.net>
9
9
* @copyright 2010-2013 J.M. <me@mynetx.net>
10
10
*
@@ -49,52 +49,52 @@ class Codebird
49
49
/**
50
50
* The OAuth consumer key of your registered app
51
51
*/
52
- private static $ _oauth_consumer_key = null ;
52
+ protected static $ _oauth_consumer_key = null ;
53
53
54
54
/**
55
55
* The corresponding consumer secret
56
56
*/
57
- private static $ _oauth_consumer_secret = null ;
57
+ protected static $ _oauth_consumer_secret = null ;
58
58
59
59
/**
60
60
* The app-only bearer token. Used to authorize app-only requests
61
61
*/
62
- private static $ _oauth_bearer_token = null ;
62
+ protected static $ _oauth_bearer_token = null ;
63
63
64
64
/**
65
65
* The API endpoint to use
66
66
*/
67
- private static $ _endpoint = 'https://api.twitter.com/1.1/ ' ;
67
+ protected static $ _endpoint = 'https://api.twitter.com/1.1/ ' ;
68
68
69
69
/**
70
70
* The API endpoint to use for OAuth requests
71
71
*/
72
- private static $ _endpoint_oauth = 'https://api.twitter.com/ ' ;
72
+ protected static $ _endpoint_oauth = 'https://api.twitter.com/ ' ;
73
73
74
74
/**
75
75
* The Request or access token. Used to sign requests
76
76
*/
77
- private $ _oauth_token = null ;
77
+ protected $ _oauth_token = null ;
78
78
79
79
/**
80
80
* The corresponding request or access token secret
81
81
*/
82
- private $ _oauth_token_secret = null ;
82
+ protected $ _oauth_token_secret = null ;
83
83
84
84
/**
85
85
* The format of data to return from API calls
86
86
*/
87
- private $ _return_format = CODEBIRD_RETURNFORMAT_OBJECT ;
87
+ protected $ _return_format = CODEBIRD_RETURNFORMAT_OBJECT ;
88
88
89
89
/**
90
90
* The file formats that Twitter accepts as image uploads
91
91
*/
92
- private $ _supported_media_files = array (IMAGETYPE_GIF , IMAGETYPE_JPEG , IMAGETYPE_PNG );
92
+ protected $ _supported_media_files = array (IMAGETYPE_GIF , IMAGETYPE_JPEG , IMAGETYPE_PNG );
93
93
94
94
/**
95
95
* The current Codebird version
96
96
*/
97
- private $ _version = '2.3.1 ' ;
97
+ protected $ _version = '2.3.2 ' ;
98
98
99
99
/**
100
100
* Returns singleton class instance
@@ -420,7 +420,7 @@ private function _sha1($data)
420
420
*
421
421
* @return string The random string
422
422
*/
423
- private function _nonce ($ length = 8 )
423
+ protected function _nonce ($ length = 8 )
424
424
{
425
425
if ($ length < 1 ) {
426
426
throw new Exception ('Invalid nonce length. ' );
@@ -437,7 +437,7 @@ private function _nonce($length = 8)
437
437
*
438
438
* @return string Authorization HTTP header
439
439
*/
440
- private function _sign ($ httpmethod , $ method , $ params = array ())
440
+ protected function _sign ($ httpmethod , $ method , $ params = array ())
441
441
{
442
442
if (self ::$ _oauth_consumer_key == null ) {
443
443
throw new Exception ('To generate a signature, the consumer key must be set. ' );
@@ -487,7 +487,7 @@ private function _sign($httpmethod, $method, $params = array())
487
487
*
488
488
* @return string The HTTP method that should be used
489
489
*/
490
- private function _detectMethod ($ method , $ params )
490
+ protected function _detectMethod ($ method , $ params )
491
491
{
492
492
// multi-HTTP method endpoints
493
493
switch ($ method ) {
@@ -659,7 +659,7 @@ private function _detectMethod($method, $params)
659
659
*
660
660
* @return bool Whether the method should be sent as multipart
661
661
*/
662
- private function _detectMultipart ($ method )
662
+ protected function _detectMultipart ($ method )
663
663
{
664
664
$ multiparts = array (
665
665
// Tweets
@@ -681,7 +681,7 @@ private function _detectMultipart($method)
681
681
*
682
682
* @return void
683
683
*/
684
- private function _detectFilenames ($ method , &$ params )
684
+ protected function _detectFilenames ($ method , &$ params )
685
685
{
686
686
// well, files will only work in multipart methods
687
687
if (! $ this ->_detectMultipart ($ method )) {
@@ -749,7 +749,7 @@ private function _detectFilenames($method, &$params)
749
749
*
750
750
* @return string The URL to send the request to
751
751
*/
752
- private function _getEndpoint ($ method , $ method_template )
752
+ protected function _getEndpoint ($ method , $ method_template )
753
753
{
754
754
if (substr ($ method , 0 , 5 ) == 'oauth ' ) {
755
755
$ url = self ::$ _endpoint_oauth . $ method ;
@@ -772,7 +772,7 @@ private function _getEndpoint($method, $method_template)
772
772
* @return mixed The API reply, encoded in the set return_format
773
773
*/
774
774
775
- private function _callApi ($ httpmethod , $ method , $ method_template , $ params = array (), $ multipart = false , $ app_only_auth = false )
775
+ protected function _callApi ($ httpmethod , $ method , $ method_template , $ params = array (), $ multipart = false , $ app_only_auth = false )
776
776
{
777
777
if (! function_exists ('curl_init ' )) {
778
778
throw new Exception ('To make API requests, the PHP curl extension must be available. ' );
@@ -837,7 +837,7 @@ private function _callApi($httpmethod, $method, $method_template, $params = arra
837
837
*
838
838
* @return array|object The parsed reply
839
839
*/
840
- private function _parseApiReply ($ method , $ reply )
840
+ protected function _parseApiReply ($ method , $ reply )
841
841
{
842
842
// split headers and body
843
843
$ headers = array ();
0 commit comments