Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}
},
"require": {
"php": ">=5.3.3"
"php": ">=5.3.23"
},
"require-dev": {
"zendframework/zend-cache": "self.version",
Expand All @@ -26,8 +26,8 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.2-dev",
"dev-develop": "2.3-dev"
"dev-master": "2.3-dev",
"dev-develop": "2.4-dev"
}
},
"autoload-dev": {
Expand Down
22 changes: 11 additions & 11 deletions src/MemoryManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class MemoryManager
/**
* This function is intended to generate unique id, used by memory manager
*/
private function _generateMemManagerId()
private function generateMemManagerId()
{
/**
* @todo !!!
Expand All @@ -132,7 +132,7 @@ public function __construct(CacheStorage $cache = null)
}

$this->cache = $cache;
$this->_generateMemManagerId();
$this->generateMemManagerId();

$memoryLimitStr = trim(ini_get('memory_limit'));
if ($memoryLimitStr != '' && $memoryLimitStr != -1) {
Expand Down Expand Up @@ -180,7 +180,7 @@ public function setMemoryLimit($newLimit)
{
$this->memoryLimit = $newLimit;

$this->_swapCheck();
$this->swapCheck();
}

/**
Expand Down Expand Up @@ -255,7 +255,7 @@ private function _create($value, $locked)
}

// Commit other objects modifications
$this->_commit();
$this->commit();

$valueObject = new Container\Movable($this, $id, $value);

Expand Down Expand Up @@ -322,15 +322,15 @@ public function processUpdate(Container\Movable $container, $id)
$this->memorySize -= $this->sizes[$id];

// Commit changes of previously modified object if necessary
$this->_commit();
$this->commit();

$this->lastModified = $container;
}

/**
* Commit modified object and put it back to the loaded objects list
*/
private function _commit()
private function commit()
{
if (($container = $this->lastModified) === null) {
return;
Expand All @@ -350,15 +350,15 @@ private function _commit()

$container->startTrace();

$this->_swapCheck();
$this->swapCheck();
}

/**
* Check and swap objects if necessary
*
* @throws Exception\RuntimeException
*/
private function _swapCheck()
private function swapCheck()
{
if ($this->memoryLimit < 0 || $this->memorySize < $this->memoryLimit) {
// Memory limit is not reached
Expand All @@ -368,7 +368,7 @@ private function _swapCheck()

// walk through loaded objects in access history order
foreach ($this->unloadCandidates as $id => $container) {
$this->_swap($container, $id);
$this->swap($container, $id);
unset($this->unloadCandidates[$id]);

if ($this->memorySize < $this->memoryLimit) {
Expand All @@ -388,7 +388,7 @@ private function _swapCheck()
* @param \Zend\Memory\Container\Movable $container
* @param int $id
*/
private function _swap(Container\Movable $container, $id)
private function swap(Container\Movable $container, $id)
{
if ($container->isLocked()) {
return;
Expand Down Expand Up @@ -418,7 +418,7 @@ public function load(Container\Movable $container, $id)
// Try to swap other objects if necessary
// (do not include specified object into check)
$this->memorySize += strlen($value);
$this->_swapCheck();
$this->swapCheck();

// Add loaded object to the end of loaded objects list
$container->setValue($value);
Expand Down
2 changes: 1 addition & 1 deletion test/AccessControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand Down
2 changes: 1 addition & 1 deletion test/LockedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand Down
2 changes: 1 addition & 1 deletion test/MemoryManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand Down
4 changes: 2 additions & 2 deletions test/MovableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand Down Expand Up @@ -137,7 +137,7 @@ class DummyMemoryManager extends Memory\MemoryManager
/** @var integer */
public $processedId;

/** @var Zend_Memory_Container_Movable */
/** @var Container\Movable */
public $processedObject;

/**
Expand Down
2 changes: 1 addition & 1 deletion test/ValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand Down

0 comments on commit 879d52a

Please sign in to comment.