Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
8ca26dcf
Commit
8ca26dcf
authored
Jul 02, 2014
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1875118
by damiankloip, tim.plunkett: Move resource plugins to correct modules.
parent
21fc02cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
18 deletions
+10
-18
core/modules/dblog/src/Plugin/rest/resource/DBLogResource.php
.../modules/dblog/src/Plugin/rest/resource/DBLogResource.php
+6
-14
core/modules/dblog/src/Tests/Rest/DbLogResourceTest.php
core/modules/dblog/src/Tests/Rest/DbLogResourceTest.php
+4
-4
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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