I try to set file Cache for OAuth like this:
OpenPayU_Configuration::setOauthTokenCache(new OauthCacheFile('/home/user/domains/mydomain.com/public_html/var/payu_cache'));
But I got error like this:
Cache directory [/home/user/domains/mydomain.com/public_html/vendor/openpayu/openpayu
/lib/OpenPayU/Oauth/Cache/../../../Cache] not exist or not writable
So it seems like the code doesn't take $directory into account.
See the code of OauthCacheFile :
public function __construct($directory = null)
{
//1
if ($directory === null) {
$directory = dirname(__FILE__).'/../../../Cache';
}
//2
if (!is_dir($directory) || !is_writable($directory)) {
//3
throw new OpenPayU_Exception_Configuration('Cache directory [' . $directory . '] not exist or not writable.');
}
$this->directory = $directory . (substr($directory, -1) != '/' ? '/' : '');
}
I have echoed $directory and in:
1 it is OK,
2 it is OK,
3 it is OK
and then OpenPayU_Exception_Configuration throws error like this:
Cache directory [/home/user/domains/mydomain.com/public_html/vendor/openpayu/openpayu /lib/OpenPayU/Oauth/Cache/../../../Cache] not exist or not writable
Why this is not working? How on earth OpenPayU_Exception_Configuration takes default $directory as a parameter of the error message instead of the one passed as constructor parameter?
I try to set file Cache for OAuth like this:
OpenPayU_Configuration::setOauthTokenCache(new OauthCacheFile('/home/user/domains/mydomain.com/public_html/var/payu_cache'));
But I got error like this:
So it seems like the code doesn't take
$directory
into account.See the code of
OauthCacheFile
:I have echoed
$directory
and in: 1 it is OK, 2 it is OK, 3 it is OKand then
OpenPayU_Exception_Configuration
throws error like this:Cache directory [/home/user/domains/mydomain.com/public_html/vendor/openpayu/openpayu /lib/OpenPayU/Oauth/Cache/../../../Cache] not exist or not writable
Why this is not working? How on earth
OpenPayU_Exception_Configuration
takes default$directory
as a parameter of the error message instead of the one passed as constructor parameter?