我遵循入门指南,使用wordpress (https://developer.vimeo.com/api/guides/start) bug在网站上实现Vimeo,我对非常基本的代码有一个问题:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$pathToAutoload = get_template_directory().'/vendor/autoload.php';
require $pathToAutoload;
use Vimeo\Vimeo;
$client = new Vimeo(
"myClientId",
"myClientSecret",
"myAccessToken"
);
$response = $client->request('/tutorial', array(), 'GET');
print_r($response);
?>我知道这个错误:
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /Users/Robin/Documents/Works/mySite/v4/wordpress/wp-content/themes/my-theme/vendor/vimeo/vimeo-api/src/Vimeo/Vimeo.php on line 88看起来错误来自库本身。在这一行中出现错误的代码如下:
public function request($url, $params = array(), $method = 'GET', $json_body = true, array $headers = array()): array知道怎么调试吗?
(我正在使用MAMP Pro和PHP 5.6.37)
发布于 2019-02-19 16:50:02
若要使用Vimeo库,必须有PHPVIL7.1.0,请检查下面>=上的要求
https://packagist.org/packages/vimeo/vimeo-api
或者尝试与PHPPH5.3.0兼容的旧版本(如果它仍然有效的话),
https://stackoverflow.com/questions/54771131
复制相似问题