From 5bd2b53cb8c85debebd952c7a488c551182e8d5c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 4 Apr 2011 12:31:30 +0200 Subject: [PATCH] [ZendBundle] removed the bundle --- autoload.php.dist | 1 - .../Compiler/ZendLoggerWriterPass.php | 37 -------- .../DependencyInjection/Configuration.php | 52 ----------- .../DependencyInjection/ZendExtension.php | 93 ------------------- .../Bundle/ZendBundle/Logger/DebugLogger.php | 62 ------------- .../Bundle/ZendBundle/Logger/Logger.php | 80 ---------------- .../ZendBundle/Resources/config/logger.xml | 37 -------- .../Resources/config/schema/zend-1.0.xsd | 42 --------- src/Symfony/Bundle/ZendBundle/ZendBundle.php | 31 ------- vendors.sh | 3 - 10 files changed, 438 deletions(-) delete mode 100644 src/Symfony/Bundle/ZendBundle/DependencyInjection/Compiler/ZendLoggerWriterPass.php delete mode 100644 src/Symfony/Bundle/ZendBundle/DependencyInjection/Configuration.php delete mode 100644 src/Symfony/Bundle/ZendBundle/DependencyInjection/ZendExtension.php delete mode 100644 src/Symfony/Bundle/ZendBundle/Logger/DebugLogger.php delete mode 100644 src/Symfony/Bundle/ZendBundle/Logger/Logger.php delete mode 100644 src/Symfony/Bundle/ZendBundle/Resources/config/logger.xml delete mode 100644 src/Symfony/Bundle/ZendBundle/Resources/config/schema/zend-1.0.xsd delete mode 100644 src/Symfony/Bundle/ZendBundle/ZendBundle.php diff --git a/autoload.php.dist b/autoload.php.dist index 1c15ad793a152..5c6f3c4764fec 100644 --- a/autoload.php.dist +++ b/autoload.php.dist @@ -15,7 +15,6 @@ $loader->registerNamespaces(array( 'Doctrine\\DBAL\\Migrations' => __DIR__.'/vendor/doctrine-migrations/lib', 'Doctrine\\DBAL' => __DIR__.'/vendor/doctrine-dbal/lib', 'Doctrine' => __DIR__.'/vendor/doctrine/lib', - 'Zend' => __DIR__.'/vendor/zend/library', 'Assetic' => __DIR__.'/vendor/assetic/src', 'Monolog' => __DIR__.'/vendor/monolog/src', )); diff --git a/src/Symfony/Bundle/ZendBundle/DependencyInjection/Compiler/ZendLoggerWriterPass.php b/src/Symfony/Bundle/ZendBundle/DependencyInjection/Compiler/ZendLoggerWriterPass.php deleted file mode 100644 index 6bfedcfbfa906..0000000000000 --- a/src/Symfony/Bundle/ZendBundle/DependencyInjection/Compiler/ZendLoggerWriterPass.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\ZendBundle\DependencyInjection\Compiler; - -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; - -/** - * Adds tagged zend.logger.writer services to zend.logger service - * - * @author Fabien Potencier - */ -class ZendLoggerWriterPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container) - { - if (false === $container->hasDefinition('zend.logger')) { - return; - } - - $definition = $container->getDefinition('zend.logger'); - - foreach ($container->findTaggedServiceIds('zend.logger.writer') as $id => $attributes) { - $definition->addMethodCall('addWriter', array(new Reference($id))); - } - } -} diff --git a/src/Symfony/Bundle/ZendBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/ZendBundle/DependencyInjection/Configuration.php deleted file mode 100644 index 41e5b1db1fc88..0000000000000 --- a/src/Symfony/Bundle/ZendBundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\ZendBundle\DependencyInjection; - -use Symfony\Component\Config\Definition\Builder\TreeBuilder; - -/** - * This class contains the configuration information for the bundle - * - * This information is solely responsible for how the different configuration - * sections are normalized, and merged. - * - * @author Christophe Coevoet - */ -class Configuration -{ - /** - * Generates the configuration tree. - * - * @return \Symfony\Component\Config\Definition\ArrayNode The config tree - */ - public function getConfigTree() - { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('zend'); - - $rootNode - ->children() - ->arrayNode('logger') - ->canBeUnset() - ->children() - ->scalarNode('priority')->defaultValue('INFO')->end() - ->scalarNode('path')->defaultValue('%kernel.logs_dir%/%kernel.environment%.log')->end() - ->scalarNode('format')->defaultValue("%%timestamp%% %%priorityName%%: %%message%%\n")->end() - ->booleanNode('log_errors')->defaultFalse()->end() - ->end() - ->end() - ->end() - ; - - return $treeBuilder->buildTree(); - } -} diff --git a/src/Symfony/Bundle/ZendBundle/DependencyInjection/ZendExtension.php b/src/Symfony/Bundle/ZendBundle/DependencyInjection/ZendExtension.php deleted file mode 100644 index df9aab0cc88d0..0000000000000 --- a/src/Symfony/Bundle/ZendBundle/DependencyInjection/ZendExtension.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\ZendBundle\DependencyInjection; - -use Symfony\Component\HttpKernel\DependencyInjection\Extension; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\Config\FileLocator; -use Symfony\Component\Config\Definition\Processor; - -/** - * ZendExtension is an extension for the Zend Framework libraries. - * - * @author Fabien Potencier - */ -class ZendExtension extends Extension -{ - /** - * Loads the Zend Framework configuration. - * - * Usage example: - * - * - * - * - * - * @param array $config An array of configuration settings - * @param ContainerBuilder $container A ContainerBuilder instance - */ - public function load(array $configs, ContainerBuilder $container) - { - $configuration = new Configuration(); - $processor = new Processor(); - $config = $processor->process($configuration->getConfigTree(), $configs); - - if (isset($config['logger'])) { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('logger.xml'); - $container->setAlias('logger', 'zend.logger'); - - $config = $config['logger']; - - $container->getDefinition('zend.logger.filter')->setArgument(0, is_int($config['priority']) ? $config['priority'] : constant('\\Zend\\Log\\Logger::'.strtoupper($config['priority']))); - $container->getDefinition('zend.logger.writer.filesystem')->setArgument(0, $config['path']); - - $definition = $container->findDefinition('zend.logger'); - if ($config['log_errors']) { - $container->findDefinition('zend.logger')->addMethodCall('registerErrorHandler'); - } - - $container->getDefinition('zend.formatter.filesystem')->setArgument(0, $config['format']); - - $this->addClassesToCompile(array( - 'Zend\\Log\\Factory', - 'Zend\\Log\\Filter', - 'Zend\\Log\\Filter\\AbstractFilter', - 'Zend\\Log\\Filter\\Priority', - 'Zend\\Log\\Formatter', - 'Zend\\Log\\Formatter\\Simple', - 'Zend\\Log\\Logger', - 'Zend\\Log\\Writer', - 'Zend\\Log\\Writer\\AbstractWriter', - 'Zend\\Log\\Writer\\Stream', - 'Symfony\\Bundle\\ZendBundle\\Logger\\DebugLogger', - 'Symfony\\Bundle\\ZendBundle\\Logger\\Logger', - )); - } - } - - /** - * Returns the base path for the XSD files. - * - * @return string The XSD base path - */ - public function getXsdValidationBasePath() - { - return __DIR__.'/../Resources/config/schema'; - } - - public function getNamespace() - { - return 'http://symfony.com/schema/dic/zend'; - } -} diff --git a/src/Symfony/Bundle/ZendBundle/Logger/DebugLogger.php b/src/Symfony/Bundle/ZendBundle/Logger/DebugLogger.php deleted file mode 100644 index 59674b12d0590..0000000000000 --- a/src/Symfony/Bundle/ZendBundle/Logger/DebugLogger.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\ZendBundle\Logger; - -use Zend\Log\Writer\AbstractWriter; -use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; - -/** - * DebugLogger. - * - * @author Fabien Potencier - */ -class DebugLogger extends AbstractWriter implements DebugLoggerInterface -{ - protected $logs = array(); - - /** - * {@inheritdoc} - */ - public function getLogs() - { - return $this->logs; - } - - /** - * {@inheritdoc} - */ - public function countErrors() - { - $count = 0; - foreach ($this->getLogs() as $log) { - if ('ERR' === $log['priorityName']) { - ++$count; - } - } - - return $count; - } - - /** - * Write a message to the log. - * - * @param array $event Event data - */ - protected function _write($event) - { - $this->logs[] = $event; - } - - static public function factory($config = array()) - { - } -} diff --git a/src/Symfony/Bundle/ZendBundle/Logger/Logger.php b/src/Symfony/Bundle/ZendBundle/Logger/Logger.php deleted file mode 100644 index e54d1994d9883..0000000000000 --- a/src/Symfony/Bundle/ZendBundle/Logger/Logger.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\ZendBundle\Logger; - -use Zend\Log\Logger as BaseLogger; -use Symfony\Component\HttpKernel\Log\LoggerInterface; -use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; - -/** - * Logger. - * - * @author Fabien Potencier - */ -class Logger extends BaseLogger implements LoggerInterface -{ - /** - * Returns a DebugLoggerInterface instance if one is registered with this logger. - * - * @return DebugLoggerInterface A DebugLoggerInterface instance or null if none is registered - */ - public function getDebugLogger() - { - foreach ($this->_writers as $writer) { - if ($writer instanceof DebugLoggerInterface) { - return $writer; - } - } - - return null; - } - - public function emerg($message) - { - return parent::log($message, 0); - } - - public function alert($message) - { - return parent::log($message, 1); - } - - public function crit($message) - { - return parent::log($message, 2); - } - - public function err($message) - { - return parent::log($message, 3); - } - - public function warn($message) - { - return parent::log($message, 4); - } - - public function notice($message) - { - return parent::log($message, 5); - } - - public function info($message) - { - return parent::log($message, 6); - } - - public function debug($message) - { - return parent::log($message, 7); - } -} diff --git a/src/Symfony/Bundle/ZendBundle/Resources/config/logger.xml b/src/Symfony/Bundle/ZendBundle/Resources/config/logger.xml deleted file mode 100644 index f10fd5c8de4dd..0000000000000 --- a/src/Symfony/Bundle/ZendBundle/Resources/config/logger.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Symfony\Bundle\ZendBundle\Logger\Logger - Symfony\Bundle\ZendBundle\Logger\DebugLogger - Zend\Log\Writer\Stream - Zend\Log\Formatter\Simple - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Symfony/Bundle/ZendBundle/Resources/config/schema/zend-1.0.xsd b/src/Symfony/Bundle/ZendBundle/Resources/config/schema/zend-1.0.xsd deleted file mode 100644 index 354043e4ee918..0000000000000 --- a/src/Symfony/Bundle/ZendBundle/Resources/config/schema/zend-1.0.xsd +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Symfony/Bundle/ZendBundle/ZendBundle.php b/src/Symfony/Bundle/ZendBundle/ZendBundle.php deleted file mode 100644 index 5445d991360ee..0000000000000 --- a/src/Symfony/Bundle/ZendBundle/ZendBundle.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\ZendBundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Bundle\ZendBundle\DependencyInjection\Compiler\ZendLoggerWriterPass; - -/** - * Bundle. - * - * @author Fabien Potencier - */ -class ZendBundle extends Bundle -{ - public function build(ContainerBuilder $container) - { - parent::build($container); - - $container->addCompilerPass(new ZendLoggerWriterPass()); - } -} diff --git a/vendors.sh b/vendors.sh index f948d78767c34..957d28eb8c8cf 100755 --- a/vendors.sh +++ b/vendors.sh @@ -66,6 +66,3 @@ install_git swiftmailer git://github.com/swiftmailer/swiftmailer.git origin/4.1 # Twig install_git twig git://github.com/fabpot/Twig.git - -# Zend Framework -install_git zend git://github.com/zendframework/zf2.git