Skip to content

Commit

Permalink
[+]: fix APC(u) detection for CLI usage
Browse files Browse the repository at this point in the history
  • Loading branch information
voku committed Dec 21, 2018
1 parent 6d0805a commit e0c9248
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/voku/cache/AdapterApc.php
Expand Up @@ -27,12 +27,24 @@ class AdapterApc implements iAdapter
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')
) {
$this->installed = true;
}
}

/**
Expand Down
12 changes: 12 additions & 0 deletions src/voku/cache/AdapterApcu.php
Expand Up @@ -27,12 +27,24 @@ class AdapterApcu implements iAdapter
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')
) {
$this->installed = true;
}
}

/**
Expand Down

0 comments on commit e0c9248

Please sign in to comment.