| 1 |
<?php |
| 2 |
|
| 3 |
namespace Vimeography\Basic; |
| 4 |
|
| 5 |
class Core extends \Vimeography\Core { |
| 6 |
|
| 7 |
public function __construct( $engine ) { |
| 8 |
parent::__construct( $engine ); |
| 9 |
|
| 10 |
$token = trim( get_option('vimeography_access_token') ); |
| 11 |
|
| 12 |
$this->_auth = $token ? $token : VIMEOGRAPHY_ACCESS_TOKEN; |
| 13 |
$this->_vimeo = new \Vimeography\Vimeo( NULL, NULL, $this->_auth ); |
| 14 |
} |
| 15 |
|
| 16 |
/** |
| 17 |
* Checks if the provided resource is a valid resource. |
| 18 |
* |
| 19 |
* @param string $resource A Vimeo API resource |
| 20 |
* @return int 1 if match found, 0 if not. |
| 21 |
*/ |
| 22 |
protected function _verify_vimeo_resource( $resource ) { |
| 23 |
return preg_match( '#^/(users|channels|albums|groups)/(.+)#', $resource ); |
| 24 |
} |
| 25 |
|
| 26 |
} |
| 27 |
|