Introduce PSR-4 autoloading
This commit is contained in:
@@ -10,12 +10,20 @@
|
||||
* @version 0.22
|
||||
*/
|
||||
|
||||
namespace PrivateBin\Model;
|
||||
|
||||
use Exception;
|
||||
use PrivateBin\configuration;
|
||||
use PrivateBin\data\AbstractData;
|
||||
use PrivateBin\sjcl;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* model_abstract
|
||||
*
|
||||
* Abstract model for PrivateBin objects.
|
||||
*/
|
||||
abstract class model_abstract
|
||||
abstract class AbstractModel
|
||||
{
|
||||
/**
|
||||
* Instance ID.
|
||||
@@ -57,7 +65,7 @@ abstract class model_abstract
|
||||
* @param privatebin_abstract $storage
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(configuration $configuration, privatebin_abstract $storage)
|
||||
public function __construct(configuration $configuration, AbstractData $storage)
|
||||
{
|
||||
$this->_conf = $configuration;
|
||||
$this->_store = $storage;
|
||||
@@ -10,12 +10,19 @@
|
||||
* @version 0.22
|
||||
*/
|
||||
|
||||
namespace PrivateBin\model;
|
||||
|
||||
use Exception;
|
||||
use PrivateBin\sjcl;
|
||||
use PrivateBin\trafficlimiter;
|
||||
use PrivateBin\vizhash16x16;
|
||||
|
||||
/**
|
||||
* model_comment
|
||||
*
|
||||
* Model of a PrivateBin comment.
|
||||
*/
|
||||
class model_comment extends model_abstract
|
||||
class comment extends AbstractModel
|
||||
{
|
||||
/**
|
||||
* Instance's parent.
|
||||
@@ -118,7 +125,7 @@ class model_comment extends model_abstract
|
||||
* @throws Exception
|
||||
* @return void
|
||||
*/
|
||||
public function setPaste(model_paste $paste)
|
||||
public function setPaste(paste $paste)
|
||||
{
|
||||
$this->_paste = $paste;
|
||||
$this->_data->meta->pasteid = $paste->getId();
|
||||
|
||||
@@ -10,12 +10,19 @@
|
||||
* @version 0.22
|
||||
*/
|
||||
|
||||
namespace PrivateBin\model;
|
||||
|
||||
use Exception;
|
||||
use PrivateBin\privatebin;
|
||||
use PrivateBin\serversalt;
|
||||
use PrivateBin\sjcl;
|
||||
|
||||
/**
|
||||
* model_paste
|
||||
*
|
||||
* Model of a PrivateBin paste.
|
||||
*/
|
||||
class model_paste extends model_abstract
|
||||
class paste extends AbstractModel
|
||||
{
|
||||
/**
|
||||
* Get paste data.
|
||||
@@ -130,7 +137,7 @@ class model_paste extends model_abstract
|
||||
{
|
||||
throw new Exception('Invalid data.', 62);
|
||||
}
|
||||
$comment = new model_comment($this->_conf, $this->_store);
|
||||
$comment = new comment($this->_conf, $this->_store);
|
||||
$comment->setPaste($this);
|
||||
$comment->setParentId($parentId);
|
||||
if ($commentId !== null) $comment->setId($commentId);
|
||||
|
||||
Reference in New Issue
Block a user