Added support for specifying conflicting extensions
This commit is contained in:
parent
0fc0b8e723
commit
79a2fe23b3
1 changed files with 9 additions and 1 deletions
|
@ -61,7 +61,7 @@ abstract class Extension
|
||||||
return 50;
|
return 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function determine_enabled_extensions()
|
public static function determine_enabled_extensions(): void
|
||||||
{
|
{
|
||||||
self::$enabled_extensions = [];
|
self::$enabled_extensions = [];
|
||||||
foreach (array_merge(
|
foreach (array_merge(
|
||||||
|
@ -138,6 +138,7 @@ abstract class ExtensionInfo
|
||||||
public $license;
|
public $license;
|
||||||
public $version;
|
public $version;
|
||||||
public $dependencies = [];
|
public $dependencies = [];
|
||||||
|
public $conflicts = [];
|
||||||
public $visibility;
|
public $visibility;
|
||||||
public $description;
|
public $description;
|
||||||
public $documentation;
|
public $documentation;
|
||||||
|
@ -193,6 +194,13 @@ abstract class ExtensionInfo
|
||||||
if (!empty($this->db_support) && !in_array($database->get_driver_name(), $this->db_support)) {
|
if (!empty($this->db_support) && !in_array($database->get_driver_name(), $this->db_support)) {
|
||||||
$this->support_info .= "Database not supported. ";
|
$this->support_info .= "Database not supported. ";
|
||||||
}
|
}
|
||||||
|
if (!empty($this->conflicts)) {
|
||||||
|
$intersects = array_intersect($this->conflicts, Extension::get_enabled_extensions());
|
||||||
|
if (!empty($intersects)) {
|
||||||
|
$this->support_info .= "Conflicts with other extension(s): " . join(", ", $intersects);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Additional checks here as needed
|
// Additional checks here as needed
|
||||||
|
|
||||||
$this->supported = empty($this->support_info);
|
$this->supported = empty($this->support_info);
|
||||||
|
|
Reference in a new issue