diff --git a/core/lib/Thelia/Command/ModuleGenerateCommand.php b/core/lib/Thelia/Command/ModuleGenerateCommand.php index b34e43dc1..dfc13f29d 100755 --- a/core/lib/Thelia/Command/ModuleGenerateCommand.php +++ b/core/lib/Thelia/Command/ModuleGenerateCommand.php @@ -62,7 +62,7 @@ class ModuleGenerateCommand extends BaseModuleGenerate $output->renderBlock(array( '', sprintf("module %s create with success", $this->module), - "You can now configure your module and complete plugin.xml file", + "You can now configure your module and complete module.xml file", '' ), "bg=green;fg=black"); } @@ -86,7 +86,7 @@ class ModuleGenerateCommand extends BaseModuleGenerate $fs = new Filesystem(); $skeletonDir = str_replace("/", DIRECTORY_SEPARATOR, THELIA_ROOT . "/core/lib/Thelia/Command/Skeleton/Module/"); $fs->copy($skeletonDir . "config.xml", $this->moduleDirectory . DIRECTORY_SEPARATOR . "Config" . DIRECTORY_SEPARATOR . "config.xml"); - $fs->copy($skeletonDir . "plugin.xml", $this->moduleDirectory . DIRECTORY_SEPARATOR . "Config" . DIRECTORY_SEPARATOR . "plugin.xml"); + $fs->copy($skeletonDir . "module.xml", $this->moduleDirectory . DIRECTORY_SEPARATOR . "Config" . DIRECTORY_SEPARATOR . "module.xml"); $classContent = file_get_contents($skeletonDir . "Class.php"); diff --git a/core/lib/Thelia/Command/Skeleton/Module/plugin.xml b/core/lib/Thelia/Command/Skeleton/Module/module.xml similarity index 100% rename from core/lib/Thelia/Command/Skeleton/Module/plugin.xml rename to core/lib/Thelia/Command/Skeleton/Module/module.xml diff --git a/core/lib/Thelia/Module/Loader/XmlFileLoader.php b/core/lib/Thelia/Module/Loader/XmlFileLoader.php new file mode 100644 index 000000000..dca9129cf --- /dev/null +++ b/core/lib/Thelia/Module/Loader/XmlFileLoader.php @@ -0,0 +1,71 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Module\Loader; +use Symfony\Component\Config\Loader\FileLoader; +use Symfony\Component\Config\Util\XmlUtils; + + +/** + * Class XmlFileLoader + * @package Thelia\Module\Loader + * @author Manuel Raynaud + */ +class XmlFileLoader extends FileLoader +{ + + /** + * Loads a resource. + * + * @param mixed $resource The resource + * @param string $type The resource type + */ + public function load($resource, $type = null) + { + $path = $this->locator->locate($resource); + + $xml = $this->parseFile($path); + } + + protected function parseFile($file) + { + $schema = str_replace('\\', '/',__DIR__.'/schema/module-1.0.xsd'); + + $dom = XmlUtils::loadFile($file, $schema); + + return simplexml_import_dom($dom); + } + + /** + * Returns true if this class supports the given resource. + * + * @param mixed $resource A resource + * @param string $type The resource type + * + * @return Boolean true if this class supports the given resource, false otherwise + */ + public function supports($resource, $type = null) + { + // TODO: Implement supports() method. + } +} \ No newline at end of file diff --git a/core/lib/Thelia/Module/schema/module-1.0.xsd b/core/lib/Thelia/Module/Loader/schema/module/module-1.0.xsd similarity index 74% rename from core/lib/Thelia/Module/schema/module-1.0.xsd rename to core/lib/Thelia/Module/Loader/schema/module/module-1.0.xsd index 2a6d29371..c394a8f26 100644 --- a/core/lib/Thelia/Module/schema/module-1.0.xsd +++ b/core/lib/Thelia/Module/Loader/schema/module/module-1.0.xsd @@ -1,12 +1,16 @@ - + - + - le descriptif complet, dans autant de langues que nécessaire. - Le code de la langue doit être un code pays ISO 639 + The full namespace for the main class module (for example MyModule\MyModule) + + + + + complete description, each description must be identify by ISO CODE 639 @@ -20,33 +24,31 @@ - La version du plugin. Format libre + Module version - Auteur du plugin + Module author - - + + - + - Le type du plugin: classique, transport, paiement, filtre, taxe + module type : classic, delivery, payment - - - - - + + + @@ -70,7 +72,7 @@ - La version minimum requise de Thelia, au format 'dot' (1.2.3.4 par exemple) + minimum required version of Thelia in 'dot' format (for example 1.2.3.4) @@ -78,17 +80,17 @@ - + - Le statut actuel du plugin: alpha, beta, rc, production + current module stability: alpha, beta, rc, prod - - + + diff --git a/core/lib/Thelia/Module/ModuleManagement.php b/core/lib/Thelia/Module/ModuleManagement.php index 754a60998..643f2a9d1 100644 --- a/core/lib/Thelia/Module/ModuleManagement.php +++ b/core/lib/Thelia/Module/ModuleManagement.php @@ -44,7 +44,7 @@ class ModuleManagement $finder = new Finder(); $finder - ->name('config.xml') + ->name('module.xml') ->in($this->baseModuleDir . '/*/Config'); foreach ($finder as $file) { diff --git a/local/modules/Cheque/Config/module.xml b/local/modules/Cheque/Config/module.xml new file mode 100755 index 000000000..1ef4340ff --- /dev/null +++ b/local/modules/Cheque/Config/module.xml @@ -0,0 +1,24 @@ + + + + Produits factices + + Insertion des produits dans votre site Thelia permettant d'avoir un Thelia de test vite opérationnel. + + + 1.1 + + Manuel Raynaud - mraynaud@openstudio.fr + + + + + classique + + 1.5.0 + production + README.TXT + + diff --git a/local/modules/Cheque/Config/plugin.xml b/local/modules/Colissimo/Config/module.xml similarity index 100% rename from local/modules/Cheque/Config/plugin.xml rename to local/modules/Colissimo/Config/module.xml diff --git a/local/modules/Colissimo/Config/plugin.xml b/local/modules/FakeCB/Config/module.xml similarity index 100% rename from local/modules/Colissimo/Config/plugin.xml rename to local/modules/FakeCB/Config/module.xml diff --git a/local/modules/FakeCB/Config/plugin.xml b/local/modules/TheliaDebugBar/Config/module.xml similarity index 100% rename from local/modules/FakeCB/Config/plugin.xml rename to local/modules/TheliaDebugBar/Config/module.xml diff --git a/local/modules/TheliaDebugBar/Config/plugin.xml b/local/modules/TheliaDebugBar/Config/plugin.xml deleted file mode 100755 index e69de29bb..000000000