Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
r-test
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Telenkov Ruslan
r-test
Commits
52895910
Commit
52895910
authored
Apr 20, 2022
by
Telenkov Ruslan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
433c317b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
178 additions
and
1 deletion
+178
-1
composer.json
app/composer.json
+1
-0
composer.lock
app/composer.lock
+123
-1
myservice.info.yml
app/docroot/modules/custom/myservice/myservice.info.yml
+5
-0
myservice.module
app/docroot/modules/custom/myservice/myservice.module
+24
-0
myservice.services.yml
app/docroot/modules/custom/myservice/myservice.services.yml
+4
-0
MyService.php
...oot/modules/custom/myservice/src/Controller/MyService.php
+21
-0
No files found.
app/composer.json
View file @
52895910
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
"drupal/core"
:
"^9.1"
,
"drupal/core"
:
"^9.1"
,
"drupal/core-composer-scaffold"
:
"^9"
,
"drupal/core-composer-scaffold"
:
"^9"
,
"drupal/devel"
:
"^4.0"
,
"drupal/devel"
:
"^4.0"
,
"drupal/devel_kint_extras"
:
"^1.0"
,
"drupal/devel_php"
:
"^1.0"
,
"drupal/devel_php"
:
"^1.0"
,
"drupal/field_group"
:
"^3.2"
,
"drupal/field_group"
:
"^3.2"
,
"drupal/fontawesome_menu_icons"
:
"^1.9"
,
"drupal/fontawesome_menu_icons"
:
"^1.9"
,
...
...
app/composer.lock
View file @
52895910
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
"This file is @generated automatically"
],
],
"content-hash": "
81d8895fd38ebf54d8fb1ed7585460ff
",
"content-hash": "
26bb62d404a206b96084a0b93b84439e
",
"packages": [
"packages": [
{
{
"name": "asm89/stack-cors",
"name": "asm89/stack-cors",
...
@@ -2681,6 +2681,58 @@
...
@@ -2681,6 +2681,58 @@
"slack": "https://drupal.slack.com/archives/C012WAW1MH6"
"slack": "https://drupal.slack.com/archives/C012WAW1MH6"
}
}
},
},
{
"name": "drupal/devel_kint_extras",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/devel_kint_extras.git",
"reference": "1.0.0"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/devel_kint_extras-1.0.0.zip",
"reference": "1.0.0",
"shasum": "286b5183552cc673fb96de7e3d943a3cfd82ec00"
},
"require": {
"drupal/core": "^8 || ^9",
"drupal/devel": "^4.0",
"kint-php/kint": "^3.3"
},
"type": "drupal-module",
"extra": {
"drupal": {
"version": "1.0.0",
"datestamp": "1597133801",
"security-coverage": {
"status": "not-covered",
"message": "Project has not opted into security advisory coverage!"
}
}
},
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "Jan Chojnacki",
"homepage": "https://www.drupal.org/u/janchojnacki"
},
{
"name": "Other contributors",
"homepage": "https://www.drupal.org/node/3164492/committers"
}
],
"description": "Shows methods and statics available for an object when using Kint with Devel",
"homepage": "https://www.drupal.org/project/devel_kint_extras",
"support": {
"source": "http://git.drupal.org/project/devel_kint_extras.git",
"issues": "https://www.drupal.org/project/issues/devel_kint_extras",
"chat": "irc://irc.freenode.org/drupal-contribute"
}
},
{
{
"name": "drupal/devel_php",
"name": "drupal/devel_php",
"version": "1.5.0",
"version": "1.5.0",
...
@@ -5118,6 +5170,76 @@
...
@@ -5118,6 +5170,76 @@
"abandoned": true,
"abandoned": true,
"time": "2020-02-16T12:49:55+00:00"
"time": "2020-02-16T12:49:55+00:00"
},
},
{
"name": "kint-php/kint",
"version": "3.3",
"source": {
"type": "git",
"url": "https://github.com/kint-php/kint.git",
"reference": "335ac1bcaf04d87df70d8aa51e8887ba2c6d203b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/kint-php/kint/zipball/335ac1bcaf04d87df70d8aa51e8887ba2c6d203b",
"reference": "335ac1bcaf04d87df70d8aa51e8887ba2c6d203b",
"shasum": ""
},
"require": {
"php": ">=5.3.6"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.0",
"phpunit/phpunit": "^4.0",
"seld/phar-utils": "^1.0",
"symfony/finder": "^2.0 || ^3.0 || ^4.0",
"vimeo/psalm": "^3.0"
},
"suggest": {
"ext-ctype": "Simple data type tests",
"ext-iconv": "Provides fallback detection for ambiguous legacy string encodings such as the Windows and ISO 8859 code pages",
"ext-mbstring": "Provides string encoding detection",
"kint-php/kint-js": "Provides a simplified dump to console.log()",
"kint-php/kint-twig": "Provides d() and s() functions in twig templates",
"symfony/polyfill-ctype": "Replacement for ext-ctype if missing",
"symfony/polyfill-iconv": "Replacement for ext-iconv if missing",
"symfony/polyfill-mbstring": "Replacement for ext-mbstring if missing"
},
"type": "library",
"autoload": {
"files": [
"init.php"
],
"psr-4": {
"Kint\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Vollebregt",
"homepage": "https://github.com/jnvsor"
},
{
"name": "Rokas Šleinius",
"homepage": "https://github.com/raveren"
},
{
"name": "Contributors",
"homepage": "https://github.com/kint-php/kint/graphs/contributors"
}
],
"description": "Kint - debugging tool for PHP developers",
"homepage": "https://kint-php.github.io/kint/",
"keywords": [
"debug",
"kint",
"php"
],
"time": "2019-10-17T18:05:24+00:00"
},
{
{
"name": "laminas/laminas-diactoros",
"name": "laminas/laminas-diactoros",
"version": "2.9.2",
"version": "2.9.2",
...
...
app/docroot/modules/custom/myservice/myservice.info.yml
0 → 100644
View file @
52895910
name
:
My Service
description
:
Creates a page showing "Bootcamp".
package
:
Custom
type
:
module
core_version_requirement
:
^8.8 || ^9
app/docroot/modules/custom/myservice/myservice.module
0 → 100644
View file @
52895910
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Queue\QueueFactory
;
use
Drupal\Core\Queue\QueueInterface
;
/**
* Implements hook_entity_insert().
*/
function
npq_entity_insert
(
EntityInterface
$entity
)
{
if
(
$entity
->
getEntityTypeId
()
!==
'node'
)
{
return
;
}
if
(
$entity
->
isPublished
())
{
return
;
}
/** @var QueueFactory $queue_factory */
$queue_factory
=
\Drupal
::
service
(
'queue'
);
/** @var QueueInterface $queue */
$queue
=
$queue_factory
->
get
(
'cron_node_publisher'
);
$item
=
new
\stdClass
();
$item
->
nid
=
$entity
->
id
();
$queue
->
createItem
(
$item
);
}
app/docroot/modules/custom/myservice/myservice.services.yml
0 → 100644
View file @
52895910
services
:
myservice.my
:
class
:
Drupal\myservice\Controller\MyService
arguments
:
[
'
@http_client'
]
app/docroot/modules/custom/myservice/src/Controller/MyService.php
0 → 100644
View file @
52895910
<?php
namespace
Drupal\myservice\Controller
;
use
Drupal\Core\Controller\ControllerBase
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
GuzzleHttp\Client
;
class
MyService
{
public
function
getResult
(
$uri
)
{
// Отправка GET-запроса
$request
=
\Drupal
::
httpClient
()
->
get
(
$uri
);
// Ответ GET-запроса
$response
=
$request
->
getBody
()
->
getContents
();
$result
=
json_decode
(
$response
)
->
results
;
return
$result
;
}
}
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