Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Apc Cache - Remove long-time gone apc_* functions #51010

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 6 additions & 23 deletions src/Illuminate/Cache/ApcWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,6 @@

class ApcWrapper
{
/**
* Indicates if APCu is supported.
*
* @var bool
*/
protected $apcu = false;

/**
* Create a new APC wrapper instance.
*
* @return void
*/
public function __construct()
{
$this->apcu = function_exists('apcu_fetch');
}

/**
* Get an item from the cache.
*
Expand All @@ -29,7 +12,7 @@ public function __construct()
*/
public function get($key)
{
$fetchedValue = $this->apcu ? apcu_fetch($key, $success) : apc_fetch($key, $success);
$fetchedValue = apcu_fetch($key, $success);

return $success ? $fetchedValue : null;
}
Expand All @@ -44,7 +27,7 @@ public function get($key)
*/
public function put($key, $value, $seconds)
{
return $this->apcu ? apcu_store($key, $value, $seconds) : apc_store($key, $value, $seconds);
return apcu_store($key, $value, $seconds);
}

/**
Expand All @@ -56,7 +39,7 @@ public function put($key, $value, $seconds)
*/
public function increment($key, $value)
{
return $this->apcu ? apcu_inc($key, $value) : apc_inc($key, $value);
return apcu_inc($key, $value);
}

/**
Expand All @@ -68,7 +51,7 @@ public function increment($key, $value)
*/
public function decrement($key, $value)
{
return $this->apcu ? apcu_dec($key, $value) : apc_dec($key, $value);
return apcu_dec($key, $value);
}

/**
Expand All @@ -79,7 +62,7 @@ public function decrement($key, $value)
*/
public function delete($key)
{
return $this->apcu ? apcu_delete($key) : apc_delete($key);
return apcu_delete($key);
}

/**
Expand All @@ -89,6 +72,6 @@ public function delete($key)
*/
public function flush()
{
return $this->apcu ? apcu_clear_cache() : apc_clear_cache('user');
return apcu_clear_cache();
}
}
Loading