Reworked config to be an arrayobject
Death to the mix of object variable and array. Also cleaned up the profiler sanity checks as the variable will always be present now. Profiler is now an all or nothing action.
This commit is contained in:
parent
f2f1cbc166
commit
1c974fc9ad
8 changed files with 98 additions and 200 deletions
|
@ -98,18 +98,18 @@ class Resource extends Object
|
|||
if ($this->auth === true
|
||||
|| (isset($this->auth[$method]) && $this->auth[$method]))
|
||||
{
|
||||
if (!$this->config->pickles['auth'])
|
||||
if (!$this->config['pickles']['auth'])
|
||||
{
|
||||
throw new \Exception('Authentication is not configured properly.', 401);
|
||||
}
|
||||
|
||||
/*
|
||||
// This class should be in the classes directory of the service
|
||||
$auth = '\\' . $this->config->pickles['namespace'] . '\\Auth';
|
||||
$auth = '\\' . $this->config['pickles']['namespace'] . '\\Auth';
|
||||
var_dump($auth);
|
||||
$auth = new $auth();
|
||||
|
||||
switch ($this->config->pickles['auth'])
|
||||
switch ($this->config['pickles']['auth'])
|
||||
{
|
||||
case 'basic':
|
||||
$auth->basic();
|
||||
|
@ -327,11 +327,8 @@ class Resource extends Object
|
|||
else
|
||||
{
|
||||
/*
|
||||
// Gets the profiler status
|
||||
$profiler = $this->config['pickles']['profiler'];
|
||||
|
||||
// Starts a timer before the resource is executed
|
||||
if ($profiler)
|
||||
if ($this->config['pickles']['profiler'])
|
||||
{
|
||||
Profiler::timer('resource ' . $method);
|
||||
}
|
||||
|
@ -341,7 +338,7 @@ class Resource extends Object
|
|||
|
||||
/*
|
||||
// Stops the resource timer
|
||||
if ($profiler)
|
||||
if ($this->config['pickles']['profiler'])
|
||||
{
|
||||
Profiler::timer('resource ' . $method);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue