Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
8ca26dcf
Commit
8ca26dcf
authored
Jul 02, 2014
by
Angie Byron
Browse files
Issue
#1875118
by damiankloip, tim.plunkett: Move resource plugins to correct modules.
parent
21fc02cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/
rest
/src/Plugin/rest/resource/DBLogResource.php
→
core/modules/
dblog
/src/Plugin/rest/resource/DBLogResource.php
View file @
8ca26dcf
...
...
@@ -5,11 +5,11 @@
* Definition of Drupal\rest\Plugin\rest\resource\DBLogResource.
*/
namespace
Drupal\
rest
\Plugin\rest\resource
;
namespace
Drupal\
dblog
\Plugin\rest\resource
;
use
Drupal\rest\Plugin\ResourceBase
;
use
Drupal\rest\ResourceResponse
;
use
Symfony\Component\HttpKernel\Exception\HttpException
;
use
Symfony\Component\HttpKernel\Exception\NotFoundHttpException
;
/**
...
...
@@ -25,17 +25,6 @@
*/
class
DBLogResource
extends
ResourceBase
{
/**
* Overrides \Drupal\rest\Plugin\ResourceBase::routes().
*/
public
function
routes
()
{
// Only expose routes if the dblog module is enabled.
if
(
\
Drupal
::
moduleHandler
()
->
moduleExists
(
'dblog'
))
{
return
parent
::
routes
();
}
return
new
RouteCollection
();
}
/**
* Responds to GET requests.
*
...
...
@@ -53,7 +42,10 @@ public function get($id = NULL) {
if
(
!
empty
(
$record
))
{
return
new
ResourceResponse
(
$record
);
}
throw
new
NotFoundHttpException
(
t
(
'Log entry with ID @id was not found'
,
array
(
'@id'
=>
$id
)));
}
throw
new
NotFoundHttpException
(
t
(
'Log entry with ID @id was not found'
,
array
(
'@id'
=>
$id
)));
throw
new
HttpException
(
t
(
'No log entry ID was provided'
));
}
}
core/modules/
rest
/src/Tests/
DBLog
Test.php
→
core/modules/
dblog
/src/Tests/
Rest/DbLogResource
Test.php
View file @
8ca26dcf
...
...
@@ -5,22 +5,22 @@
* Definition of Drupal\rest\test\DBLogTest.
*/
namespace
Drupal\
rest
\Tests
;
namespace
Drupal\
dblog
\Tests
\Rest
;
use
Drupal\Component\Serialization\Json
;
use
Drupal\rest\Tests\RESTTestBase
;
/**
* Tests the Watchdog resource to retrieve log messages.
* Tests the Watchdog
REST
resource to retrieve log messages.
*/
class
D
B
LogTest
extends
RESTTestBase
{
class
D
b
Log
Resource
Test
extends
RESTTestBase
{
/**
* Modules to enable.
*
* @var array
*/
public
static
$modules
=
array
(
'hal'
,
'rest'
,
'dblog'
);
public
static
$modules
=
array
(
'hal'
,
'dblog'
);
public
static
function
getInfo
()
{
return
array
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment