Add SkillsBundle file + fix Kernel file

pull/2487/head
jmontoyaa 7 years ago
parent 5cc7410904
commit 8c7b08d61f
  1. 73
      src/Kernel.php
  2. 26
      src/SkillBundle/ChamiloSkillBundle.php

@ -7,6 +7,7 @@ use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Component\Routing\RouteCollectionBuilder;
use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
class Kernel extends BaseKernel
{
@ -58,4 +59,76 @@ class Kernel extends BaseKernel
}
$routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');
}
/**
* @return string
*/
public function getRootDir()
{
if (null === $this->rootDir) {
$r = new \ReflectionObject($this);
$this->rootDir = str_replace('\\', '/', dirname($r->getFileName()));
}
return $this->rootDir;
}
/**
* Returns the real root path
* @return string
*/
public function getRealRootDir()
{
return realpath($this->getRootDir().'/../').'/';
}
/**
* Returns the data path
* @return string
*/
public function getDataDir()
{
return $this->getRealRootDir().'data/';
}
/**
* @return string
*/
public function getAppDir()
{
return $this->getRealRootDir().'app/';
}
/**
* @return string
*/
public function getConfigDir()
{
return $this->getRealRootDir().'app/config/';
}
/**
* @return string
*/
public function getConfigurationFile()
{
return $this->getRealRootDir().'app/config/configuration.php';
}
/**
* @param array $configuration
*/
public function setApi(array $configuration)
{
new ChamiloApi($configuration);
}
/**
* Check if system is installed
* @return bool
*/
public function isInstalled()
{
return !empty($this->getContainer()->getParameter('installed'));
}
}

@ -0,0 +1,26 @@
<?php
/**
* This file is part of the <name> project.
*
* (c) <yourname> <youremail>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Chamilo\SkillBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* This file has been generated by the EasyExtends bundle ( https://sonata-project.org/easy-extends )
*
* References :
* bundles : http://symfony.com/doc/current/book/bundles.html
*
* @author <yourname> <youremail>
*/
class ChamiloSkillBundle extends Bundle
{
}
Loading…
Cancel
Save