Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何将Cloudflare库添加到codeigniter_Php_Codeigniter - Fatal编程技术网

Php 如何将Cloudflare库添加到codeigniter

Php 如何将Cloudflare库添加到codeigniter,php,codeigniter,Php,Codeigniter,我突然来了,想在codigniter中实现 如何在源代码中使用此cloudflare库 这是中间代码: require_once(APPPATH.'libraries/Cloudflare/API/'); $key = new Cloudflare\API\Auth\APIKey(CLOUDFLARE_API_USER, CLOUDFLARE_API_USER); $adapter = new Cloudflare\API\Adapter\

我突然来了,想在codigniter中实现

如何在源代码中使用此cloudflare库

这是中间代码:

        require_once(APPPATH.'libraries/Cloudflare/API/');
        $key     = new Cloudflare\API\Auth\APIKey(CLOUDFLARE_API_USER, CLOUDFLARE_API_USER);
        $adapter = new Cloudflare\API\Adapter\Guzzle($key);
        $user    = new Cloudflare\API\Endpoints\User($adapter);
错误消息是:

消息:需要\u一次(…\application\libraries\Cloudflare\API): 无法打开流:权限被拒绝

  • 我已经安装了composer并添加了
    require_once('vendor/autoload.php')如中的示例所示,现在显示以下错误消息:
  • 消息:require_once(vendor/autoload.php):无法打开流:否 这样的文件或目录

    请帮忙。谢谢

    需要一次(APPPATH.libraries/Cloudflare/API/)是一个目录

    您需要使用:

    安装它:

    • composer需要cloudflare/sdk
    然后使用composer的自动加载器:

    <?php
    require 'vendor/autoload.php';
    
    $key     = new Cloudflare\API\Auth\APIKey('user@example.com', 'apiKey');
    $adapter = new Cloudflare\API\Adapter\Guzzle($key);
    $user    = new Cloudflare\API\Endpoints\User($adapter);
    
    echo $user->getUserID();
    

    该代码有什么问题?错误是权限被拒绝