renaming controller #342
This commit is contained in:
@@ -17,11 +17,11 @@ use PrivateBin\Persistence\ServerSalt;
|
||||
use PrivateBin\Persistence\TrafficLimiter;
|
||||
|
||||
/**
|
||||
* PrivateBin
|
||||
* Controller
|
||||
*
|
||||
* Controller, puts it all together.
|
||||
* Puts it all together.
|
||||
*/
|
||||
class PrivateBin
|
||||
class Controller
|
||||
{
|
||||
/**
|
||||
* version
|
||||
@@ -151,7 +151,7 @@ class PrivateBin
|
||||
}
|
||||
|
||||
/**
|
||||
* initialize privatebin
|
||||
* initialize PrivateBin
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
@@ -368,7 +368,7 @@ class PrivateBin
|
||||
}
|
||||
|
||||
/**
|
||||
* Display PrivateBin frontend.
|
||||
* Display frontend.
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
@@ -15,7 +15,7 @@ namespace PrivateBin\Data;
|
||||
use Exception;
|
||||
use PDO;
|
||||
use PDOException;
|
||||
use PrivateBin\PrivateBin;
|
||||
use PrivateBin\Controller;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
@@ -122,7 +122,7 @@ class Database extends AbstractData
|
||||
}
|
||||
|
||||
// create config table if necessary
|
||||
$db_version = PrivateBin::VERSION;
|
||||
$db_version = Controller::VERSION;
|
||||
if (!in_array(self::_sanitizeIdentifier('config'), $tables)) {
|
||||
self::_createConfigTable();
|
||||
// if we only needed to create the config table, the DB is older then 0.22
|
||||
@@ -134,7 +134,7 @@ class Database extends AbstractData
|
||||
}
|
||||
|
||||
// update database structure if necessary
|
||||
if (version_compare($db_version, PrivateBin::VERSION, '<')) {
|
||||
if (version_compare($db_version, Controller::VERSION, '<')) {
|
||||
self::_upgradeDatabase($db_version);
|
||||
}
|
||||
} else {
|
||||
@@ -623,7 +623,7 @@ class Database extends AbstractData
|
||||
self::_exec(
|
||||
'INSERT INTO ' . self::_sanitizeIdentifier('config') .
|
||||
' VALUES(?,?)',
|
||||
array('VERSION', PrivateBin::VERSION)
|
||||
array('VERSION', Controller::VERSION)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -698,7 +698,7 @@ class Database extends AbstractData
|
||||
self::_exec(
|
||||
'UPDATE ' . self::_sanitizeIdentifier('config') .
|
||||
' SET value = ? WHERE id = ?',
|
||||
array(PrivateBin::VERSION, 'VERSION')
|
||||
array(Controller::VERSION, 'VERSION')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace PrivateBin\Model;
|
||||
|
||||
use Exception;
|
||||
use PrivateBin\Persistence\ServerSalt;
|
||||
use PrivateBin\PrivateBin;
|
||||
use PrivateBin\Controller;
|
||||
use PrivateBin\Sjcl;
|
||||
|
||||
/**
|
||||
@@ -35,14 +35,14 @@ class Paste extends AbstractModel
|
||||
{
|
||||
$data = $this->_store->read($this->getId());
|
||||
if ($data === false) {
|
||||
throw new Exception(PrivateBin::GENERIC_ERROR, 64);
|
||||
throw new Exception(Controller::GENERIC_ERROR, 64);
|
||||
}
|
||||
|
||||
// check if paste has expired and delete it if neccessary.
|
||||
if (property_exists($data->meta, 'expire_date')) {
|
||||
if ($data->meta->expire_date < time()) {
|
||||
$this->delete();
|
||||
throw new Exception(PrivateBin::GENERIC_ERROR, 63);
|
||||
throw new Exception(Controller::GENERIC_ERROR, 63);
|
||||
}
|
||||
// We kindly provide the remaining time before expiration (in seconds)
|
||||
$data->meta->remaining_time = $data->meta->expire_date - time();
|
||||
|
||||
Reference in New Issue
Block a user