8000 Merge remote-tracking branch 'upstream/master' · codezninja/codebird-php@86d5d1a · GitHub
[go: up one dir, main page]

Skip to content

Commit 86d5d1a

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents fa414b1 + 5e3148c commit 86d5d1a

File tree

3 files changed

+23
-20
lines changed

3 files changed

+23
-20
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
codebird-php - changelog
22
========================
33

4+
2.3.2 (2013-04-09)
5+
+ Use protected keyword for methods that may be overriden in extended classes
6+
47
2.3.1 (2013-03-23)
58
- Re-remove statuses/sample. It's streaming API, which Codebird doesn't currently support
69
+ Don't send multipart POST to non-multipart methods, fix issue #8

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mynetx/codebird-php",
33
"description" : "A Twitter library in PHP.",
4-
"version": "2.3.1",
4+
"version": "2.3.2",
55
"autoload": {
66
"classmap": ["src/"]
77
},

src/codebird.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* A Twitter library in PHP.
55
*
66
* @package codebird
7-
* @version 2.3.1
7+
* @version 2.3.2
88
* @author J.M. <me@mynetx.net>
99
* @copyright 2010-2013 J.M. <me@mynetx.net>
1010
*
@@ -49,52 +49,52 @@ class Codebird
4949
/**
5050
* The OAuth consumer key of your registered app
5151
*/
52-
private static $_oauth_consumer_key = null;
52+
protected static $_oauth_consumer_key = null;
5353

5454
/**
5555
* The corresponding consumer secret
5656
*/
57-
private static $_oauth_consumer_secret = null;
57+
protected static $_oauth_consumer_secret = null;
5858

5959
/**
6060
* The app-only bearer token. Used to authorize app-only requests
6161
*/
62-
private static $_oauth_bearer_token = null;
62+
protected static $_oauth_bearer_token = null;
6363

6464
/**
6565
* The API endpoint to use
6666
*/
67-
private static $_endpoint = 'https://api.twitter.com/1.1/';
67+
protected static $_endpoint = 'https://api.twitter.com/1.1/';
6868

6969
/**
7070
* The API endpoint to use for OAuth requests
7171
*/
72-
private static $_endpoint_oauth = 'https://api.twitter.com/';
72+
protected static $_endpoint_oauth = 'https://api.twitter.com/';
7373

7474
/**
7575
* The Request or access token. Used to sign requests
7676
*/
77-
private $_oauth_token = null;
77+
protected $_oauth_token = null;
7878

7979
/**
8080
* The corresponding request or access token secret
8181
*/
82-
private $_oauth_token_secret = null;
82+
protected $_oauth_token_secret = null;
8383

8484
/**
8585
* The format of data to return from API calls
8686
*/
87-
private $_return_format = CODEBIRD_RETURNFORMAT_OBJECT;
87+
protected $_return_format = CODEBIRD_RETURNFORMAT_OBJECT;
8888

8989
/**
9090
* The file formats that Twitter accepts as image uploads
9191
*/
92-
private $_supported_media_files = array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG);
92+
protected $_supported_media_files = array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG);
9393

9494
/**
9595
* The current Codebird version
9696
*/
97-
private $_version = '2.3.1';
97+
protected $_version = '2.3.2';
9898

9999
/**
100100
* Returns singleton class instance
@@ -420,7 +420,7 @@ private function _sha1($data)
420420
*
421421
* @return string The random string
422422
*/
423-
private function _nonce($length = 8)
423+
protected function _nonce($length = 8)
424424
{
425425
if ($length < 1) {
426426
throw new Exception('Invalid nonce length.');
@@ -437,7 +437,7 @@ private function _nonce($length = 8)
437437
*
438438
* @return string Authorization HTTP header
439439
*/
440-
private function _sign($httpmethod, $method, $params = array())
440+
protected function _sign($httpmethod, $method, $params = array())
441441
{
442442
if (self::$_oauth_consumer_key == null) {
443443
throw new Exception('To generate a signature, the consumer key must be set.');
@@ -487,7 +487,7 @@ private function _sign($httpmethod, $method, $params = array())
487487
*
488488
* @return string The HTTP method that should be used
489489
*/
490-
private function _detectMethod($method, $params)
490+
protected function _detectMethod($method, $params)
491491
{
492492
// multi-HTTP method endpoints
493493
switch($method) {
@@ -659,7 +659,7 @@ private function _detectMethod($method, $params)
659659
*
660660
* @return bool Whether the method should be sent as multipart
661661
*/
662-
private function _detectMultipart($method)
662+
protected function _detectMultipart($method)
663663
{
664664
$multiparts = array(
665665
// Tweets
@@ -681,7 +681,7 @@ private function _detectMultipart($method)
681681
*
682682
* @return void
683683
*/
684-
private function _detectFilenames($method, &$params)
684+
protected function _detectFilenames($method, &$params)
685685
{
686686
// well, files will only work in multipart methods
687687
if (! $this->_detectMultipart($method)) {
@@ -749,7 +749,7 @@ private function _detectFilenames($method, &$params)
749749
*
750750
* @return string The URL to send the request to
751751
*/
752-
private function _getEndpoint($method, $method_template)
752+
protected function _getEndpoint($method, $method_template)
753753
{
754754
if (substr($method, 0, 5) == 'oauth') {
755755
$url = self::$_endpoint_oauth . $method;
@@ -772,7 +772,7 @@ private function _getEndpoint($method, $method_template)
772772
* @return mixed The API reply, encoded in the set return_format
773773
*/
774774

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)
776776
{
777777
if (! function_exists('curl_init')) {
778778
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
837837
*
838838
* @return array|object The parsed reply
839839
*/
840-
private function _parseApiReply($method, $reply)
840+
protected function _parseApiReply($method, $reply)
841841
{
842842
// split headers and body
843843
$headers = array();

0 commit comments

Comments
 (0)
0