Implement storage defaulting to the old one and required when using as PHAR

This commit is contained in:
Niklas Keller
2016-03-23 19:33:26 +01:00
parent 1a06a5cadf
commit 9ea97f18e1
6 changed files with 74 additions and 16 deletions

View File

@@ -2,6 +2,7 @@
namespace Kelunik\AcmeClient;
use Phar;
use Webmozart\Assert\Assert;
function suggestCommand($badCommand, array $commands, $suggestThreshold = 70) {
@@ -56,4 +57,16 @@ function serverToKeyname($server) {
$keyFile = preg_replace("@\\.+@", ".", $keyFile);
return $keyFile;
}
function isPhar() {
if (!class_exists("Phar")) {
return false;
}
return Phar::running(true) !== "";
}
function normalizePath($path) {
return rtrim(str_replace("\\", "/", $path), "/");
}