crowl all module descriptor file for discovering new modules
This commit is contained in:
@@ -43,6 +43,8 @@ abstract class BaseModule extends ContainerAware
|
||||
const IS_ACTIVATED = 1;
|
||||
const IS_NOT_ACTIVATED = 0;
|
||||
|
||||
protected $reflected;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -178,7 +180,16 @@ abstract class BaseModule extends ContainerAware
|
||||
return $moduleModel;
|
||||
}
|
||||
|
||||
abstract public function getCode();
|
||||
|
||||
public function getCode()
|
||||
{
|
||||
if (null === $this->reflected) {
|
||||
$this->reflected = new \ReflectionObject($this);
|
||||
}
|
||||
|
||||
return dirname($this->reflected->getFileName());
|
||||
}
|
||||
|
||||
abstract public function install();
|
||||
abstract public function afterActivation();
|
||||
abstract public function destroy();
|
||||
|
||||
@@ -47,8 +47,10 @@ class ModuleManagement
|
||||
->name('module.xml')
|
||||
->in($this->baseModuleDir . '/*/Config');
|
||||
|
||||
$descriptorValidator = new ModuleDescriptorValidator();
|
||||
foreach ($finder as $file) {
|
||||
echo $file->getRealPath()."\n";
|
||||
$content = $descriptorValidator->getDescriptor($file->getRealPath());
|
||||
var_dump($content); exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<xs:documentation>Module version</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="auteur">
|
||||
<xs:element name="author">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Module author</xs:documentation>
|
||||
</xs:annotation>
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module xmlns="http://thelia.net/schema/module"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://thelia.net/schema/module http://thelia.net/schema/module/module-1.0.xsd">
|
||||
<module>
|
||||
<full-namespace>Cheque\\Cheque</full-namespace>
|
||||
<descriptive locale="en_US">
|
||||
<title>Cheque</title>
|
||||
</descriptive>
|
||||
<full-namespace>Cheque\\Cheque</full-namespace>
|
||||
<version>1.1</version>
|
||||
<author>
|
||||
<name>Manuel Raynaud</name>
|
||||
|
||||
Reference in New Issue
Block a user