PHP code example of hostnet / hn-dependency-injection-plugin

1. Go to this page and download the library: Download hostnet/hn-dependency-injection-plugin library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hostnet / hn-dependency-injection-plugin example snippets

 composer.phar 
unit

   protected function createKernel()
   {
       return new MyKernel($this);
   }
   

   class MyKernel extends Hostnet\HnDependencyInjectionPlugin\Symfony1Kernel
   {
       public function registerBundles()
       {
           $bundles = array(
               new Symfony\Bundle\FrameworkBundle\FrameworkBundle()
           );
           return array_merge($bundles, parent::registerBundles());
       }
   }
   

    
config/ProjectConfiguration.php

   use Doctrine\Common\Annotations\AnnotationRegistry;

   $loader =    

if ($this->getEnvironment() == 'dev') {
    $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
}

$response = $configuration->handle($request);
$response->send();
$configuration->terminate($request, $response);