-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ezsystems/impl-EZP-24925-extract-xmltext
Implement EZP-24925: Extract XmlText field type out of kernel into separate repository
- Loading branch information
Showing
62 changed files
with
847 additions
and
3,202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/vendor/ | ||
composer.lock | ||
.php_cs.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | ||
) | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# XmlText field type for eZ Platform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
bundle/DependencyInjection/Configuration/Parser/FieldType/XmlText.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
bundle/DependencyInjection/EzSystemsEzPlatformXmlTextFieldTypeExtension.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']); | ||
} | ||
} |
Oops, something went wrong.