Download the PHP package raketman/service-versioning-bundle without Composer

On this page you can find all versions of the php package raketman/service-versioning-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package service-versioning-bundle

Versioning Symfony Services

composer require raketman/service-versioning-bundle

Usage :

services:

  #Specify the tag 'raketman.version.factory' - now this service will have versions
  #resolver - service that will determine the version

  app.validation.test:
    class: App\Validation\VInterface
    tags:
      - {name: 'raketman.version.factory', resolver: 'app.version.resolver'}
  # OR if yuo have autowire

  App\Validation\VInterface
    tags:
      - {name: 'raketman.version.factory', resolver: 'app.version.resolver'}

  #The version is indicated through tags that correspond to the name of the service we want to version
  #version - value of version 

  app.validation.test_v1:
    class: App\Validation\V1
    tags:
      - {name: 'app.validation.test', version: 1 }
      - {name: 'app.validation.test', version: 3 }

  app.validation.test_v2:
    class: App\Validation\V2
    tags:
      - {name: 'app.validation.test', version: 2 }
  #OR if yuo have autowire

  app.validation.test_v1:
    class: App\Validation\V1
    tags:
      - {name: 'App\Validation\VInterface', version: 1 }
      - {name: 'App\Validation\VInterface', version: 3 }

  app.validation.test_v2:
    class: App\Validation\V2
    tags:
      - {name: 'App\Validation\VInterface', version: 2 }        

  # Version resolver

  app.version.resolver:
    class: App\Resolver\Version
    arguments:
        - '@request_stack'

Now you have the service "app.validation.test", upon receipt of which, depending on which version it will return "app.version.resolver", if 1 then "app.validation.test_v1" or if 2 then "app.validation.test_v2 will return

For example, the implementation of "app.version.resolver" is as follows:
 namespace App\Resolver;

 use Raketman\Bundle\ServiceVersioningBundle\Resolver\VersionResolverInterface;
 use Symfony\Component\HttpFoundation\RequestStack;

 class Version implements VersionResolverInterface
 {
     /** @var RequestStack  */
     private  $request;

     public function __construct(RequestStack $request)
     {
         $this->request = $request;
     }

     public function getVersion()
     {
         return $this->request->getMasterRequest()->get('version') ? : 1;
     }
 }

Now we can use "app.validation.test", and get different versions depending on $ _GET ['version']

 $validation = $this->get('app.validation.test');

 if $_GET['version'] === 1, then get_class($validation) - App\Validation\V1 // app.validation.test_v1
 if $_GET['version'] === 2, then get_class($validation) - App\Validation\V2 // app.validation.test_v2
 if $_GET['version'] === 3, then get_class($validation) - App\Validation\V1 // app.validation.test_v1

 OR

 /**
 * @Route("/some-method")
 */
 public function test(App\Validation\VInterface $validation)
 {
     //if $_GET['version'] === 1, then get_class($validation) - App\Validation\V1 // app.validation.test_v1
     //if $_GET['version'] === 2, then get_class($validation) - App\Validation\V2 // app.validation.test_v2
     //if $_GET['version'] === 3, then get_class($validation) - App\Validation\V1 // app.validation.test_v1
 }

The implementation of resolver can be any, for example, based on the current user, which will allow for various users on the go to issue the necessary service implementations

If you use versioning in daemons, then do not forget to set the service mode

  shared: false

otherwise you will always be given the same instance after the first call


All versions of service-versioning-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package raketman/service-versioning-bundle contains the following files

Loading the files please wait ....