CLEANUP
* Updated `composer.phar` to latest version * Remove libs that get installed by Composer from repo (run `./composer.phar install` after checkout) * Change `composer.json` to use default `vendor` dir and raise max. PHP to 7.99.99 since we're at 7.4 now * Rename `README.markdown` to `README.md`
This commit is contained in:
parent
be2de1a0ed
commit
5d696b6842
3
.gitignore
vendored
3
.gitignore
vendored
@ -4,9 +4,6 @@ templates_c/*
|
||||
serendipity_config_local.inc.php
|
||||
plugins/additional_plugins*
|
||||
|
||||
# php stuff
|
||||
composer.lock
|
||||
|
||||
# ide / dev stuff
|
||||
.cvsignore
|
||||
.htaccess*
|
||||
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitcbda25b16bb8365467298ce193f0f30c::getLoader();
|
@ -1,479 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
/**
|
||||
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
||||
*
|
||||
* $loader = new \Composer\Autoload\ClassLoader();
|
||||
*
|
||||
* // register classes with namespaces
|
||||
* $loader->add('Symfony\Component', __DIR__.'/component');
|
||||
* $loader->add('Symfony', __DIR__.'/framework');
|
||||
*
|
||||
* // activate the autoloader
|
||||
* $loader->register();
|
||||
*
|
||||
* // to enable searching the include path (eg. for PEAR packages)
|
||||
* $loader->setUseIncludePath(true);
|
||||
*
|
||||
* In this example, if you try to use a class in the Symfony\Component
|
||||
* namespace or one of its children (Symfony\Component\Console for instance),
|
||||
* the autoloader will first look for the class under the component/
|
||||
* directory, and it will then fallback to the framework/ directory if not
|
||||
* found before giving up.
|
||||
*
|
||||
* This class is loosely based on the Symfony UniversalClassLoader.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
* @see https://www.php-fig.org/psr/psr-0/
|
||||
* @see https://www.php-fig.org/psr/psr-4/
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
private $vendorDir;
|
||||
|
||||
// PSR-4
|
||||
private $prefixLengthsPsr4 = array();
|
||||
private $prefixDirsPsr4 = array();
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
private $prefixesPsr0 = array();
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
private $useIncludePath = false;
|
||||
private $classMap = array();
|
||||
private $classMapAuthoritative = false;
|
||||
private $missingClasses = array();
|
||||
private $apcuPrefix;
|
||||
|
||||
private static $registeredLoaders = array();
|
||||
|
||||
public function __construct($vendorDir = null)
|
||||
{
|
||||
$this->vendorDir = $vendorDir;
|
||||
}
|
||||
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $classMap Class to filename map
|
||||
*/
|
||||
public function addClassMap(array $classMap)
|
||||
{
|
||||
if ($this->classMap) {
|
||||
$this->classMap = array_merge($this->classMap, $classMap);
|
||||
} else {
|
||||
$this->classMap = $classMap;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
// Register directories for a new namespace.
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 base directories
|
||||
*/
|
||||
public function set($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr0 = (array) $paths;
|
||||
} else {
|
||||
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function setPsr4($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr4 = (array) $paths;
|
||||
} else {
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns on searching the include path for class files.
|
||||
*
|
||||
* @param bool $useIncludePath
|
||||
*/
|
||||
public function setUseIncludePath($useIncludePath)
|
||||
{
|
||||
$this->useIncludePath = $useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be used to check if the autoloader uses the include path to check
|
||||
* for classes.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getUseIncludePath()
|
||||
{
|
||||
return $this->useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns off searching the prefix and fallback directories for classes
|
||||
* that have not been registered with the class map.
|
||||
*
|
||||
* @param bool $classMapAuthoritative
|
||||
*/
|
||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||
{
|
||||
$this->classMapAuthoritative = $classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should class lookup fail if not found in the current class map?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isClassMapAuthoritative()
|
||||
{
|
||||
return $this->classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||
*
|
||||
* @param string|null $apcuPrefix
|
||||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The APCu prefix in use, or null if APCu caching is not enabled.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getApcuPrefix()
|
||||
{
|
||||
return $this->apcuPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers this instance as an autoloader.
|
||||
*
|
||||
* @param bool $prepend Whether to prepend the autoloader or not
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||
|
||||
if (null === $this->vendorDir) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($prepend) {
|
||||
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
||||
} else {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
self::$registeredLoaders[$this->vendorDir] = $this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
|
||||
if (null !== $this->vendorDir) {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return bool|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the path to the file where the class is defined.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
*
|
||||
* @return string|false The path if found, false otherwise
|
||||
*/
|
||||
public function findFile($class)
|
||||
{
|
||||
// class map lookup
|
||||
if (isset($this->classMap[$class])) {
|
||||
return $this->classMap[$class];
|
||||
}
|
||||
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
||||
return false;
|
||||
}
|
||||
if (null !== $this->apcuPrefix) {
|
||||
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
||||
if ($hit) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
$file = $this->findFileWithExtension($class, '.php');
|
||||
|
||||
// Search for Hack files if we are running on HHVM
|
||||
if (false === $file && defined('HHVM_VERSION')) {
|
||||
$file = $this->findFileWithExtension($class, '.hh');
|
||||
}
|
||||
|
||||
if (null !== $this->apcuPrefix) {
|
||||
apcu_add($this->apcuPrefix.$class, $file);
|
||||
}
|
||||
|
||||
if (false === $file) {
|
||||
// Remember that this class does not exist.
|
||||
$this->missingClasses[$class] = true;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently registered loaders indexed by their corresponding vendor directories.
|
||||
*
|
||||
* @return self[]
|
||||
*/
|
||||
public static function getRegisteredLoaders()
|
||||
{
|
||||
return self::$registeredLoaders;
|
||||
}
|
||||
|
||||
private function findFileWithExtension($class, $ext)
|
||||
{
|
||||
// PSR-4 lookup
|
||||
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
||||
|
||||
$first = $class[0];
|
||||
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||
$subPath = $class;
|
||||
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
||||
$subPath = substr($subPath, 0, $lastPos);
|
||||
$search = $subPath . '\\';
|
||||
if (isset($this->prefixDirsPsr4[$search])) {
|
||||
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
||||
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||
if (file_exists($file = $dir . $pathEnd)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-4 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr4 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 lookup
|
||||
if (false !== $pos = strrpos($class, '\\')) {
|
||||
// namespaced class name
|
||||
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
||||
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
||||
} else {
|
||||
// PEAR-like class name
|
||||
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
||||
}
|
||||
|
||||
if (isset($this->prefixesPsr0[$first])) {
|
||||
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($dirs as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr0 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 include paths.
|
||||
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*/
|
||||
function includeFile($file)
|
||||
{
|
||||
include $file;
|
||||
}
|
@ -1,326 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
namespace Composer;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Composer\Semver\VersionParser;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class InstalledVersions
|
||||
{
|
||||
private static $installed = array (
|
||||
'root' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '1e645f52d45985949359c49ab147bcd45d6554f8',
|
||||
'name' => '__root__',
|
||||
),
|
||||
'versions' =>
|
||||
array (
|
||||
'__root__' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '1e645f52d45985949359c49ab147bcd45d6554f8',
|
||||
),
|
||||
'katzgrau/klogger' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.0',
|
||||
'version' => '1.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '46cdd92a9b4a8443120cc955bf831450cb274813',
|
||||
),
|
||||
'psr/log' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.0',
|
||||
'version' => '1.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'fe0936ee26643249e916849d48e3a51d5f5e278b',
|
||||
),
|
||||
'psr/simple-cache' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
|
||||
),
|
||||
'psr/simple-cache-implementation' =>
|
||||
array (
|
||||
'provided' =>
|
||||
array (
|
||||
0 => '1.0',
|
||||
),
|
||||
),
|
||||
'voku/simple-cache' =>
|
||||
array (
|
||||
'pretty_version' => '4.0.5',
|
||||
'version' => '4.0.5.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '416cf88902991f3bf6168b71c0683e6dabb3d5e1',
|
||||
),
|
||||
),
|
||||
);
|
||||
private static $canGetVendors;
|
||||
private static $installedByVendor = array();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
$packages = array();
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
$packages[] = array_keys($installed['versions']);
|
||||
}
|
||||
|
||||
|
||||
if (1 === \count($packages)) {
|
||||
return $packages[0];
|
||||
}
|
||||
|
||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function isInstalled($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints($constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getRootPackage()
|
||||
{
|
||||
$installed = self::getInstalled();
|
||||
|
||||
return $installed[0]['root'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getRawData()
|
||||
{
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
self::$installedByVendor = array();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private static function getInstalled()
|
||||
{
|
||||
if (null === self::$canGetVendors) {
|
||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||
}
|
||||
|
||||
$installed = array();
|
||||
|
||||
if (self::$canGetVendors) {
|
||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$installed[] = self::$installed;
|
||||
|
||||
return $installed;
|
||||
}
|
||||
}
|
@ -1,381 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
namespace Composer;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Composer\Semver\VersionParser;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class InstalledVersions
|
||||
{
|
||||
private static $installed = array (
|
||||
'root' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
<<<<<<< HEAD
|
||||
'reference' => 'ea886da10cdbdad164cd253003e862a0ec7ecd6c',
|
||||
=======
|
||||
'reference' => '05f58f90d743fe9ade24f3fdfe9a934d0b87c6a1',
|
||||
>>>>>>> master
|
||||
'name' => '__root__',
|
||||
),
|
||||
'versions' =>
|
||||
array (
|
||||
'__root__' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
<<<<<<< HEAD
|
||||
'reference' => 'ea886da10cdbdad164cd253003e862a0ec7ecd6c',
|
||||
=======
|
||||
'reference' => '05f58f90d743fe9ade24f3fdfe9a934d0b87c6a1',
|
||||
>>>>>>> master
|
||||
),
|
||||
'katzgrau/klogger' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.0',
|
||||
'version' => '1.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '46cdd92a9b4a8443120cc955bf831450cb274813',
|
||||
),
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
'laminas/laminas-db' =>
|
||||
array (
|
||||
'pretty_version' => '2.11.4',
|
||||
'version' => '2.11.4.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '5b59413b8dd5d79e3fe58c2650c60b1730989f36',
|
||||
),
|
||||
'laminas/laminas-stdlib' =>
|
||||
array (
|
||||
'pretty_version' => '3.2.1',
|
||||
'version' => '3.2.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '2b18347625a2f06a1a485acfbc870f699dbe51c6',
|
||||
),
|
||||
'laminas/laminas-zendframework-bridge' =>
|
||||
array (
|
||||
'pretty_version' => '1.1.1',
|
||||
'version' => '1.1.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '6ede70583e101030bcace4dcddd648f760ddf642',
|
||||
),
|
||||
>>>>>>> master
|
||||
'psr/log' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.0',
|
||||
'version' => '1.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'fe0936ee26643249e916849d48e3a51d5f5e278b',
|
||||
),
|
||||
'psr/simple-cache' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
|
||||
),
|
||||
'psr/simple-cache-implementation' =>
|
||||
array (
|
||||
'provided' =>
|
||||
array (
|
||||
0 => '1.0',
|
||||
),
|
||||
),
|
||||
'voku/simple-cache' =>
|
||||
array (
|
||||
'pretty_version' => '4.0.5',
|
||||
'version' => '4.0.5.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '416cf88902991f3bf6168b71c0683e6dabb3d5e1',
|
||||
),
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
'zendframework/zend-db' =>
|
||||
array (
|
||||
'replaced' =>
|
||||
array (
|
||||
0 => '^2.11.0',
|
||||
),
|
||||
),
|
||||
'zendframework/zend-stdlib' =>
|
||||
array (
|
||||
'replaced' =>
|
||||
array (
|
||||
0 => '3.2.1',
|
||||
),
|
||||
),
|
||||
>>>>>>> master
|
||||
),
|
||||
);
|
||||
private static $canGetVendors;
|
||||
private static $installedByVendor = array();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
$packages = array();
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
$packages[] = array_keys($installed['versions']);
|
||||
}
|
||||
|
||||
|
||||
if (1 === \count($packages)) {
|
||||
return $packages[0];
|
||||
}
|
||||
|
||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function isInstalled($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints($constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getRootPackage()
|
||||
{
|
||||
$installed = self::getInstalled();
|
||||
|
||||
return $installed[0]['root'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getRawData()
|
||||
{
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
self::$installedByVendor = array();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private static function getInstalled()
|
||||
{
|
||||
if (null === self::$canGetVendors) {
|
||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||
}
|
||||
|
||||
$installed = array();
|
||||
|
||||
if (self::$canGetVendors) {
|
||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$installed[] = self::$installed;
|
||||
|
||||
return $installed;
|
||||
}
|
||||
}
|
@ -1,381 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
namespace Composer;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Composer\Semver\VersionParser;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class InstalledVersions
|
||||
{
|
||||
private static $installed = array (
|
||||
'root' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
<<<<<<< HEAD
|
||||
'reference' => 'ea886da10cdbdad164cd253003e862a0ec7ecd6c',
|
||||
=======
|
||||
'reference' => '05f58f90d743fe9ade24f3fdfe9a934d0b87c6a1',
|
||||
>>>>>>> master
|
||||
'name' => '__root__',
|
||||
),
|
||||
'versions' =>
|
||||
array (
|
||||
'__root__' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
<<<<<<< HEAD
|
||||
'reference' => 'ea886da10cdbdad164cd253003e862a0ec7ecd6c',
|
||||
=======
|
||||
'reference' => '05f58f90d743fe9ade24f3fdfe9a934d0b87c6a1',
|
||||
>>>>>>> master
|
||||
),
|
||||
'katzgrau/klogger' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.0',
|
||||
'version' => '1.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '46cdd92a9b4a8443120cc955bf831450cb274813',
|
||||
),
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
'laminas/laminas-db' =>
|
||||
array (
|
||||
'pretty_version' => '2.11.4',
|
||||
'version' => '2.11.4.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '5b59413b8dd5d79e3fe58c2650c60b1730989f36',
|
||||
),
|
||||
'laminas/laminas-stdlib' =>
|
||||
array (
|
||||
'pretty_version' => '3.2.1',
|
||||
'version' => '3.2.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '2b18347625a2f06a1a485acfbc870f699dbe51c6',
|
||||
),
|
||||
'laminas/laminas-zendframework-bridge' =>
|
||||
array (
|
||||
'pretty_version' => '1.1.1',
|
||||
'version' => '1.1.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '6ede70583e101030bcace4dcddd648f760ddf642',
|
||||
),
|
||||
>>>>>>> master
|
||||
'psr/log' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.0',
|
||||
'version' => '1.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'fe0936ee26643249e916849d48e3a51d5f5e278b',
|
||||
),
|
||||
'psr/simple-cache' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
|
||||
),
|
||||
'psr/simple-cache-implementation' =>
|
||||
array (
|
||||
'provided' =>
|
||||
array (
|
||||
0 => '1.0',
|
||||
),
|
||||
),
|
||||
'voku/simple-cache' =>
|
||||
array (
|
||||
'pretty_version' => '4.0.5',
|
||||
'version' => '4.0.5.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '416cf88902991f3bf6168b71c0683e6dabb3d5e1',
|
||||
),
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
'zendframework/zend-db' =>
|
||||
array (
|
||||
'replaced' =>
|
||||
array (
|
||||
0 => '^2.11.0',
|
||||
),
|
||||
),
|
||||
'zendframework/zend-stdlib' =>
|
||||
array (
|
||||
'replaced' =>
|
||||
array (
|
||||
0 => '3.2.1',
|
||||
),
|
||||
),
|
||||
>>>>>>> master
|
||||
),
|
||||
);
|
||||
private static $canGetVendors;
|
||||
private static $installedByVendor = array();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
$packages = array();
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
$packages[] = array_keys($installed['versions']);
|
||||
}
|
||||
|
||||
|
||||
if (1 === \count($packages)) {
|
||||
return $packages[0];
|
||||
}
|
||||
|
||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function isInstalled($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints($constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getRootPackage()
|
||||
{
|
||||
$installed = self::getInstalled();
|
||||
|
||||
return $installed[0]['root'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getRawData()
|
||||
{
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
self::$installedByVendor = array();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private static function getInstalled()
|
||||
{
|
||||
if (null === self::$canGetVendors) {
|
||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||
}
|
||||
|
||||
$installed = array();
|
||||
|
||||
if (self::$canGetVendors) {
|
||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$installed[] = self::$installed;
|
||||
|
||||
return $installed;
|
||||
}
|
||||
}
|
@ -1,326 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
namespace Composer;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Composer\Semver\VersionParser;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class InstalledVersions
|
||||
{
|
||||
private static $installed = array (
|
||||
'root' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'ea886da10cdbdad164cd253003e862a0ec7ecd6c',
|
||||
'name' => '__root__',
|
||||
),
|
||||
'versions' =>
|
||||
array (
|
||||
'__root__' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'ea886da10cdbdad164cd253003e862a0ec7ecd6c',
|
||||
),
|
||||
'katzgrau/klogger' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.0',
|
||||
'version' => '1.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '46cdd92a9b4a8443120cc955bf831450cb274813',
|
||||
),
|
||||
'psr/log' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.0',
|
||||
'version' => '1.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'fe0936ee26643249e916849d48e3a51d5f5e278b',
|
||||
),
|
||||
'psr/simple-cache' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
|
||||
),
|
||||
'psr/simple-cache-implementation' =>
|
||||
array (
|
||||
'provided' =>
|
||||
array (
|
||||
0 => '1.0',
|
||||
),
|
||||
),
|
||||
'voku/simple-cache' =>
|
||||
array (
|
||||
'pretty_version' => '4.0.5',
|
||||
'version' => '4.0.5.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '416cf88902991f3bf6168b71c0683e6dabb3d5e1',
|
||||
),
|
||||
),
|
||||
);
|
||||
private static $canGetVendors;
|
||||
private static $installedByVendor = array();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
$packages = array();
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
$packages[] = array_keys($installed['versions']);
|
||||
}
|
||||
|
||||
|
||||
if (1 === \count($packages)) {
|
||||
return $packages[0];
|
||||
}
|
||||
|
||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function isInstalled($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints($constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getRootPackage()
|
||||
{
|
||||
$installed = self::getInstalled();
|
||||
|
||||
return $installed[0]['root'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getRawData()
|
||||
{
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
self::$installedByVendor = array();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private static function getInstalled()
|
||||
{
|
||||
if (null === self::$canGetVendors) {
|
||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||
}
|
||||
|
||||
$installed = array();
|
||||
|
||||
if (self::$canGetVendors) {
|
||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$installed[] = self::$installed;
|
||||
|
||||
return $installed;
|
||||
}
|
||||
}
|
@ -1,367 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
namespace Composer;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Composer\Semver\VersionParser;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class InstalledVersions
|
||||
{
|
||||
private static $installed = array (
|
||||
'root' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '05f58f90d743fe9ade24f3fdfe9a934d0b87c6a1',
|
||||
'name' => '__root__',
|
||||
),
|
||||
'versions' =>
|
||||
array (
|
||||
'__root__' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '05f58f90d743fe9ade24f3fdfe9a934d0b87c6a1',
|
||||
),
|
||||
'katzgrau/klogger' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.0',
|
||||
'version' => '1.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '46cdd92a9b4a8443120cc955bf831450cb274813',
|
||||
),
|
||||
'laminas/laminas-db' =>
|
||||
array (
|
||||
'pretty_version' => '2.11.4',
|
||||
'version' => '2.11.4.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '5b59413b8dd5d79e3fe58c2650c60b1730989f36',
|
||||
),
|
||||
'laminas/laminas-stdlib' =>
|
||||
array (
|
||||
'pretty_version' => '3.2.1',
|
||||
'version' => '3.2.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '2b18347625a2f06a1a485acfbc870f699dbe51c6',
|
||||
),
|
||||
'laminas/laminas-zendframework-bridge' =>
|
||||
array (
|
||||
'pretty_version' => '1.1.1',
|
||||
'version' => '1.1.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '6ede70583e101030bcace4dcddd648f760ddf642',
|
||||
),
|
||||
'psr/log' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.0',
|
||||
'version' => '1.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'fe0936ee26643249e916849d48e3a51d5f5e278b',
|
||||
),
|
||||
'psr/simple-cache' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
|
||||
),
|
||||
'psr/simple-cache-implementation' =>
|
||||
array (
|
||||
'provided' =>
|
||||
array (
|
||||
0 => '1.0',
|
||||
),
|
||||
),
|
||||
'voku/simple-cache' =>
|
||||
array (
|
||||
'pretty_version' => '4.0.5',
|
||||
'version' => '4.0.5.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '416cf88902991f3bf6168b71c0683e6dabb3d5e1',
|
||||
),
|
||||
'zendframework/zend-db' =>
|
||||
array (
|
||||
'replaced' =>
|
||||
array (
|
||||
0 => '^2.11.0',
|
||||
),
|
||||
),
|
||||
'zendframework/zend-stdlib' =>
|
||||
array (
|
||||
'replaced' =>
|
||||
array (
|
||||
0 => '3.2.1',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
private static $canGetVendors;
|
||||
private static $installedByVendor = array();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
$packages = array();
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
$packages[] = array_keys($installed['versions']);
|
||||
}
|
||||
|
||||
|
||||
if (1 === \count($packages)) {
|
||||
return $packages[0];
|
||||
}
|
||||
|
||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function isInstalled($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints($constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getRootPackage()
|
||||
{
|
||||
$installed = self::getInstalled();
|
||||
|
||||
return $installed[0]['root'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getRawData()
|
||||
{
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
self::$installedByVendor = array();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private static function getInstalled()
|
||||
{
|
||||
if (null === self::$canGetVendors) {
|
||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||
}
|
||||
|
||||
$installed = array();
|
||||
|
||||
if (self::$canGetVendors) {
|
||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$installed[] = self::$installed;
|
||||
|
||||
return $installed;
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
|
||||
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
@ -1,51 +0,0 @@
|
||||
<?php
|
||||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
||||
'Katzgrau\\KLogger\\Logger' => $vendorDir . '/katzgrau/klogger/src/Logger.php',
|
||||
'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php',
|
||||
'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php',
|
||||
'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php',
|
||||
'Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareInterface.php',
|
||||
'Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareTrait.php',
|
||||
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
|
||||
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
|
||||
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
|
||||
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
||||
'Psr\\SimpleCache\\CacheException' => $vendorDir . '/psr/simple-cache/src/CacheException.php',
|
||||
'Psr\\SimpleCache\\CacheInterface' => $vendorDir . '/psr/simple-cache/src/CacheInterface.php',
|
||||
'Psr\\SimpleCache\\InvalidArgumentException' => $vendorDir . '/psr/simple-cache/src/InvalidArgumentException.php',
|
||||
'voku\\cache\\AdapterApc' => $vendorDir . '/voku/simple-cache/src/voku/cache/AdapterApc.php',
|
||||
'voku\\cache\\AdapterApcu' => $vendorDir . '/voku/simple-cache/src/voku/cache/AdapterApcu.php',
|
||||
'voku\\cache\\AdapterArray' => $vendorDir . '/voku/simple-cache/src/voku/cache/AdapterArray.php',
|
||||
'voku\\cache\\AdapterFile' => $vendorDir . '/voku/simple-cache/src/voku/cache/AdapterFile.php',
|
||||
'voku\\cache\\AdapterFileAbstract' => $vendorDir . '/voku/simple-cache/src/voku/cache/AdapterFileAbstract.php',
|
||||
'voku\\cache\\AdapterFileSimple' => $vendorDir . '/voku/simple-cache/src/voku/cache/AdapterFileSimple.php',
|
||||
'voku\\cache\\AdapterMemcache' => $vendorDir . '/voku/simple-cache/src/voku/cache/AdapterMemcache.php',
|
||||
'voku\\cache\\AdapterMemcached' => $vendorDir . '/voku/simple-cache/src/voku/cache/AdapterMemcached.php',
|
||||
'voku\\cache\\AdapterOpCache' => $vendorDir . '/voku/simple-cache/src/voku/cache/AdapterOpCache.php',
|
||||
'voku\\cache\\AdapterPredis' => $vendorDir . '/voku/simple-cache/src/voku/cache/AdapterPredis.php',
|
||||
'voku\\cache\\AdapterXcache' => $vendorDir . '/voku/simple-cache/src/voku/cache/AdapterXcache.php',
|
||||
'voku\\cache\\Cache' => $vendorDir . '/voku/simple-cache/src/voku/cache/Cache.php',
|
||||
'voku\\cache\\CacheAdapterAutoManager' => $vendorDir . '/voku/simple-cache/src/voku/cache/CacheAdapterAutoManager.php',
|
||||
'voku\\cache\\CacheChain' => $vendorDir . '/voku/simple-cache/src/voku/cache/CacheChain.php',
|
||||
'voku\\cache\\CachePsr16' => $vendorDir . '/voku/simple-cache/src/voku/cache/CachePsr16.php',
|
||||
'voku\\cache\\Exception\\ChmodException' => $vendorDir . '/voku/simple-cache/src/voku/cache/Exception/ChmodException.php',
|
||||
'voku\\cache\\Exception\\FileErrorExceptionInterface' => $vendorDir . '/voku/simple-cache/src/voku/cache/Exception/FileErrorExceptionInterface.php',
|
||||
'voku\\cache\\Exception\\InvalidArgumentException' => $vendorDir . '/voku/simple-cache/src/voku/cache/Exception/InvalidArgumentException.php',
|
||||
'voku\\cache\\Exception\\RenameException' => $vendorDir . '/voku/simple-cache/src/voku/cache/Exception/RenameException.php',
|
||||
'voku\\cache\\Exception\\RuntimeException' => $vendorDir . '/voku/simple-cache/src/voku/cache/Exception/RuntimeException.php',
|
||||
'voku\\cache\\Exception\\WriteContentException' => $vendorDir . '/voku/simple-cache/src/voku/cache/Exception/WriteContentException.php',
|
||||
'voku\\cache\\SerializerDefault' => $vendorDir . '/voku/simple-cache/src/voku/cache/SerializerDefault.php',
|
||||
'voku\\cache\\SerializerIgbinary' => $vendorDir . '/voku/simple-cache/src/voku/cache/SerializerIgbinary.php',
|
||||
'voku\\cache\\SerializerMsgpack' => $vendorDir . '/voku/simple-cache/src/voku/cache/SerializerMsgpack.php',
|
||||
'voku\\cache\\SerializerNo' => $vendorDir . '/voku/simple-cache/src/voku/cache/SerializerNo.php',
|
||||
'voku\\cache\\iAdapter' => $vendorDir . '/voku/simple-cache/src/voku/cache/iAdapter.php',
|
||||
'voku\\cache\\iCache' => $vendorDir . '/voku/simple-cache/src/voku/cache/iCache.php',
|
||||
'voku\\cache\\iSerializer' => $vendorDir . '/voku/simple-cache/src/voku/cache/iSerializer.php',
|
||||
);
|
@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Psr\\Log\\' => array($vendorDir . '/psr/log'),
|
||||
);
|
@ -1,12 +0,0 @@
|
||||
<?php
|
||||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'voku\\cache\\' => array($vendorDir . '/voku/simple-cache/src/voku/cache'),
|
||||
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
|
||||
'Katzgrau\\KLogger\\' => array($vendorDir . '/katzgrau/klogger/src'),
|
||||
);
|
@ -1,58 +0,0 @@
|
||||
<?php
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInitcbda25b16bb8365467298ce193f0f30c
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
public static function loadClassLoader($class)
|
||||
{
|
||||
if ('Composer\Autoload\ClassLoader' === $class) {
|
||||
require __DIR__ . '/ClassLoader.php';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Composer\Autoload\ClassLoader
|
||||
*/
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
require __DIR__ . '/platform_check.php';
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitcbda25b16bb8365467298ce193f0f30c', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitcbda25b16bb8365467298ce193f0f30c', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitcbda25b16bb8365467298ce193f0f30c::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
$loader->addClassMap($classMap);
|
||||
}
|
||||
}
|
||||
|
||||
$loader->setApcuPrefix('stPjNJ6R//PsoDT+nlxLT');
|
||||
$loader->register(true);
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
<?php
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInitcbda25b16bb8365467298ce193f0f30c
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
public static function loadClassLoader($class)
|
||||
{
|
||||
if ('Composer\Autoload\ClassLoader' === $class) {
|
||||
require __DIR__ . '/ClassLoader.php';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Composer\Autoload\ClassLoader
|
||||
*/
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
require __DIR__ . '/platform_check.php';
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitcbda25b16bb8365467298ce193f0f30c', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitcbda25b16bb8365467298ce193f0f30c', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitcbda25b16bb8365467298ce193f0f30c::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
$loader->addClassMap($classMap);
|
||||
}
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
$loader->setApcuPrefix('28BtV+nSo+i2r5OI8fIU9');
|
||||
=======
|
||||
$loader->setApcuPrefix('3FCa+2qDld553P2McvH+w');
|
||||
>>>>>>> master
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitcbda25b16bb8365467298ce193f0f30c::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequirecbda25b16bb8365467298ce193f0f30c($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequirecbda25b16bb8365467298ce193f0f30c($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
}
|
||||
}
|
@ -1,104 +0,0 @@
|
||||
<?php
|
||||
|
||||
// autoload_static.php @generated by Composer
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInitcbda25b16bb8365467298ce193f0f30c
|
||||
{
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'v' =>
|
||||
array (
|
||||
'voku\\cache\\' => 11,
|
||||
),
|
||||
'P' =>
|
||||
array (
|
||||
'Psr\\SimpleCache\\' => 16,
|
||||
),
|
||||
'K' =>
|
||||
array (
|
||||
'Katzgrau\\KLogger\\' => 17,
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixDirsPsr4 = array (
|
||||
'voku\\cache\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache',
|
||||
),
|
||||
'Psr\\SimpleCache\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/simple-cache/src',
|
||||
),
|
||||
'Katzgrau\\KLogger\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/katzgrau/klogger/src',
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixesPsr0 = array (
|
||||
'P' =>
|
||||
array (
|
||||
'Psr\\Log\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/log',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
||||
'Katzgrau\\KLogger\\Logger' => __DIR__ . '/..' . '/katzgrau/klogger/src/Logger.php',
|
||||
'Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/AbstractLogger.php',
|
||||
'Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/Psr/Log/InvalidArgumentException.php',
|
||||
'Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/Psr/Log/LogLevel.php',
|
||||
'Psr\\Log\\LoggerAwareInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareInterface.php',
|
||||
'Psr\\Log\\LoggerAwareTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareTrait.php',
|
||||
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php',
|
||||
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php',
|
||||
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php',
|
||||
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
||||
'Psr\\SimpleCache\\CacheException' => __DIR__ . '/..' . '/psr/simple-cache/src/CacheException.php',
|
||||
'Psr\\SimpleCache\\CacheInterface' => __DIR__ . '/..' . '/psr/simple-cache/src/CacheInterface.php',
|
||||
'Psr\\SimpleCache\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/simple-cache/src/InvalidArgumentException.php',
|
||||
'voku\\cache\\AdapterApc' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterApc.php',
|
||||
'voku\\cache\\AdapterApcu' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterApcu.php',
|
||||
'voku\\cache\\AdapterArray' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterArray.php',
|
||||
'voku\\cache\\AdapterFile' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterFile.php',
|
||||
'voku\\cache\\AdapterFileAbstract' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterFileAbstract.php',
|
||||
'voku\\cache\\AdapterFileSimple' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterFileSimple.php',
|
||||
'voku\\cache\\AdapterMemcache' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterMemcache.php',
|
||||
'voku\\cache\\AdapterMemcached' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterMemcached.php',
|
||||
'voku\\cache\\AdapterOpCache' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterOpCache.php',
|
||||
'voku\\cache\\AdapterPredis' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterPredis.php',
|
||||
'voku\\cache\\AdapterXcache' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterXcache.php',
|
||||
'voku\\cache\\Cache' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/Cache.php',
|
||||
'voku\\cache\\CacheAdapterAutoManager' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/CacheAdapterAutoManager.php',
|
||||
'voku\\cache\\CacheChain' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/CacheChain.php',
|
||||
'voku\\cache\\CachePsr16' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/CachePsr16.php',
|
||||
'voku\\cache\\Exception\\ChmodException' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/Exception/ChmodException.php',
|
||||
'voku\\cache\\Exception\\FileErrorExceptionInterface' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/Exception/FileErrorExceptionInterface.php',
|
||||
'voku\\cache\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/Exception/InvalidArgumentException.php',
|
||||
'voku\\cache\\Exception\\RenameException' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/Exception/RenameException.php',
|
||||
'voku\\cache\\Exception\\RuntimeException' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/Exception/RuntimeException.php',
|
||||
'voku\\cache\\Exception\\WriteContentException' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/Exception/WriteContentException.php',
|
||||
'voku\\cache\\SerializerDefault' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/SerializerDefault.php',
|
||||
'voku\\cache\\SerializerIgbinary' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/SerializerIgbinary.php',
|
||||
'voku\\cache\\SerializerMsgpack' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/SerializerMsgpack.php',
|
||||
'voku\\cache\\SerializerNo' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/SerializerNo.php',
|
||||
'voku\\cache\\iAdapter' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/iAdapter.php',
|
||||
'voku\\cache\\iCache' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/iCache.php',
|
||||
'voku\\cache\\iSerializer' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/iSerializer.php',
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitcbda25b16bb8365467298ce193f0f30c::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitcbda25b16bb8365467298ce193f0f30c::$prefixDirsPsr4;
|
||||
$loader->prefixesPsr0 = ComposerStaticInitcbda25b16bb8365467298ce193f0f30c::$prefixesPsr0;
|
||||
$loader->classMap = ComposerStaticInitcbda25b16bb8365467298ce193f0f30c::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
}
|
@ -1,384 +0,0 @@
|
||||
<?php
|
||||
|
||||
// autoload_static.php @generated by Composer
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInitcbda25b16bb8365467298ce193f0f30c
|
||||
{
|
||||
public static $files = array (
|
||||
'7e9bd612cc444b3eed788ebbe46263a0' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/autoload.php',
|
||||
);
|
||||
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'v' =>
|
||||
array (
|
||||
'voku\\cache\\' => 11,
|
||||
),
|
||||
'P' =>
|
||||
array (
|
||||
'Psr\\SimpleCache\\' => 16,
|
||||
),
|
||||
'L' =>
|
||||
array (
|
||||
'Laminas\\ZendFrameworkBridge\\' => 28,
|
||||
'Laminas\\Stdlib\\' => 15,
|
||||
'Laminas\\Db\\' => 11,
|
||||
),
|
||||
'K' =>
|
||||
array (
|
||||
'Katzgrau\\KLogger\\' => 17,
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixDirsPsr4 = array (
|
||||
'voku\\cache\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache',
|
||||
),
|
||||
'Psr\\SimpleCache\\' =>
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/simple-cache/src',
|
||||
),
|
||||
'Laminas\\ZendFrameworkBridge\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src',
|
||||
),
|
||||
'Laminas\\Stdlib\\' =>
|
||||
>>>>>>> master
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/laminas/laminas-stdlib/src',
|
||||
),
|
||||
'Laminas\\Db\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/laminas/laminas-db/src',
|
||||
),
|
||||
'Katzgrau\\KLogger\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/katzgrau/klogger/src',
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixesPsr0 = array (
|
||||
'P' =>
|
||||
array (
|
||||
'Psr\\Log\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/log',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
||||
'Katzgrau\\KLogger\\Logger' => __DIR__ . '/..' . '/katzgrau/klogger/src/Logger.php',
|
||||
'Laminas\\Db\\Adapter\\Adapter' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Adapter.php',
|
||||
'Laminas\\Db\\Adapter\\AdapterAbstractServiceFactory' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/AdapterAbstractServiceFactory.php',
|
||||
'Laminas\\Db\\Adapter\\AdapterAwareInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/AdapterAwareInterface.php',
|
||||
'Laminas\\Db\\Adapter\\AdapterAwareTrait' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/AdapterAwareTrait.php',
|
||||
'Laminas\\Db\\Adapter\\AdapterInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/AdapterInterface.php',
|
||||
'Laminas\\Db\\Adapter\\AdapterServiceFactory' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/AdapterServiceFactory.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\AbstractConnection' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/AbstractConnection.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\ConnectionInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/ConnectionInterface.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\DriverInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/DriverInterface.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Feature\\AbstractFeature' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Feature/AbstractFeature.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Feature\\DriverFeatureInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Feature/DriverFeatureInterface.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\IbmDb2\\Connection' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/IbmDb2/Connection.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\IbmDb2\\IbmDb2' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/IbmDb2/IbmDb2.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\IbmDb2\\Result' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/IbmDb2/Result.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\IbmDb2\\Statement' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/IbmDb2/Statement.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Mysqli\\Connection' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Mysqli/Connection.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Mysqli\\Mysqli' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Mysqli/Mysqli.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Mysqli\\Result' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Mysqli/Result.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Mysqli\\Statement' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Mysqli/Statement.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Oci8\\Connection' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Oci8/Connection.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Oci8\\Feature\\RowCounter' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Oci8/Feature/RowCounter.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Oci8\\Oci8' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Oci8/Oci8.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Oci8\\Result' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Oci8/Result.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Oci8\\Statement' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Oci8/Statement.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Pdo\\Connection' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Pdo/Connection.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Pdo\\Feature\\OracleRowCounter' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Pdo/Feature/OracleRowCounter.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Pdo\\Feature\\SqliteRowCounter' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Pdo/Feature/SqliteRowCounter.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Pdo\\Pdo' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Pdo/Pdo.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Pdo\\Result' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Pdo/Result.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Pdo\\Statement' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Pdo/Statement.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Pgsql\\Connection' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Pgsql/Connection.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Pgsql\\Pgsql' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Pgsql/Pgsql.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Pgsql\\Result' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Pgsql/Result.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Pgsql\\Statement' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Pgsql/Statement.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\ResultInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/ResultInterface.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Sqlsrv\\Connection' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Sqlsrv/Connection.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Sqlsrv\\Exception\\ErrorException' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Sqlsrv/Exception/ErrorException.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Sqlsrv\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Sqlsrv/Exception/ExceptionInterface.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Sqlsrv\\Result' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Sqlsrv/Result.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Sqlsrv\\Sqlsrv' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Sqlsrv/Sqlsrv.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\Sqlsrv\\Statement' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/Sqlsrv/Statement.php',
|
||||
'Laminas\\Db\\Adapter\\Driver\\StatementInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Driver/StatementInterface.php',
|
||||
'Laminas\\Db\\Adapter\\Exception\\ErrorException' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Exception/ErrorException.php',
|
||||
'Laminas\\Db\\Adapter\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Exception/ExceptionInterface.php',
|
||||
'Laminas\\Db\\Adapter\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Exception/InvalidArgumentException.php',
|
||||
'Laminas\\Db\\Adapter\\Exception\\InvalidConnectionParametersException' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Exception/InvalidConnectionParametersException.php',
|
||||
'Laminas\\Db\\Adapter\\Exception\\InvalidQueryException' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Exception/InvalidQueryException.php',
|
||||
'Laminas\\Db\\Adapter\\Exception\\RuntimeException' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Exception/RuntimeException.php',
|
||||
'Laminas\\Db\\Adapter\\Exception\\UnexpectedValueException' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Exception/UnexpectedValueException.php',
|
||||
'Laminas\\Db\\Adapter\\ParameterContainer' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/ParameterContainer.php',
|
||||
'Laminas\\Db\\Adapter\\Platform\\AbstractPlatform' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Platform/AbstractPlatform.php',
|
||||
'Laminas\\Db\\Adapter\\Platform\\IbmDb2' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Platform/IbmDb2.php',
|
||||
'Laminas\\Db\\Adapter\\Platform\\Mysql' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Platform/Mysql.php',
|
||||
'Laminas\\Db\\Adapter\\Platform\\Oracle' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Platform/Oracle.php',
|
||||
'Laminas\\Db\\Adapter\\Platform\\PlatformInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Platform/PlatformInterface.php',
|
||||
'Laminas\\Db\\Adapter\\Platform\\Postgresql' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Platform/Postgresql.php',
|
||||
'Laminas\\Db\\Adapter\\Platform\\Sql92' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Platform/Sql92.php',
|
||||
'Laminas\\Db\\Adapter\\Platform\\SqlServer' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Platform/SqlServer.php',
|
||||
'Laminas\\Db\\Adapter\\Platform\\Sqlite' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Platform/Sqlite.php',
|
||||
'Laminas\\Db\\Adapter\\Profiler\\Profiler' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Profiler/Profiler.php',
|
||||
'Laminas\\Db\\Adapter\\Profiler\\ProfilerAwareInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Profiler/ProfilerAwareInterface.php',
|
||||
'Laminas\\Db\\Adapter\\Profiler\\ProfilerInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/Profiler/ProfilerInterface.php',
|
||||
'Laminas\\Db\\Adapter\\StatementContainer' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/StatementContainer.php',
|
||||
'Laminas\\Db\\Adapter\\StatementContainerInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Adapter/StatementContainerInterface.php',
|
||||
'Laminas\\Db\\ConfigProvider' => __DIR__ . '/..' . '/laminas/laminas-db/src/ConfigProvider.php',
|
||||
'Laminas\\Db\\Exception\\ErrorException' => __DIR__ . '/..' . '/laminas/laminas-db/src/Exception/ErrorException.php',
|
||||
'Laminas\\Db\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Exception/ExceptionInterface.php',
|
||||
'Laminas\\Db\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/laminas/laminas-db/src/Exception/InvalidArgumentException.php',
|
||||
'Laminas\\Db\\Exception\\RuntimeException' => __DIR__ . '/..' . '/laminas/laminas-db/src/Exception/RuntimeException.php',
|
||||
'Laminas\\Db\\Exception\\UnexpectedValueException' => __DIR__ . '/..' . '/laminas/laminas-db/src/Exception/UnexpectedValueException.php',
|
||||
'Laminas\\Db\\Metadata\\Metadata' => __DIR__ . '/..' . '/laminas/laminas-db/src/Metadata/Metadata.php',
|
||||
'Laminas\\Db\\Metadata\\MetadataInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Metadata/MetadataInterface.php',
|
||||
'Laminas\\Db\\Metadata\\Object\\AbstractTableObject' => __DIR__ . '/..' . '/laminas/laminas-db/src/Metadata/Object/AbstractTableObject.php',
|
||||
'Laminas\\Db\\Metadata\\Object\\ColumnObject' => __DIR__ . '/..' . '/laminas/laminas-db/src/Metadata/Object/ColumnObject.php',
|
||||
'Laminas\\Db\\Metadata\\Object\\ConstraintKeyObject' => __DIR__ . '/..' . '/laminas/laminas-db/src/Metadata/Object/ConstraintKeyObject.php',
|
||||
'Laminas\\Db\\Metadata\\Object\\ConstraintObject' => __DIR__ . '/..' . '/laminas/laminas-db/src/Metadata/Object/ConstraintObject.php',
|
||||
'Laminas\\Db\\Metadata\\Object\\TableObject' => __DIR__ . '/..' . '/laminas/laminas-db/src/Metadata/Object/TableObject.php',
|
||||
'Laminas\\Db\\Metadata\\Object\\TriggerObject' => __DIR__ . '/..' . '/laminas/laminas-db/src/Metadata/Object/TriggerObject.php',
|
||||
'Laminas\\Db\\Metadata\\Object\\ViewObject' => __DIR__ . '/..' . '/laminas/laminas-db/src/Metadata/Object/ViewObject.php',
|
||||
'Laminas\\Db\\Metadata\\Source\\AbstractSource' => __DIR__ . '/..' . '/laminas/laminas-db/src/Metadata/Source/AbstractSource.php',
|
||||
'Laminas\\Db\\Metadata\\Source\\Factory' => __DIR__ . '/..' . '/laminas/laminas-db/src/Metadata/Source/Factory.php',
|
||||
'Laminas\\Db\\Metadata\\Source\\MysqlMetadata' => __DIR__ . '/..' . '/laminas/laminas-db/src/Metadata/Source/MysqlMetadata.php',
|
||||
'Laminas\\Db\\Metadata\\Source\\OracleMetadata' => __DIR__ . '/..' . '/laminas/laminas-db/src/Metadata/Source/OracleMetadata.php',
|
||||
'Laminas\\Db\\Metadata\\Source\\PostgresqlMetadata' => __DIR__ . '/..' . '/laminas/laminas-db/src/Metadata/Source/PostgresqlMetadata.php',
|
||||
'Laminas\\Db\\Metadata\\Source\\SqlServerMetadata' => __DIR__ . '/..' . '/laminas/laminas-db/src/Metadata/Source/SqlServerMetadata.php',
|
||||
'Laminas\\Db\\Metadata\\Source\\SqliteMetadata' => __DIR__ . '/..' . '/laminas/laminas-db/src/Metadata/Source/SqliteMetadata.php',
|
||||
'Laminas\\Db\\Module' => __DIR__ . '/..' . '/laminas/laminas-db/src/Module.php',
|
||||
'Laminas\\Db\\ResultSet\\AbstractResultSet' => __DIR__ . '/..' . '/laminas/laminas-db/src/ResultSet/AbstractResultSet.php',
|
||||
'Laminas\\Db\\ResultSet\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/ResultSet/Exception/ExceptionInterface.php',
|
||||
'Laminas\\Db\\ResultSet\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/laminas/laminas-db/src/ResultSet/Exception/InvalidArgumentException.php',
|
||||
'Laminas\\Db\\ResultSet\\Exception\\RuntimeException' => __DIR__ . '/..' . '/laminas/laminas-db/src/ResultSet/Exception/RuntimeException.php',
|
||||
'Laminas\\Db\\ResultSet\\HydratingResultSet' => __DIR__ . '/..' . '/laminas/laminas-db/src/ResultSet/HydratingResultSet.php',
|
||||
'Laminas\\Db\\ResultSet\\ResultSet' => __DIR__ . '/..' . '/laminas/laminas-db/src/ResultSet/ResultSet.php',
|
||||
'Laminas\\Db\\ResultSet\\ResultSetInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/ResultSet/ResultSetInterface.php',
|
||||
'Laminas\\Db\\RowGateway\\AbstractRowGateway' => __DIR__ . '/..' . '/laminas/laminas-db/src/RowGateway/AbstractRowGateway.php',
|
||||
'Laminas\\Db\\RowGateway\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/RowGateway/Exception/ExceptionInterface.php',
|
||||
'Laminas\\Db\\RowGateway\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/laminas/laminas-db/src/RowGateway/Exception/InvalidArgumentException.php',
|
||||
'Laminas\\Db\\RowGateway\\Exception\\RuntimeException' => __DIR__ . '/..' . '/laminas/laminas-db/src/RowGateway/Exception/RuntimeException.php',
|
||||
'Laminas\\Db\\RowGateway\\Feature\\AbstractFeature' => __DIR__ . '/..' . '/laminas/laminas-db/src/RowGateway/Feature/AbstractFeature.php',
|
||||
'Laminas\\Db\\RowGateway\\Feature\\FeatureSet' => __DIR__ . '/..' . '/laminas/laminas-db/src/RowGateway/Feature/FeatureSet.php',
|
||||
'Laminas\\Db\\RowGateway\\RowGateway' => __DIR__ . '/..' . '/laminas/laminas-db/src/RowGateway/RowGateway.php',
|
||||
'Laminas\\Db\\RowGateway\\RowGatewayInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/RowGateway/RowGatewayInterface.php',
|
||||
'Laminas\\Db\\Sql\\AbstractExpression' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/AbstractExpression.php',
|
||||
'Laminas\\Db\\Sql\\AbstractPreparableSql' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/AbstractPreparableSql.php',
|
||||
'Laminas\\Db\\Sql\\AbstractSql' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/AbstractSql.php',
|
||||
'Laminas\\Db\\Sql\\Combine' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Combine.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\AlterTable' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/AlterTable.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\AbstractLengthColumn' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/AbstractLengthColumn.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\AbstractPrecisionColumn' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/AbstractPrecisionColumn.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\AbstractTimestampColumn' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/AbstractTimestampColumn.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\BigInteger' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/BigInteger.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\Binary' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/Binary.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\Blob' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/Blob.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\Boolean' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/Boolean.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\Char' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/Char.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\Column' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/Column.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\ColumnInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/ColumnInterface.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\Date' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/Date.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\Datetime' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/Datetime.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\Decimal' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/Decimal.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\Float' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/Float.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\Floating' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/Floating.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\Integer' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/Integer.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\Text' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/Text.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\Time' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/Time.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\Timestamp' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/Timestamp.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\Varbinary' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/Varbinary.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Column\\Varchar' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Column/Varchar.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Constraint\\AbstractConstraint' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Constraint/AbstractConstraint.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Constraint\\Check' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Constraint/Check.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Constraint\\ConstraintInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Constraint/ConstraintInterface.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Constraint\\ForeignKey' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Constraint/ForeignKey.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Constraint\\PrimaryKey' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Constraint/PrimaryKey.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Constraint\\UniqueKey' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Constraint/UniqueKey.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\CreateTable' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/CreateTable.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\DropTable' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/DropTable.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Index\\AbstractIndex' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Index/AbstractIndex.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\Index\\Index' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/Index/Index.php',
|
||||
'Laminas\\Db\\Sql\\Ddl\\SqlInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Ddl/SqlInterface.php',
|
||||
'Laminas\\Db\\Sql\\Delete' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Delete.php',
|
||||
'Laminas\\Db\\Sql\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Exception/ExceptionInterface.php',
|
||||
'Laminas\\Db\\Sql\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Exception/InvalidArgumentException.php',
|
||||
'Laminas\\Db\\Sql\\Exception\\RuntimeException' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Exception/RuntimeException.php',
|
||||
'Laminas\\Db\\Sql\\Expression' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Expression.php',
|
||||
'Laminas\\Db\\Sql\\ExpressionInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/ExpressionInterface.php',
|
||||
'Laminas\\Db\\Sql\\Having' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Having.php',
|
||||
'Laminas\\Db\\Sql\\Insert' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Insert.php',
|
||||
'Laminas\\Db\\Sql\\InsertIgnore' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/InsertIgnore.php',
|
||||
'Laminas\\Db\\Sql\\Join' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Join.php',
|
||||
'Laminas\\Db\\Sql\\Literal' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Literal.php',
|
||||
'Laminas\\Db\\Sql\\Platform\\AbstractPlatform' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Platform/AbstractPlatform.php',
|
||||
'Laminas\\Db\\Sql\\Platform\\IbmDb2\\IbmDb2' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Platform/IbmDb2/IbmDb2.php',
|
||||
'Laminas\\Db\\Sql\\Platform\\IbmDb2\\SelectDecorator' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Platform/IbmDb2/SelectDecorator.php',
|
||||
'Laminas\\Db\\Sql\\Platform\\Mysql\\Ddl\\AlterTableDecorator' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Platform/Mysql/Ddl/AlterTableDecorator.php',
|
||||
'Laminas\\Db\\Sql\\Platform\\Mysql\\Ddl\\CreateTableDecorator' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Platform/Mysql/Ddl/CreateTableDecorator.php',
|
||||
'Laminas\\Db\\Sql\\Platform\\Mysql\\Mysql' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Platform/Mysql/Mysql.php',
|
||||
'Laminas\\Db\\Sql\\Platform\\Mysql\\SelectDecorator' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Platform/Mysql/SelectDecorator.php',
|
||||
'Laminas\\Db\\Sql\\Platform\\Oracle\\Oracle' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Platform/Oracle/Oracle.php',
|
||||
'Laminas\\Db\\Sql\\Platform\\Oracle\\SelectDecorator' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Platform/Oracle/SelectDecorator.php',
|
||||
'Laminas\\Db\\Sql\\Platform\\Platform' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Platform/Platform.php',
|
||||
'Laminas\\Db\\Sql\\Platform\\PlatformDecoratorInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Platform/PlatformDecoratorInterface.php',
|
||||
'Laminas\\Db\\Sql\\Platform\\SqlServer\\Ddl\\CreateTableDecorator' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Platform/SqlServer/Ddl/CreateTableDecorator.php',
|
||||
'Laminas\\Db\\Sql\\Platform\\SqlServer\\SelectDecorator' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Platform/SqlServer/SelectDecorator.php',
|
||||
'Laminas\\Db\\Sql\\Platform\\SqlServer\\SqlServer' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Platform/SqlServer/SqlServer.php',
|
||||
'Laminas\\Db\\Sql\\Platform\\Sqlite\\SelectDecorator' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Platform/Sqlite/SelectDecorator.php',
|
||||
'Laminas\\Db\\Sql\\Platform\\Sqlite\\Sqlite' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Platform/Sqlite/Sqlite.php',
|
||||
'Laminas\\Db\\Sql\\Predicate\\Between' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Predicate/Between.php',
|
||||
'Laminas\\Db\\Sql\\Predicate\\Expression' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Predicate/Expression.php',
|
||||
'Laminas\\Db\\Sql\\Predicate\\In' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Predicate/In.php',
|
||||
'Laminas\\Db\\Sql\\Predicate\\IsNotNull' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Predicate/IsNotNull.php',
|
||||
'Laminas\\Db\\Sql\\Predicate\\IsNull' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Predicate/IsNull.php',
|
||||
'Laminas\\Db\\Sql\\Predicate\\Like' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Predicate/Like.php',
|
||||
'Laminas\\Db\\Sql\\Predicate\\Literal' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Predicate/Literal.php',
|
||||
'Laminas\\Db\\Sql\\Predicate\\NotBetween' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Predicate/NotBetween.php',
|
||||
'Laminas\\Db\\Sql\\Predicate\\NotIn' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Predicate/NotIn.php',
|
||||
'Laminas\\Db\\Sql\\Predicate\\NotLike' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Predicate/NotLike.php',
|
||||
'Laminas\\Db\\Sql\\Predicate\\Operator' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Predicate/Operator.php',
|
||||
'Laminas\\Db\\Sql\\Predicate\\Predicate' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Predicate/Predicate.php',
|
||||
'Laminas\\Db\\Sql\\Predicate\\PredicateInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Predicate/PredicateInterface.php',
|
||||
'Laminas\\Db\\Sql\\Predicate\\PredicateSet' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Predicate/PredicateSet.php',
|
||||
'Laminas\\Db\\Sql\\PreparableSqlInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/PreparableSqlInterface.php',
|
||||
'Laminas\\Db\\Sql\\Select' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Select.php',
|
||||
'Laminas\\Db\\Sql\\Sql' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Sql.php',
|
||||
'Laminas\\Db\\Sql\\SqlInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/SqlInterface.php',
|
||||
'Laminas\\Db\\Sql\\TableIdentifier' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/TableIdentifier.php',
|
||||
'Laminas\\Db\\Sql\\Update' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Update.php',
|
||||
'Laminas\\Db\\Sql\\Where' => __DIR__ . '/..' . '/laminas/laminas-db/src/Sql/Where.php',
|
||||
'Laminas\\Db\\TableGateway\\AbstractTableGateway' => __DIR__ . '/..' . '/laminas/laminas-db/src/TableGateway/AbstractTableGateway.php',
|
||||
'Laminas\\Db\\TableGateway\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/TableGateway/Exception/ExceptionInterface.php',
|
||||
'Laminas\\Db\\TableGateway\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/laminas/laminas-db/src/TableGateway/Exception/InvalidArgumentException.php',
|
||||
'Laminas\\Db\\TableGateway\\Exception\\RuntimeException' => __DIR__ . '/..' . '/laminas/laminas-db/src/TableGateway/Exception/RuntimeException.php',
|
||||
'Laminas\\Db\\TableGateway\\Feature\\AbstractFeature' => __DIR__ . '/..' . '/laminas/laminas-db/src/TableGateway/Feature/AbstractFeature.php',
|
||||
'Laminas\\Db\\TableGateway\\Feature\\EventFeature' => __DIR__ . '/..' . '/laminas/laminas-db/src/TableGateway/Feature/EventFeature.php',
|
||||
'Laminas\\Db\\TableGateway\\Feature\\EventFeatureEventsInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/TableGateway/Feature/EventFeatureEventsInterface.php',
|
||||
'Laminas\\Db\\TableGateway\\Feature\\EventFeature\\TableGatewayEvent' => __DIR__ . '/..' . '/laminas/laminas-db/src/TableGateway/Feature/EventFeature/TableGatewayEvent.php',
|
||||
'Laminas\\Db\\TableGateway\\Feature\\FeatureSet' => __DIR__ . '/..' . '/laminas/laminas-db/src/TableGateway/Feature/FeatureSet.php',
|
||||
'Laminas\\Db\\TableGateway\\Feature\\GlobalAdapterFeature' => __DIR__ . '/..' . '/laminas/laminas-db/src/TableGateway/Feature/GlobalAdapterFeature.php',
|
||||
'Laminas\\Db\\TableGateway\\Feature\\MasterSlaveFeature' => __DIR__ . '/..' . '/laminas/laminas-db/src/TableGateway/Feature/MasterSlaveFeature.php',
|
||||
'Laminas\\Db\\TableGateway\\Feature\\MetadataFeature' => __DIR__ . '/..' . '/laminas/laminas-db/src/TableGateway/Feature/MetadataFeature.php',
|
||||
'Laminas\\Db\\TableGateway\\Feature\\RowGatewayFeature' => __DIR__ . '/..' . '/laminas/laminas-db/src/TableGateway/Feature/RowGatewayFeature.php',
|
||||
'Laminas\\Db\\TableGateway\\Feature\\SequenceFeature' => __DIR__ . '/..' . '/laminas/laminas-db/src/TableGateway/Feature/SequenceFeature.php',
|
||||
'Laminas\\Db\\TableGateway\\TableGateway' => __DIR__ . '/..' . '/laminas/laminas-db/src/TableGateway/TableGateway.php',
|
||||
'Laminas\\Db\\TableGateway\\TableGatewayInterface' => __DIR__ . '/..' . '/laminas/laminas-db/src/TableGateway/TableGatewayInterface.php',
|
||||
'Laminas\\Stdlib\\AbstractOptions' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/AbstractOptions.php',
|
||||
'Laminas\\Stdlib\\ArrayObject' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/ArrayObject.php',
|
||||
'Laminas\\Stdlib\\ArraySerializableInterface' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/ArraySerializableInterface.php',
|
||||
'Laminas\\Stdlib\\ArrayStack' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/ArrayStack.php',
|
||||
'Laminas\\Stdlib\\ArrayUtils' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/ArrayUtils.php',
|
||||
'Laminas\\Stdlib\\ArrayUtils\\MergeRemoveKey' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/ArrayUtils/MergeRemoveKey.php',
|
||||
'Laminas\\Stdlib\\ArrayUtils\\MergeReplaceKey' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/ArrayUtils/MergeReplaceKey.php',
|
||||
'Laminas\\Stdlib\\ArrayUtils\\MergeReplaceKeyInterface' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/ArrayUtils/MergeReplaceKeyInterface.php',
|
||||
'Laminas\\Stdlib\\ConsoleHelper' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/ConsoleHelper.php',
|
||||
'Laminas\\Stdlib\\DispatchableInterface' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/DispatchableInterface.php',
|
||||
'Laminas\\Stdlib\\ErrorHandler' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/ErrorHandler.php',
|
||||
'Laminas\\Stdlib\\Exception\\BadMethodCallException' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/Exception/BadMethodCallException.php',
|
||||
'Laminas\\Stdlib\\Exception\\DomainException' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/Exception/DomainException.php',
|
||||
'Laminas\\Stdlib\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/Exception/ExceptionInterface.php',
|
||||
'Laminas\\Stdlib\\Exception\\ExtensionNotLoadedException' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/Exception/ExtensionNotLoadedException.php',
|
||||
'Laminas\\Stdlib\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/Exception/InvalidArgumentException.php',
|
||||
'Laminas\\Stdlib\\Exception\\LogicException' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/Exception/LogicException.php',
|
||||
'Laminas\\Stdlib\\Exception\\RuntimeException' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/Exception/RuntimeException.php',
|
||||
'Laminas\\Stdlib\\FastPriorityQueue' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/FastPriorityQueue.php',
|
||||
'Laminas\\Stdlib\\Glob' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/Glob.php',
|
||||
'Laminas\\Stdlib\\Guard\\AllGuardsTrait' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/Guard/AllGuardsTrait.php',
|
||||
'Laminas\\Stdlib\\Guard\\ArrayOrTraversableGuardTrait' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/Guard/ArrayOrTraversableGuardTrait.php',
|
||||
'Laminas\\Stdlib\\Guard\\EmptyGuardTrait' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/Guard/EmptyGuardTrait.php',
|
||||
'Laminas\\Stdlib\\Guard\\NullGuardTrait' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/Guard/NullGuardTrait.php',
|
||||
'Laminas\\Stdlib\\InitializableInterface' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/InitializableInterface.php',
|
||||
'Laminas\\Stdlib\\JsonSerializable' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/JsonSerializable.php',
|
||||
'Laminas\\Stdlib\\Message' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/Message.php',
|
||||
'Laminas\\Stdlib\\MessageInterface' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/MessageInterface.php',
|
||||
'Laminas\\Stdlib\\ParameterObjectInterface' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/ParameterObjectInterface.php',
|
||||
'Laminas\\Stdlib\\Parameters' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/Parameters.php',
|
||||
'Laminas\\Stdlib\\ParametersInterface' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/ParametersInterface.php',
|
||||
'Laminas\\Stdlib\\PriorityList' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/PriorityList.php',
|
||||
'Laminas\\Stdlib\\PriorityQueue' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/PriorityQueue.php',
|
||||
'Laminas\\Stdlib\\Request' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/Request.php',
|
||||
'Laminas\\Stdlib\\RequestInterface' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/RequestInterface.php',
|
||||
'Laminas\\Stdlib\\Response' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/Response.php',
|
||||
'Laminas\\Stdlib\\ResponseInterface' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/ResponseInterface.php',
|
||||
'Laminas\\Stdlib\\SplPriorityQueue' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/SplPriorityQueue.php',
|
||||
'Laminas\\Stdlib\\SplQueue' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/SplQueue.php',
|
||||
'Laminas\\Stdlib\\SplStack' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/SplStack.php',
|
||||
'Laminas\\Stdlib\\StringUtils' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/StringUtils.php',
|
||||
'Laminas\\Stdlib\\StringWrapper\\AbstractStringWrapper' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/StringWrapper/AbstractStringWrapper.php',
|
||||
'Laminas\\Stdlib\\StringWrapper\\Iconv' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/StringWrapper/Iconv.php',
|
||||
'Laminas\\Stdlib\\StringWrapper\\Intl' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/StringWrapper/Intl.php',
|
||||
'Laminas\\Stdlib\\StringWrapper\\MbString' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/StringWrapper/MbString.php',
|
||||
'Laminas\\Stdlib\\StringWrapper\\Native' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/StringWrapper/Native.php',
|
||||
'Laminas\\Stdlib\\StringWrapper\\StringWrapperInterface' => __DIR__ . '/..' . '/laminas/laminas-stdlib/src/StringWrapper/StringWrapperInterface.php',
|
||||
'Laminas\\ZendFrameworkBridge\\Autoloader' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/Autoloader.php',
|
||||
'Laminas\\ZendFrameworkBridge\\ConfigPostProcessor' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/ConfigPostProcessor.php',
|
||||
'Laminas\\ZendFrameworkBridge\\Module' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/Module.php',
|
||||
'Laminas\\ZendFrameworkBridge\\Replacements' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/Replacements.php',
|
||||
'Laminas\\ZendFrameworkBridge\\RewriteRules' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/RewriteRules.php',
|
||||
'Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/AbstractLogger.php',
|
||||
'Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/Psr/Log/InvalidArgumentException.php',
|
||||
'Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/Psr/Log/LogLevel.php',
|
||||
'Psr\\Log\\LoggerAwareInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareInterface.php',
|
||||
'Psr\\Log\\LoggerAwareTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareTrait.php',
|
||||
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php',
|
||||
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php',
|
||||
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php',
|
||||
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
||||
'Psr\\SimpleCache\\CacheException' => __DIR__ . '/..' . '/psr/simple-cache/src/CacheException.php',
|
||||
'Psr\\SimpleCache\\CacheInterface' => __DIR__ . '/..' . '/psr/simple-cache/src/CacheInterface.php',
|
||||
'Psr\\SimpleCache\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/simple-cache/src/InvalidArgumentException.php',
|
||||
'voku\\cache\\AdapterApc' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterApc.php',
|
||||
'voku\\cache\\AdapterApcu' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterApcu.php',
|
||||
'voku\\cache\\AdapterArray' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterArray.php',
|
||||
'voku\\cache\\AdapterFile' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterFile.php',
|
||||
'voku\\cache\\AdapterFileAbstract' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterFileAbstract.php',
|
||||
'voku\\cache\\AdapterFileSimple' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterFileSimple.php',
|
||||
'voku\\cache\\AdapterMemcache' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterMemcache.php',
|
||||
'voku\\cache\\AdapterMemcached' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterMemcached.php',
|
||||
'voku\\cache\\AdapterOpCache' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterOpCache.php',
|
||||
'voku\\cache\\AdapterPredis' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterPredis.php',
|
||||
'voku\\cache\\AdapterXcache' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/AdapterXcache.php',
|
||||
'voku\\cache\\Cache' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/Cache.php',
|
||||
'voku\\cache\\CacheAdapterAutoManager' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/CacheAdapterAutoManager.php',
|
||||
'voku\\cache\\CacheChain' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/CacheChain.php',
|
||||
'voku\\cache\\CachePsr16' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/CachePsr16.php',
|
||||
'voku\\cache\\Exception\\ChmodException' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/Exception/ChmodException.php',
|
||||
'voku\\cache\\Exception\\FileErrorExceptionInterface' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/Exception/FileErrorExceptionInterface.php',
|
||||
'voku\\cache\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/Exception/InvalidArgumentException.php',
|
||||
'voku\\cache\\Exception\\RenameException' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/Exception/RenameException.php',
|
||||
'voku\\cache\\Exception\\RuntimeException' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/Exception/RuntimeException.php',
|
||||
'voku\\cache\\Exception\\WriteContentException' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/Exception/WriteContentException.php',
|
||||
'voku\\cache\\SerializerDefault' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/SerializerDefault.php',
|
||||
'voku\\cache\\SerializerIgbinary' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/SerializerIgbinary.php',
|
||||
'voku\\cache\\SerializerMsgpack' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/SerializerMsgpack.php',
|
||||
'voku\\cache\\SerializerNo' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/SerializerNo.php',
|
||||
'voku\\cache\\iAdapter' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/iAdapter.php',
|
||||
'voku\\cache\\iCache' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/iCache.php',
|
||||
'voku\\cache\\iSerializer' => __DIR__ . '/..' . '/voku/simple-cache/src/voku/cache/iSerializer.php',
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitcbda25b16bb8365467298ce193f0f30c::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitcbda25b16bb8365467298ce193f0f30c::$prefixDirsPsr4;
|
||||
$loader->prefixesPsr0 = ComposerStaticInitcbda25b16bb8365467298ce193f0f30c::$prefixesPsr0;
|
||||
$loader->classMap = ComposerStaticInitcbda25b16bb8365467298ce193f0f30c::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
}
|
@ -1,602 +0,0 @@
|
||||
{
|
||||
"packages": [
|
||||
{
|
||||
"name": "katzgrau/klogger",
|
||||
"version": "1.0.0",
|
||||
"version_normalized": "1.0.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/katzgrau/klogger.git",
|
||||
"reference": "46cdd92a9b4a8443120cc955bf831450cb274813"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/katzgrau/klogger/zipball/46cdd92a9b4a8443120cc955bf831450cb274813",
|
||||
"reference": "46cdd92a9b4a8443120cc955bf831450cb274813",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"psr/log": "1.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "4.0.*"
|
||||
},
|
||||
"time": "2014-03-20T02:36:36+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Katzgrau\\KLogger\\": "src/"
|
||||
},
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Dan Horrigan",
|
||||
"email": "dan@dhorrigan.com",
|
||||
"homepage": "http://dhorrigan.com",
|
||||
"role": "Lead Developer"
|
||||
},
|
||||
{
|
||||
"name": "Kenny Katzgrau",
|
||||
"email": "katzgrau@gmail.com"
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
],
|
||||
"description": "A Simple Logging Class",
|
||||
"keywords": [
|
||||
"logging"
|
||||
],
|
||||
"install-path": "../katzgrau/klogger"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "1.0.0",
|
||||
"version_normalized": "1.0.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/log.git",
|
||||
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b",
|
||||
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
|
||||
"shasum": ""
|
||||
},
|
||||
"time": "2012-12-21T11:40:51+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Psr\\Log\\": ""
|
||||
=======
|
||||
],
|
||||
"description": "A Simple Logging Class",
|
||||
"keywords": [
|
||||
"logging"
|
||||
],
|
||||
"install-path": "../katzgrau/klogger"
|
||||
},
|
||||
{
|
||||
"name": "laminas/laminas-db",
|
||||
"version": "2.11.4",
|
||||
"version_normalized": "2.11.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laminas/laminas-db.git",
|
||||
"reference": "5b59413b8dd5d79e3fe58c2650c60b1730989f36"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laminas/laminas-db/zipball/5b59413b8dd5d79e3fe58c2650c60b1730989f36",
|
||||
"reference": "5b59413b8dd5d79e3fe58c2650c60b1730989f36",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"laminas/laminas-stdlib": "^2.7 || ^3.0",
|
||||
"laminas/laminas-zendframework-bridge": "^1.0",
|
||||
"php": "^5.6 || ^7.0"
|
||||
},
|
||||
"replace": {
|
||||
"zendframework/zend-db": "^2.11.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"laminas/laminas-coding-standard": "~1.0.0",
|
||||
"laminas/laminas-eventmanager": "^2.6.2 || ^3.0",
|
||||
"laminas/laminas-hydrator": "^1.1 || ^2.1 || ^3.0",
|
||||
"laminas/laminas-servicemanager": "^2.7.5 || ^3.0.3",
|
||||
"phpunit/phpunit": "^5.7.27 || ^6.5.14"
|
||||
},
|
||||
"suggest": {
|
||||
"laminas/laminas-eventmanager": "Laminas\\EventManager component",
|
||||
"laminas/laminas-hydrator": "Laminas\\Hydrator component for using HydratingResultSets",
|
||||
"laminas/laminas-servicemanager": "Laminas\\ServiceManager component"
|
||||
},
|
||||
"time": "2021-02-20T18:52:15+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laminas": {
|
||||
"component": "Laminas\\Db",
|
||||
"config-provider": "Laminas\\Db\\ConfigProvider"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Laminas\\Db\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"description": "Database abstraction layer, SQL abstraction, result set abstraction, and RowDataGateway and TableDataGateway implementations",
|
||||
"homepage": "https://laminas.dev",
|
||||
"keywords": [
|
||||
"db",
|
||||
"laminas"
|
||||
],
|
||||
"support": {
|
||||
"chat": "https://laminas.dev/chat",
|
||||
"docs": "https://docs.laminas.dev/laminas-db/",
|
||||
"forum": "https://discourse.laminas.dev",
|
||||
"issues": "https://github.com/laminas/laminas-db/issues",
|
||||
"rss": "https://github.com/laminas/laminas-db/releases.atom",
|
||||
"source": "https://github.com/laminas/laminas-db"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://funding.communitybridge.org/projects/laminas-project",
|
||||
"type": "community_bridge"
|
||||
}
|
||||
],
|
||||
"install-path": "../laminas/laminas-db"
|
||||
},
|
||||
{
|
||||
"name": "laminas/laminas-stdlib",
|
||||
"version": "3.2.1",
|
||||
"version_normalized": "3.2.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laminas/laminas-stdlib.git",
|
||||
"reference": "2b18347625a2f06a1a485acfbc870f699dbe51c6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/2b18347625a2f06a1a485acfbc870f699dbe51c6",
|
||||
"reference": "2b18347625a2f06a1a485acfbc870f699dbe51c6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"laminas/laminas-zendframework-bridge": "^1.0",
|
||||
"php": "^5.6 || ^7.0"
|
||||
},
|
||||
"replace": {
|
||||
"zendframework/zend-stdlib": "self.version"
|
||||
},
|
||||
"require-dev": {
|
||||
"laminas/laminas-coding-standard": "~1.0.0",
|
||||
"phpbench/phpbench": "^0.13",
|
||||
"phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2"
|
||||
},
|
||||
"time": "2019-12-31T17:51:15+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.2.x-dev",
|
||||
"dev-develop": "3.3.x-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Laminas\\Stdlib\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"description": "SPL extensions, array utilities, error handlers, and more",
|
||||
"homepage": "https://laminas.dev",
|
||||
"keywords": [
|
||||
"laminas",
|
||||
"stdlib"
|
||||
],
|
||||
"support": {
|
||||
"chat": "https://laminas.dev/chat",
|
||||
"docs": "https://docs.laminas.dev/laminas-stdlib/",
|
||||
"forum": "https://discourse.laminas.dev",
|
||||
"issues": "https://github.com/laminas/laminas-stdlib/issues",
|
||||
"rss": "https://github.com/laminas/laminas-stdlib/releases.atom",
|
||||
"source": "https://github.com/laminas/laminas-stdlib"
|
||||
},
|
||||
"install-path": "../laminas/laminas-stdlib"
|
||||
},
|
||||
{
|
||||
"name": "laminas/laminas-zendframework-bridge",
|
||||
"version": "1.1.1",
|
||||
"version_normalized": "1.1.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laminas/laminas-zendframework-bridge.git",
|
||||
"reference": "6ede70583e101030bcace4dcddd648f760ddf642"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/6ede70583e101030bcace4dcddd648f760ddf642",
|
||||
"reference": "6ede70583e101030bcace4dcddd648f760ddf642",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.6 || ^7.0 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.1 || ^9.3",
|
||||
"squizlabs/php_codesniffer": "^3.5"
|
||||
},
|
||||
"time": "2020-09-14T14:23:00+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laminas": {
|
||||
"module": "Laminas\\ZendFrameworkBridge"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/autoload.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Laminas\\ZendFrameworkBridge\\": "src//"
|
||||
>>>>>>> master
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
<<<<<<< HEAD
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interface for logging libraries",
|
||||
"keywords": [
|
||||
"log",
|
||||
"psr",
|
||||
"psr-3"
|
||||
],
|
||||
"install-path": "../psr/log"
|
||||
},
|
||||
{
|
||||
"name": "psr/simple-cache",
|
||||
"version": "1.0.1",
|
||||
"version_normalized": "1.0.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/simple-cache.git",
|
||||
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
|
||||
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"time": "2017-10-23T01:57:42+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\SimpleCache\\": "src/"
|
||||
=======
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"description": "Alias legacy ZF class names to Laminas Project equivalents.",
|
||||
"keywords": [
|
||||
"ZendFramework",
|
||||
"autoloading",
|
||||
"laminas",
|
||||
"zf"
|
||||
],
|
||||
"support": {
|
||||
"forum": "https://discourse.laminas.dev/",
|
||||
"issues": "https://github.com/laminas/laminas-zendframework-bridge/issues",
|
||||
"rss": "https://github.com/laminas/laminas-zendframework-bridge/releases.atom",
|
||||
"source": "https://github.com/laminas/laminas-zendframework-bridge"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://funding.communitybridge.org/projects/laminas-project",
|
||||
"type": "community_bridge"
|
||||
}
|
||||
],
|
||||
"install-path": "../laminas/laminas-zendframework-bridge"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "1.0.0",
|
||||
"version_normalized": "1.0.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/log.git",
|
||||
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b",
|
||||
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
|
||||
"shasum": ""
|
||||
},
|
||||
"time": "2012-12-21T11:40:51+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Psr\\Log\\": ""
|
||||
>>>>>>> master
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
<<<<<<< HEAD
|
||||
"description": "Common interfaces for simple caching",
|
||||
"keywords": [
|
||||
"cache",
|
||||
"caching",
|
||||
"psr",
|
||||
"psr-16",
|
||||
"simple-cache"
|
||||
],
|
||||
"install-path": "../psr/simple-cache"
|
||||
},
|
||||
{
|
||||
"name": "voku/simple-cache",
|
||||
"version": "4.0.5",
|
||||
"version_normalized": "4.0.5.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/voku/simple-cache.git",
|
||||
"reference": "416cf88902991f3bf6168b71c0683e6dabb3d5e1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/voku/simple-cache/zipball/416cf88902991f3bf6168b71c0683e6dabb3d5e1",
|
||||
"reference": "416cf88902991f3bf6168b71c0683e6dabb3d5e1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.0.0",
|
||||
"psr/simple-cache": "~1.0"
|
||||
},
|
||||
"provide": {
|
||||
"psr/simple-cache-implementation": "1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~6.0 || ~7.0"
|
||||
},
|
||||
"suggest": {
|
||||
"predis/predis": "~1.1",
|
||||
"symfony/var-exporter": "~3.0 || ~4.0 || ~5.0"
|
||||
},
|
||||
"time": "2020-03-15T21:00:57+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"voku\\cache\\": "src/voku/cache/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Lars Moelleken",
|
||||
"homepage": "http://www.moelleken.org/",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "Simple Cache library",
|
||||
"homepage": "https://github.com/voku/simple-cache",
|
||||
"keywords": [
|
||||
"cache",
|
||||
"caching",
|
||||
"php",
|
||||
"simple cache"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/voku/simple-cache/issues",
|
||||
"source": "https://github.com/voku/simple-cache/tree/master"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://www.paypal.me/moelleken",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/voku",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://www.patreon.com/voku",
|
||||
"type": "patreon"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/voku/simple-cache",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
=======
|
||||
"description": "Common interface for logging libraries",
|
||||
"keywords": [
|
||||
"log",
|
||||
"psr",
|
||||
"psr-3"
|
||||
],
|
||||
"install-path": "../psr/log"
|
||||
},
|
||||
{
|
||||
"name": "psr/simple-cache",
|
||||
"version": "1.0.1",
|
||||
"version_normalized": "1.0.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/simple-cache.git",
|
||||
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
|
||||
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"time": "2017-10-23T01:57:42+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\SimpleCache\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interfaces for simple caching",
|
||||
"keywords": [
|
||||
"cache",
|
||||
"caching",
|
||||
"psr",
|
||||
"psr-16",
|
||||
"simple-cache"
|
||||
],
|
||||
"install-path": "../psr/simple-cache"
|
||||
},
|
||||
{
|
||||
"name": "voku/simple-cache",
|
||||
"version": "4.0.5",
|
||||
"version_normalized": "4.0.5.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/voku/simple-cache.git",
|
||||
"reference": "416cf88902991f3bf6168b71c0683e6dabb3d5e1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/voku/simple-cache/zipball/416cf88902991f3bf6168b71c0683e6dabb3d5e1",
|
||||
"reference": "416cf88902991f3bf6168b71c0683e6dabb3d5e1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.0.0",
|
||||
"psr/simple-cache": "~1.0"
|
||||
},
|
||||
"provide": {
|
||||
"psr/simple-cache-implementation": "1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~6.0 || ~7.0"
|
||||
},
|
||||
"suggest": {
|
||||
"predis/predis": "~1.1",
|
||||
"symfony/var-exporter": "~3.0 || ~4.0 || ~5.0"
|
||||
},
|
||||
"time": "2020-03-15T21:00:57+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"voku\\cache\\": "src/voku/cache/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Lars Moelleken",
|
||||
"homepage": "http://www.moelleken.org/",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "Simple Cache library",
|
||||
"homepage": "https://github.com/voku/simple-cache",
|
||||
"keywords": [
|
||||
"cache",
|
||||
"caching",
|
||||
"php",
|
||||
"simple cache"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/voku/simple-cache/issues",
|
||||
"source": "https://github.com/voku/simple-cache/tree/master"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://www.paypal.me/moelleken",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/voku",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://www.patreon.com/voku",
|
||||
"type": "patreon"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/voku/simple-cache",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
>>>>>>> master
|
||||
"install-path": "../voku/simple-cache"
|
||||
}
|
||||
],
|
||||
"dev": true,
|
||||
"dev-package-names": []
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
<?php return array (
|
||||
'root' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '1e645f52d45985949359c49ab147bcd45d6554f8',
|
||||
'name' => '__root__',
|
||||
),
|
||||
'versions' =>
|
||||
array (
|
||||
'__root__' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '1e645f52d45985949359c49ab147bcd45d6554f8',
|
||||
),
|
||||
'katzgrau/klogger' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.0',
|
||||
'version' => '1.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '46cdd92a9b4a8443120cc955bf831450cb274813',
|
||||
),
|
||||
'psr/log' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.0',
|
||||
'version' => '1.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'fe0936ee26643249e916849d48e3a51d5f5e278b',
|
||||
),
|
||||
'psr/simple-cache' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
|
||||
),
|
||||
'psr/simple-cache-implementation' =>
|
||||
array (
|
||||
'provided' =>
|
||||
array (
|
||||
0 => '1.0',
|
||||
),
|
||||
),
|
||||
'voku/simple-cache' =>
|
||||
array (
|
||||
'pretty_version' => '4.0.5',
|
||||
'version' => '4.0.5.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '416cf88902991f3bf6168b71c0683e6dabb3d5e1',
|
||||
),
|
||||
),
|
||||
);
|
@ -1,122 +0,0 @@
|
||||
<?php return array (
|
||||
'root' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
<<<<<<< HEAD
|
||||
'reference' => 'ea886da10cdbdad164cd253003e862a0ec7ecd6c',
|
||||
=======
|
||||
'reference' => '05f58f90d743fe9ade24f3fdfe9a934d0b87c6a1',
|
||||
>>>>>>> master
|
||||
'name' => '__root__',
|
||||
),
|
||||
'versions' =>
|
||||
array (
|
||||
'__root__' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
<<<<<<< HEAD
|
||||
'reference' => 'ea886da10cdbdad164cd253003e862a0ec7ecd6c',
|
||||
=======
|
||||
'reference' => '05f58f90d743fe9ade24f3fdfe9a934d0b87c6a1',
|
||||
>>>>>>> master
|
||||
),
|
||||
'katzgrau/klogger' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.0',
|
||||
'version' => '1.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '46cdd92a9b4a8443120cc955bf831450cb274813',
|
||||
),
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
'laminas/laminas-db' =>
|
||||
array (
|
||||
'pretty_version' => '2.11.4',
|
||||
'version' => '2.11.4.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '5b59413b8dd5d79e3fe58c2650c60b1730989f36',
|
||||
),
|
||||
'laminas/laminas-stdlib' =>
|
||||
array (
|
||||
'pretty_version' => '3.2.1',
|
||||
'version' => '3.2.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '2b18347625a2f06a1a485acfbc870f699dbe51c6',
|
||||
),
|
||||
'laminas/laminas-zendframework-bridge' =>
|
||||
array (
|
||||
'pretty_version' => '1.1.1',
|
||||
'version' => '1.1.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '6ede70583e101030bcace4dcddd648f760ddf642',
|
||||
),
|
||||
>>>>>>> master
|
||||
'psr/log' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.0',
|
||||
'version' => '1.0.0.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => 'fe0936ee26643249e916849d48e3a51d5f5e278b',
|
||||
),
|
||||
'psr/simple-cache' =>
|
||||
array (
|
||||
'pretty_version' => '1.0.1',
|
||||
'version' => '1.0.1.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
|
||||
),
|
||||
'psr/simple-cache-implementation' =>
|
||||
array (
|
||||
'provided' =>
|
||||
array (
|
||||
0 => '1.0',
|
||||
),
|
||||
),
|
||||
'voku/simple-cache' =>
|
||||
array (
|
||||
'pretty_version' => '4.0.5',
|
||||
'version' => '4.0.5.0',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '416cf88902991f3bf6168b71c0683e6dabb3d5e1',
|
||||
),
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
'zendframework/zend-db' =>
|
||||
array (
|
||||
'replaced' =>
|
||||
array (
|
||||
0 => '^2.11.0',
|
||||
),
|
||||
),
|
||||
'zendframework/zend-stdlib' =>
|
||||
array (
|
||||
'replaced' =>
|
||||
array (
|
||||
0 => '3.2.1',
|
||||
),
|
||||
),
|
||||
>>>>>>> master
|
||||
),
|
||||
);
|
@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
// platform_check.php @generated by Composer
|
||||
|
||||
$issues = array();
|
||||
|
||||
if (!(PHP_VERSION_ID >= 70000)) {
|
||||
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.0". You are running ' . PHP_VERSION . '.';
|
||||
}
|
||||
|
||||
if ($issues) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
|
||||
} elseif (!headers_sent()) {
|
||||
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
|
||||
}
|
||||
}
|
||||
trigger_error(
|
||||
'Composer detected issues in your platform: ' . implode(' ', $issues),
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
3
bundled-libs/katzgrau/klogger/.gitignore
vendored
3
bundled-libs/katzgrau/klogger/.gitignore
vendored
@ -1,3 +0,0 @@
|
||||
/tests/logs/*.txt
|
||||
/vendor/
|
||||
composer.lock
|
@ -1,163 +0,0 @@
|
||||
# KLogger: Simple Logging for PHP
|
||||
|
||||
A project written by [Kenny Katzgrau](http://twitter.com/katzgrau) and [Dan Horrigan](http://twitter.com/dhrrgn).
|
||||
|
||||
## About
|
||||
|
||||
KLogger is an easy-to-use [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
|
||||
compliant logging class for PHP. It isn't naive about
|
||||
file permissions (which is expected). It was meant to be a class that you could
|
||||
quickly include into a project and have working right away.
|
||||
|
||||
## Installation
|
||||
|
||||
### Composer
|
||||
|
||||
From the Command Line:
|
||||
|
||||
```
|
||||
composer require katzgrau/klogger:1.0.*
|
||||
```
|
||||
|
||||
In your `composer.json`:
|
||||
|
||||
``` json
|
||||
{
|
||||
"require": {
|
||||
"katzgrau/klogger": "1.0.*"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Basic Usage
|
||||
|
||||
``` php
|
||||
<?php
|
||||
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
$users = [
|
||||
[
|
||||
'name' => 'Kenny Katzgrau',
|
||||
'username' => 'katzgrau',
|
||||
],
|
||||
[
|
||||
'name' => 'Dan Horrigan',
|
||||
'username' => 'dhrrgn',
|
||||
],
|
||||
];
|
||||
|
||||
$logger = new Katzgrau\KLogger\Logger(__DIR__.'/logs');
|
||||
$logger->info('Returned a million search results');
|
||||
$logger->error('Oh dear.');
|
||||
$logger->debug('Got these users from the Database.', $users);
|
||||
```
|
||||
|
||||
### Output
|
||||
|
||||
```
|
||||
[2014-03-20 3:35:43.762437] [INFO] Returned a million search results
|
||||
[2014-03-20 3:35:43.762578] [ERROR] Oh dear.
|
||||
[2014-03-20 3:35:43.762795] [DEBUG] Got these users from the Database.
|
||||
0: array(
|
||||
'name' => 'Kenny Katzgrau',
|
||||
'username' => 'katzgrau',
|
||||
)
|
||||
1: array(
|
||||
'name' => 'Dan Horrigan',
|
||||
'username' => 'dhrrgn',
|
||||
)
|
||||
```
|
||||
|
||||
## PSR-3 Compliant
|
||||
|
||||
KLogger is [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
|
||||
compliant. This means it implements the `Psr\Log\LoggerInterface`.
|
||||
|
||||
[See Here for the interface definition.](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md#3-psrlogloggerinterface)
|
||||
|
||||
## Setting the Log Level Threshold
|
||||
|
||||
You can use the `Psr\Log\LogLevel` constants to set Log Level Threshold, so that
|
||||
any messages below that level, will not be logged.
|
||||
|
||||
### Default Level
|
||||
|
||||
The default level is `DEBUG`, which means everything will be logged.
|
||||
|
||||
### Available Levels
|
||||
|
||||
``` php
|
||||
<?php
|
||||
use Psr\Log\LogLevel;
|
||||
|
||||
// These are in order of highest priority to lowest.
|
||||
LogLevel::EMERGENCY;
|
||||
LogLevel::ALERT;
|
||||
LogLevel::CRITICAL;
|
||||
LogLevel::ERROR;
|
||||
LogLevel::WARNING;
|
||||
LogLevel::NOTICE;
|
||||
LogLevel::INFO;
|
||||
LogLevel::DEBUG;
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
``` php
|
||||
<?php
|
||||
// The
|
||||
$logger = new Katzgrau\KLogger\Logger('/var/log/', Psr\Log\LogLevel::WARNING);
|
||||
$logger->error('Uh Oh!'); // Will be logged
|
||||
$logger->info('Something Happened Here'); // Will be NOT logged
|
||||
```
|
||||
|
||||
## Why use KLogger?
|
||||
|
||||
Why not? Just drop it in and go. If it saves you time and does what you need,
|
||||
go for it! Take a line from the book of our C-code fathers: "`build` upon the
|
||||
work of others".
|
||||
|
||||
## Who uses KLogger?
|
||||
|
||||
Klogger has been used in projects at:
|
||||
|
||||
* The University of Iowa
|
||||
* The University of Laverne
|
||||
* The New Jersey Institute of Technology
|
||||
* Middlesex Hospital in NJ
|
||||
|
||||
Additionally, it's been used in numerous projects, both commercial and personal.
|
||||
|
||||
## Special Thanks
|
||||
|
||||
Special thanks to all contributors:
|
||||
|
||||
* [Dan Horrigan](http://twitter.com/dhrrgn)
|
||||
* [Tim Kinnane](http://twitter.com/etherealtim)
|
||||
* [Brian Fenton](http://github.com/fentie)
|
||||
* [Cameron Will](https://github.com/cwill747)
|
||||
|
||||
## License
|
||||
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2008-2014 Kenny Katzgrau <katzgrau@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
@ -1,30 +0,0 @@
|
||||
{
|
||||
"name": "katzgrau/klogger",
|
||||
"version": "1.0.0",
|
||||
"description": "A Simple Logging Class",
|
||||
"keywords": ["logging"],
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"psr/log": "1.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "4.0.*"
|
||||
},
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Kenny Katzgrau",
|
||||
"email": "katzgrau@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Dan Horrigan",
|
||||
"email": "dan@dhorrigan.com"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Katzgrau\\KLogger\\": "src/"
|
||||
},
|
||||
"classmap": ["src/"]
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit colors="true"
|
||||
stopOnFailure="false"
|
||||
bootstrap="./vendor/autoload.php"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true">
|
||||
<testsuites>
|
||||
<testsuite name="common">
|
||||
<directory suffix="Test.php">tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<blacklist>
|
||||
<directory>./vendor</directory>
|
||||
</blacklist>
|
||||
</filter>
|
||||
</phpunit>
|
@ -1,231 +0,0 @@
|
||||
<?php
|
||||
namespace Katzgrau\KLogger;
|
||||
|
||||
use DateTime;
|
||||
use RuntimeException;
|
||||
use Psr\Log\AbstractLogger;
|
||||
use Psr\Log\LogLevel;
|
||||
|
||||
/**
|
||||
* Finally, a light, permissions-checking logging class.
|
||||
*
|
||||
* Originally written for use with wpSearch
|
||||
*
|
||||
* Usage:
|
||||
* $log = new Katzgrau\KLogger\Logger('/var/log/', Psr\Log\LogLevel::INFO);
|
||||
* $log->info('Returned a million search results'); //Prints to the log file
|
||||
* $log->error('Oh dear.'); //Prints to the log file
|
||||
* $log->debug('x = 5'); //Prints nothing due to current severity threshhold
|
||||
*
|
||||
* @author Kenny Katzgrau <katzgrau@gmail.com>
|
||||
* @since July 26, 2008 — Last update July 1, 2012
|
||||
* @link http://codefury.net
|
||||
* @version 0.2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class documentation
|
||||
*/
|
||||
class Logger extends AbstractLogger
|
||||
{
|
||||
/**
|
||||
* Path to the log file
|
||||
* @var string
|
||||
*/
|
||||
private $logFilePath = null;
|
||||
|
||||
/**
|
||||
* Current minimum logging threshold
|
||||
* @var integer
|
||||
*/
|
||||
private $logLevelThreshold = LogLevel::DEBUG;
|
||||
|
||||
private $logLevels = array(
|
||||
LogLevel::EMERGENCY => 0,
|
||||
LogLevel::ALERT => 1,
|
||||
LogLevel::CRITICAL => 2,
|
||||
LogLevel::ERROR => 3,
|
||||
LogLevel::WARNING => 4,
|
||||
LogLevel::NOTICE => 5,
|
||||
LogLevel::INFO => 6,
|
||||
LogLevel::DEBUG => 7,
|
||||
);
|
||||
|
||||
/**
|
||||
* This holds the file handle for this instance's log file
|
||||
* @var resource
|
||||
*/
|
||||
private $fileHandle = null;
|
||||
|
||||
/**
|
||||
* Valid PHP date() format string for log timestamps
|
||||
* @var string
|
||||
*/
|
||||
private $dateFormat = 'Y-m-d G:i:s.u';
|
||||
|
||||
/**
|
||||
* Octal notation for default permissions of the log file
|
||||
* @var integer
|
||||
*/
|
||||
private $defaultPermissions = 0777;
|
||||
|
||||
/**
|
||||
* Class constructor
|
||||
*
|
||||
* @param string $logDirectory File path to the logging directory
|
||||
* @param integer $logLevelThreshold The LogLevel Threshold
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($logDirectory, $logLevelThreshold = LogLevel::DEBUG)
|
||||
{
|
||||
$this->logLevelThreshold = $logLevelThreshold;
|
||||
|
||||
$logDirectory = rtrim($logDirectory, '\\/');
|
||||
if (! file_exists($logDirectory)) {
|
||||
mkdir($logDirectory, $this->defaultPermissions, true);
|
||||
}
|
||||
|
||||
$this->logFilePath = $logDirectory.DIRECTORY_SEPARATOR.'log_'.date('Y-m-d').'.txt';
|
||||
if (file_exists($this->logFilePath) && !is_writable($this->logFilePath)) {
|
||||
throw new RuntimeException('The file could not be written to. Check that appropriate permissions have been set.');
|
||||
}
|
||||
|
||||
$this->fileHandle = fopen($this->logFilePath, 'a');
|
||||
if ( ! $this->fileHandle) {
|
||||
throw new RuntimeException('The file could not be opened. Check permissions.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class destructor
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
if ($this->fileHandle) {
|
||||
fclose($this->fileHandle);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the date format used by all instances of KLogger
|
||||
*
|
||||
* @param string $dateFormat Valid format string for date()
|
||||
*/
|
||||
public function setDateFormat($dateFormat)
|
||||
{
|
||||
$this->dateFormat = $dateFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Log Level Threshold
|
||||
*
|
||||
* @param string $dateFormat Valid format string for date()
|
||||
*/
|
||||
public function setLogLevelThreshold($logLevelThreshold)
|
||||
{
|
||||
$this->logLevelThreshold = $logLevelThreshold;
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs with an arbitrary level.
|
||||
*
|
||||
* @param mixed $level
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function log($level, $message, array $context = array())
|
||||
{
|
||||
if ($this->logLevels[$this->logLevelThreshold] < $this->logLevels[$level]) {
|
||||
return;
|
||||
}
|
||||
$message = $this->formatMessage($level, $message, $context);
|
||||
$this->write($message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a line to the log without prepending a status or timestamp
|
||||
*
|
||||
* @param string $line Line to write to the log
|
||||
* @return void
|
||||
*/
|
||||
public function write($message)
|
||||
{
|
||||
if (! is_null($this->fileHandle)) {
|
||||
if (fwrite($this->fileHandle, $message) === false) {
|
||||
throw new RuntimeException('The file could not be written to. Check that appropriate permissions have been set.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats the message for logging.
|
||||
*
|
||||
* @param string $level The Log Level of the message
|
||||
* @param string $message The message to log
|
||||
* @param array $context The context
|
||||
* @return string
|
||||
*/
|
||||
private function formatMessage($level, $message, $context)
|
||||
{
|
||||
$level = strtoupper($level);
|
||||
if (! empty($context)) {
|
||||
$message .= PHP_EOL.$this->indent($this->contextToString($context));
|
||||
}
|
||||
return "[{$this->getTimestamp()}] [{$level}] {$message}".PHP_EOL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the correctly formatted Date/Time for the log entry.
|
||||
*
|
||||
* PHP DateTime is dump, and you have to resort to trickery to get microseconds
|
||||
* to work correctly, so here it is.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getTimestamp()
|
||||
{
|
||||
$originalTime = microtime(true);
|
||||
$micro = sprintf("%06d", ($originalTime - floor($originalTime)) * 1000000);
|
||||
$date = new DateTime(date('Y-m-d H:i:s.'.$micro, $originalTime));
|
||||
|
||||
return $date->format($this->dateFormat);
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes the given context and coverts it to a string.
|
||||
*
|
||||
* @param array $context The Context
|
||||
* @return string
|
||||
*/
|
||||
private function contextToString($context)
|
||||
{
|
||||
$export = '';
|
||||
foreach ($context as $key => $value) {
|
||||
$export .= "{$key}: ";
|
||||
$export .= preg_replace(array(
|
||||
'/=>\s+([a-zA-Z])/im',
|
||||
'/array\(\s+\)/im',
|
||||
'/^ |\G /m',
|
||||
), array(
|
||||
'=> $1',
|
||||
'array()',
|
||||
' ',
|
||||
), str_replace('array (', 'array(', var_export($value, true)));
|
||||
$export .= PHP_EOL;
|
||||
}
|
||||
return str_replace(array('\\\\', '\\\''), array('\\', '\''), rtrim($export));
|
||||
}
|
||||
|
||||
/**
|
||||
* Indents the given string with the given indent.
|
||||
*
|
||||
* @param string $string The string to indent
|
||||
* @param string $indent What to use as the indent.
|
||||
* @return string
|
||||
*/
|
||||
private function indent($string, $indent = ' ')
|
||||
{
|
||||
return $indent.str_replace("\n", "\n".$indent, $string);
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Katzgrau\KLogger\Logger;
|
||||
|
||||
class LoggerTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
private $logPath;
|
||||
private $logger;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->logPath = __DIR__.'/logs';
|
||||
$this->logger = new Logger($this->logPath);
|
||||
}
|
||||
|
||||
public function testImplementsPsr3LoggerInterface()
|
||||
{
|
||||
$this->assertInstanceOf('Psr\Log\LoggerInterface', $this->logger);
|
||||
}
|
||||
}
|
1
bundled-libs/psr/log/.gitignore
vendored
1
bundled-libs/psr/log/.gitignore
vendored
@ -1 +0,0 @@
|
||||
vendor
|
@ -1,19 +0,0 @@
|
||||
Copyright (c) 2012 PHP Framework Interoperability Group
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
@ -1,120 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Psr\Log;
|
||||
|
||||
/**
|
||||
* This is a simple Logger implementation that other Loggers can inherit from.
|
||||
*
|
||||
* It simply delegates all log-level-specific methods to the `log` method to
|
||||
* reduce boilerplate code that a simple Logger that does the same thing with
|
||||
* messages regardless of the error level has to implement.
|
||||
*/
|
||||
abstract class AbstractLogger implements LoggerInterface
|
||||
{
|
||||
/**
|
||||
* System is unusable.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function emergency($message, array $context = array())
|
||||
{
|
||||
$this->log(LogLevel::EMERGENCY, $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Action must be taken immediately.
|
||||
*
|
||||
* Example: Entire website down, database unavailable, etc. This should
|
||||
* trigger the SMS alerts and wake you up.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function alert($message, array $context = array())
|
||||
{
|
||||
$this->log(LogLevel::ALERT, $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Critical conditions.
|
||||
*
|
||||
* Example: Application component unavailable, unexpected exception.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function critical($message, array $context = array())
|
||||
{
|
||||
$this->log(LogLevel::CRITICAL, $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Runtime errors that do not require immediate action but should typically
|
||||
* be logged and monitored.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function error($message, array $context = array())
|
||||
{
|
||||
$this->log(LogLevel::ERROR, $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Exceptional occurrences that are not errors.
|
||||
*
|
||||
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
||||
* that are not necessarily wrong.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function warning($message, array $context = array())
|
||||
{
|
||||
$this->log(LogLevel::WARNING, $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Normal but significant events.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function notice($message, array $context = array())
|
||||
{
|
||||
$this->log(LogLevel::NOTICE, $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Interesting events.
|
||||
*
|
||||
* Example: User logs in, SQL logs.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function info($message, array $context = array())
|
||||
{
|
||||
$this->log(LogLevel::INFO, $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Detailed debug information.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function debug($message, array $context = array())
|
||||
{
|
||||
$this->log(LogLevel::DEBUG, $message, $context);
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Psr\Log;
|
||||
|
||||
class InvalidArgumentException extends \InvalidArgumentException
|
||||
{
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Psr\Log;
|
||||
|
||||
/**
|
||||
* Describes log levels
|
||||
*/
|
||||
class LogLevel
|
||||
{
|
||||
const EMERGENCY = 'emergency';
|
||||
const ALERT = 'alert';
|
||||
const CRITICAL = 'critical';
|
||||
const ERROR = 'error';
|
||||
const WARNING = 'warning';
|
||||
const NOTICE = 'notice';
|
||||
const INFO = 'info';
|
||||
const DEBUG = 'debug';
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Psr\Log;
|
||||
|
||||
/**
|
||||
* Describes a logger-aware instance
|
||||
*/
|
||||
interface LoggerAwareInterface
|
||||
{
|
||||
/**
|
||||
* Sets a logger instance on the object
|
||||
*
|
||||
* @param LoggerInterface $logger
|
||||
* @return null
|
||||
*/
|
||||
public function setLogger(LoggerInterface $logger);
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Psr\Log;
|
||||
|
||||
/**
|
||||
* Basic Implementation of LoggerAwareInterface.
|
||||
*/
|
||||
trait LoggerAwareTrait
|
||||
{
|
||||
/** @var LoggerInterface */
|
||||
protected $logger;
|
||||
|
||||
/**
|
||||
* Sets a logger.
|
||||
*
|
||||
* @param LoggerInterface $logger
|
||||
*/
|
||||
public function setLogger(LoggerInterface $logger)
|
||||
{
|
||||
$this->logger = $logger;
|
||||
}
|
||||
}
|
@ -1,114 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Psr\Log;
|
||||
|
||||
/**
|
||||
* Describes a logger instance
|
||||
*
|
||||
* The message MUST be a string or object implementing __toString().
|
||||
*
|
||||
* The message MAY contain placeholders in the form: {foo} where foo
|
||||
* will be replaced by the context data in key "foo".
|
||||
*
|
||||
* The context array can contain arbitrary data, the only assumption that
|
||||
* can be made by implementors is that if an Exception instance is given
|
||||
* to produce a stack trace, it MUST be in a key named "exception".
|
||||
*
|
||||
* See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
|
||||
* for the full interface specification.
|
||||
*/
|
||||
interface LoggerInterface
|
||||
{
|
||||
/**
|
||||
* System is unusable.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function emergency($message, array $context = array());
|
||||
|
||||
/**
|
||||
* Action must be taken immediately.
|
||||
*
|
||||
* Example: Entire website down, database unavailable, etc. This should
|
||||
* trigger the SMS alerts and wake you up.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function alert($message, array $context = array());
|
||||
|
||||
/**
|
||||
* Critical conditions.
|
||||
*
|
||||
* Example: Application component unavailable, unexpected exception.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function critical($message, array $context = array());
|
||||
|
||||
/**
|
||||
* Runtime errors that do not require immediate action but should typically
|
||||
* be logged and monitored.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function error($message, array $context = array());
|
||||
|
||||
/**
|
||||
* Exceptional occurrences that are not errors.
|
||||
*
|
||||
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
||||
* that are not necessarily wrong.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function warning($message, array $context = array());
|
||||
|
||||
/**
|
||||
* Normal but significant events.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function notice($message, array $context = array());
|
||||
|
||||
/**
|
||||
* Interesting events.
|
||||
*
|
||||
* Example: User logs in, SQL logs.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function info($message, array $context = array());
|
||||
|
||||
/**
|
||||
* Detailed debug information.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function debug($message, array $context = array());
|
||||
|
||||
/**
|
||||
* Logs with an arbitrary level.
|
||||
*
|
||||
* @param mixed $level
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function log($level, $message, array $context = array());
|
||||
}
|
@ -1,131 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Psr\Log;
|
||||
|
||||
/**
|
||||
* This is a simple Logger trait that classes unable to extend AbstractLogger
|
||||
* (because they extend another class, etc) can include.
|
||||
*
|
||||
* It simply delegates all log-level-specific methods to the `log` method to
|
||||
* reduce boilerplate code that a simple Logger that does the same thing with
|
||||
* messages regardless of the error level has to implement.
|
||||
*/
|
||||
trait LoggerTrait
|
||||
{
|
||||
/**
|
||||
* System is unusable.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function emergency($message, array $context = array())
|
||||
{
|
||||
$this->log(LogLevel::EMERGENCY, $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Action must be taken immediately.
|
||||
*
|
||||
* Example: Entire website down, database unavailable, etc. This should
|
||||
* trigger the SMS alerts and wake you up.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function alert($message, array $context = array())
|
||||
{
|
||||
$this->log(LogLevel::ALERT, $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Critical conditions.
|
||||
*
|
||||
* Example: Application component unavailable, unexpected exception.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function critical($message, array $context = array())
|
||||
{
|
||||
$this->log(LogLevel::CRITICAL, $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Runtime errors that do not require immediate action but should typically
|
||||
* be logged and monitored.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function error($message, array $context = array())
|
||||
{
|
||||
$this->log(LogLevel::ERROR, $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Exceptional occurrences that are not errors.
|
||||
*
|
||||
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
||||
* that are not necessarily wrong.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function warning($message, array $context = array())
|
||||
{
|
||||
$this->log(LogLevel::WARNING, $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Normal but significant events.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function notice($message, array $context = array())
|
||||
{
|
||||
$this->log(LogLevel::NOTICE, $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Interesting events.
|
||||
*
|
||||
* Example: User logs in, SQL logs.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function info($message, array $context = array())
|
||||
{
|
||||
$this->log(LogLevel::INFO, $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Detailed debug information.
|
||||
*
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function debug($message, array $context = array())
|
||||
{
|
||||
$this->log(LogLevel::DEBUG, $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs with an arbitrary level.
|
||||
*
|
||||
* @param mixed $level
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
abstract public function log($level, $message, array $context = array());
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Psr\Log;
|
||||
|
||||
/**
|
||||
* This Logger can be used to avoid conditional log calls
|
||||
*
|
||||
* Logging should always be optional, and if no logger is provided to your
|
||||
* library creating a NullLogger instance to have something to throw logs at
|
||||
* is a good way to avoid littering your code with `if ($this->logger) { }`
|
||||
* blocks.
|
||||
*/
|
||||
class NullLogger extends AbstractLogger
|
||||
{
|
||||
/**
|
||||
* Logs with an arbitrary level.
|
||||
*
|
||||
* @param mixed $level
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
* @return null
|
||||
*/
|
||||
public function log($level, $message, array $context = array())
|
||||
{
|
||||
// noop
|
||||
}
|
||||
}
|
@ -1,116 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Psr\Log\Test;
|
||||
|
||||
use Psr\Log\LogLevel;
|
||||
|
||||
/**
|
||||
* Provides a base test class for ensuring compliance with the LoggerInterface
|
||||
*
|
||||
* Implementors can extend the class and implement abstract methods to run this as part of their test suite
|
||||
*/
|
||||
abstract class LoggerInterfaceTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @return LoggerInterface
|
||||
*/
|
||||
abstract function getLogger();
|
||||
|
||||
/**
|
||||
* This must return the log messages in order with a simple formatting: "<LOG LEVEL> <MESSAGE>"
|
||||
*
|
||||
* Example ->error('Foo') would yield "error Foo"
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
abstract function getLogs();
|
||||
|
||||
public function testImplements()
|
||||
{
|
||||
$this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideLevelsAndMessages
|
||||
*/
|
||||
public function testLogsAtAllLevels($level, $message)
|
||||
{
|
||||
$logger = $this->getLogger();
|
||||
$logger->{$level}($message, array('user' => 'Bob'));
|
||||
$logger->log($level, $message, array('user' => 'Bob'));
|
||||
|
||||
$expected = array(
|
||||
$level.' message of level '.$level.' with context: Bob',
|
||||
$level.' message of level '.$level.' with context: Bob',
|
||||
);
|
||||
$this->assertEquals($expected, $this->getLogs());
|
||||
}
|
||||
|
||||
public function provideLevelsAndMessages()
|
||||
{
|
||||
return array(
|
||||
LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'),
|
||||
LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'),
|
||||
LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'),
|
||||
LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'),
|
||||
LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'),
|
||||
LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'),
|
||||
LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'),
|
||||
LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Psr\Log\InvalidArgumentException
|
||||
*/
|
||||
public function testThrowsOnInvalidLevel()
|
||||
{
|
||||
$logger = $this->getLogger();
|
||||
$logger->log('invalid level', 'Foo');
|
||||
}
|
||||
|
||||
public function testContextReplacement()
|
||||
{
|
||||
$logger = $this->getLogger();
|
||||
$logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar'));
|
||||
|
||||
$expected = array('info {Message {nothing} Bob Bar a}');
|
||||
$this->assertEquals($expected, $this->getLogs());
|
||||
}
|
||||
|
||||
public function testObjectCastToString()
|
||||
{
|
||||
$dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString'));
|
||||
$dummy->expects($this->once())
|
||||
->method('__toString')
|
||||
->will($this->returnValue('DUMMY'));
|
||||
|
||||
$this->getLogger()->warning($dummy);
|
||||
}
|
||||
|
||||
public function testContextCanContainAnything()
|
||||
{
|
||||
$context = array(
|
||||
'bool' => true,
|
||||
'null' => null,
|
||||
'string' => 'Foo',
|
||||
'int' => 0,
|
||||
'float' => 0.5,
|
||||
'nested' => array('with object' => new DummyTest),
|
||||
'object' => new \DateTime,
|
||||
'resource' => fopen('php://memory', 'r'),
|
||||
);
|
||||
|
||||
$this->getLogger()->warning('Crazy context data', $context);
|
||||
}
|
||||
|
||||
public function testContextExceptionKeyCanBeExceptionOrOtherValues()
|
||||
{
|
||||
$this->getLogger()->warning('Random message', array('exception' => 'oops'));
|
||||
$this->getLogger()->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail')));
|
||||
}
|
||||
}
|
||||
|
||||
class DummyTest
|
||||
{
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
PSR Log
|
||||
=======
|
||||
|
||||
This repository holds all interfaces/classes/traits related to
|
||||
[PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md).
|
||||
|
||||
Note that this is not a logger of its own. It is merely an interface that
|
||||
describes a logger. See the specification for more details.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
If you need a logger, you can use the interface like this:
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class Foo
|
||||
{
|
||||
private $logger;
|
||||
|
||||
public function __construct(LoggerInterface $logger = null)
|
||||
{
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public function doSomething()
|
||||
{
|
||||
if ($this->logger) {
|
||||
$this->logger->info('Doing work');
|
||||
}
|
||||
|
||||
// do something useful
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can then pick one of the implementations of the interface to get a logger.
|
||||
|
||||
If you want to implement the interface, you can require this package and
|
||||
implement `Psr\Log\LoggerInterface` in your code. Please read the
|
||||
[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
|
||||
for details.
|
@ -1,17 +0,0 @@
|
||||
{
|
||||
"name": "psr/log",
|
||||
"description": "Common interface for logging libraries",
|
||||
"keywords": ["psr", "psr-3", "log"],
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Psr\\Log\\": ""
|
||||
}
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 PHP Framework Interoperability Group
|
||||
|
||||
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
> of this software and associated documentation files (the "Software"), to deal
|
||||
> in the Software without restriction, including without limitation the rights
|
||||
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
> copies of the Software, and to permit persons to whom the Software is
|
||||
> furnished to do so, subject to the following conditions:
|
||||
>
|
||||
> The above copyright notice and this permission notice shall be included in
|
||||
> all copies or substantial portions of the Software.
|
||||
>
|
||||
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
> THE SOFTWARE.
|
@ -1,8 +0,0 @@
|
||||
PHP FIG Simple Cache PSR
|
||||
========================
|
||||
|
||||
This repository holds all interfaces related to PSR-16.
|
||||
|
||||
Note that this is not a cache implementation of its own. It is merely an interface that describes a cache implementation. See [the specification](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-16-simple-cache.md) for more details.
|
||||
|
||||
You can find implementations of the specification by looking for packages providing the [psr/simple-cache-implementation](https://packagist.org/providers/psr/simple-cache-implementation) virtual package.
|
@ -1,25 +0,0 @@
|
||||
{
|
||||
"name": "psr/simple-cache",
|
||||
"description": "Common interfaces for simple caching",
|
||||
"keywords": ["psr", "psr-16", "cache", "simple-cache", "caching"],
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\SimpleCache\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Psr\SimpleCache;
|
||||
|
||||
/**
|
||||
* Interface used for all types of exceptions thrown by the implementing library.
|
||||
*/
|
||||
interface CacheException
|
||||
{
|
||||
}
|
@ -1,114 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Psr\SimpleCache;
|
||||
|
||||
interface CacheInterface
|
||||
{
|
||||
/**
|
||||
* Fetches a value from the cache.
|
||||
*
|
||||
* @param string $key The unique key of this item in the cache.
|
||||
* @param mixed $default Default value to return if the key does not exist.
|
||||
*
|
||||
* @return mixed The value of the item from the cache, or $default in case of cache miss.
|
||||
*
|
||||
* @throws \Psr\SimpleCache\InvalidArgumentException
|
||||
* MUST be thrown if the $key string is not a legal value.
|
||||
*/
|
||||
public function get($key, $default = null);
|
||||
|
||||
/**
|
||||
* Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.
|
||||
*
|
||||
* @param string $key The key of the item to store.
|
||||
* @param mixed $value The value of the item to store, must be serializable.
|
||||
* @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and
|
||||
* the driver supports TTL then the library may set a default value
|
||||
* for it or let the driver take care of that.
|
||||
*
|
||||
* @return bool True on success and false on failure.
|
||||
*
|
||||
* @throws \Psr\SimpleCache\InvalidArgumentException
|
||||
* MUST be thrown if the $key string is not a legal value.
|
||||
*/
|
||||
public function set($key, $value, $ttl = null);
|
||||
|
||||
/**
|
||||
* Delete an item from the cache by its unique key.
|
||||
*
|
||||
* @param string $key The unique cache key of the item to delete.
|
||||
*
|
||||
* @return bool True if the item was successfully removed. False if there was an error.
|
||||
*
|
||||
* @throws \Psr\SimpleCache\InvalidArgumentException
|
||||
* MUST be thrown if the $key string is not a legal value.
|
||||
*/
|
||||
public function delete($key);
|
||||
|
||||
/**
|
||||
* Wipes clean the entire cache's keys.
|
||||
*
|
||||
* @return bool True on success and false on failure.
|
||||
*/
|
||||
public function clear();
|
||||
|
||||
/**
|
||||
* Obtains multiple cache items by their unique keys.
|
||||
*
|
||||
* @param iterable $keys A list of keys that can obtained in a single operation.
|
||||
* @param mixed $default Default value to return for keys that do not exist.
|
||||
*
|
||||
* @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value.
|
||||
*
|
||||
* @throws \Psr\SimpleCache\InvalidArgumentException
|
||||
* MUST be thrown if $keys is neither an array nor a Traversable,
|
||||
* or if any of the $keys are not a legal value.
|
||||
*/
|
||||
public function getMultiple($keys, $default = null);
|
||||
|
||||
/**
|
||||
* Persists a set of key => value pairs in the cache, with an optional TTL.
|
||||
*
|
||||
* @param iterable $values A list of key => value pairs for a multiple-set operation.
|
||||
* @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and
|
||||
* the driver supports TTL then the library may set a default value
|
||||
* for it or let the driver take care of that.
|
||||
*
|
||||
* @return bool True on success and false on failure.
|
||||
*
|
||||
* @throws \Psr\SimpleCache\InvalidArgumentException
|
||||
* MUST be thrown if $values is neither an array nor a Traversable,
|
||||
* or if any of the $values are not a legal value.
|
||||
*/
|
||||
public function setMultiple($values, $ttl = null);
|
||||
|
||||
/**
|
||||
* Deletes multiple cache items in a single operation.
|
||||
*
|
||||
* @param iterable $keys A list of string-based keys to be deleted.
|
||||
*
|
||||
* @return bool True if the items were successfully removed. False if there was an error.
|
||||
*
|
||||
* @throws \Psr\SimpleCache\InvalidArgumentException
|
||||
* MUST be thrown if $keys is neither an array nor a Traversable,
|
||||
* or if any of the $keys are not a legal value.
|
||||
*/
|
||||
public function deleteMultiple($keys);
|
||||
|
||||
/**
|
||||
* Determines whether an item is present in the cache.
|
||||
*
|
||||
* NOTE: It is recommended that has() is only to be used for cache warming type purposes
|
||||
* and not to be used within your live applications operations for get/set, as this method
|
||||
* is subject to a race condition where your has() will return true and immediately after,
|
||||
* another script can remove it making the state of your app out of date.
|
||||
*
|
||||
* @param string $key The cache item key.
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @throws \Psr\SimpleCache\InvalidArgumentException
|
||||
* MUST be thrown if the $key string is not a legal value.
|
||||
*/
|
||||
public function has($key);
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Psr\SimpleCache;
|
||||
|
||||
/**
|
||||
* Exception interface for invalid cache arguments.
|
||||
*
|
||||
* When an invalid argument is passed it must throw an exception which implements
|
||||
* this interface
|
||||
*/
|
||||
interface InvalidArgumentException extends CacheException
|
||||
{
|
||||
}
|
@ -1,87 +0,0 @@
|
||||
# Changelog 4.0.5 (2020-03-15)
|
||||
|
||||
- fix "symfony/var-exporter" for OpCache
|
||||
|
||||
# Changelog 4.0.4 (2020-03-15)
|
||||
|
||||
- use "symfony/var-exporter" for OpCache
|
||||
|
||||
-> better performance, because we don't need to serialize the data
|
||||
|
||||
-> but it's optional, because it required PHP >= 7.1
|
||||
|
||||
# Changelog 4.0.3 (2019-11-18)
|
||||
|
||||
- "iSerializer" -> add "getName()"
|
||||
- fix usage of "file_put_contents"
|
||||
- fix errors from php 7.4
|
||||
- fix return of "CacheChain" (return true, if one cache-instance was successfully)
|
||||
|
||||
|
||||
# Changelog 4.0.2 (2019-04-23)
|
||||
|
||||
- fix errors reported by phpstan (level 7)
|
||||
- fix for APC(u) + CLI usage
|
||||
- fix & new tests for "CacheChain" -> now accepts Cache objects instead of "iCache"
|
||||
|
||||
|
||||
# Changelog 4.0.1 (2019-03-03)
|
||||
|
||||
- hide "warning" about Zend OPcache API is restricted by "restrict_api"
|
||||
|
||||
|
||||
# Changelog 4.0.0 (2019-02-24)
|
||||
|
||||
- add "CacheAdapterAutoManager"
|
||||
- fix typos in "CachePsr16"
|
||||
- "iCache->setItemToDate()" now accepts DateTimeInterface instead of DateTime
|
||||
|
||||
|
||||
# Changelog 3.2.2 (2018-12-21)
|
||||
|
||||
- fix APC(u) detection for CLI usage
|
||||
|
||||
|
||||
# Changelog 3.2.1 (2018-12-20)
|
||||
|
||||
- use phpcs fixer
|
||||
|
||||
|
||||
# Changelog 3.2.0 (2018-12-03)
|
||||
|
||||
- "AdapterOpCache" -> use "opcache_compile_file()"
|
||||
- add "AdapterFileSimple" + tests
|
||||
- "Cache" -> add the possibility to disable the cache behavior via constructor() -> "disableCacheGetParameter, useCheckForAdminSession, useCheckForServerIpIsClientIp, useCheckForDev"
|
||||
|
||||
|
||||
# Changelog 3.1.1 (2018-01-07)
|
||||
|
||||
- "AdapterApcu" -> fixed php-warning from "apcu_clear_cache()"
|
||||
|
||||
|
||||
# Changelog 3.1.0 (2018-01-07)
|
||||
|
||||
- "AdapterOpCache" -> added
|
||||
- "AdapterFile" -> remove duplicate file-get code
|
||||
|
||||
|
||||
# Changelog 3.0.2 (2017-12-14)
|
||||
|
||||
- "AdapterFile" -> fix php warning
|
||||
|
||||
|
||||
# Chabgelog 3.0.1 (2017-12-01)
|
||||
|
||||
- fix return from the "CacheChain"-class
|
||||
- update phpunit-config
|
||||
|
||||
|
||||
# Changelog 3.0.0 (2017-11-25)
|
||||
|
||||
- drop support for PHP < 7.0
|
||||
- use "strict_types"
|
||||
|
||||
|
||||
# Changelog 2.4.0 (2017-10-06)
|
||||
|
||||
- add support for PSR-16
|
@ -1,19 +0,0 @@
|
||||
Copyright (c) 2015 Lars Moelleken
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
@ -1,182 +0,0 @@
|
||||
[](https://travis-ci.org/voku/simple-cache)
|
||||
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fvoku%2Fsimple-cache?ref=badge_shield)
|
||||
[](https://coveralls.io/github/voku/simple-cache?branch=master)
|
||||
[](https://scrutinizer-ci.com/g/voku/simple-cache/?branch=master)
|
||||
[](https://www.codacy.com/app/voku/simple-cache)
|
||||
[](https://packagist.org/packages/voku/simple-cache)
|
||||
[](https://packagist.org/packages/voku/simple-cache)
|
||||
[](https://packagist.org/packages/voku/simple-cache)
|
||||
[](https://www.paypal.me/moelleken)
|
||||
[](https://www.patreon.com/voku)
|
||||
|
||||
# :zap: Simple Cache Class
|
||||
|
||||
This is a simple Cache Abstraction Layer for PHP >= 7.0 that provides a simple interaction
|
||||
with your cache-server. You can define the Adapter / Serializer in the "constructor" or the class will auto-detect you server-cache in this order:
|
||||
|
||||
1. Memcached / Memcache
|
||||
2. Redis
|
||||
3. Xcache
|
||||
4. APC / APCu
|
||||
5. OpCache (via PHP-files)
|
||||
6. Static-PHP-Cache
|
||||
|
||||
### Get "Simple Cache"
|
||||
|
||||
You can download it from here, or require it using [composer](https://packagist.org/packages/voku/simple-cache).
|
||||
```json
|
||||
{
|
||||
"require": {
|
||||
"voku/simple-cache": "4.*"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Install via "composer require"
|
||||
|
||||
```shell
|
||||
composer require voku/simple-cache
|
||||
```
|
||||
|
||||
|
||||
### Quick Start
|
||||
|
||||
```php
|
||||
use voku\cache\Cache;
|
||||
|
||||
require_once 'composer/autoload.php';
|
||||
|
||||
$cache = new Cache();
|
||||
$ttl = 3600; // 60s * 60 = 1h
|
||||
$cache->setItem('foo', 'bar', $ttl);
|
||||
$bar = $cache->getItem('foo');
|
||||
```
|
||||
|
||||
|
||||
### Usage
|
||||
|
||||
```php
|
||||
use voku\cache\Cache;
|
||||
|
||||
$cache = new Cache();
|
||||
|
||||
if ($cache->getCacheIsReady() === true && $cache->existsItem('foo')) {
|
||||
return $cache->getItem('foo');
|
||||
} else {
|
||||
$bar = someSpecialFunctionsWithAReturnValue();
|
||||
$cache->setItem('foo', $bar);
|
||||
return $bar;
|
||||
}
|
||||
```
|
||||
|
||||
If you have an heavy task e.g. a really-big-loop, then you can also use static-cache.
|
||||
But keep in mind, that this will be stored into PHP (it needs more memory).
|
||||
|
||||
```php
|
||||
use voku\cache\Cache;
|
||||
|
||||
$cache = new Cache();
|
||||
|
||||
if ($cache->getCacheIsReady() === true && $cache->existsItem('foo')) {
|
||||
for ($i = 0; $i <= 100000; $i++) {
|
||||
echo $this->cache->getItem('foo', 3); // use also static-php-cache, when we hit the cache 3-times
|
||||
}
|
||||
return $cache->getItem('foo');
|
||||
} else {
|
||||
$bar = someSpecialFunctionsWithAReturnValue();
|
||||
$cache->setItem('foo', $bar);
|
||||
return $bar;
|
||||
}
|
||||
```
|
||||
|
||||
PS: By default, the static cache is also used by >= 10 cache hits. But you can configure
|
||||
this behavior via $cache->setStaticCacheHitCounter(INT).
|
||||
|
||||
## No-Cache for the admin or a specific ip-address
|
||||
|
||||
If you use the parameter "$checkForUser" (=== true) in the constructor, then the cache isn't used for the admin-session.
|
||||
|
||||
-> You can also overwrite the check for the user, if you add a global function named "checkForDev()".
|
||||
|
||||
## Overwrite the auto-connection option
|
||||
|
||||
You can overwrite the cache auto-detect via "CacheAdapterAutoManager" and the
|
||||
"$cacheAdapterManagerForAutoConnect" option in the "Cache"-constructor. Additional you can also
|
||||
activate the "$cacheAdapterManagerForAutoConnectOverwrite" option in the "Cache"-constructor, so that
|
||||
you can implement your own cache auto-detect logic.
|
||||
|
||||
```php
|
||||
|
||||
$cacheManager = new \voku\cache\CacheAdapterAutoManager();
|
||||
|
||||
// 1. check for "APCu" support first
|
||||
$cacheManager->addAdapter(
|
||||
\voku\cache\AdapterApcu::class
|
||||
);
|
||||
|
||||
// 2. check for "APC" support
|
||||
$cacheManager->addAdapter(
|
||||
\voku\cache\AdapterApcu::class
|
||||
);
|
||||
|
||||
// 3. try "OpCache"-Cache
|
||||
$cacheManager->addAdapter(
|
||||
\voku\cache\AdapterOpCache::class,
|
||||
static function () {
|
||||
$cacheDir = \realpath(\sys_get_temp_dir()) . '/simple_php_cache_opcache';
|
||||
|
||||
return $cacheDir;
|
||||
}
|
||||
);
|
||||
|
||||
// 4. try "File"-Cache
|
||||
$cacheManager->addAdapter(
|
||||
\voku\cache\AdapterFileSimple::class,
|
||||
static function () {
|
||||
$cacheDir = \realpath(\sys_get_temp_dir()) . '/simple_php_cache_file';
|
||||
|
||||
return $cacheDir;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// 5. use Memory Cache as final fallback
|
||||
$cacheManager->addAdapter(
|
||||
\voku\cache\AdapterArray::class
|
||||
);
|
||||
|
||||
$cache = new \voku\cache\CachePsr16(
|
||||
null, // use auto-detection
|
||||
null, // use auto-detection
|
||||
false, // do not check for usage
|
||||
true, // enable the cache
|
||||
false, // do not check for admin session
|
||||
false, // do not check for dev
|
||||
false, // do not check for admin session
|
||||
false, // do not check for server vs. client ip
|
||||
'', // do not use "_GET"-parameter for disabling
|
||||
$cacheManager, // new auto-detection logic
|
||||
true // overwrite the auto-detection logic
|
||||
);
|
||||
```
|
||||
|
||||
### Support
|
||||
|
||||
For support and donations please visit [Github](https://github.com/voku/simple-cache/) | [Issues](https://github.com/voku/simple-cache/issues) | [PayPal](https://paypal.me/moelleken) | [Patreon](https://www.patreon.com/voku).
|
||||
|
||||
For status updates and release announcements please visit [Releases](https://github.com/voku/simple-cache/releases) | [Twitter](https://twitter.com/suckup_de) | [Patreon](https://www.patreon.com/voku/posts).
|
||||
|
||||
For professional support please contact [me](https://about.me/voku).
|
||||
|
||||
### Thanks
|
||||
|
||||
- Thanks to [GitHub](https://github.com) (Microsoft) for hosting the code and a good infrastructure including Issues-Managment, etc.
|
||||
- Thanks to [IntelliJ](https://www.jetbrains.com) as they make the best IDEs for PHP and they gave me an open source license for PhpStorm!
|
||||
- Thanks to [Travis CI](https://travis-ci.com/) for being the most awesome, easiest continous integration tool out there!
|
||||
- Thanks to [StyleCI](https://styleci.io/) for the simple but powerfull code style check.
|
||||
- Thanks to [PHPStan](https://github.com/phpstan/phpstan) && [Psalm](https://github.com/vimeo/psalm) for relly great Static analysis tools and for discover bugs in the code!
|
||||
|
||||
|
||||
### License
|
||||
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fvoku%2Fsimple-cache?ref=badge_large)
|
@ -1,39 +0,0 @@
|
||||
{
|
||||
"name": "voku/simple-cache",
|
||||
"description": "Simple Cache library",
|
||||
"keywords": [
|
||||
"php",
|
||||
"cache",
|
||||
"simple cache",
|
||||
"caching"
|
||||
],
|
||||
"type": "library",
|
||||
"homepage": "https://github.com/voku/simple-cache",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Lars Moelleken",
|
||||
"homepage": "http://www.moelleken.org/",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"provide": {
|
||||
"psr/simple-cache-implementation": "1.0"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.0.0",
|
||||
"psr/simple-cache": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~6.0 || ~7.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/var-exporter" : "~3.0 || ~4.0 || ~5.0",
|
||||
"predis/predis": "~1.1"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"voku\\cache\\": "src/voku/cache/"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
parameters:
|
||||
level: max
|
||||
paths:
|
||||
- %currentWorkingDirectory%/src/
|
||||
reportUnmatchedIgnoredErrors: false
|
||||
checkMissingIterableValueType: false
|
||||
excludes_analyse:
|
||||
- %currentWorkingDirectory%/vendor/*
|
||||
- %currentWorkingDirectory%/tests/*
|
||||
autoload_files:
|
||||
- %currentWorkingDirectory%/vendor/autoload.php
|
||||
ignoreErrors:
|
||||
- '/always false/'
|
||||
- '/always true/'
|
||||
- '/Predis\\Client/'
|
||||
- '/Symfony\\Component\\VarExporter/'
|
||||
- '/Memcache(d)*/'
|
||||
- '/MEMCACHE_COMPRESSED/'
|
||||
- '/Function checkForDev not found\./'
|
||||
- '/Function msgpack/'
|
||||
- '/function unserialize expects array/'
|
@ -1,168 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
/**
|
||||
* AdapterApc: a APC-Cache adapter
|
||||
*
|
||||
* @see http://php.net/manual/de/book.apc.php
|
||||
*/
|
||||
class AdapterApc implements iAdapter
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $installed = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $debug = false;
|
||||
|
||||
/**
|
||||
* __construct()
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (
|
||||
\PHP_SAPI !== 'cli'
|
||||
&&
|
||||
\function_exists('apc_store') === true
|
||||
&&
|
||||
\ini_get('apc.enabled')
|
||||
) {
|
||||
$this->installed = true;
|
||||
}
|
||||
|
||||
if (
|
||||
\PHP_SAPI === 'cli'
|
||||
&&
|
||||
\function_exists('apc_store') === true
|
||||
&&
|
||||
\ini_get('apc.enable_cli')
|
||||
) {
|
||||
\ini_set('apc.use_request_time', '0');
|
||||
|
||||
$this->installed = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if apc-cache exists.
|
||||
*
|
||||
* WARNING: use $this->exists($key) instead
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public function apc_cache_exists($key): bool
|
||||
{
|
||||
return (bool) \apc_fetch($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the APC cache by type.
|
||||
*
|
||||
* @param string $type - If $type is "user", the user cache will be cleared; otherwise,
|
||||
* the system cache (cached files) will be cleared
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public function cacheClear(string $type): bool
|
||||
{
|
||||
return (bool) \apc_clear_cache($type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves cached information from APC's data store
|
||||
*
|
||||
* @param string $type - If $type is "user", information about the user cache will be returned
|
||||
* @param bool $limited - If $limited is TRUE, the return value will exclude the individual list of cache
|
||||
* entries. This is useful when trying to optimize calls for statistics gathering
|
||||
*
|
||||
* @return array
|
||||
* <p>Array of cached data (and meta-data) or empty array on failure.</p>
|
||||
*/
|
||||
public function cacheInfo(string $type = '', bool $limited = false): array
|
||||
{
|
||||
/** @var array|false $return */
|
||||
$return = \apc_cache_info($type, $limited);
|
||||
|
||||
if ($return === false) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exists(string $key): bool
|
||||
{
|
||||
if (\function_exists('apc_exists')) {
|
||||
return (bool) \apc_exists($key);
|
||||
}
|
||||
|
||||
return $this->apc_cache_exists($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get(string $key)
|
||||
{
|
||||
if ($this->exists($key)) {
|
||||
return \apc_fetch($key);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function installed(): bool
|
||||
{
|
||||
return $this->installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function remove(string $key): bool
|
||||
{
|
||||
return (bool) \apc_delete($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function removeAll(): bool
|
||||
{
|
||||
return (bool) ($this->cacheClear('system') && $this->cacheClear('user'));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function set(string $key, $value): bool
|
||||
{
|
||||
return (bool) \apc_store($key, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setExpired(string $key, $data, int $ttl = 0): bool
|
||||
{
|
||||
return (bool) \apc_store($key, $data, $ttl);
|
||||
}
|
||||
}
|
@ -1,163 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
/**
|
||||
* AdapterApcu: a APCu-Cache adapter
|
||||
*
|
||||
* @see http://php.net/manual/de/book.apcu.php
|
||||
*/
|
||||
class AdapterApcu implements iAdapter
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $installed = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $debug = false;
|
||||
|
||||
/**
|
||||
* __construct()
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (
|
||||
\PHP_SAPI !== 'cli'
|
||||
&&
|
||||
\function_exists('apcu_store') === true
|
||||
&&
|
||||
\ini_get('apc.enabled')
|
||||
) {
|
||||
$this->installed = true;
|
||||
}
|
||||
|
||||
if (
|
||||
\PHP_SAPI === 'cli'
|
||||
&&
|
||||
\function_exists('apcu_store') === true
|
||||
&&
|
||||
\ini_get('apc.enable_cli')
|
||||
) {
|
||||
\ini_set('apc.use_request_time', '0');
|
||||
|
||||
$this->installed = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if apcu-cache exists.
|
||||
*
|
||||
* WARNING: we only keep this method for compatibly-reasons
|
||||
* -> use ->exists($key)
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public function apcu_cache_exists($key): bool
|
||||
{
|
||||
return $this->exists($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the APCu cache by type.
|
||||
*
|
||||
* @param string $type <p>WARNING: is not used in APCu only valid for APC</p>
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public function cacheClear(string $type): bool
|
||||
{
|
||||
return (bool) \apcu_clear_cache();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves cached information from APCu's data store
|
||||
*
|
||||
* @param bool $limited - If $limited is TRUE, the return value will exclude the individual list of cache
|
||||
* entries. This is useful when trying to optimize calls for statistics gathering
|
||||
*
|
||||
* @return array
|
||||
* <p>Array of cached data (and meta-data) or empty array on failure.</p>
|
||||
*/
|
||||
public function cacheInfo(bool $limited = false): array
|
||||
{
|
||||
/** @var array|false $return */
|
||||
$return = \apcu_cache_info($limited);
|
||||
|
||||
if ($return === false) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exists(string $key): bool
|
||||
{
|
||||
return (bool) \apcu_exists($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get(string $key)
|
||||
{
|
||||
if ($this->exists($key)) {
|
||||
return \apcu_fetch($key);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function installed(): bool
|
||||
{
|
||||
return $this->installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function remove(string $key): bool
|
||||
{
|
||||
return (bool) \apcu_delete($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function removeAll(): bool
|
||||
{
|
||||
return (bool) ($this->cacheClear('system') && $this->cacheClear('user'));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function set(string $key, $value): bool
|
||||
{
|
||||
return (bool) \apcu_store($key, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setExpired(string $key, $data, int $ttl = 0): bool
|
||||
{
|
||||
return (bool) \apcu_store($key, $data, $ttl);
|
||||
}
|
||||
}
|
@ -1,130 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
/**
|
||||
* AdapterArray: simple array-cache adapter
|
||||
*/
|
||||
class AdapterArray implements iAdapter
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private static $values = [];
|
||||
|
||||
/**
|
||||
* @var array<string, array<int>>
|
||||
*/
|
||||
private static $expired = [];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exists(string $key): bool
|
||||
{
|
||||
$this->removeExpired($key);
|
||||
|
||||
return \array_key_exists($key, self::$values);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get(string $key)
|
||||
{
|
||||
return $this->exists($key) ? self::$values[$key] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function installed(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function remove(string $key): bool
|
||||
{
|
||||
$this->removeExpired($key);
|
||||
|
||||
if (\array_key_exists($key, self::$values) === true) {
|
||||
unset(self::$values[$key]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function removeAll(): bool
|
||||
{
|
||||
self::$values = [];
|
||||
self::$expired = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function set(string $key, $value): bool
|
||||
{
|
||||
self::$values[$key] = $value;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setExpired(string $key, $value, int $ttl = 0): bool
|
||||
{
|
||||
self::$values[$key] = $value;
|
||||
|
||||
if ($ttl !== 0) {
|
||||
self::$expired[$key] = [\time(), $ttl];
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove expired cache.
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function removeExpired($key): bool
|
||||
{
|
||||
if (
|
||||
\array_key_exists($key, self::$expired) === false
|
||||
||
|
||||
\array_key_exists($key, self::$values) === false
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
list($time, $ttl) = self::$expired[$key];
|
||||
\assert(\is_int($time));
|
||||
\assert(\is_int($ttl));
|
||||
|
||||
if (\time() > ($time + $ttl)) {
|
||||
unset(self::$values[$key]);
|
||||
}
|
||||
|
||||
if (!isset(self::$values[$key])) {
|
||||
unset(self::$expired[$key]);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,95 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
/**
|
||||
* AdapterFile: File-adapter
|
||||
*/
|
||||
class AdapterFile extends AdapterFileAbstract
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get(string $key)
|
||||
{
|
||||
$path = $this->getFileName($key);
|
||||
|
||||
if (
|
||||
\file_exists($path) === false
|
||||
||
|
||||
\filesize($path) === 0
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// init
|
||||
$string = '';
|
||||
|
||||
/** @noinspection PhpUsageOfSilenceOperatorInspection */
|
||||
$fp = @\fopen($path, 'rb');
|
||||
if ($fp && \flock($fp, \LOCK_SH | \LOCK_NB)) {
|
||||
while (!\feof($fp)) {
|
||||
$line = \fgets($fp);
|
||||
$string .= $line;
|
||||
}
|
||||
\flock($fp, \LOCK_UN);
|
||||
}
|
||||
if ($fp) {
|
||||
\fclose($fp);
|
||||
}
|
||||
|
||||
if (!$string) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = $this->serializer->unserialize($string);
|
||||
|
||||
if (!$data || !$this->validateDataFromCache($data)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($this->ttlHasExpired($data['ttl']) === true) {
|
||||
$this->remove($key);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return $data['value'];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setExpired(string $key, $value, int $ttl = 0): bool
|
||||
{
|
||||
$item = $this->serializer->serialize(
|
||||
[
|
||||
'value' => $value,
|
||||
'ttl' => $ttl ? $ttl + \time() : 0,
|
||||
]
|
||||
);
|
||||
|
||||
// init
|
||||
$octetWritten = false;
|
||||
|
||||
$cacheFile = $this->getFileName($key);
|
||||
|
||||
// Open the file for writing only. If the file does not exist, it is created.
|
||||
// If it exists, it is neither truncated, nor the call to this function fails.
|
||||
/** @noinspection PhpUsageOfSilenceOperatorInspection */
|
||||
$fp = @\fopen($cacheFile, 'cb');
|
||||
if ($fp && \flock($fp, \LOCK_EX | \LOCK_NB)) {
|
||||
\ftruncate($fp, 0);
|
||||
$octetWritten = \fwrite($fp, $item);
|
||||
\fflush($fp);
|
||||
\flock($fp, \LOCK_UN);
|
||||
}
|
||||
if ($fp !== false) {
|
||||
\fclose($fp);
|
||||
}
|
||||
|
||||
return $octetWritten !== false;
|
||||
}
|
||||
}
|
@ -1,300 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
/**
|
||||
* AdapterFileSimple: File-adapter (simple)
|
||||
*/
|
||||
abstract class AdapterFileAbstract implements iAdapter
|
||||
{
|
||||
const CACHE_FILE_PREFIX = '__';
|
||||
|
||||
const CACHE_FILE_SUBFIX = '.php.cache';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $installed = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $cacheDir;
|
||||
|
||||
/**
|
||||
* @var iSerializer
|
||||
*/
|
||||
protected $serializer;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $fileMode = '0755';
|
||||
|
||||
/**
|
||||
* @param callable|string|null $cacheDir
|
||||
*/
|
||||
public function __construct($cacheDir = null)
|
||||
{
|
||||
$this->serializer = new SerializerIgbinary();
|
||||
|
||||
if (!$cacheDir) {
|
||||
$cacheDir = \realpath(\sys_get_temp_dir()) . '/simple_php_cache';
|
||||
}
|
||||
|
||||
if (\is_callable($cacheDir)) {
|
||||
$this->cacheDir = (string) \call_user_func($cacheDir);
|
||||
} else {
|
||||
$this->cacheDir = (string) $cacheDir;
|
||||
}
|
||||
|
||||
if ($this->createCacheDirectory($this->cacheDir) === true) {
|
||||
$this->installed = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively creates & chmod directories.
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function createCacheDirectory($path): bool
|
||||
{
|
||||
if (
|
||||
!$path
|
||||
||
|
||||
$path === '/'
|
||||
||
|
||||
$path === '.'
|
||||
||
|
||||
$path === '\\'
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// if the directory already exists, just return true
|
||||
if (\is_dir($path) && \is_writable($path)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// if more than one level, try parent first
|
||||
if (\dirname($path) !== '.') {
|
||||
$return = $this->createCacheDirectory(\dirname($path));
|
||||
// if creating parent fails, we can abort immediately
|
||||
if (!$return) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$mode_dec = \intval($this->fileMode, 8);
|
||||
$old_umask = \umask(0);
|
||||
|
||||
/** @noinspection PhpUsageOfSilenceOperatorInspection */
|
||||
if (!@\mkdir($path, $mode_dec) && !\is_dir($path)) {
|
||||
$return = false;
|
||||
} else {
|
||||
$return = true;
|
||||
}
|
||||
|
||||
if (\is_dir($path) && !\is_writable($path)) {
|
||||
$return = \chmod($path, $mode_dec);
|
||||
}
|
||||
|
||||
\umask($old_umask);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $cacheFileWithPath
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function deleteFile($cacheFileWithPath): bool
|
||||
{
|
||||
if (\is_file($cacheFileWithPath)) {
|
||||
return \unlink($cacheFileWithPath);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exists(string $key): bool
|
||||
{
|
||||
$value = $this->get($key);
|
||||
|
||||
return $value !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
abstract public function get(string $key);
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function installed(): bool
|
||||
{
|
||||
return $this->installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function remove(string $key): bool
|
||||
{
|
||||
$cacheFile = $this->getFileName($key);
|
||||
|
||||
return $this->deleteFile($cacheFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function removeAll(): bool
|
||||
{
|
||||
if (!$this->cacheDir) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$return = [];
|
||||
foreach (new \DirectoryIterator($this->cacheDir) as $fileInfo) {
|
||||
if (!$fileInfo->isDot()) {
|
||||
$return[] = \unlink($fileInfo->getPathname());
|
||||
}
|
||||
}
|
||||
|
||||
return \in_array(false, $return, true) === false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function set(string $key, $value): bool
|
||||
{
|
||||
return $this->setExpired($key, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
abstract public function setExpired(string $key, $value, int $ttl = 0): bool;
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getFileName(string $key): string
|
||||
{
|
||||
return $this->cacheDir . \DIRECTORY_SEPARATOR . self::CACHE_FILE_PREFIX . $key . self::CACHE_FILE_SUBFIX;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the file-mode for new cache-files.
|
||||
*
|
||||
* e.g. '0777', or '0755' ...
|
||||
*
|
||||
* @param string $fileMode
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setFileMode($fileMode)
|
||||
{
|
||||
$this->fileMode = $fileMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $ttl
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function ttlHasExpired(int $ttl): bool
|
||||
{
|
||||
if ($ttl === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return \time() > $ttl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $data
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function validateDataFromCache($data): bool
|
||||
{
|
||||
if (!\is_array($data)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (['value', 'ttl'] as $missing) {
|
||||
if (!\array_key_exists($missing, $data)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* copy&past from https://github.com/webimpress/safe-writer (thx @michalbundyra)
|
||||
*
|
||||
* @param string $file
|
||||
* @param string $content
|
||||
* @param int|null $chmod
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function writeFile($file, $content, $chmod = null): bool
|
||||
{
|
||||
if (!$file) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($chmod === null) {
|
||||
$chmod = \intval($this->fileMode, 8);
|
||||
}
|
||||
|
||||
$dir = \dirname($file);
|
||||
|
||||
$tmp = \tempnam($dir, 'wsw');
|
||||
if ($tmp === false) {
|
||||
throw Exception\RuntimeException::unableToCreateTemporaryFile($dir);
|
||||
}
|
||||
|
||||
if (\file_put_contents($tmp, $content) === false) {
|
||||
\unlink($tmp);
|
||||
|
||||
throw Exception\WriteContentException::unableToWriteContent($tmp);
|
||||
}
|
||||
|
||||
if (\chmod($tmp, $chmod & ~\umask()) === false) {
|
||||
\unlink($tmp);
|
||||
|
||||
throw Exception\ChmodException::unableToChangeChmod($tmp);
|
||||
}
|
||||
|
||||
// On windows try again if rename was not successful but target file is writable.
|
||||
/** @noinspection PhpUsageOfSilenceOperatorInspection */
|
||||
while (@\rename($tmp, $file) === false) {
|
||||
if (\is_writable($file) && \stripos(\PHP_OS, 'WIN') === 0) {
|
||||
continue;
|
||||
}
|
||||
\unlink($tmp);
|
||||
|
||||
throw Exception\RenameException::unableToMoveFile($tmp, $file);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,90 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
/**
|
||||
* AdapterFileSimple: File-adapter (simple)
|
||||
*/
|
||||
class AdapterFileSimple extends AdapterFileAbstract
|
||||
{
|
||||
const CACHE_FILE_PREFIX = '__simple_';
|
||||
|
||||
/**
|
||||
* @return resource
|
||||
*/
|
||||
protected function getContext()
|
||||
{
|
||||
static $CONTEXT_CACHE = null;
|
||||
|
||||
if ($CONTEXT_CACHE === null) {
|
||||
$CONTEXT_CACHE = \stream_context_create(
|
||||
[
|
||||
'http' => [
|
||||
'timeout' => 2,
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
return $CONTEXT_CACHE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get(string $key)
|
||||
{
|
||||
$path = $this->getFileName($key);
|
||||
|
||||
if (
|
||||
\file_exists($path) === false
|
||||
||
|
||||
\filesize($path) === 0
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// init
|
||||
$string = \file_get_contents(
|
||||
$path,
|
||||
false,
|
||||
$this->getContext()
|
||||
);
|
||||
|
||||
if (!$string) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = $this->serializer->unserialize($string);
|
||||
|
||||
if (!$data || !$this->validateDataFromCache($data)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($this->ttlHasExpired($data['ttl']) === true) {
|
||||
$this->remove($key);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return $data['value'];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setExpired(string $key, $value, int $ttl = 0): bool
|
||||
{
|
||||
return $this->writeFile(
|
||||
$this->getFileName($key),
|
||||
$this->serializer->serialize(
|
||||
[
|
||||
'value' => $value,
|
||||
'ttl' => $ttl ? $ttl + \time() : 0,
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
@ -1,145 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
use Memcache;
|
||||
use voku\cache\Exception\InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* AdapterMemcache: Memcache-adapter
|
||||
*/
|
||||
class AdapterMemcache implements iAdapter
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $installed = false;
|
||||
|
||||
/**
|
||||
* @var Memcache
|
||||
*/
|
||||
private $memcache;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $compressed = false;
|
||||
|
||||
/**
|
||||
* __construct
|
||||
*
|
||||
* @param Memcache|null $memcache
|
||||
*/
|
||||
public function __construct($memcache = null)
|
||||
{
|
||||
if ($memcache instanceof Memcache) {
|
||||
$this->setMemcache($memcache);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Memcache $memcache
|
||||
*/
|
||||
public function setMemcache(Memcache $memcache)
|
||||
{
|
||||
$this->memcache = $memcache;
|
||||
$this->installed = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exists(string $key): bool
|
||||
{
|
||||
return $this->get($key) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get(string $key)
|
||||
{
|
||||
return $this->memcache->get($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function installed(): bool
|
||||
{
|
||||
return $this->installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function remove(string $key): bool
|
||||
{
|
||||
return $this->memcache->delete($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function removeAll(): bool
|
||||
{
|
||||
return $this->memcache->flush();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function set(string $key, $value): bool
|
||||
{
|
||||
// Make sure we are under the proper limit
|
||||
if (\strlen($key) > 250) {
|
||||
throw new InvalidArgumentException('The passed cache key is over 250 bytes:' . \print_r($key, true));
|
||||
}
|
||||
|
||||
return $this->memcache->set($key, $value, $this->getCompressedFlag());
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setExpired(string $key, $value, int $ttl = 0): bool
|
||||
{
|
||||
if ($ttl > 2592000) {
|
||||
$ttl = 2592000;
|
||||
}
|
||||
|
||||
return $this->memcache->set($key, $value, $this->getCompressedFlag(), $ttl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the compressed-flag from MemCache.
|
||||
*
|
||||
* @return int 2 || 0
|
||||
*/
|
||||
private function getCompressedFlag(): int
|
||||
{
|
||||
return $this->isCompressed() ? \MEMCACHE_COMPRESSED : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if compression from MemCache is active.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isCompressed(): bool
|
||||
{
|
||||
return $this->compressed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate the compression from MemCache.
|
||||
*
|
||||
* @param mixed $value will be converted to bool
|
||||
*/
|
||||
public function setCompressed($value)
|
||||
{
|
||||
$this->compressed = (bool) $value;
|
||||
}
|
||||
}
|
@ -1,133 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
use Memcached;
|
||||
use voku\cache\Exception\InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* AdapterMemcached: Memcached-adapter
|
||||
*/
|
||||
class AdapterMemcached implements iAdapter
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $installed = false;
|
||||
|
||||
/**
|
||||
* @var Memcached
|
||||
*/
|
||||
private $memcached;
|
||||
|
||||
/**
|
||||
* __construct
|
||||
*
|
||||
* @param Memcached|null $memcached
|
||||
*/
|
||||
public function __construct($memcached = null)
|
||||
{
|
||||
if ($memcached instanceof Memcached) {
|
||||
$this->setMemcached($memcached);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Memcached $memcached
|
||||
*/
|
||||
public function setMemcached(Memcached $memcached)
|
||||
{
|
||||
$this->memcached = $memcached;
|
||||
$this->installed = true;
|
||||
|
||||
$this->setSettings();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exists(string $key): bool
|
||||
{
|
||||
return $this->get($key) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get(string $key)
|
||||
{
|
||||
return $this->memcached->get($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function installed(): bool
|
||||
{
|
||||
return $this->installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function remove(string $key): bool
|
||||
{
|
||||
return $this->memcached->delete($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function removeAll(): bool
|
||||
{
|
||||
return $this->memcached->flush();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function set(string $key, $value): bool
|
||||
{
|
||||
// Make sure we are under the proper limit
|
||||
if (\strlen($this->memcached->getOption(Memcached::OPT_PREFIX_KEY) . $key) > 250) {
|
||||
throw new InvalidArgumentException('The passed cache key is over 250 bytes:' . \print_r($key, true));
|
||||
}
|
||||
|
||||
return $this->memcached->set($key, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setExpired(string $key, $value, int $ttl = 0): bool
|
||||
{
|
||||
if ($ttl > 2592000) {
|
||||
$ttl = 2592000;
|
||||
}
|
||||
|
||||
return $this->memcached->set($key, $value, $ttl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the MemCached settings.
|
||||
*
|
||||
* @noinspection PhpUndefinedClassConstantInspection -> MSGPACK is not added into phpstorm stubs
|
||||
*/
|
||||
private function setSettings()
|
||||
{
|
||||
// Use faster compression if available
|
||||
if (Memcached::HAVE_IGBINARY) {
|
||||
$this->memcached->setOption(Memcached::OPT_SERIALIZER, Memcached::SERIALIZER_IGBINARY);
|
||||
} elseif (\defined('Memcached::HAVE_MSGPACK') && Memcached::HAVE_MSGPACK) {
|
||||
$this->memcached->setOption(Memcached::OPT_SERIALIZER, Memcached::SERIALIZER_MSGPACK);
|
||||
}
|
||||
$this->memcached->setOption(Memcached::OPT_DISTRIBUTION, Memcached::DISTRIBUTION_CONSISTENT);
|
||||
$this->memcached->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
|
||||
$this->memcached->setOption(Memcached::OPT_NO_BLOCK, true);
|
||||
$this->memcached->setOption(Memcached::OPT_TCP_NODELAY, true);
|
||||
$this->memcached->setOption(Memcached::OPT_COMPRESSION, false);
|
||||
$this->memcached->setOption(Memcached::OPT_CONNECT_TIMEOUT, 2);
|
||||
}
|
||||
}
|
@ -1,130 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
/**
|
||||
* AdapterOpCache: PHP-OPcache
|
||||
*
|
||||
* OPcache improves PHP performance by storing precompiled script bytecode
|
||||
* in shared memory, thereby removing the need for PHP to load and
|
||||
* parse scripts on each request.
|
||||
*/
|
||||
class AdapterOpCache extends AdapterFileSimple
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private static $hasCompileFileFunction;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct($cacheDir = null)
|
||||
{
|
||||
parent::__construct($cacheDir);
|
||||
|
||||
$this->serializer = new SerializerNo();
|
||||
|
||||
if (self::$hasCompileFileFunction === null) {
|
||||
/** @noinspection PhpComposerExtensionStubsInspection */
|
||||
/** @noinspection PhpUsageOfSilenceOperatorInspection */
|
||||
self::$hasCompileFileFunction = (
|
||||
\function_exists('opcache_compile_file')
|
||||
&&
|
||||
!empty(@\opcache_get_status())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get(string $key)
|
||||
{
|
||||
$path = $this->getFileName($key);
|
||||
|
||||
if (
|
||||
\file_exists($path) === false
|
||||
||
|
||||
\filesize($path) === 0
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
$data = include $path;
|
||||
|
||||
if (!$data || !$this->validateDataFromCache($data)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($this->ttlHasExpired($data['ttl']) === true) {
|
||||
$this->remove($key);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return $data['value'];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getFileName(string $key): string
|
||||
{
|
||||
return $this->cacheDir . \DIRECTORY_SEPARATOR . self::CACHE_FILE_PREFIX . $key . '.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @noinspection PhpUndefinedClassInspection
|
||||
* @noinspection PhpUndefinedNamespaceInspection
|
||||
* @noinspection BadExceptionsProcessingInspection
|
||||
*/
|
||||
public function setExpired(string $key, $value, int $ttl = 0): bool
|
||||
{
|
||||
$item = [
|
||||
'value' => $value,
|
||||
'ttl' => $ttl ? $ttl + \time() : 0,
|
||||
];
|
||||
if (\class_exists('\Symfony\Component\VarExporter\VarExporter')) {
|
||||
try {
|
||||
$content = \Symfony\Component\VarExporter\VarExporter::export($item);
|
||||
} catch (\Symfony\Component\VarExporter\Exception\ExceptionInterface $e) {
|
||||
$content = \var_export($item, true);
|
||||
}
|
||||
} else {
|
||||
$content = \var_export($item, true);
|
||||
}
|
||||
|
||||
$content = '<?php return ' . $content . ';';
|
||||
|
||||
$cacheFile = $this->getFileName($key);
|
||||
|
||||
$result = $this->writeFile(
|
||||
$cacheFile,
|
||||
$content
|
||||
);
|
||||
|
||||
if (
|
||||
$result === true
|
||||
&&
|
||||
self::$hasCompileFileFunction === true
|
||||
) {
|
||||
// opcache will only compile and cache files older than the script execution start.
|
||||
// set a date before the script execution date, then opcache will compile and cache the generated file.
|
||||
/** @noinspection SummerTimeUnsafeTimeManipulationInspection */
|
||||
\touch($cacheFile, \time() - 86400);
|
||||
|
||||
/** @noinspection PhpComposerExtensionStubsInspection */
|
||||
\opcache_invalidate($cacheFile);
|
||||
/** @noinspection PhpComposerExtensionStubsInspection */
|
||||
\opcache_compile_file($cacheFile);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
@ -1,100 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
use Predis\Client;
|
||||
|
||||
/**
|
||||
* AdapterPredis: Memcached-adapter
|
||||
*/
|
||||
class AdapterPredis implements iAdapter
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $installed = false;
|
||||
|
||||
/**
|
||||
* @var Client
|
||||
*/
|
||||
private $client;
|
||||
|
||||
/**
|
||||
* @param Client|null $client
|
||||
*/
|
||||
public function __construct($client = null)
|
||||
{
|
||||
if ($client instanceof Client) {
|
||||
$this->setPredisClient($client);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Client $client
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setPredisClient(Client $client)
|
||||
{
|
||||
$this->installed = true;
|
||||
$this->client = $client;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exists(string $key): bool
|
||||
{
|
||||
return (bool) $this->client->exists($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get(string $key)
|
||||
{
|
||||
return $this->client->get($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function installed(): bool
|
||||
{
|
||||
return $this->installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function remove(string $key): bool
|
||||
{
|
||||
return (bool) $this->client->del($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function removeAll(): bool
|
||||
{
|
||||
return $this->client->flushall();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function set(string $key, $value): bool
|
||||
{
|
||||
return $this->client->set($key, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setExpired(string $key, $value, int $ttl = 0): bool
|
||||
{
|
||||
return (bool) $this->client->setex($key, $ttl, $value);
|
||||
}
|
||||
}
|
@ -1,91 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
/**
|
||||
* AdapterXcache: Xcache-adapter
|
||||
*/
|
||||
class AdapterXcache implements iAdapter
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $installed = false;
|
||||
|
||||
/**
|
||||
* __construct
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (\extension_loaded('xcache') === true) {
|
||||
$this->installed = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exists(string $key): bool
|
||||
{
|
||||
return \xcache_isset($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get(string $key)
|
||||
{
|
||||
return \xcache_get($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function installed(): bool
|
||||
{
|
||||
return $this->installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function remove(string $key): bool
|
||||
{
|
||||
return \xcache_unset($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function removeAll(): bool
|
||||
{
|
||||
if (\defined('XC_TYPE_VAR')) {
|
||||
$xCacheCount = xcache_count(XC_TYPE_VAR);
|
||||
for ($i = 0; $i < $xCacheCount; $i++) {
|
||||
\xcache_clear_cache(XC_TYPE_VAR, $i);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function set(string $key, $value): bool
|
||||
{
|
||||
return \xcache_set($key, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setExpired(string $key, $value, int $ttl = 0): bool
|
||||
{
|
||||
return \xcache_set($key, $value, $ttl);
|
||||
}
|
||||
}
|
@ -1,772 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
use voku\cache\Exception\InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* Cache: global-cache class
|
||||
*
|
||||
* can use different cache-adapter:
|
||||
* - Redis
|
||||
* - Memcache / Memcached
|
||||
* - APC / APCu
|
||||
* - Xcache
|
||||
* - Array
|
||||
* - File / OpCache
|
||||
*/
|
||||
class Cache implements iCache
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected static $STATIC_CACHE = [];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected static $STATIC_CACHE_EXPIRE = [];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected static $STATIC_CACHE_COUNTER = [];
|
||||
|
||||
/**
|
||||
* @var iAdapter|null
|
||||
*/
|
||||
protected $adapter;
|
||||
|
||||
/**
|
||||
* @var iSerializer|null
|
||||
*/
|
||||
protected $serializer;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $unserialize_options = ['allowed_classes' => true];
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $prefix = '';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $isReady = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $isActive = true;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $useCheckForDev;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $useCheckForAdminSession;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $useCheckForServerIpIsClientIp;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $disableCacheGetParameter;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $isAdminSession;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $staticCacheHitCounter = 10;
|
||||
|
||||
/**
|
||||
* __construct
|
||||
*
|
||||
* @param iAdapter|null $adapter
|
||||
* @param iSerializer|null $serializer
|
||||
* @param bool $checkForUsage <p>check for admin-session && check
|
||||
* for server-ip == client-ip
|
||||
* && check for dev</p>
|
||||
* @param bool $cacheEnabled <p>false === disable the cache (use
|
||||
* it
|
||||
* e.g. for global settings)</p>
|
||||
* @param bool $isAdminSession <p>true === disable cache for this
|
||||
* user
|
||||
* (use it e.g. for admin user settings)
|
||||
* @param bool $useCheckForAdminSession <p>use $isAdminSession flag or
|
||||
* not</p>
|
||||
* @param bool $useCheckForDev <p>use checkForDev() or not</p>
|
||||
* @param bool $useCheckForServerIpIsClientIp <p>use check for server-ip ==
|
||||
* client-ip or not</p>
|
||||
* @param string $disableCacheGetParameter <p>set the _GET parameter for
|
||||
* disabling the cache, disable this
|
||||
* check via empty string</p>
|
||||
* @param CacheAdapterAutoManager $cacheAdapterManagerForAutoConnect <p>Overwrite some Adapters for the
|
||||
* auto-connect-function.</p>
|
||||
* @param bool $cacheAdapterManagerForAutoConnectOverwrite <p>true === Use only Adapters from
|
||||
* your
|
||||
* "CacheAdapterManager".</p>
|
||||
*/
|
||||
public function __construct(
|
||||
iAdapter $adapter = null,
|
||||
iSerializer $serializer = null,
|
||||
bool $checkForUsage = true,
|
||||
bool $cacheEnabled = true,
|
||||
bool $isAdminSession = false,
|
||||
bool $useCheckForDev = true,
|
||||
bool $useCheckForAdminSession = true,
|
||||
bool $useCheckForServerIpIsClientIp = true,
|
||||
string $disableCacheGetParameter = 'testWithoutCache',
|
||||
CacheAdapterAutoManager $cacheAdapterManagerForAutoConnect = null,
|
||||
bool $cacheAdapterManagerForAutoConnectOverwrite = false
|
||||
) {
|
||||
$this->isAdminSession = $isAdminSession;
|
||||
|
||||
$this->useCheckForDev = $useCheckForDev;
|
||||
$this->useCheckForAdminSession = $useCheckForAdminSession;
|
||||
$this->useCheckForServerIpIsClientIp = $useCheckForServerIpIsClientIp;
|
||||
|
||||
$this->disableCacheGetParameter = $disableCacheGetParameter;
|
||||
|
||||
// First check if the cache is active at all.
|
||||
$this->isActive = $cacheEnabled;
|
||||
if (
|
||||
$this->isActive
|
||||
&&
|
||||
$checkForUsage
|
||||
) {
|
||||
$this->setActive($this->isCacheActiveForTheCurrentUser());
|
||||
}
|
||||
|
||||
// If the cache is active, then try to auto-connect to the best possible cache-system.
|
||||
if ($this->isActive) {
|
||||
$this->setPrefix($this->getTheDefaultPrefix());
|
||||
|
||||
if ($adapter === null) {
|
||||
$adapter = $this->autoConnectToAvailableCacheSystem($cacheAdapterManagerForAutoConnect, $cacheAdapterManagerForAutoConnectOverwrite);
|
||||
}
|
||||
|
||||
if (!\is_object($serializer) && $serializer === null) {
|
||||
if (
|
||||
$adapter instanceof AdapterMemcached
|
||||
||
|
||||
$adapter instanceof AdapterMemcache
|
||||
) {
|
||||
// INFO: Memcache(d) has his own "serializer", so don't use it twice
|
||||
$serializer = new SerializerNo();
|
||||
} elseif (
|
||||
$adapter instanceof AdapterOpCache
|
||||
&&
|
||||
\class_exists('\Symfony\Component\VarExporter\VarExporter')
|
||||
) {
|
||||
// INFO: opcache + Symfony-VarExporter don't need any "serializer"
|
||||
$serializer = new SerializerNo();
|
||||
} else {
|
||||
// set default serializer
|
||||
$serializer = new SerializerIgbinary();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Final checks ...
|
||||
if (
|
||||
$serializer !== null
|
||||
&&
|
||||
$adapter !== null
|
||||
) {
|
||||
$this->setCacheIsReady(true);
|
||||
|
||||
$this->adapter = $adapter;
|
||||
|
||||
$this->serializer = $serializer;
|
||||
|
||||
$this->serializer->setUnserializeOptions($this->unserialize_options);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUnserializeOptions(array $array = [])
|
||||
{
|
||||
$this->unserialize_options = $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Auto-connect to the available cache-system on the server.
|
||||
*
|
||||
* @param CacheAdapterAutoManager $cacheAdapterManagerForAutoConnect <p>Overwrite some Adapters for the
|
||||
* auto-connect-function.</p>
|
||||
* @param bool $cacheAdapterManagerForAutoConnectOverwrite <p>true === Use only Adapters from
|
||||
* your
|
||||
* "CacheAdapterManager".</p>
|
||||
*
|
||||
* @return iAdapter
|
||||
*/
|
||||
protected function autoConnectToAvailableCacheSystem(
|
||||
CacheAdapterAutoManager $cacheAdapterManagerForAutoConnect = null,
|
||||
bool $cacheAdapterManagerForAutoConnectOverwrite = false
|
||||
): iAdapter {
|
||||
static $AUTO_ADAPTER_STATIC_CACHE = null;
|
||||
|
||||
if (
|
||||
\is_object($AUTO_ADAPTER_STATIC_CACHE)
|
||||
&&
|
||||
$AUTO_ADAPTER_STATIC_CACHE instanceof iAdapter
|
||||
) {
|
||||
return $AUTO_ADAPTER_STATIC_CACHE;
|
||||
}
|
||||
|
||||
// init
|
||||
$adapter = null;
|
||||
|
||||
$cacheAdapterManagerDefault = CacheAdapterAutoManager::getDefaultsForAutoInit();
|
||||
|
||||
if ($cacheAdapterManagerForAutoConnect !== null) {
|
||||
if ($cacheAdapterManagerForAutoConnectOverwrite) {
|
||||
$cacheAdapterManagerDefault = $cacheAdapterManagerForAutoConnect;
|
||||
} else {
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
$cacheAdapterManagerDefault->merge($cacheAdapterManagerForAutoConnect);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($cacheAdapterManagerDefault->getAdapters() as $adapterTmp => $callableFunctionTmp) {
|
||||
|
||||
/** @var iAdapter $adapterTest */
|
||||
if ($callableFunctionTmp !== null) {
|
||||
$adapterTest = new $adapterTmp($callableFunctionTmp);
|
||||
} else {
|
||||
$adapterTest = new $adapterTmp();
|
||||
}
|
||||
|
||||
if ($adapterTest->installed()) {
|
||||
$adapter = $adapterTest;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// save to static cache
|
||||
$AUTO_ADAPTER_STATIC_CACHE = $adapter;
|
||||
|
||||
return $adapter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate store-key (prefix + $rawKey).
|
||||
*
|
||||
* @param string $rawKey
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function calculateStoreKey(string $rawKey): string
|
||||
{
|
||||
$str = $this->getPrefix() . $rawKey;
|
||||
|
||||
if ($this->adapter instanceof AdapterFileAbstract) {
|
||||
$str = $this->cleanStoreKey($str);
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for local developer.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function checkForDev(): bool
|
||||
{
|
||||
$return = false;
|
||||
|
||||
if (\function_exists('checkForDev')) {
|
||||
$return = checkForDev();
|
||||
} else {
|
||||
|
||||
// for testing with dev-address
|
||||
$noDev = isset($_GET['noDev']) ? (int) $_GET['noDev'] : 0;
|
||||
$remoteAddr = $_SERVER['REMOTE_ADDR'] ?? 'NO_REMOTE_ADDR';
|
||||
|
||||
if (
|
||||
$noDev !== 1
|
||||
&&
|
||||
(
|
||||
$remoteAddr === '127.0.0.1'
|
||||
||
|
||||
$remoteAddr === '::1'
|
||||
||
|
||||
\PHP_SAPI === 'cli'
|
||||
)
|
||||
) {
|
||||
$return = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $storeKey
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function checkForStaticCache(string $storeKey): bool
|
||||
{
|
||||
return !empty(self::$STATIC_CACHE)
|
||||
&&
|
||||
\array_key_exists($storeKey, self::$STATIC_CACHE)
|
||||
&&
|
||||
\array_key_exists($storeKey, self::$STATIC_CACHE_EXPIRE)
|
||||
&&
|
||||
\time() <= self::$STATIC_CACHE_EXPIRE[$storeKey];
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean store-key (required e.g. for the "File"-Adapter).
|
||||
*
|
||||
* @param string $str
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function cleanStoreKey(string $str): string
|
||||
{
|
||||
return \md5($str);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if cached-item exists.
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function existsItem(string $key): bool
|
||||
{
|
||||
if (!$this->adapter instanceof iAdapter) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$storeKey = $this->calculateStoreKey($key);
|
||||
|
||||
// check static-cache
|
||||
if ($this->checkForStaticCache($storeKey)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->adapter->exists($storeKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cached-item by key.
|
||||
*
|
||||
* @param string $key
|
||||
* @param int $forceStaticCacheHitCounter
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getItem(string $key, int $forceStaticCacheHitCounter = 0)
|
||||
{
|
||||
if (!$this->adapter instanceof iAdapter) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$storeKey = $this->calculateStoreKey($key);
|
||||
|
||||
// check if we already using static-cache
|
||||
$useStaticCache = true;
|
||||
if ($this->adapter instanceof AdapterArray) {
|
||||
$useStaticCache = false;
|
||||
}
|
||||
|
||||
if (!isset(self::$STATIC_CACHE_COUNTER[$storeKey])) {
|
||||
self::$STATIC_CACHE_COUNTER[$storeKey] = 0;
|
||||
}
|
||||
|
||||
// get from static-cache
|
||||
if (
|
||||
$useStaticCache
|
||||
&&
|
||||
$this->checkForStaticCache($storeKey)
|
||||
) {
|
||||
return self::$STATIC_CACHE[$storeKey];
|
||||
}
|
||||
|
||||
$serialized = $this->adapter->get($storeKey);
|
||||
if ($this->serializer && $this->serializer instanceof SerializerNo) {
|
||||
$value = $serialized;
|
||||
} else {
|
||||
$value = $serialized && $this->serializer ? $this->serializer->unserialize($serialized) : null;
|
||||
}
|
||||
|
||||
self::$STATIC_CACHE_COUNTER[$storeKey]++;
|
||||
|
||||
// save into static-cache if needed
|
||||
if (
|
||||
$useStaticCache
|
||||
&&
|
||||
(
|
||||
(
|
||||
$forceStaticCacheHitCounter !== 0
|
||||
&&
|
||||
self::$STATIC_CACHE_COUNTER[$storeKey] >= $forceStaticCacheHitCounter
|
||||
)
|
||||
||
|
||||
(
|
||||
$this->staticCacheHitCounter !== 0
|
||||
&&
|
||||
self::$STATIC_CACHE_COUNTER[$storeKey] >= $this->staticCacheHitCounter
|
||||
)
|
||||
)
|
||||
) {
|
||||
self::$STATIC_CACHE[$storeKey] = $value;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all cached-items.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function removeAll(): bool
|
||||
{
|
||||
if (!$this->adapter instanceof iAdapter) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// remove static-cache
|
||||
if (!empty(self::$STATIC_CACHE)) {
|
||||
self::$STATIC_CACHE = [];
|
||||
self::$STATIC_CACHE_COUNTER = [];
|
||||
self::$STATIC_CACHE_EXPIRE = [];
|
||||
}
|
||||
|
||||
return $this->adapter->removeAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a cached-item.
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function removeItem(string $key): bool
|
||||
{
|
||||
if (!$this->adapter instanceof iAdapter) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$storeKey = $this->calculateStoreKey($key);
|
||||
|
||||
// remove static-cache
|
||||
if (
|
||||
!empty(self::$STATIC_CACHE)
|
||||
&&
|
||||
\array_key_exists($storeKey, self::$STATIC_CACHE)
|
||||
) {
|
||||
unset(
|
||||
self::$STATIC_CACHE[$storeKey],
|
||||
self::$STATIC_CACHE_COUNTER[$storeKey],
|
||||
self::$STATIC_CACHE_EXPIRE[$storeKey]
|
||||
);
|
||||
}
|
||||
|
||||
return $this->adapter->remove($storeKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cache-item by key => value + ttl.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @param \DateInterval|int|null $ttl
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setItem(string $key, $value, $ttl = 0): bool
|
||||
{
|
||||
if (
|
||||
!$this->adapter instanceof iAdapter
|
||||
||
|
||||
!$this->serializer instanceof iSerializer
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$storeKey = $this->calculateStoreKey($key);
|
||||
$serialized = $this->serializer->serialize($value);
|
||||
|
||||
// update static-cache, if it's exists
|
||||
if (\array_key_exists($storeKey, self::$STATIC_CACHE)) {
|
||||
self::$STATIC_CACHE[$storeKey] = $value;
|
||||
}
|
||||
|
||||
if ($ttl) {
|
||||
if ($ttl instanceof \DateInterval) {
|
||||
// Converting to a TTL in seconds
|
||||
$ttl = (new \DateTimeImmutable('now'))->add($ttl)->getTimestamp() - \time();
|
||||
}
|
||||
|
||||
// always cache the TTL time, maybe we need this later ...
|
||||
self::$STATIC_CACHE_EXPIRE[$storeKey] = ($ttl ? (int) $ttl + \time() : 0);
|
||||
|
||||
return $this->adapter->setExpired($storeKey, $serialized, $ttl);
|
||||
}
|
||||
|
||||
return $this->adapter->set($storeKey, $serialized);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cache-item by key => value + date.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @param \DateTimeInterface $date <p>If the date is in the past, we will remove the existing cache-item.</p>
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* <p>If the $date is in the past.</p>
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setItemToDate(string $key, $value, \DateTimeInterface $date): bool
|
||||
{
|
||||
$ttl = $date->getTimestamp() - \time();
|
||||
|
||||
if ($ttl <= 0) {
|
||||
throw new InvalidArgumentException('Date in the past.');
|
||||
}
|
||||
|
||||
return $this->setItem($key, $value, $ttl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the "isReady" state.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getCacheIsReady(): bool
|
||||
{
|
||||
return $this->isReady;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the IP address of the client
|
||||
*
|
||||
* @param bool $trust_proxy_headers <p>
|
||||
* Whether or not to trust the
|
||||
* proxy headers HTTP_CLIENT_IP
|
||||
* and HTTP_X_FORWARDED_FOR. ONLY
|
||||
* use if your $_SERVER is behind a
|
||||
* proxy that sets these values
|
||||
* </p>
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getClientIp(bool $trust_proxy_headers = false): string
|
||||
{
|
||||
$remoteAddr = $_SERVER['REMOTE_ADDR'] ?? 'NO_REMOTE_ADDR';
|
||||
|
||||
if ($trust_proxy_headers) {
|
||||
return $remoteAddr;
|
||||
}
|
||||
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
|
||||
$ip = $_SERVER['HTTP_CLIENT_IP'];
|
||||
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
} else {
|
||||
$ip = $remoteAddr;
|
||||
}
|
||||
|
||||
return $ip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the prefix.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPrefix(): string
|
||||
{
|
||||
return $this->prefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current value, when the static cache is used.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getStaticCacheHitCounter(): int
|
||||
{
|
||||
return $this->staticCacheHitCounter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the default-prefix via "SERVER"-var + "SESSION"-language.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getTheDefaultPrefix(): string
|
||||
{
|
||||
return ($_SERVER['SERVER_NAME'] ?? '') . '_' .
|
||||
($_SERVER['THEME'] ?? '') . '_' .
|
||||
($_SERVER['STAGE'] ?? '') . '_' .
|
||||
($_SESSION['language'] ?? '') . '_' .
|
||||
($_SESSION['language_extra'] ?? '') . '_' .
|
||||
\PHP_VERSION_ID . '_' .
|
||||
($this->serializer ? $this->serializer->getName() : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current adapter class-name.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @psalm-return class-string|string
|
||||
*/
|
||||
public function getUsedAdapterClassName(): string
|
||||
{
|
||||
if ($this->adapter) {
|
||||
return \get_class($this->adapter);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current serializer class-name.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @psalm-return class-string|string
|
||||
*/
|
||||
public function getUsedSerializerClassName(): string
|
||||
{
|
||||
if ($this->serializer) {
|
||||
return \get_class($this->serializer);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* check if the current use is a admin || dev || server == client
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isCacheActiveForTheCurrentUser(): bool
|
||||
{
|
||||
// init
|
||||
$active = true;
|
||||
|
||||
// test the cache, with this GET-parameter
|
||||
if ($this->disableCacheGetParameter) {
|
||||
$testCache = isset($_GET[$this->disableCacheGetParameter]) ? (int) $_GET[$this->disableCacheGetParameter] : 0;
|
||||
} else {
|
||||
$testCache = 0;
|
||||
}
|
||||
|
||||
if ($testCache !== 1) {
|
||||
if (
|
||||
// admin session is active
|
||||
(
|
||||
$this->useCheckForAdminSession
|
||||
&&
|
||||
$this->isAdminSession
|
||||
)
|
||||
||
|
||||
// server == client
|
||||
(
|
||||
$this->useCheckForServerIpIsClientIp
|
||||
&&
|
||||
isset($_SERVER['SERVER_ADDR'])
|
||||
&&
|
||||
$_SERVER['SERVER_ADDR'] === $this->getClientIp()
|
||||
)
|
||||
||
|
||||
// user is a dev
|
||||
(
|
||||
$this->useCheckForDev
|
||||
&&
|
||||
$this->checkForDev()
|
||||
)
|
||||
) {
|
||||
$active = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $active;
|
||||
}
|
||||
|
||||
/**
|
||||
* enable / disable the cache
|
||||
*
|
||||
* @param bool $isActive
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setActive(bool $isActive)
|
||||
{
|
||||
$this->isActive = $isActive;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set "isReady" state.
|
||||
*
|
||||
* @param bool $isReady
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setCacheIsReady(bool $isReady)
|
||||
{
|
||||
$this->isReady = $isReady;
|
||||
}
|
||||
|
||||
/**
|
||||
* !!! Set the prefix. !!!
|
||||
*
|
||||
* WARNING: Do not use if you don't know what you do. Because this will overwrite the default prefix.
|
||||
*
|
||||
* @param string $prefix
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setPrefix(string $prefix)
|
||||
{
|
||||
$this->prefix = $prefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the static-hit-counter: Who often do we hit the cache, before we use static cache?
|
||||
*
|
||||
* @param int $staticCacheHitCounter
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setStaticCacheHitCounter(int $staticCacheHitCounter)
|
||||
{
|
||||
$this->staticCacheHitCounter = $staticCacheHitCounter;
|
||||
}
|
||||
}
|
@ -1,238 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
use voku\cache\Exception\InvalidArgumentException;
|
||||
|
||||
class CacheAdapterAutoManager
|
||||
{
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private $adapter = [];
|
||||
|
||||
/**
|
||||
* @var callable[]|null[]
|
||||
*/
|
||||
private $callableFunctions = [];
|
||||
|
||||
/**
|
||||
* @param string $adapter
|
||||
* @param callable|null $callableFunction
|
||||
*
|
||||
* @psalm-param class-string $adapter
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function addAdapter(
|
||||
string $adapter,
|
||||
callable $callableFunction = null
|
||||
): self {
|
||||
$this->validateAdapter($adapter);
|
||||
$this->validateCallable($callableFunction);
|
||||
|
||||
$this->adapter[] = $adapter;
|
||||
$this->callableFunctions[] = $callableFunction;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Generator|\Generator<string, callable>
|
||||
*/
|
||||
public function getAdapters(): \Generator
|
||||
{
|
||||
foreach ($this->adapter as $key => $value) {
|
||||
yield $this->adapter[$key] => $this->callableFunctions[$key];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param self $adapterManager
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function merge(self $adapterManager): self
|
||||
{
|
||||
foreach ($adapterManager->getAdapters() as $adapterTmp => $callableFunctionTmp) {
|
||||
$this->validateAdapter($adapterTmp);
|
||||
$this->validateCallable($callableFunctionTmp);
|
||||
|
||||
$key = \array_search($adapterTmp, $this->adapter, true);
|
||||
|
||||
if ($key) {
|
||||
$this->adapter[$key] = $adapterTmp;
|
||||
$this->callableFunctions[$key] = $callableFunctionTmp;
|
||||
} else {
|
||||
$this->adapter[] = $adapterTmp;
|
||||
$this->callableFunctions[] = $callableFunctionTmp;
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $replaceAdapter
|
||||
*
|
||||
* @psalm-param class-string $replaceAdapter
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function validateAdapter(string $replaceAdapter)
|
||||
{
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
$interfaces = (new \ReflectionClass($replaceAdapter))->getInterfaces();
|
||||
if (!\array_key_exists(iAdapter::class, $interfaces)) {
|
||||
throw new InvalidArgumentException('"' . $replaceAdapter . '" did not implement the "iAdapter"-interface [' . \print_r($interfaces, true) . ']');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param callable $callableFunction
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function validateCallable(callable $callableFunction = null)
|
||||
{
|
||||
if (
|
||||
$callableFunction !== null
|
||||
&&
|
||||
!\is_callable($callableFunction)
|
||||
) {
|
||||
throw new InvalidArgumentException('$callableFunction is not callable');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return CacheAdapterAutoManager
|
||||
*/
|
||||
public static function getDefaultsForAutoInit(): self
|
||||
{
|
||||
$cacheAdapterManager = new self();
|
||||
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
$cacheAdapterManager->addAdapter(
|
||||
AdapterMemcached::class,
|
||||
static function () {
|
||||
$memcached = null;
|
||||
$isMemcachedAvailable = false;
|
||||
if (\extension_loaded('memcached')) {
|
||||
/** @noinspection PhpComposerExtensionStubsInspection */
|
||||
$memcached = new \Memcached();
|
||||
/** @noinspection PhpUsageOfSilenceOperatorInspection */
|
||||
$isMemcachedAvailable = @$memcached->addServer('127.0.0.1', 11211);
|
||||
}
|
||||
|
||||
if (!$isMemcachedAvailable) {
|
||||
$memcached = null;
|
||||
}
|
||||
|
||||
return $memcached;
|
||||
}
|
||||
);
|
||||
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
$cacheAdapterManager->addAdapter(
|
||||
AdapterMemcache::class,
|
||||
static function () {
|
||||
$memcache = null;
|
||||
$isMemcacheAvailable = false;
|
||||
/** @noinspection ClassConstantCanBeUsedInspection */
|
||||
if (\class_exists('\Memcache')) {
|
||||
/** @noinspection PhpComposerExtensionStubsInspection */
|
||||
$memcache = new \Memcache();
|
||||
/** @noinspection PhpUsageOfSilenceOperatorInspection */
|
||||
$isMemcacheAvailable = @$memcache->connect('127.0.0.1', 11211);
|
||||
}
|
||||
|
||||
if (!$isMemcacheAvailable) {
|
||||
$memcache = null;
|
||||
}
|
||||
|
||||
return $memcache;
|
||||
}
|
||||
);
|
||||
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
$cacheAdapterManager->addAdapter(
|
||||
AdapterPredis::class,
|
||||
static function () {
|
||||
$redis = null;
|
||||
$isRedisAvailable = false;
|
||||
if (
|
||||
\extension_loaded('redis')
|
||||
&&
|
||||
\class_exists('\Predis\Client')
|
||||
) {
|
||||
/** @noinspection PhpUndefinedNamespaceInspection */
|
||||
/** @noinspection PhpUndefinedClassInspection */
|
||||
/** @noinspection PhpFullyQualifiedNameUsageInspection */
|
||||
$redis = new \Predis\Client(
|
||||
[
|
||||
'scheme' => 'tcp',
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 6379,
|
||||
'timeout' => '2.0',
|
||||
]
|
||||
);
|
||||
|
||||
try {
|
||||
/** @noinspection PhpUndefinedMethodInspection */
|
||||
$redis->connect();
|
||||
/** @noinspection PhpUndefinedMethodInspection */
|
||||
$isRedisAvailable = $redis->getConnection()->isConnected();
|
||||
} catch (\Exception $e) {
|
||||
// nothing
|
||||
}
|
||||
}
|
||||
|
||||
if ($isRedisAvailable === false) {
|
||||
$redis = null;
|
||||
}
|
||||
|
||||
return $redis;
|
||||
}
|
||||
);
|
||||
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
$cacheAdapterManager->addAdapter(
|
||||
AdapterXcache::class
|
||||
);
|
||||
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
$cacheAdapterManager->addAdapter(
|
||||
AdapterApcu::class
|
||||
);
|
||||
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
$cacheAdapterManager->addAdapter(
|
||||
AdapterApc::class
|
||||
);
|
||||
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
$cacheAdapterManager->addAdapter(
|
||||
AdapterOpCache::class,
|
||||
static function () {
|
||||
return \realpath(\sys_get_temp_dir()) . '/simple_php_cache';
|
||||
}
|
||||
);
|
||||
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
$cacheAdapterManager->addAdapter(
|
||||
AdapterArray::class
|
||||
);
|
||||
|
||||
return $cacheAdapterManager;
|
||||
}
|
||||
}
|
@ -1,176 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
class CacheChain implements iCache
|
||||
{
|
||||
/**
|
||||
* @var Cache[]
|
||||
*/
|
||||
private $caches = [];
|
||||
|
||||
/**
|
||||
* __construct
|
||||
*
|
||||
* @param array $caches
|
||||
*/
|
||||
public function __construct(array $caches = [])
|
||||
{
|
||||
\array_map(
|
||||
[
|
||||
$this,
|
||||
'addCache',
|
||||
],
|
||||
$caches
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* get caches
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getCaches(): array
|
||||
{
|
||||
return $this->caches;
|
||||
}
|
||||
|
||||
/**
|
||||
* add cache
|
||||
*
|
||||
* @param Cache $cache
|
||||
* @param bool $prepend
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addCache(Cache $cache, $prepend = true)
|
||||
{
|
||||
if ($prepend) {
|
||||
\array_unshift($this->caches, $cache);
|
||||
} else {
|
||||
$this->caches[] = $cache;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getItem(string $key)
|
||||
{
|
||||
foreach ($this->caches as $cache) {
|
||||
if ($cache->existsItem($key)) {
|
||||
return $cache->getItem($key);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the "isReady" state.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getCacheIsReady(): bool
|
||||
{
|
||||
foreach ($this->caches as $cache) {
|
||||
if (!$cache->getCacheIsReady()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setItem(string $key, $value, $ttl = null): bool
|
||||
{
|
||||
// init
|
||||
$results = [];
|
||||
|
||||
foreach ($this->caches as $cache) {
|
||||
$results[] = $cache->setItem($key, $value, $ttl);
|
||||
}
|
||||
|
||||
return \in_array(true, $results, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setItemToDate(string $key, $value, \DateTimeInterface $date): bool
|
||||
{
|
||||
// init
|
||||
$results = [];
|
||||
|
||||
foreach ($this->caches as $cache) {
|
||||
$results[] = $cache->setItemToDate($key, $value, $date);
|
||||
}
|
||||
|
||||
return \in_array(true, $results, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* !!! Set the prefix. !!!
|
||||
*
|
||||
* WARNING: Do not use if you don't know what you do. Because this will overwrite the default prefix.
|
||||
*
|
||||
* @param string $prefix
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setPrefix(string $prefix)
|
||||
{
|
||||
foreach ($this->caches as $cache) {
|
||||
$cache->setPrefix($prefix);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function removeItem(string $key): bool
|
||||
{
|
||||
// init
|
||||
$results = [];
|
||||
|
||||
foreach ($this->caches as $cache) {
|
||||
$results[] = $cache->removeItem($key);
|
||||
}
|
||||
|
||||
return \in_array(true, $results, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function existsItem(string $key): bool
|
||||
{
|
||||
foreach ($this->caches as $cache) {
|
||||
if ($cache->existsItem($key)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function removeAll(): bool
|
||||
{
|
||||
// init
|
||||
$results = [];
|
||||
|
||||
foreach ($this->caches as $cache) {
|
||||
$results[] = $cache->removeAll();
|
||||
}
|
||||
|
||||
return \in_array(true, $results, true);
|
||||
}
|
||||
}
|
@ -1,189 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
use Psr\SimpleCache\CacheInterface;
|
||||
use voku\cache\Exception\InvalidArgumentException;
|
||||
|
||||
class CachePsr16 extends Cache implements CacheInterface
|
||||
{
|
||||
/**
|
||||
* Wipes clean the entire cache's keys.
|
||||
*
|
||||
* @return bool true on success and false on failure
|
||||
*/
|
||||
public function clear(): bool
|
||||
{
|
||||
return $this->removeAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an item from the cache by its unique key.
|
||||
*
|
||||
* @param string $key the unique cache key of the item to delete
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
* @return bool True if the item was successfully removed. False if there was an error.
|
||||
*/
|
||||
public function delete($key): bool
|
||||
{
|
||||
if (!\is_string($key)) {
|
||||
throw new InvalidArgumentException('$key is not a string:' . \print_r($key, true));
|
||||
}
|
||||
|
||||
return $this->removeItem($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes multiple cache items in a single operation.
|
||||
*
|
||||
* @param iterable $keys a list of string-based keys to be deleted
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
* @return bool True if the items were successfully removed. False if there was an error.
|
||||
*/
|
||||
public function deleteMultiple($keys): bool
|
||||
{
|
||||
if (
|
||||
!\is_array($keys)
|
||||
&&
|
||||
!($keys instanceof \Traversable)
|
||||
) {
|
||||
throw new InvalidArgumentException('$keys is not iterable:' . \print_r($keys, true));
|
||||
}
|
||||
|
||||
$results = [];
|
||||
foreach ((array) $keys as $key) {
|
||||
$results[] = $this->delete($key);
|
||||
}
|
||||
|
||||
return !\in_array(false, $results, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches a value from the cache.
|
||||
*
|
||||
* @param string $key the unique key of this item in the cache
|
||||
* @param mixed $default default value to return if the key does not exist
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
* @return mixed the value of the item from the cache, or $default in case of cache miss
|
||||
*/
|
||||
public function get($key, $default = null)
|
||||
{
|
||||
if ($this->has($key)) {
|
||||
return $this->getItem($key);
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtains multiple cache items by their unique keys.
|
||||
*
|
||||
* @param iterable $keys a list of keys that can obtained in a single operation
|
||||
* @param mixed $default default value to return for keys that do not exist
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
* @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as
|
||||
* value.
|
||||
*/
|
||||
public function getMultiple($keys, $default = null)
|
||||
{
|
||||
if (
|
||||
!\is_array($keys)
|
||||
&&
|
||||
!($keys instanceof \Traversable)
|
||||
) {
|
||||
throw new InvalidArgumentException('$keys is not iterable:' . \print_r($keys, true));
|
||||
}
|
||||
|
||||
$result = [];
|
||||
foreach ((array) $keys as $key) {
|
||||
$result[$key] = $this->has($key) ? $this->get($key) : $default;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether an item is present in the cache.
|
||||
*
|
||||
* NOTE: It is recommended that has() is only to be used for cache warming type purposes
|
||||
* and not to be used within your live applications operations for get/set, as this method
|
||||
* is subject to a race condition where your has() will return true and immediately after,
|
||||
* another script can remove it making the state of your app out of date.
|
||||
*
|
||||
* @param string $key the cache item key
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has($key): bool
|
||||
{
|
||||
if (!\is_string($key)) {
|
||||
throw new InvalidArgumentException('$key is not a string:' . \print_r($key, true));
|
||||
}
|
||||
|
||||
return $this->existsItem($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.
|
||||
*
|
||||
* @param string $key the key of the item to store
|
||||
* @param mixed $value the value of the item to store, must be serializable
|
||||
* @param \DateInterval|int|null $ttl Optional. The TTL value of this item. If no value is sent and
|
||||
* the driver supports TTL then the library may set a default value
|
||||
* for it or let the driver take care of that.
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
* @return bool true on success and false on failure
|
||||
*/
|
||||
public function set($key, $value, $ttl = null): bool
|
||||
{
|
||||
if (!\is_string($key)) {
|
||||
throw new InvalidArgumentException('$key is not a string:' . \print_r($key, true));
|
||||
}
|
||||
|
||||
return $this->setItem($key, $value, $ttl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Persists a set of key => value pairs in the cache, with an optional TTL.
|
||||
*
|
||||
* @param iterable $values a list of key => value pairs for a multiple-set operation
|
||||
* @param \DateInterval|int|null $ttl Optional. The TTL value of this item. If no value is sent and
|
||||
* the driver supports TTL then the library may set a default value
|
||||
* for it or let the driver take care of that.
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
* @return bool true on success and false on failure
|
||||
*/
|
||||
public function setMultiple($values, $ttl = null): bool
|
||||
{
|
||||
if (
|
||||
!\is_array($values)
|
||||
&&
|
||||
!($values instanceof \Traversable)
|
||||
) {
|
||||
throw new InvalidArgumentException('$values is not iterable:' . \print_r($values, true));
|
||||
}
|
||||
|
||||
$results = [];
|
||||
foreach ((array) $values as $key => $value) {
|
||||
$results[] = $this->set($key, $value, $ttl);
|
||||
}
|
||||
|
||||
return !\in_array(false, $results, true);
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache\Exception;
|
||||
|
||||
final class ChmodException extends \RuntimeException implements FileErrorExceptionInterface
|
||||
{
|
||||
/**
|
||||
* @param string $file
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public static function unableToChangeChmod($file)
|
||||
{
|
||||
return new self(\sprintf('Could not change chmod of the file "%s"', $file));
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache\Exception;
|
||||
|
||||
interface FileErrorExceptionInterface
|
||||
{
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache\Exception;
|
||||
|
||||
class InvalidArgumentException extends \Exception implements \Psr\SimpleCache\InvalidArgumentException
|
||||
{
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache\Exception;
|
||||
|
||||
final class RenameException extends \RuntimeException implements FileErrorExceptionInterface
|
||||
{
|
||||
/**
|
||||
* @param string $source
|
||||
* @param string $target
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public static function unableToMoveFile($source, $target)
|
||||
{
|
||||
return new self(\sprintf(
|
||||
'Could not move file "%s" to location "%s": '
|
||||
. 'either the source file is not readable, or the destination is not writable',
|
||||
$source,
|
||||
$target
|
||||
));
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache\Exception;
|
||||
|
||||
final class RuntimeException extends \RuntimeException implements FileErrorExceptionInterface
|
||||
{
|
||||
/**
|
||||
* @param string $dir
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public static function unableToCreateTemporaryFile($dir)
|
||||
{
|
||||
return new self(\sprintf('Could not create temporary file in directory "%s"', $dir));
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache\Exception;
|
||||
|
||||
final class WriteContentException extends \RuntimeException implements FileErrorExceptionInterface
|
||||
{
|
||||
/**
|
||||
* @param string $file
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public static function unableToWriteContent($file)
|
||||
{
|
||||
return new self(\sprintf('Could not write content to the file "%s"', $file));
|
||||
}
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
/**
|
||||
* SerializerDefault: simple serialize / unserialize
|
||||
*/
|
||||
class SerializerDefault implements iSerializer
|
||||
{
|
||||
/**
|
||||
* @var array|null
|
||||
*/
|
||||
private $unserialize_options;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function serialize($value)
|
||||
{
|
||||
return \serialize($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return 'default';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function unserialize($value)
|
||||
{
|
||||
if ($this->unserialize_options !== null) {
|
||||
return \unserialize($value, $this->unserialize_options);
|
||||
}
|
||||
|
||||
/** @noinspection UnserializeExploitsInspection */
|
||||
return \unserialize($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUnserializeOptions(array $options)
|
||||
{
|
||||
$this->unserialize_options = $options;
|
||||
}
|
||||
}
|
@ -1,99 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
/**
|
||||
* SerializerIgbinary: serialize / unserialize
|
||||
*/
|
||||
class SerializerIgbinary implements iSerializer
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public static $_exists_igbinary;
|
||||
|
||||
/**
|
||||
* @var array|null
|
||||
*/
|
||||
private $unserialize_options;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $name = '';
|
||||
|
||||
/**
|
||||
* SerializerIgbinary constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (self::$_exists_igbinary === null) {
|
||||
self::$_exists_igbinary = (
|
||||
\function_exists('igbinary_serialize')
|
||||
&&
|
||||
\function_exists('igbinary_unserialize')
|
||||
);
|
||||
}
|
||||
|
||||
if (self::$_exists_igbinary) {
|
||||
$this->name = 'igbinary';
|
||||
} else {
|
||||
$this->name = 'default';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function serialize($value)
|
||||
{
|
||||
if (self::$_exists_igbinary === true) {
|
||||
/** @noinspection PhpUndefinedFunctionInspection */
|
||||
/** @noinspection PhpComposerExtensionStubsInspection */
|
||||
return \igbinary_serialize($value);
|
||||
}
|
||||
|
||||
// fallback
|
||||
return \serialize($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function unserialize($value)
|
||||
{
|
||||
if (self::$_exists_igbinary === true) {
|
||||
/** @noinspection PhpUndefinedFunctionInspection */
|
||||
/** @noinspection PhpComposerExtensionStubsInspection */
|
||||
return \igbinary_unserialize($value);
|
||||
}
|
||||
|
||||
// fallback
|
||||
if ($this->unserialize_options !== null) {
|
||||
return \unserialize($value, $this->unserialize_options);
|
||||
}
|
||||
|
||||
/** @noinspection UnserializeExploitsInspection */
|
||||
return \unserialize($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUnserializeOptions(array $options)
|
||||
{
|
||||
$this->unserialize_options = $options;
|
||||
}
|
||||
}
|
@ -1,97 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
/**
|
||||
* SerializerMsgpack: serialize / unserialize
|
||||
*/
|
||||
class SerializerMsgpack implements iSerializer
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public static $_exists_msgpack;
|
||||
|
||||
/**
|
||||
* @var array|null
|
||||
*/
|
||||
private $unserialize_options;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $name = '';
|
||||
|
||||
/**
|
||||
* SerializerIgbinary constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (self::$_exists_msgpack === null) {
|
||||
self::$_exists_msgpack = (
|
||||
\function_exists('msgpack_pack')
|
||||
&&
|
||||
\function_exists('msgpack_unpack')
|
||||
);
|
||||
}
|
||||
|
||||
if (self::$_exists_msgpack) {
|
||||
$this->name = 'msgpack';
|
||||
} else {
|
||||
$this->name = 'default';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function serialize($value)
|
||||
{
|
||||
if (self::$_exists_msgpack === true) {
|
||||
/** @noinspection PhpUndefinedFunctionInspection */
|
||||
return \msgpack_pack($value);
|
||||
}
|
||||
|
||||
// fallback
|
||||
return \serialize($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function unserialize($value)
|
||||
{
|
||||
if (self::$_exists_msgpack === true) {
|
||||
/** @noinspection PhpUndefinedFunctionInspection */
|
||||
return \msgpack_unpack($value);
|
||||
}
|
||||
|
||||
// fallback
|
||||
if ($this->unserialize_options !== null) {
|
||||
return \unserialize($value, $this->unserialize_options);
|
||||
}
|
||||
|
||||
/** @noinspection UnserializeExploitsInspection */
|
||||
return \unserialize($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUnserializeOptions(array $options)
|
||||
{
|
||||
$this->unserialize_options = $options;
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
/**
|
||||
* SerializerNo: no serialize / unserialize !!!
|
||||
*/
|
||||
class SerializerNo implements iSerializer
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function serialize($value)
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function unserialize($value)
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return 'no';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUnserializeOptions(array $options)
|
||||
{
|
||||
// nothing to do here
|
||||
}
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
/**
|
||||
* iAdapter: cache-adapter interface
|
||||
*/
|
||||
interface iAdapter
|
||||
{
|
||||
/**
|
||||
* Get cached-item by key.
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return mixed|null
|
||||
* <p>will return NULL if the key not exists</p>
|
||||
*/
|
||||
public function get(string $key);
|
||||
|
||||
/**
|
||||
* Set cache-item by key => value.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function set(string $key, $value): bool;
|
||||
|
||||
/**
|
||||
* Set cache-item by key => value + ttl.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @param int $ttl
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setExpired(string $key, $value, int $ttl): bool;
|
||||
|
||||
/**
|
||||
* Remove cached-item by key.
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function remove(string $key): bool;
|
||||
|
||||
/**
|
||||
* Remove all cached items.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function removeAll(): bool;
|
||||
|
||||
/**
|
||||
* Check if cache-key exists.
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function exists(string $key): bool;
|
||||
|
||||
/**
|
||||
* Check if cache is installed.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function installed(): bool;
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
use DateTimeInterface;
|
||||
|
||||
/**
|
||||
* iCache: cache-global interface
|
||||
*/
|
||||
interface iCache
|
||||
{
|
||||
/**
|
||||
* get item
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getItem(string $key);
|
||||
|
||||
/**
|
||||
* set item
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @param int|null $ttl
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setItem(string $key, $value, $ttl = 0): bool;
|
||||
|
||||
/**
|
||||
* set item a special expire-date
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @param DateTimeInterface $date
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setItemToDate(string $key, $value, DateTimeInterface $date): bool;
|
||||
|
||||
/**
|
||||
* remove item
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function removeItem(string $key): bool;
|
||||
|
||||
/**
|
||||
* remove all items
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function removeAll(): bool;
|
||||
|
||||
/**
|
||||
* check if item exists
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function existsItem(string $key): bool;
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace voku\cache;
|
||||
|
||||
/**
|
||||
* iSerializer: cache-serializer interface
|
||||
*/
|
||||
interface iSerializer
|
||||
{
|
||||
/**
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function serialize($value);
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function unserialize($value);
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUnserializeOptions(array $options);
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): string;
|
||||
}
|
@ -15,15 +15,9 @@
|
||||
"config": {
|
||||
"apcu-autoloader": true,
|
||||
"optimize-autoloader": true,
|
||||
"github-protocols": [
|
||||
"git",
|
||||
"https",
|
||||
"http"
|
||||
],
|
||||
"platform": {
|
||||
"php": "7.0.99"
|
||||
"php": "7.99.99"
|
||||
},
|
||||
"sort-packages": true,
|
||||
"vendor-dir": "bundled-libs"
|
||||
"sort-packages": true
|
||||
}
|
||||
}
|
||||
|
53
bundled-libs/composer/installed.json → composer.lock
generated
53
bundled-libs/composer/installed.json → composer.lock
generated
@ -1,9 +1,14 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "98bec009e636138a74601c2c4025e160",
|
||||
"packages": [
|
||||
{
|
||||
"name": "katzgrau/klogger",
|
||||
"version": "1.0.0",
|
||||
"version_normalized": "1.0.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/katzgrau/klogger.git",
|
||||
@ -22,9 +27,7 @@
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "4.0.*"
|
||||
},
|
||||
"time": "2014-03-20T02:36:36+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Katzgrau\\KLogger\\": "src/"
|
||||
@ -53,12 +56,15 @@
|
||||
"keywords": [
|
||||
"logging"
|
||||
],
|
||||
"install-path": "../katzgrau/klogger"
|
||||
"support": {
|
||||
"issues": "https://github.com/katzgrau/klogger/issues",
|
||||
"source": "https://github.com/katzgrau/klogger/tree/1.0.0"
|
||||
},
|
||||
"time": "2014-03-20T02:36:36+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "1.0.0",
|
||||
"version_normalized": "1.0.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/log.git",
|
||||
@ -70,9 +76,7 @@
|
||||
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
|
||||
"shasum": ""
|
||||
},
|
||||
"time": "2012-12-21T11:40:51+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Psr\\Log\\": ""
|
||||
@ -94,12 +98,15 @@
|
||||
"psr",
|
||||
"psr-3"
|
||||
],
|
||||
"install-path": "../psr/log"
|
||||
"support": {
|
||||
"issues": "https://github.com/php-fig/log/issues",
|
||||
"source": "https://github.com/php-fig/log/tree/1.0.0"
|
||||
},
|
||||
"time": "2012-12-21T11:40:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/simple-cache",
|
||||
"version": "1.0.1",
|
||||
"version_normalized": "1.0.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/simple-cache.git",
|
||||
@ -114,14 +121,12 @@
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"time": "2017-10-23T01:57:42+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\SimpleCache\\": "src/"
|
||||
@ -145,12 +150,14 @@
|
||||
"psr-16",
|
||||
"simple-cache"
|
||||
],
|
||||
"install-path": "../psr/simple-cache"
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/simple-cache/tree/master"
|
||||
},
|
||||
"time": "2017-10-23T01:57:42+00:00"
|
||||
},
|
||||
{
|
||||
"name": "voku/simple-cache",
|
||||
"version": "4.0.5",
|
||||
"version_normalized": "4.0.5.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/voku/simple-cache.git",
|
||||
@ -176,9 +183,7 @@
|
||||
"predis/predis": "~1.1",
|
||||
"symfony/var-exporter": "~3.0 || ~4.0 || ~5.0"
|
||||
},
|
||||
"time": "2020-03-15T21:00:57+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"voku\\cache\\": "src/voku/cache/"
|
||||
@ -225,9 +230,21 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"install-path": "../voku/simple-cache"
|
||||
"time": "2020-03-15T21:00:57+00:00"
|
||||
}
|
||||
],
|
||||
"dev": true,
|
||||
"dev-package-names": []
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "dev",
|
||||
"stability-flags": [],
|
||||
"prefer-stable": true,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": "~7.0"
|
||||
},
|
||||
"platform-dev": [],
|
||||
"platform-overrides": {
|
||||
"php": "7.99.99"
|
||||
},
|
||||
"plugin-api-version": "2.2.0"
|
||||
}
|
BIN
composer.phar
BIN
composer.phar
Binary file not shown.
@ -241,7 +241,7 @@ if (function_exists('get_include_path')) {
|
||||
}
|
||||
|
||||
|
||||
require_once("bundled-libs/autoload.php");
|
||||
require_once("vendor/autoload.php");
|
||||
|
||||
$new_include = ($serendipity['use_PEAR'] ? $old_include . PATH_SEPARATOR : '')
|
||||
. S9Y_INCLUDE_PATH . 'bundled-libs/' . PATH_SEPARATOR
|
||||
|
3
vendor/.gitignore
vendored
Normal file
3
vendor/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Ignore everything but .gitignore
|
||||
*
|
||||
!.gitignore
|
Loading…
x
Reference in New Issue
Block a user