updated documentation, small cleanups

This commit is contained in:
El RIDO
2016-08-09 12:21:32 +02:00
parent b45bef8388
commit 3fa0881c07
4 changed files with 18 additions and 17 deletions

View File

@@ -13,7 +13,7 @@
namespace PrivateBin\Data;
/**
* privatebin_abstract
* AbstractData
*
* Abstract model for PrivateBin data access, implemented as a singleton.
*/
@@ -24,7 +24,7 @@ abstract class AbstractData
*
* @access protected
* @static
* @var privatebin_abstract
* @var AbstractData
*/
protected static $_instance = null;

View File

@@ -45,7 +45,7 @@ abstract class AbstractModel
* Configuration.
*
* @access protected
* @var configuration
* @var Configuration
*/
protected $_conf;
@@ -53,7 +53,7 @@ abstract class AbstractModel
* Data storage.
*
* @access protected
* @var privatebin_abstract
* @var AbstractData
*/
protected $_store;
@@ -61,11 +61,11 @@ abstract class AbstractModel
* Instance constructor.
*
* @access public
* @param configuration $configuration
* @param privatebin_abstract $storage
* @param Configuration $configuration
* @param AbstractData $storage
* @return void
*/
public function __construct(configuration $configuration, AbstractData $storage)
public function __construct(Configuration $configuration, AbstractData $storage)
{
$this->_conf = $configuration;
$this->_store = $storage;

View File

@@ -74,12 +74,9 @@ class PurgeLimiter extends AbstractPersistence
$file = 'purge_limiter.php';
$now = time();
$content = '<?php' . PHP_EOL . '$GLOBALS[\'purge_limiter\'] = ' . $now . ';' . PHP_EOL;
if (!self::_exists($file)) {
self::_store(
$file,
'<?php' . PHP_EOL .
'$GLOBALS[\'purge_limiter\'] = ' . $now . ';' . PHP_EOL
);
self::_store($file, $content);
}
$path = self::getPath($file);
@@ -90,11 +87,7 @@ class PurgeLimiter extends AbstractPersistence
$result = false;
} else {
$result = true;
self::_store(
$file,
'<?php' . PHP_EOL .
'$GLOBALS[\'purge_limiter\'] = ' . $now . ';' . PHP_EOL
);
self::_store($file, $content);
}
return $result;
}