| 1 |
<?php |
| 2 |
|
| 3 |
require_once dirname( __FILE__ ) . '/class.json-api-token.php'; |
| 4 |
|
| 5 |
abstract class SAL_Platform { |
| 6 |
public $token; |
| 7 |
|
| 8 |
function __construct( $token ) { |
| 9 |
if ( is_array( $token ) ) { |
| 10 |
$token = SAL_Token::from_rest_token( $token ); |
| 11 |
} else { |
| 12 |
$token = SAL_Token::for_anonymous_user(); |
| 13 |
} |
| 14 |
|
| 15 |
$this->token = $token; |
| 16 |
} |
| 17 |
|
| 18 |
abstract public function get_site( $blog_id ); |
| 19 |
} |
| 20 |
|
| 21 |
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { |
| 22 |
require_once dirname( __FILE__ ) . '/class.json-api-platform-wpcom.php'; |
| 23 |
} else { |
| 24 |
require_once dirname( __FILE__ ) . '/class.json-api-platform-jetpack.php'; |
| 25 |
} |
| 26 |
|