update 2023-05-22 02:53:53
This commit is contained in:
parent
3edd68587a
commit
719461fa0a
@ -25,6 +25,8 @@ class Infusion #Gold {
|
|||||||
+ set() : void
|
+ set() : void
|
||||||
- parsePowers() : void
|
- parsePowers() : void
|
||||||
- setSuperPowers() : void
|
- setSuperPowers() : void
|
||||||
|
- mergePowers($powers, $old) : void
|
||||||
|
- sortPowers($powers) : void
|
||||||
- setPowers() : void
|
- setPowers() : void
|
||||||
- index(array $powers) : string
|
- index(array $powers) : string
|
||||||
- code(object $power) : string
|
- code(object $power) : string
|
||||||
@ -70,6 +72,20 @@ note left of Infusion::setSuperPowers
|
|||||||
return: void
|
return: void
|
||||||
end note
|
end note
|
||||||
|
|
||||||
|
note right of Infusion::mergePowers
|
||||||
|
Merge the old missing powers found in local repository back into the index
|
||||||
|
|
||||||
|
since: 3.2.0
|
||||||
|
return: void
|
||||||
|
end note
|
||||||
|
|
||||||
|
note left of Infusion::sortPowers
|
||||||
|
Sort Powers
|
||||||
|
|
||||||
|
since: 3.2.0
|
||||||
|
return: void
|
||||||
|
end note
|
||||||
|
|
||||||
note right of Infusion::setPowers
|
note right of Infusion::setPowers
|
||||||
Set the Powers code
|
Set the Powers code
|
||||||
|
|
||||||
|
@ -232,9 +232,18 @@ class Infusion
|
|||||||
array(&$context, &$path, &$key, &$powers)
|
array(&$context, &$path, &$key, &$powers)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// we add and all missing powers
|
||||||
|
if (isset($this->power->old_superpowers[$path]))
|
||||||
|
{
|
||||||
|
$this->mergePowers($powers, $this->power->old_superpowers[$path]);
|
||||||
|
}
|
||||||
|
|
||||||
// POWERREADME
|
// POWERREADME
|
||||||
$this->content->set_($key, 'POWERREADME', $this->reposreadme->get($powers));
|
$this->content->set_($key, 'POWERREADME', $this->reposreadme->get($powers));
|
||||||
|
|
||||||
|
// sort all powers
|
||||||
|
$this->sortPowers($powers);
|
||||||
|
|
||||||
// POWERINDEX
|
// POWERINDEX
|
||||||
$this->content->set_($key, 'POWERINDEX', $this->index($powers));
|
$this->content->set_($key, 'POWERINDEX', $this->index($powers));
|
||||||
|
|
||||||
@ -247,6 +256,34 @@ class Infusion
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Merge the old missing powers found in local repository back into the index
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function mergePowers(array &$powers, array &$old)
|
||||||
|
{
|
||||||
|
foreach ($old as $guid => $values)
|
||||||
|
{
|
||||||
|
if (!isset($powers[$guid]))
|
||||||
|
{
|
||||||
|
$powers[$guid] = $values;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sort Powers
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function sortPowers(array &$powers)
|
||||||
|
{
|
||||||
|
ksort($powers, SORT_STRING);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the Powers code
|
* Set the Powers code
|
||||||
*
|
*
|
||||||
|
@ -197,9 +197,18 @@
|
|||||||
array(&$context, &$path, &$key, &$powers)
|
array(&$context, &$path, &$key, &$powers)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// we add and all missing powers
|
||||||
|
if (isset($this->power->old_superpowers[$path]))
|
||||||
|
{
|
||||||
|
$this->mergePowers($powers, $this->power->old_superpowers[$path]);
|
||||||
|
}
|
||||||
|
|
||||||
// POWERREADME
|
// POWERREADME
|
||||||
$this->content->set_($key, 'POWERREADME', $this->reposreadme->get($powers));
|
$this->content->set_($key, 'POWERREADME', $this->reposreadme->get($powers));
|
||||||
|
|
||||||
|
// sort all powers
|
||||||
|
$this->sortPowers($powers);
|
||||||
|
|
||||||
// POWERINDEX
|
// POWERINDEX
|
||||||
$this->content->set_($key, 'POWERINDEX', $this->index($powers));
|
$this->content->set_($key, 'POWERINDEX', $this->index($powers));
|
||||||
|
|
||||||
@ -212,6 +221,34 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Merge the old missing powers found in local repository back into the index
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function mergePowers(array &$powers, array &$old)
|
||||||
|
{
|
||||||
|
foreach ($old as $guid => $values)
|
||||||
|
{
|
||||||
|
if (!isset($powers[$guid]))
|
||||||
|
{
|
||||||
|
$powers[$guid] = $values;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sort Powers
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function sortPowers(array &$powers)
|
||||||
|
{
|
||||||
|
ksort($powers, SORT_STRING);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the Powers code
|
* Set the Powers code
|
||||||
*
|
*
|
||||||
|
@ -18,13 +18,11 @@ class Readme #Gold {
|
|||||||
- readmeBuilder($powers) : string
|
- readmeBuilder($powers) : string
|
||||||
- readmeModel(array $classes) : string
|
- readmeModel(array $classes) : string
|
||||||
- generateIndex(array $classes) : string
|
- generateIndex(array $classes) : string
|
||||||
- generateDiagramBucket(array $classes) : string
|
|
||||||
- defineTypeOrder() : array
|
- defineTypeOrder() : array
|
||||||
- sortClasses(array $classes, array $typeOrder) : void
|
- sortClasses(array $classes, array $typeOrder) : void
|
||||||
- compareNamespace(array $a, array $b) : int
|
- compareNamespace(array $a, array $b) : int
|
||||||
- compareType(array $a, array $b, ...) : int
|
- compareType(array $a, array $b, ...) : int
|
||||||
- compareName(array $a, array $b) : int
|
- compareName(array $a, array $b) : int
|
||||||
- generateNamespaceDiagram(string $current_namespace, string $diagrams) : string
|
|
||||||
- indexLinkPower(string $power) : string
|
- indexLinkPower(string $power) : string
|
||||||
- linkPowerRepo(string $power) : string
|
- linkPowerRepo(string $power) : string
|
||||||
- linkPowerCode(string $power) : string
|
- linkPowerCode(string $power) : string
|
||||||
@ -65,34 +63,28 @@ note right of Readme::generateIndex
|
|||||||
return: string
|
return: string
|
||||||
end note
|
end note
|
||||||
|
|
||||||
note left of Readme::generateDiagramBucket
|
note left of Readme::defineTypeOrder
|
||||||
Generate the diagram bucket string for classes
|
|
||||||
|
|
||||||
return: string
|
|
||||||
end note
|
|
||||||
|
|
||||||
note right of Readme::defineTypeOrder
|
|
||||||
Define the order of types for sorting purposes
|
Define the order of types for sorting purposes
|
||||||
|
|
||||||
since: 3.2.0
|
since: 3.2.0
|
||||||
return: array
|
return: array
|
||||||
end note
|
end note
|
||||||
|
|
||||||
note left of Readme::sortClasses
|
note right of Readme::sortClasses
|
||||||
Sort the flattened array using a single sorting function
|
Sort the flattened array using a single sorting function
|
||||||
|
|
||||||
since: 3.2.0
|
since: 3.2.0
|
||||||
return: void
|
return: void
|
||||||
end note
|
end note
|
||||||
|
|
||||||
note right of Readme::compareNamespace
|
note left of Readme::compareNamespace
|
||||||
Compare the namespace of two classes
|
Compare the namespace of two classes
|
||||||
|
|
||||||
since: 3.2.0
|
since: 3.2.0
|
||||||
return: int
|
return: int
|
||||||
end note
|
end note
|
||||||
|
|
||||||
note left of Readme::compareType
|
note right of Readme::compareType
|
||||||
Compare the type of two classes
|
Compare the type of two classes
|
||||||
|
|
||||||
since: 3.2.0
|
since: 3.2.0
|
||||||
@ -104,19 +96,13 @@ note left of Readme::compareType
|
|||||||
array $typeOrder
|
array $typeOrder
|
||||||
end note
|
end note
|
||||||
|
|
||||||
note right of Readme::compareName
|
note left of Readme::compareName
|
||||||
Compare the name of two classes
|
Compare the name of two classes
|
||||||
|
|
||||||
since: 3.2.0
|
since: 3.2.0
|
||||||
return: int
|
return: int
|
||||||
end note
|
end note
|
||||||
|
|
||||||
note left of Readme::generateNamespaceDiagram
|
|
||||||
Generate a namespace diagram string
|
|
||||||
|
|
||||||
return: string
|
|
||||||
end note
|
|
||||||
|
|
||||||
note right of Readme::indexLinkPower
|
note right of Readme::indexLinkPower
|
||||||
Build the Link to the power in this repository
|
Build the Link to the power in this repository
|
||||||
|
|
||||||
|
@ -123,18 +123,13 @@ class Readme
|
|||||||
$classes = [];
|
$classes = [];
|
||||||
foreach ($powers as $guid => $power)
|
foreach ($powers as $guid => $power)
|
||||||
{
|
{
|
||||||
$power_object = $this->power->get($guid);
|
// add to the sort bucket
|
||||||
if (isset($power_object->parsed_class_code) && is_array($power_object->parsed_class_code))
|
$classes[] = [
|
||||||
{
|
'namespace' => $power['namespace'],
|
||||||
// add to the sort bucket
|
'type' => $power['type'],
|
||||||
$classes[] = [
|
'name' => $power['name'],
|
||||||
'namespace' => $power['namespace'],
|
'link' => $this->indexLinkPower($power)
|
||||||
'type' => $power['type'],
|
];
|
||||||
'name' => $power['name'],
|
|
||||||
'link' => $this->indexLinkPower($power),
|
|
||||||
'diagram' => $this->plantuml->classBasicDiagram($power, $power_object->parsed_class_code)
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->readmeModel($classes);
|
return $this->readmeModel($classes);
|
||||||
@ -152,11 +147,7 @@ class Readme
|
|||||||
{
|
{
|
||||||
$this->sortClasses($classes, $this->defineTypeOrder());
|
$this->sortClasses($classes, $this->defineTypeOrder());
|
||||||
|
|
||||||
$result = $this->generateIndex($classes);
|
return $this->generateIndex($classes);
|
||||||
|
|
||||||
$diagram_bucket = $this->generateDiagramBucket($classes);
|
|
||||||
|
|
||||||
return $result . $diagram_bucket;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -187,40 +178,6 @@ class Readme
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate the diagram bucket string for classes
|
|
||||||
*
|
|
||||||
* @param array $classes The sorted classes
|
|
||||||
*
|
|
||||||
* @return string The diagram bucket string
|
|
||||||
*/
|
|
||||||
private function generateDiagramBucket(array &$classes): string
|
|
||||||
{
|
|
||||||
$diagram_bucket = "\n\n# Class Diagrams\n";
|
|
||||||
$current_namespace = null;
|
|
||||||
$diagrams = '';
|
|
||||||
|
|
||||||
foreach ($classes as $class)
|
|
||||||
{
|
|
||||||
if ($class['namespace'] !== $current_namespace)
|
|
||||||
{
|
|
||||||
if ($current_namespace !== null)
|
|
||||||
{
|
|
||||||
$diagram_bucket .= $this->generateNamespaceDiagram($current_namespace, $diagrams);
|
|
||||||
}
|
|
||||||
$current_namespace = $class['namespace'];
|
|
||||||
$diagrams = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$diagrams .= $class['diagram'];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the last namespace diagram
|
|
||||||
$diagram_bucket .= $this->generateNamespaceDiagram($current_namespace, $diagrams);
|
|
||||||
|
|
||||||
return $diagram_bucket;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the order of types for sorting purposes
|
* Define the order of types for sorting purposes
|
||||||
*
|
*
|
||||||
@ -318,24 +275,6 @@ class Readme
|
|||||||
return strcmp($a['name'], $b['name']);
|
return strcmp($a['name'], $b['name']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a namespace diagram string
|
|
||||||
*
|
|
||||||
* @param string $current_namespace The current namespace
|
|
||||||
* @param string $diagrams The diagrams for the namespace
|
|
||||||
*
|
|
||||||
* @return string The namespace diagram string
|
|
||||||
*/
|
|
||||||
private function generateNamespaceDiagram(string $current_namespace, string $diagrams): string
|
|
||||||
{
|
|
||||||
$namespace_title = str_replace('\\', ' ', $current_namespace);
|
|
||||||
$diagram_code = "\n## {$namespace_title}\n> namespace {$current_namespace}\n";
|
|
||||||
$diagram_code .= "```uml\n@startuml\n\n" .
|
|
||||||
$this->plantuml->namespaceDiagram($current_namespace, $diagrams) . "\n\n@enduml\n```\n";
|
|
||||||
|
|
||||||
return $diagram_code;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the Link to the power in this repository
|
* Build the Link to the power in this repository
|
||||||
*
|
*
|
||||||
@ -403,7 +342,6 @@ class Readme
|
|||||||
private function linkPowerSPK(array &$power): string
|
private function linkPowerSPK(array &$power): string
|
||||||
{
|
{
|
||||||
return $power['spk'];
|
return $power['spk'];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,18 +98,13 @@
|
|||||||
$classes = [];
|
$classes = [];
|
||||||
foreach ($powers as $guid => $power)
|
foreach ($powers as $guid => $power)
|
||||||
{
|
{
|
||||||
$power_object = $this->power->get($guid);
|
// add to the sort bucket
|
||||||
if (isset($power_object->parsed_class_code) && is_array($power_object->parsed_class_code))
|
$classes[] = [
|
||||||
{
|
'namespace' => $power['namespace'],
|
||||||
// add to the sort bucket
|
'type' => $power['type'],
|
||||||
$classes[] = [
|
'name' => $power['name'],
|
||||||
'namespace' => $power['namespace'],
|
'link' => $this->indexLinkPower($power)
|
||||||
'type' => $power['type'],
|
];
|
||||||
'name' => $power['name'],
|
|
||||||
'link' => $this->indexLinkPower($power),
|
|
||||||
'diagram' => $this->plantuml->classBasicDiagram($power, $power_object->parsed_class_code)
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->readmeModel($classes);
|
return $this->readmeModel($classes);
|
||||||
@ -127,11 +122,7 @@
|
|||||||
{
|
{
|
||||||
$this->sortClasses($classes, $this->defineTypeOrder());
|
$this->sortClasses($classes, $this->defineTypeOrder());
|
||||||
|
|
||||||
$result = $this->generateIndex($classes);
|
return $this->generateIndex($classes);
|
||||||
|
|
||||||
$diagram_bucket = $this->generateDiagramBucket($classes);
|
|
||||||
|
|
||||||
return $result . $diagram_bucket;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -162,40 +153,6 @@
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate the diagram bucket string for classes
|
|
||||||
*
|
|
||||||
* @param array $classes The sorted classes
|
|
||||||
*
|
|
||||||
* @return string The diagram bucket string
|
|
||||||
*/
|
|
||||||
private function generateDiagramBucket(array &$classes): string
|
|
||||||
{
|
|
||||||
$diagram_bucket = "\n\n# Class Diagrams\n";
|
|
||||||
$current_namespace = null;
|
|
||||||
$diagrams = '';
|
|
||||||
|
|
||||||
foreach ($classes as $class)
|
|
||||||
{
|
|
||||||
if ($class['namespace'] !== $current_namespace)
|
|
||||||
{
|
|
||||||
if ($current_namespace !== null)
|
|
||||||
{
|
|
||||||
$diagram_bucket .= $this->generateNamespaceDiagram($current_namespace, $diagrams);
|
|
||||||
}
|
|
||||||
$current_namespace = $class['namespace'];
|
|
||||||
$diagrams = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$diagrams .= $class['diagram'];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the last namespace diagram
|
|
||||||
$diagram_bucket .= $this->generateNamespaceDiagram($current_namespace, $diagrams);
|
|
||||||
|
|
||||||
return $diagram_bucket;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the order of types for sorting purposes
|
* Define the order of types for sorting purposes
|
||||||
*
|
*
|
||||||
@ -293,24 +250,6 @@
|
|||||||
return strcmp($a['name'], $b['name']);
|
return strcmp($a['name'], $b['name']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a namespace diagram string
|
|
||||||
*
|
|
||||||
* @param string $current_namespace The current namespace
|
|
||||||
* @param string $diagrams The diagrams for the namespace
|
|
||||||
*
|
|
||||||
* @return string The namespace diagram string
|
|
||||||
*/
|
|
||||||
private function generateNamespaceDiagram(string $current_namespace, string $diagrams): string
|
|
||||||
{
|
|
||||||
$namespace_title = str_replace('\\', ' ', $current_namespace);
|
|
||||||
$diagram_code = "\n## {$namespace_title}\n> namespace {$current_namespace}\n";
|
|
||||||
$diagram_code .= "```uml\n@startuml\n\n" .
|
|
||||||
$this->plantuml->namespaceDiagram($current_namespace, $diagrams) . "\n\n@enduml\n```\n";
|
|
||||||
|
|
||||||
return $diagram_code;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the Link to the power in this repository
|
* Build the Link to the power in this repository
|
||||||
*
|
*
|
||||||
@ -378,4 +317,4 @@
|
|||||||
private function linkPowerSPK(array &$power): string
|
private function linkPowerSPK(array &$power): string
|
||||||
{
|
{
|
||||||
return $power['spk'];
|
return $power['spk'];
|
||||||
}
|
}
|
@ -29,6 +29,7 @@ class Structure #Gold {
|
|||||||
- setDynamicFolders() : void
|
- setDynamicFolders() : void
|
||||||
- setSuperPowerDetails() : void
|
- setSuperPowerDetails() : void
|
||||||
- setSuperPowerFiles(object $power, string $bom) : void
|
- setSuperPowerFiles(object $power, string $bom) : void
|
||||||
|
- loadExistingSuperPower(string $repository) : void
|
||||||
}
|
}
|
||||||
|
|
||||||
note right of Structure::__construct
|
note right of Structure::__construct
|
||||||
@ -49,7 +50,7 @@ note right of Structure::__construct
|
|||||||
?CMSApplication $app = null
|
?CMSApplication $app = null
|
||||||
end note
|
end note
|
||||||
|
|
||||||
note right of Structure::build
|
note left of Structure::build
|
||||||
Build the Powers files, folders
|
Build the Powers files, folders
|
||||||
|
|
||||||
since: 3.2.0
|
since: 3.2.0
|
||||||
@ -69,7 +70,7 @@ note right of Structure::createFile
|
|||||||
string $key
|
string $key
|
||||||
end note
|
end note
|
||||||
|
|
||||||
note right of Structure::setHtaccess
|
note left of Structure::setHtaccess
|
||||||
Set the .htaccess for this power path
|
Set the .htaccess for this power path
|
||||||
|
|
||||||
since: 3.2.0
|
since: 3.2.0
|
||||||
@ -83,7 +84,7 @@ note right of Structure::setDynamicFolders
|
|||||||
return: void
|
return: void
|
||||||
end note
|
end note
|
||||||
|
|
||||||
note right of Structure::setSuperPowerDetails
|
note left of Structure::setSuperPowerDetails
|
||||||
Set the super powers details structure
|
Set the super powers details structure
|
||||||
|
|
||||||
since: 3.2.0
|
since: 3.2.0
|
||||||
@ -96,6 +97,13 @@ note right of Structure::setSuperPowerFiles
|
|||||||
since: 3.2.0
|
since: 3.2.0
|
||||||
return: void
|
return: void
|
||||||
end note
|
end note
|
||||||
|
|
||||||
|
note left of Structure::loadExistingSuperPower
|
||||||
|
Set the super power file paths
|
||||||
|
|
||||||
|
since: 3.2.0
|
||||||
|
return: void
|
||||||
|
end note
|
||||||
|
|
||||||
@enduml
|
@enduml
|
||||||
```
|
```
|
||||||
|
@ -28,6 +28,8 @@ use VDM\Joomla\Componentbuilder\Compiler\Utilities\Files;
|
|||||||
use VDM\Joomla\Utilities\ObjectHelper;
|
use VDM\Joomla\Utilities\ObjectHelper;
|
||||||
use VDM\Joomla\Utilities\ArrayHelper;
|
use VDM\Joomla\Utilities\ArrayHelper;
|
||||||
use VDM\Joomla\Utilities\StringHelper;
|
use VDM\Joomla\Utilities\StringHelper;
|
||||||
|
use VDM\Joomla\Utilities\JsonHelper;
|
||||||
|
use VDM\Joomla\Utilities\FileHelper;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
||||||
|
|
||||||
|
|
||||||
@ -372,6 +374,9 @@ class Structure
|
|||||||
{
|
{
|
||||||
foreach ($this->power->superpowers as $path => $powers)
|
foreach ($this->power->superpowers as $path => $powers)
|
||||||
{
|
{
|
||||||
|
// get existing files
|
||||||
|
$this->loadExistingSuperPower($path);
|
||||||
|
|
||||||
// create the path if it does not exist
|
// create the path if it does not exist
|
||||||
$this->folder->create($path, false);
|
$this->folder->create($path, false);
|
||||||
|
|
||||||
@ -424,6 +429,22 @@ class Structure
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the super power file paths
|
||||||
|
*
|
||||||
|
* @param string $repository The super power repository
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function loadExistingSuperPower(string $repository)
|
||||||
|
{
|
||||||
|
if (($content = FileHelper::getContent($repository . '/super-powers.json', null)) !== null &&
|
||||||
|
JsonHelper::check($content))
|
||||||
|
{
|
||||||
|
$this->power->old_superpowers[$repository] = json_decode($content, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,6 +332,9 @@
|
|||||||
{
|
{
|
||||||
foreach ($this->power->superpowers as $path => $powers)
|
foreach ($this->power->superpowers as $path => $powers)
|
||||||
{
|
{
|
||||||
|
// get existing files
|
||||||
|
$this->loadExistingSuperPower($path);
|
||||||
|
|
||||||
// create the path if it does not exist
|
// create the path if it does not exist
|
||||||
$this->folder->create($path, false);
|
$this->folder->create($path, false);
|
||||||
|
|
||||||
@ -384,3 +387,20 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the super power file paths
|
||||||
|
*
|
||||||
|
* @param string $repository The super power repository
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function loadExistingSuperPower(string $repository)
|
||||||
|
{
|
||||||
|
if (($content = FileHelper::getContent($repository . '/super-powers.json', null)) !== null &&
|
||||||
|
JsonHelper::check($content))
|
||||||
|
{
|
||||||
|
$this->power->old_superpowers[$repository] = json_decode($content, true);
|
||||||
|
}
|
||||||
|
}
|
@ -63,6 +63,14 @@
|
|||||||
"as": "default"
|
"as": "default"
|
||||||
},
|
},
|
||||||
"use_selection13": {
|
"use_selection13": {
|
||||||
|
"use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18",
|
||||||
|
"as": "default"
|
||||||
|
},
|
||||||
|
"use_selection14": {
|
||||||
|
"use": "a223b31e-ea1d-4cdf-92ae-5f9becffaff0",
|
||||||
|
"as": "default"
|
||||||
|
},
|
||||||
|
"use_selection15": {
|
||||||
"use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388",
|
"use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388",
|
||||||
"as": "default"
|
"as": "default"
|
||||||
}
|
}
|
||||||
|
@ -69,6 +69,14 @@ class Power implements PowerInterface
|
|||||||
**/
|
**/
|
||||||
public array $superpowers = [];
|
public array $superpowers = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Old super powers found in the local repos
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 3.2.0
|
||||||
|
**/
|
||||||
|
public array $old_superpowers = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The url to the power, if there is an error.
|
* The url to the power, if there is an error.
|
||||||
*
|
*
|
||||||
|
@ -30,6 +30,14 @@
|
|||||||
**/
|
**/
|
||||||
public array $superpowers = [];
|
public array $superpowers = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Old super powers found in the local repos
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 3.2.0
|
||||||
|
**/
|
||||||
|
public array $old_superpowers = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The url to the power, if there is an error.
|
* The url to the power, if there is an error.
|
||||||
*
|
*
|
||||||
|
3292
super-powers.json
3292
super-powers.json
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user