瀏覽代碼

Se agrega redis-bundle. Para ir encarando los comandos para stats.

Maximiliano Schvindt 7 年之前
父節點
當前提交
0ee51e533e
共有 5 個文件被更改,包括 145 次插入18 次删除
  1. 1 0
      app/AppKernel.php
  2. 1 0
      app/config/config.yml
  3. 21 13
      composer.json
  4. 80 5
      composer.lock
  5. 42 0
      src/StatsBundle/Command/RedisCommand.php

+ 1 - 0
app/AppKernel.php

@@ -36,6 +36,7 @@ class AppKernel extends Kernel
             new OwnerVoterBundle\OwnerVoterBundle(),
             
             new StatsBundle\StatsBundle(),
+            new RedisBundle\RedisBundle()
         ];
 
         if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {

+ 1 - 0
app/config/config.yml

@@ -12,6 +12,7 @@ imports:
     - { resource: "@WebserviceBundle/Resources/config/services.yml" }
     - { resource: "@ExtraDataBundle/Resources/config/services.yml" }
     - { resource: "@OwnerVoterBundle/Resources/config/services.yml" }
+    - { resource: "@RedisBundle/Resources/config/services.yml" }
    
     - { resource: "@StatsBundle/Resources/config/services.yml" }
 

+ 21 - 13
composer.json

@@ -61,6 +61,13 @@
             "options": {
                     "local_pk": "./keys/bitbucket.id_rsa"
             }
+        },
+        {
+            "type": "vcs",
+			"url": "ssh://git@gogs.infra.flowdat.com:222/VendorSoftwareFlowdat3/RedisBundle.git",
+            "options": {
+                    "local_pk": "./keys/bitbucket.id_rsa"
+            }
         }
     ],
     "require": {
@@ -68,27 +75,28 @@
         "doctrine/doctrine-bundle": "^1.6",
         "doctrine/doctrine-cache-bundle": "^1.2",
         "doctrine/orm": "^2.5",
+        "ik/base-admin-bundle": "dev-master",
+        "ik/device-bundle": "dev-master",
+        "ik/extra-data-bundle": "dev-master",
+        "ik/oauthclient-bundle": "dev-master",
+        "ik/owner-voter-bundle": "dev-master",
+        "ik/redis-bundle": "dev-master",
+        "ik/webservice-bundle": "dev-master",
         "incenteev/composer-parameter-handler": "^2.0",
+        "jms/serializer-bundle": "^1.1",
+        "php-amqplib/rabbitmq-bundle": "^1.12",
+        "phpunit/phpunit": "5.5.*",
         "sensio/distribution-bundle": "^5.0",
         "sensio/framework-extra-bundle": "^3.0.2",
+        "sonata-project/admin-bundle": "^3.12",
+        "sonata-project/doctrine-orm-admin-bundle": "^3.1",
+        "stof/doctrine-extensions-bundle": "^1.2",
         "symfony/monolog-bundle": "^3.0.2",
         "symfony/polyfill-apcu": "^1.0",
         "symfony/swiftmailer-bundle": "^2.3.10",
         "symfony/symfony": "3.2.*",
         "twig/twig": "^1.0||^2.0",
-        "sonata-project/admin-bundle": "^3.12",
-        "sonata-project/doctrine-orm-admin-bundle": "^3.1",
-        "jms/serializer-bundle": "^1.1",
-        "phpunit/phpunit": "5.5.*",
-        "stof/doctrine-extensions-bundle": "^1.2",
-        "voryx/restgeneratorbundle": "dev-master",
-        "php-amqplib/rabbitmq-bundle": "^1.12",
-        "ik/base-admin-bundle": "dev-master",
-        "ik/oauthclient-bundle": "dev-master",
-        "ik/webservice-bundle": "dev-master",
-        "ik/device-bundle": "dev-master",
-        "ik/extra-data-bundle": "dev-master",
-        "ik/owner-voter-bundle": "dev-master"
+        "voryx/restgeneratorbundle": "dev-master"
     },
     "require-dev": {
         "sensio/generator-bundle": "^3.0",

+ 80 - 5
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "content-hash": "ea46834f1379bc83646db9043b190d8d",
+    "content-hash": "a056ae781c277c4418991e124d09629f",
     "packages": [
         {
             "name": "behat/transliterator",
@@ -1375,6 +1375,30 @@
             ],
             "time": "2017-06-12 15:49:24"
         },
+        {
+            "name": "ik/redis-bundle",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "ssh://git@gogs.infra.flowdat.com:222/VendorSoftwareFlowdat3/RedisBundle.git",
+                "reference": "78e12635d9b5ef92d43af538e6aa766fefff2a4d"
+            },
+            "require": {
+                "predis/predis": "^1.1"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "RedisBundle\\": ""
+                }
+            },
+            "description": "Flowdat 3 Redis Bundle",
+            "keywords": [
+                "php-redis-service",
+                "redis"
+            ],
+            "time": "2017-07-19 16:50:25"
+        },
         {
             "name": "ik/webservice-bundle",
             "version": "dev-master",
@@ -2963,6 +2987,56 @@
             ],
             "time": "2016-12-08T20:27:08+00:00"
         },
