Browse Source

[ZendBundle] removed the bundle

Fabien Potencier 14 years ago
parent
commit
5bd2b53cb8

+ 0 - 1
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',
 ));

+ 0 - 37
src/Symfony/Bundle/ZendBundle/DependencyInjection/Compiler/ZendLoggerWriterPass.php

@@ -1,37 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * 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 <fabien@symfony.com>
- */
-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)));
-        }
-    }
-}

+ 0 - 52
src/Symfony/Bundle/ZendBundle/DependencyInjection/Configuration.php

@@ -1,52 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * 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 <stof@notk.org>
- */
-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();
-    }
-}

+ 0 - 93
src/Symfony/Bundle/ZendBundle/DependencyInjection/ZendExtension.php

@@ -1,93 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * 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 <fabien@symfony.com>
- */
-class ZendExtension extends Extension
-{
-    /**
-     * Loads the Zend Framework configuration.
-     *
-     * Usage example:
-     *
-     *      <zend:config>
-     *          <zend:logger priority="info" path="/path/to/some.log" />
-     *      </zend:config>
-     *
-     * @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';
-    }
-}

+ 0 - 62
src/Symfony/Bundle/ZendBundle/Logger/DebugLogger.php

@@ -1,62 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * 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 <fabien@symfony.com>
- */
-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())
-    {
-    }
-}

+ 0 - 80
src/Symfony/Bundle/ZendBundle/Logger/Logger.php

@@ -1,80 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * 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 <fabien@symfony.com>
- */
-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);
-    }
-}

+ 0 - 37
src/Symfony/Bundle/ZendBundle/Resources/config/logger.xml

@@ -1,37 +0,0 @@
-<?xml version="1.0" ?>
-
-<container xmlns="http://symfony.com/schema/dic/services"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
-
-    <parameters>
-        <parameter key="zend.logger.class">Symfony\Bundle\ZendBundle\Logger\Logger</parameter>
-        <parameter key="zend.logger.writer.debug.class">Symfony\Bundle\ZendBundle\Logger\DebugLogger</parameter>
-        <parameter key="zend.logger.writer.filesystem.class">Zend\Log\Writer\Stream</parameter>
-        <parameter key="zend.formatter.filesystem.class">Zend\Log\Formatter\Simple</parameter>
-    </parameters>
-
-    <services>
-        <service id="zend.logger" class="%zend.logger.class%" public="false" />
-
-        <service id="zend.logger.writer.filesystem" class="%zend.logger.writer.filesystem.class%" public="false">
-            <tag name="zend.logger.writer" />
-            <argument /> <!-- path -->
-            <call method="addFilter"><argument type="service" id="zend.logger.filter" /></call>
-            <call method="setFormatter"><argument type="service" id="zend.formatter.filesystem" /></call>
-        </service>
-
-        <service id="zend.formatter.filesystem" class="%zend.formatter.filesystem.class%" public="false">
-            <argument /> <!-- format -->
-        </service>
-
-        <service id="zend.logger.writer.debug" class="%zend.logger.writer.debug.class%" public="false">
-            <tag name="zend.logger.writer" />
-            <call method="addFilter"><argument type="service" id="zend.logger.filter" /></call>
-        </service>
-
-        <service id="zend.logger.filter" class="Zend\Log\Filter\Priority" public="false">
-            <argument /> <!-- priority -->
-        </service>
-    </services>
-</container>

+ 0 - 42
src/Symfony/Bundle/ZendBundle/Resources/config/schema/zend-1.0.xsd

@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<xsd:schema xmlns="http://symfony.com/schema/dic/zend"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    targetNamespace="http://symfony.com/schema/dic/zend"
-    elementFormDefault="qualified">
-
-    <xsd:element name="config" type="config" />
-
-    <xsd:complexType name="config">
-        <xsd:all>
-            <xsd:element name="logger" type="logger" minOccurs="0" maxOccurs="1" />
-        </xsd:all>
-    </xsd:complexType>
-
-    <xsd:complexType name="logger">
-        <xsd:attribute name="priority" type="priority" />
-        <xsd:attribute name="path" type="xsd:string" />
-    </xsd:complexType>
-
-    <xsd:simpleType name="priority">
-        <xsd:restriction base="xsd:string">
-            <xsd:enumeration value="emerg" />
-            <xsd:enumeration value="alert" />
-            <xsd:enumeration value="crit" />
-            <xsd:enumeration value="err" />
-            <xsd:enumeration value="warn" />
-            <xsd:enumeration value="notice" />
-            <xsd:enumeration value="info" />
-            <xsd:enumeration value="debug" />
-
-            <xsd:enumeration value="0" />
-            <xsd:enumeration value="1" />
-            <xsd:enumeration value="2" />
-            <xsd:enumeration value="3" />
-            <xsd:enumeration value="4" />
-            <xsd:enumeration value="5" />
-            <xsd:enumeration value="6" />
-            <xsd:enumeration value="7" />
-        </xsd:restriction>
-    </xsd:simpleType>
-</xsd:schema>

+ 0 - 31
src/Symfony/Bundle/ZendBundle/ZendBundle.php

@@ -1,31 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * 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 <fabien@symfony.com>
- */
-class ZendBundle extends Bundle
-{
-    public function build(ContainerBuilder $container)
-    {
-        parent::build($container);
-
-        $container->addCompilerPass(new ZendLoggerWriterPass());
-    }
-}

+ 0 - 3
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