我的 bootstrap.php 中包含了类,并且在包含的类中实例化了变量,当我包含 bootstrap.php 时,它给了我对非对象上的成员函数的调用
引导程序.php
require_once "config/constants.php";
require_once "libraries/Dropbox/DropboxClient.php";
$dropbox = new DropboxClient(array(
'app_key' => DROPBOX_CONSUMER_KEY,
'app_secret' => DROPBOX_CONSUMER_SECRET,
'app_full_access' => true,
),'en');
索引.php
require_once "bootstrap.php";
dropbox_file_tree();
function dropbox_file_tree()
{
if(!empty($access_token)) {
$dropbox->SetAccessToken($access_token);
}
$files = $dropbox->GetFiles("",true);
print_r($files);
}