Ver código fonte

Changed namespaces to all files. Also changed Bundle name

Marc 13 anos atrás
pai
commit
9c250e3d4f

+ 1 - 1
@todo

@@ -1,2 +1,2 @@
-* Set parameters on config.yml instead using gearman.yml
+* Set parameters on config.yml instead using gearman.yml (dependence injection)
 * Testings

+ 3 - 3
Command/GearmanClientTestCommand.php

@@ -1,13 +1,13 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Command;
+namespace Mmoreramerino\GearmanBundle\Command;
 
-use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
-use Symfony\Component\Console\Input\InputDefinition;
 use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputDefinition;
 use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
 
 class GearmanClientTestCommand extends ContainerAwareCommand
 {

+ 3 - 3
Command/GearmanJobDescribeCommand.php

@@ -1,13 +1,13 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Command;
+namespace Mmoreramerino\GearmanBundle\Command;
 
-use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
-use Symfony\Component\Console\Input\InputDefinition;
 use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputDefinition;
 use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
 
 class GearmanJobDescribeCommand extends ContainerAwareCommand
 {

+ 3 - 3
Command/GearmanJobExecuteCommand.php

@@ -1,13 +1,13 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Command;
+namespace Mmoreramerino\GearmanBundle\Command;
 
-use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
-use Symfony\Component\Console\Input\InputDefinition;
 use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputDefinition;
 use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
 
 class GearmanJobExecuteCommand extends ContainerAwareCommand
 {

+ 3 - 3
Command/GearmanJobListCommand.php

@@ -1,13 +1,13 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Command;
+namespace Mmoreramerino\GearmanBundle\Command;
 
-use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
-use Symfony\Component\Console\Input\InputDefinition;
 use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputDefinition;
 use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
 
 class GearmanJobListCommand extends ContainerAwareCommand
 {

+ 1 - 1
DependencyInjection/Configuration.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Ulabox\GearmanBundle\DependencyInjection;
+namespace Mmoreramerino\GearmanBundle\DependencyInjection;
 
 use Symfony\Component\Config\Definition\Builder\TreeBuilder;
 use Symfony\Component\Config\Definition\ConfigurationInterface;

+ 2 - 2
DependencyInjection/UlaboxGearmanExtension.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Ulabox\GearmanBundle\DependencyInjection;
+namespace Mmoreramerino\GearmanBundle\DependencyInjection;
 
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\Config\FileLocator;
@@ -12,7 +12,7 @@ use Symfony\Component\DependencyInjection\Loader;
  *
  * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
  */
-class UlaboxGearmanExtension extends Extension
+class MmoreramerinoGearmanExtension extends Extension
 {
     /**
      * {@inheritDoc}

+ 1 - 1
Driver/Gearman/GearmanAnnotations.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Driver\Gearman;
+namespace Mmoreramerino\GearmanBundle\Driver\Gearman;
 
 use Doctrine\Common\Annotations\Annotation;
 

+ 1 - 1
Exceptions/JobDoesNotExistException.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Exceptions;
+namespace Mmoreramerino\GearmanBundle\Exceptions;
 
 /**
  * GearmanBundle can't find job specified as Gearman format Exception

+ 1 - 1
Exceptions/NoSettingsFileExistsException.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Exceptions;
+namespace Mmoreramerino\GearmanBundle\Exceptions;
 
 /**
  * GearmanBundle can't find settings into specified path Exception

+ 1 - 1
Exceptions/SettingValueMissingException.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Exceptions;
+namespace Mmoreramerino\GearmanBundle\Exceptions;
 
 /**
  * GearmanBundle can't find setting value

+ 1 - 1
Exceptions/SettingsNotLoadedException.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Exceptions;
+namespace Mmoreramerino\GearmanBundle\Exceptions;
 
 /**
  * GearmanBundle has not already load settings file Exception

+ 9 - 9
UlaboxGearmanBundle.php

@@ -1,15 +1,15 @@
 <?php
 
-namespace Ulabox\GearmanBundle;
+namespace Mmoreramerino\GearmanBundle;
 
 use Symfony\Component\Config\FileLocator;
-use Ulabox\GearmanBundle\Module\GearmanBaseBundle;
-use Ulabox\GearmanBundle\Module\WorksDirectoryLoader;
-use Ulabox\GearmanBundle\Module\WorkerClass as Worker;
-use Ulabox\GearmanBundle\Module\WorkerCollection;
 use Doctrine\Common\Annotations\AnnotationReader;
 use Doctrine\Common\Annotations\AnnotationRegistry;
-use Ulabox\GearmanBundle\Module\GearmanCache as Cache;
+use Mmoreramerino\GearmanBundle\Module\WorkerCollection;
+use Mmoreramerino\GearmanBundle\Module\GearmanBaseBundle;
+use Mmoreramerino\GearmanBundle\Module\WorksDirectoryLoader;
+use Mmoreramerino\GearmanBundle\Module\WorkerClass as Worker;
+use Mmoreramerino\GearmanBundle\Module\GearmanCache as Cache;
 use Symfony\Component\Routing\Loader\AnnotationDirectoryLoader;
 
 /**
@@ -17,7 +17,7 @@ use Symfony\Component\Routing\Loader\AnnotationDirectoryLoader;
  *
  * @author Marc Morera <marc@ulabox.com>
  */
-class UlaboxGearmanBundle extends GearmanBaseBundle
+class MmoreramerinoGearmanBundle extends GearmanBaseBundle
 {
     /**
      * Boots the Bundle.
@@ -45,7 +45,7 @@ class UlaboxGearmanBundle extends GearmanBaseBundle
             }
             $reader = new AnnotationReader();
             AnnotationRegistry::registerFile(__DIR__ . "/Driver/Gearman/GearmanAnnotations.php");
-            $reader->setDefaultAnnotationNamespace('Ulabox\GearmanBundle\Driver\\');
+            $reader->setDefaultAnnotationNamespace('Mmoreramerino\GearmanBundle\Driver\\');
             $workerCollection = new WorkerCollection;
             $bundles = $this->container->get('kernel')->getBundles();
             foreach ($bundles as $bundle) {
@@ -62,7 +62,7 @@ class UlaboxGearmanBundle extends GearmanBaseBundle
 
                     foreach ($classAnnotations as $annot) {
 
-                        if ($annot instanceof \Ulabox\GearmanBundle\Driver\Gearman\Work) {
+                        if ($annot instanceof \Mmoreramerino\GearmanBundle\Driver\Gearman\Work) {
                             $workerCollection->add(New Worker($annot, $reflClass, $reader, $this->getSettings()));
                         }
                     }

+ 2 - 2
Module/GearmanBaseBundle.php

@@ -1,10 +1,10 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Module;
+namespace Mmoreramerino\GearmanBundle\Module;
 
 use Symfony\Component\HttpKernel\Bundle\Bundle;
+use Mmoreramerino\GearmanBundle\Sevices\GearmanSettings;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Ulabox\GearmanBundle\Sevices\GearmanSettings;
 
 /**
  * Gearman Base Bundle

+ 1 - 1
Module/GearmanCache.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Module;
+namespace Mmoreramerino\GearmanBundle\Module;
 
 /**
  * Gearman cache class

+ 4 - 4
Module/JobClass.php

@@ -1,10 +1,10 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Module;
+namespace Mmoreramerino\GearmanBundle\Module;
 
-use Ulabox\GearmanBundle\Driver\Gearman\Job;
-use Ulabox\GearmanBundle\Driver\Gearman\Work;
-use Ulabox\GearmanBundle\Exceptions\SettingValueMissingException;
+use Mmoreramerino\GearmanBundle\Driver\Gearman\Job;
+use Mmoreramerino\GearmanBundle\Driver\Gearman\Work;
+use Mmoreramerino\GearmanBundle\Exceptions\SettingValueMissingException;
 
 /**
  * Job class

+ 2 - 2
Module/JobCollection.php

@@ -1,8 +1,8 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Module;
+namespace Mmoreramerino\GearmanBundle\Module;
 
-use Ulabox\GearmanBundle\Module\JobClass as Job;
+use Mmoreramerino\GearmanBundle\Module\JobClass as Job;
 
 /**
  * Job Collection class

+ 5 - 5
Module/WorkerClass.php

@@ -1,11 +1,11 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Module;
+namespace Mmoreramerino\GearmanBundle\Module;
 
-use Ulabox\GearmanBundle\Driver\Gearman\Work;
-use Ulabox\GearmanBundle\Module\JobCollection;
-use Ulabox\GearmanBundle\Module\JobClass as Job;
 use Doctrine\Common\Annotations\AnnotationReader;
+use Mmoreramerino\GearmanBundle\Driver\Gearman\Work;
+use Mmoreramerino\GearmanBundle\Module\JobCollection;
+use Mmoreramerino\GearmanBundle\Module\JobClass as Job;
 
 /**
  * Worker class
@@ -67,7 +67,7 @@ class WorkerClass
             $reflMethod = new \ReflectionMethod($method->class, $method->name);
             $methodAnnotations = $reader->getMethodAnnotations($reflMethod);
             foreach ($methodAnnotations as $annot) {
-                if ($annot instanceof \Ulabox\GearmanBundle\Driver\Gearman\Job) {
+                if ($annot instanceof \Mmoreramerino\GearmanBundle\Driver\Gearman\Job) {
                     $this->jobCollection->add(new Job($annot, $reflMethod, $classAnnotation, $this->callableName, $settings));
                 }
             }

+ 2 - 2
Module/WorkerCollection.php

@@ -1,8 +1,8 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Module;
+namespace Mmoreramerino\GearmanBundle\Module;
 
-use Ulabox\GearmanBundle\Module\WorkerClass as Worker;
+use Mmoreramerino\GearmanBundle\Module\WorkerClass as Worker;
 
 /**
  * WorkerCollection class

+ 1 - 1
Module/WorksDirectoryLoader.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Module;
+namespace Mmoreramerino\GearmanBundle\Module;
 
 use Symfony\Component\Config\FileLocator;
 use Symfony\Component\Config\Loader\FileLoader;

+ 3 - 3
Resources/config/services.yml

@@ -1,7 +1,7 @@
 parameters:
-    gearman.execute.job.class:  Ulabox\GearmanBundle\Service\GearmanExecute
-    gearman.settings.class:     Ulabox\GearmanBundle\Service\GearmanSettings
-    gearman.class:              Ulabox\GearmanBundle\Service\Gearman
+    gearman.execute.job.class:  Mmoreramerino\GearmanBundle\Service\GearmanExecute
+    gearman.settings.class:     Mmoreramerino\GearmanBundle\Service\GearmanSettings
+    gearman.class:              Mmoreramerino\GearmanBundle\Service\Gearman
 services:
     gearman: 
         class: %gearman.class%

+ 3 - 3
Service/Gearman.php

@@ -1,9 +1,9 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Service;
+namespace Mmoreramerino\GearmanBundle\Service;
 
-use Ulabox\GearmanBundle\Service\GearmanService;
-use Ulabox\GearmanBundle\Service\GearmanInterface;
+use Mmoreramerino\GearmanBundle\Service\GearmanService;
+use Mmoreramerino\GearmanBundle\Service\GearmanInterface;
 
 /**
  * Implementation of GearmanInterface

+ 2 - 2
Service/GearmanExecute.php

@@ -1,8 +1,8 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Service;
+namespace Mmoreramerino\GearmanBundle\Service;
 
-use Ulabox\GearmanBundle\Service\GearmanService;
+use Mmoreramerino\GearmanBundle\Service\GearmanService;
 
 /**
  * Gearman execute methods. All Worker methods

+ 1 - 1
Service/GearmanInterface.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Service;
+namespace Mmoreramerino\GearmanBundle\Service;
 
 /**
  * Interface of how a Gearman class should be implemented

+ 3 - 3
Service/GearmanService.php

@@ -1,9 +1,9 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Service;
+namespace Mmoreramerino\GearmanBundle\Service;
 
-use Ulabox\GearmanBundle\Module\GearmanCache as Cache;
-use Ulabox\GearmanBundle\Exceptions\JobDoesNotExistException;
+use Mmoreramerino\GearmanBundle\Module\GearmanCache as Cache;
+use Mmoreramerino\GearmanBundle\Exceptions\JobDoesNotExistException;
 
 /**
  * Gearman execute methods. All Worker methods

+ 3 - 3
Service/GearmanSettings.php

@@ -1,11 +1,11 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Service;
+namespace Mmoreramerino\GearmanBundle\Service;
 
 use Symfony\Component\Yaml\Parser;
 use Symfony\Component\DependencyInjection\ContainerAware;
-use Ulabox\GearmanBundle\Exceptions\SettingsNotLoadedException;
-use Ulabox\GearmanBundle\Exceptions\NoSettingsFileExistsException;
+use Mmoreramerino\GearmanBundle\Exceptions\SettingsNotLoadedException;
+use Mmoreramerino\GearmanBundle\Exceptions\NoSettingsFileExistsException;
 
 /**
  * Class GearmanSettings

+ 1 - 1
Workers/testWorker.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Ulabox\GearmanBundle\Workers;
+namespace Mmoreramerino\GearmanBundle\Workers;
 
 /**
  * @Gearman\Work(description="Worker test description")

+ 2 - 2
composer.json

@@ -1,5 +1,5 @@
 {
-    "name": "Ulabox/gearman-bundle",
+    "name": "Mmoreramerino/gearman-bundle",
     "description": "Adds gearman support",
     "keywords": ["gearman"],
     "type": "symfony-bundle",
@@ -10,5 +10,5 @@
             "email": "marc@ulabox.com"
         }
     ],
-    "target-dir": "Ulabox/GearmanBundle"
+    "target-dir": "Mmoreramerino/GearmanBundle"
 }

+ 1 - 1
config.example.yml

@@ -4,7 +4,7 @@ bundles:
   # Name of bundle
   GearmanBundle:
     # Namespace to be found
-    namespace: Ulabox\GearmanBundle
+    namespace: Mmoreramerino\GearmanBundle
     # Bundle search can be enabled or disabled
     active: true