在许多文档中,以及关于Google PHP API客户端的许多问题中,它显示的代码如下:
<?php
require_once 'google-api-php-client/src/Google_Client.php';
require_once 'google-api-php-client/src/contrib/Google_StorageService.php';
但现在使用自动加载器时,这是不必要的吗?
<?php
require_once realpath(dirname(__FILE__).'/google-api-php-client/src/Google/autoload.php');
是的,它替换了所有单独的require_once
调用。