secuconnect / secuconnect-php-sdk

The PHP-SDK for the secuconnect API
http://developer.secuconnect.com/
Apache License 2.0
1 stars 1 forks source link

Error when initializing Authenticator mkdir() permission denied #2

Open seddik opened 5 years ago

seddik commented 5 years ago
 $auth =  Authenticator::authenticateByClientCredentials($clientId, $clientSecret);
    $accessToken = $auth->getToken();
    Configuration::getDefaultConfiguration()->setAccessToken($accessToken);

The exception :

public function __construct($dir = null)
{

    if (is_dir($dir)) {
        $this->dir = $dir;
    } else {
        $this->dir = self::DEFAULT_FOLDER;

        if (!file_exists($this->dir)) {
            if (!mkdir($this->dir)) {
                return null;
            }
        }
    }
}

I've got : mkdir(): Permission denied exception, when I debugged the directory name was 'tmp'

I am using laravel 5.8 (Php 7.2) and composer

seddik commented 5 years ago

you should maybe consider using

const DEFAULT_FOLDER =__DIR__.DIRECTORY_SEPARATOR. 'tmp';

in Cache/FileCache.php