Skip to content

Commit

Permalink
Merge pull request #2 from ezsystems/impl-EZP-24925-extract-xmltext
Browse files Browse the repository at this point in the history
Implement EZP-24925: Extract XmlText field type out of kernel into separate repository
  • Loading branch information
pspanja committed Oct 21, 2015
2 parents aece54c + 7973773 commit 21d63a7
Show file tree
Hide file tree
Showing 62 changed files with 847 additions and 3,202 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/vendor/
composer.lock
.php_cs.cache
29 changes: 29 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

return Symfony\CS\Config\Config::create()
->setUsingLinter(false)
->setUsingCache(true)
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
->fixers([
'concat_with_spaces',
'-concat_without_spaces',
'-empty_return',
'-phpdoc_params',
'-phpdoc_separation',
'-phpdoc_to_comment',
'-spaces_cast',
'-blankline_after_open_tag',
'-single_blank_line_before_namespace',
// psr0 has weird issues with our PSR-4 layout, so deactivating it.
'-psr0',
])
->finder(
Symfony\CS\Finder\DefaultFinder::create()
->in(__DIR__)
->notPath('phpunit.xml')
->exclude([
'vendor',
])
->files()->name('*.php')
)
;
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
language: php

matrix:
include:
- php: 5.4
env: TEST_CONFIG="phpunit.xml"
- php: 5.5
env: TEST_CONFIG="phpunit-integration-legacy.xml"
- php: 5.6
env: TEST_CONFIG="phpunit-integration-legacy-solr.xml" SOLR_VERSION="4.10.4" CORES_SETUP="single" SOLR_CONFS="vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/schema.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/custom-fields-types.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/language-fieldtypes.xml"

# test only master (+ Pull requests)
branches:
only:
- master

before_script:
# - composer selfupdate
- curl -sS https://getcomposer.org/installer | php
- php -d memory_limit=-1 composer.phar install --prefer-dist
- if [ "$SOLR_VERSION" != "" ] ; then ./vendor/ezsystems/ezplatform-solr-search-engine/bin/.travis/init_solr.sh ; fi

script:
- php vendor/bin/phpunit --bootstrap tests/bootstrap.php -c $TEST_CONFIG

notifications:
email: false
343 changes: 343 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# XmlText field type for eZ Platform
4 changes: 2 additions & 2 deletions bundle/Converter/Html5.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

/**
* File containing the Html5 class.
* This file is part of the eZ Platform XmlText Field Type package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*
* @version //autogentag//
*/
namespace eZ\Bundle\EzPublishCoreBundle\FieldType\XmlText\Converter;
namespace EzSystems\EzPlatformXmlTextFieldTypeBundle\Converter;

use eZ\Publish\Core\FieldType\XmlText\Converter\Html5 as BaseHtml5Converter;
use eZ\Publish\Core\MVC\ConfigResolverInterface;
Expand Down
4 changes: 2 additions & 2 deletions bundle/DependencyInjection/Compiler/XmlTextConverterPass.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

/**
* File containing the XmlTextConverterPass class.
* This file is part of the eZ Platform XmlText Field Type package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*
* @version //autogentag//
*/
namespace eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler;
namespace EzSystems\EzPlatformXmlTextFieldTypeBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

/**
* File containing the XmlText class.
* This file is part of the eZ Platform XmlText Field Type package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*
* @version //autogentag//
*/
namespace eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Parser\FieldType;
namespace EzSystems\EzPlatformXmlTextFieldTypeBundle\DependencyInjection\Configuration\Parser\FieldType;

use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Parser\AbstractFieldTypeParser;
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?php

/**
* This file is part of the eZ Platform XmlText Field Type package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*
* @version //autogentag//
*/
namespace EzSystems\EzPlatformXmlTextFieldTypeBundle\DependencyInjection;

use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\Yaml\Yaml;
use InvalidArgumentException;

class EzSystemsEzPlatformXmlTextFieldTypeExtension extends Extension implements PrependExtensionInterface
{
/**
* Loads a specific configuration.
*
* @param mixed[] $configs An array of configuration values
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container A ContainerBuilder instance
*
* @throws \InvalidArgumentException When provided tag is not defined in this extension
*
* @api
*/
public function load(array $configs, ContainerBuilder $container)
{
// Load core configuration
$loader = new Loader\YamlFileLoader(
$container,
new FileLocator(__DIR__ . '/../../lib/settings')
);
$loader->load('fieldtype_external_storages.yml');
$loader->load('fieldtypes.yml');
$loader->load('indexable_fieldtypes.yml');
$loader->load('storage_engines/legacy/external_storage_gateways.yml');
$loader->load('storage_engines/legacy/field_value_converters.yml');

// Load bundle configuration
$loader = new Loader\YamlFileLoader(
$container,
new FileLocator(__DIR__ . '/../Resources/config')
);
$loader->load('services.yml');
$loader->load('fieldtype_services.yml');
$loader->load('templating.yml');
}

/**
* Allow an extension to prepend the extension configurations.
*
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
*/
public function prepend(ContainerBuilder $container)
{
// Field type's Content field and ContentType field definition templates
$configFile = __DIR__ . '/../Resources/config/ezpublish.yml';
$config = Yaml::parse(file_get_contents($configFile));
$container->prependExtensionConfig('ezpublish', $config);
$container->addResource(new FileResource($configFile));
}
}
133 changes: 0 additions & 133 deletions bundle/EzPublishCoreBundle.php

This file was deleted.

33 changes: 33 additions & 0 deletions bundle/EzSystemsEzPlatformXmlTextFieldTypeBundle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/**
* This file is part of the eZ Platform XmlText Field Type package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*
* @version //autogentag//
*/
namespace EzSystems\EzPlatformXmlTextFieldTypeBundle;

use EzSystems\EzPlatformXmlTextFieldTypeBundle\DependencyInjection\Compiler\XmlTextConverterPass;
use EzSystems\EzPlatformXmlTextFieldTypeBundle\DependencyInjection\Configuration\Parser as ConfigParser;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class EzSystemsEzPlatformXmlTextFieldTypeBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
parent::build($container);

$container->addCompilerPass(new XmlTextConverterPass());

/**
* @var \eZ\Bundle\EzPublishCoreBundle\DependencyInjection\EzPublishCoreExtension $eZExtension
*/
$eZExtension = $container->getExtension('ezpublish');
$eZExtension->addConfigParser(new ConfigParser\FieldType\XmlText());
$eZExtension->addDefaultSettings(__DIR__ . '/Resources/config', ['default_settings.yml']);
}
}
Loading

0 comments on commit 21d63a7

Please sign in to comment.