2011-01-16 09:17:38 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
2012-03-31 22:00:32 +01:00
|
|
|
* This file is part of the Symfony package.
|
2011-01-16 09:17:38 +00:00
|
|
|
*
|
2011-03-06 11:40:06 +00:00
|
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
2011-01-16 09:17:38 +00:00
|
|
|
*
|
2012-03-31 22:00:32 +01:00
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
2011-01-16 09:17:38 +00:00
|
|
|
*/
|
|
|
|
|
2012-04-02 04:52:14 +01:00
|
|
|
namespace Symfony\Component\HttpKernel\DependencyInjection;
|
|
|
|
|
2012-12-06 12:09:44 +00:00
|
|
|
use Symfony\Component\DependencyInjection\Extension\Extension as BaseExtension;
|
2012-04-02 04:52:14 +01:00
|
|
|
|
2011-01-16 09:17:38 +00:00
|
|
|
/**
|
2012-12-06 12:09:44 +00:00
|
|
|
* Allow adding classes to the class cache.
|
2011-01-16 09:17:38 +00:00
|
|
|
*
|
2011-03-06 11:40:06 +00:00
|
|
|
* @author Fabien Potencier <fabien@symfony.com>
|
2011-01-16 09:17:38 +00:00
|
|
|
*/
|
2012-12-06 12:09:44 +00:00
|
|
|
abstract class Extension extends BaseExtension
|
2011-01-16 09:17:38 +00:00
|
|
|
{
|
2011-03-23 18:47:16 +00:00
|
|
|
private $classes = array();
|
2016-06-28 13:49:00 +01:00
|
|
|
private $annotatedClasses = array();
|
2011-01-16 09:17:38 +00:00
|
|
|
|
2011-01-27 13:26:49 +00:00
|
|
|
/**
|
|
|
|
* Gets the classes to cache.
|
|
|
|
*
|
|
|
|
* @return array An array of classes
|
2017-05-24 09:44:44 +01:00
|
|
|
*
|
|
|
|
* @deprecated since version 3.3, to be removed in 4.0.
|
2011-01-27 13:26:49 +00:00
|
|
|
*/
|
2011-01-16 09:17:38 +00:00
|
|
|
public function getClassesToCompile()
|
|
|
|
{
|
2017-05-24 09:44:44 +01:00
|
|
|
if (PHP_VERSION_ID >= 70000) {
|
|
|
|
@trigger_error(__METHOD__.'() is deprecated since version 3.3, to be removed in 4.0.', E_USER_DEPRECATED);
|
|
|
|
}
|
|
|
|
|
2011-01-16 09:17:38 +00:00
|
|
|
return $this->classes;
|
|
|
|
}
|
|
|
|
|
2016-06-28 13:49:00 +01:00
|
|
|
/**
|
|
|
|
* Gets the annotated classes to cache.
|
|
|
|
*
|
|
|
|
* @return array An array of classes
|
|
|
|
*/
|
|
|
|
public function getAnnotatedClassesToCompile()
|
|
|
|
{
|
|
|
|
return $this->annotatedClasses;
|
|
|
|
}
|
|
|
|
|
2011-01-16 09:17:38 +00:00
|
|
|
/**
|
2011-01-27 13:26:49 +00:00
|
|
|
* Adds classes to the class cache.
|
2011-01-16 09:17:38 +00:00
|
|
|
*
|
2016-06-28 13:49:00 +01:00
|
|
|
* @param array $classes An array of class patterns
|
2016-12-03 10:46:43 +00:00
|
|
|
*
|
|
|
|
* @deprecated since version 3.3, to be removed in 4.0.
|
2011-01-16 09:17:38 +00:00
|
|
|
*/
|
2011-03-23 18:47:16 +00:00
|
|
|
public function addClassesToCompile(array $classes)
|
2011-01-16 09:17:38 +00:00
|
|
|
{
|
2016-12-03 10:46:43 +00:00
|
|
|
if (PHP_VERSION_ID >= 70000) {
|
|
|
|
@trigger_error(__METHOD__.'() is deprecated since version 3.3, to be removed in 4.0.', E_USER_DEPRECATED);
|
|
|
|
}
|
|
|
|
|
2011-01-16 09:17:38 +00:00
|
|
|
$this->classes = array_merge($this->classes, $classes);
|
|
|
|
}
|
2016-06-28 13:49:00 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds annotated classes to the class cache.
|
|
|
|
*
|
|
|
|
* @param array $annotatedClasses An array of class patterns
|
|
|
|
*/
|
|
|
|
public function addAnnotatedClassesToCompile(array $annotatedClasses)
|
|
|
|
{
|
|
|
|
$this->annotatedClasses = array_merge($this->annotatedClasses, $annotatedClasses);
|
|
|
|
}
|
2011-01-16 09:17:38 +00:00
|
|
|
}
|