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
@@ -414,7 +414,7 @@ private function _sha1($data)
414
414
*
415
415
* @return string The random string
416
416
*/
417
- private function _nonce ($ length = 8 )
417
+ protected function _nonce ($ length = 8 )
418
418
{
419
419
if ($ length < 1 ) {
420
420
throw new Exception ('Invalid nonce length. ' );
@@ -431,7 +431,7 @@ private function _nonce($length = 8)
431
431
*
432
432
* @return string Authorization HTTP header
433
433
*/
434
- private function _sign ($ httpmethod , $ method , $ params = array ())
434
+ protected function _sign ($ httpmethod , $ method , $ params = array ())
435
435
{
436
436
if (self ::$ _oauth_consumer_key == null ) {
437
437
throw new Exception ('To generate a signature, the consumer key must be set. ' );
@@ -481,7 +481,7 @@ private function _sign($httpmethod, $method, $params = array())
481
481
*
482
482
* @return string The HTTP method that should be used
483
483
*/
484
- private function _detectMethod ($ method , $ params )
484
+ protected function _detectMethod ($ method , $ params )
485
485
{
486
486
// multi-HTTP method endpoints
487
487
switch ($ method ) {
@@ -653,7 +653,7 @@ private function _detectMethod($method, $params)
653
653
*
654
654
* @return bool Whether the method should be sent as multipart
655
655
*/
656
- private function _detectMultipart ($ method )
656
+ protected function _detectMultipart ($ method )
657
657
{
658
658
$ multiparts = array (
659
659
// Tweets
@@ -675,7 +675,7 @@ private function _detectMultipart($method)
675
675
*
676
676
* @return void
677
677
*/
678
- private function _detectFilenames ($ method , &$ params )
678
+ protected function _detectFilenames ($ method , &$ params )
679
679
{
680
680
// well, files will only work in multipart methods
681
681
if (! $ this ->_detectMultipart ($ method )) {
@@ -743,7 +743,7 @@ private function _detectFilenames($method, &$params)
743
743
*
744
744
* @return string The URL to send the request to
745
745
*/
746
- private function _getEndpoint ($ method , $ method_template )
746
+ protected function _getEndpoint ($ method , $ method_template )
747
747
{
748
748
if (substr ($ method , 0 , 5 ) == 'oauth ' ) {
749
749
$ url = self ::$ _endpoint_oauth . $ method ;
@@ -766,7 +766,7 @@ private function _getEndpoint($method, $method_template)
766
766
* @return mixed The API reply, encoded in the set return_format
767
767
*/
768
768
769
- private function _callApi ($ httpmethod , $ method , $ method_template , $ params = array (), $ multipart = false , $ app_only_auth = false )
769
+ protected function _callApi ($ httpmethod , $ method , $ method_template , $ params = array (), $ multipart = false , $ app_only_auth = false )
770
770
{
771
771
if (! function_exists ('curl_init ' )) {
772
772
throw new Exception ('To make API requests, the PHP curl extension must be available. ' );
@@ -831,7 +831,7 @@ private function _callApi($httpmethod, $method, $method_template, $params = arra
831
831
*
832
832
* @return array|object The parsed reply
833
833
*/
834
- private function _parseApiReply ($ method , $ reply )
834
+ protected function _parseApiReply ($ method , $ reply )
835
835
{
836
836
// split headers and body
837
837
$ headers = array ();
0 commit comments