Commit 52895910 authored by Telenkov Ruslan's avatar Telenkov Ruslan

test

parent 433c317b
......@@ -21,6 +21,7 @@
"drupal/core": "^9.1",
"drupal/core-composer-scaffold": "^9",
"drupal/devel": "^4.0",
"drupal/devel_kint_extras": "^1.0",
"drupal/devel_php": "^1.0",
"drupal/field_group": "^3.2",
"drupal/fontawesome_menu_icons": "^1.9",
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "81d8895fd38ebf54d8fb1ed7585460ff",
"content-hash": "26bb62d404a206b96084a0b93b84439e",
"packages": [
{
"name": "asm89/stack-cors",
......@@ -2681,6 +2681,58 @@
"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",
"version": "1.5.0",
......@@ -5118,6 +5170,76 @@
"abandoned": true,
"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",
"version": "2.9.2",
......
name: My Service
description: Creates a page showing "Bootcamp".
package: Custom
type: module
core_version_requirement: ^8.8 || ^9
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);
}
services:
myservice.my:
class: Drupal\myservice\Controller\MyService
arguments: ['@http_client']
<?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;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment