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_ACTIVATED = 1;
|
||||||
const IS_NOT_ACTIVATED = 0;
|
const IS_NOT_ACTIVATED = 0;
|
||||||
|
|
||||||
|
protected $reflected;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -178,7 +180,16 @@ abstract class BaseModule extends ContainerAware
|
|||||||
return $moduleModel;
|
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 install();
|
||||||
abstract public function afterActivation();
|
abstract public function afterActivation();
|
||||||
abstract public function destroy();
|
abstract public function destroy();
|
||||||
|
|||||||
@@ -47,8 +47,10 @@ class ModuleManagement
|
|||||||
->name('module.xml')
|
->name('module.xml')
|
||||||
->in($this->baseModuleDir . '/*/Config');
|
->in($this->baseModuleDir . '/*/Config');
|
||||||
|
|
||||||
|
$descriptorValidator = new ModuleDescriptorValidator();
|
||||||
foreach ($finder as $file) {
|
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:documentation>Module version</xs:documentation>
|
||||||
</xs:annotation>
|
</xs:annotation>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element name="auteur">
|
<xs:element name="author">
|
||||||
<xs:annotation>
|
<xs:annotation>
|
||||||
<xs:documentation>Module author</xs:documentation>
|
<xs:documentation>Module author</xs:documentation>
|
||||||
</xs:annotation>
|
</xs:annotation>
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module xmlns="http://thelia.net/schema/module"
|
<module>
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<full-namespace>Cheque\\Cheque</full-namespace>
|
||||||
xsi:schemaLocation="http://thelia.net/schema/module http://thelia.net/schema/module/module-1.0.xsd">
|
|
||||||
<descriptive locale="en_US">
|
<descriptive locale="en_US">
|
||||||
<title>Cheque</title>
|
<title>Cheque</title>
|
||||||
</descriptive>
|
</descriptive>
|
||||||
<full-namespace>Cheque\\Cheque</full-namespace>
|
|
||||||
<version>1.1</version>
|
<version>1.1</version>
|
||||||
<author>
|
<author>
|
||||||
<name>Manuel Raynaud</name>
|
<name>Manuel Raynaud</name>
|
||||||
|
|||||||
Reference in New Issue
Block a user