+        {
+            "name": "predis/predis",
+            "version": "v1.1.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/nrk/predis.git",
+                "reference": "f0210e38881631afeafb56ab43405a92cafd9fd1"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/nrk/predis/zipball/f0210e38881631afeafb56ab43405a92cafd9fd1",
+                "reference": "f0210e38881631afeafb56ab43405a92cafd9fd1",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.9"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.8"
+            },
+            "suggest": {
+                "ext-curl": "Allows access to Webdis when paired with phpiredis",
+                "ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Predis\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Daniele Alessandri",
+                    "email": "suppakilla@gmail.com",
+                    "homepage": "http://clorophilla.net"
+                }
+            ],
+            "description": "Flexible and feature-complete Redis client for PHP and HHVM",
+            "homepage": "http://github.com/nrk/predis",
+            "keywords": [
+                "nosql",
+                "predis",
+                "redis"
+            ],
+            "time": "2016-06-16T16:22:20+00:00"
+        },
         {
             "name": "psr/cache",
             "version": "1.0.1",
@@ -5460,13 +5534,14 @@
     "aliases": [],
     "minimum-stability": "stable",
     "stability-flags": {
-        "voryx/restgeneratorbundle": 20,
         "ik/base-admin-bundle": 20,
-        "ik/oauthclient-bundle": 20,
-        "ik/webservice-bundle": 20,
         "ik/device-bundle": 20,
         "ik/extra-data-bundle": 20,
-        "ik/owner-voter-bundle": 20
+        "ik/oauthclient-bundle": 20,
+        "ik/owner-voter-bundle": 20,
+        "ik/redis-bundle": 20,
+        "ik/webservice-bundle": 20,
+        "voryx/restgeneratorbundle": 20
     },
     "prefer-stable": false,
     "prefer-lowest": false,

+ 42 - 0
src/StatsBundle/Command/RedisCommand.php

@@ -0,0 +1,42 @@
+<?php
+
+namespace StatsBundle\Command;
+
+use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use RedisBundle\Services\RedisService;
+
+class RedisCommand extends ContainerAwareCommand
+{
+
+    protected function configure()
+    {
+        $this
+                ->setName('redis:test')
+                ->setDescription('Test Redis')
+                ->setHelp('This command allows test redis')
+        ;
+    }
+
+    /**
+     * @param InputInterface $input
+     * @param OutputInterface $output
+     */
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        /* @var $statsDeviceManager DeviceManager */
+        $redis = $this->getContainer()->get('redis');
+        
+        //$parameters = ['tcp://127.0.0.1:6379'];
+
+        //$redis->setOptions($options);
+        //$redis->setConnection($parameters);
+
+        $value = $redis->getString('clave',true);
+
+        $output->writeln($value);
+        
+    }
+
+}