debug
This commit is contained in:
40
include/condorcet/Dev/update-documentation.php
Normal file
40
include/condorcet/Dev/update-documentation.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use CondorcetPHP\Condorcet\Dev\CondorcetDocumentationGenerator\Generate;
|
||||
|
||||
require_once __DIR__.str_replace('/', \DIRECTORY_SEPARATOR, '/../vendor/../vendor/autoload.php');
|
||||
|
||||
// Build command
|
||||
|
||||
$path = mb_substr(__DIR__, 0, mb_strlen(__DIR__) - 4);
|
||||
$path .= \DIRECTORY_SEPARATOR.'Documentation';
|
||||
|
||||
// Clear folder
|
||||
|
||||
function rrmdir(string $dir, string $path): void
|
||||
{
|
||||
if (is_dir($dir)) {
|
||||
$objects = scandir($dir);
|
||||
foreach ($objects as $object) {
|
||||
if ($object !== '.' && $object !== '..') {
|
||||
if (filetype($dir.\DIRECTORY_SEPARATOR.$object) === 'dir') {
|
||||
rrmdir($dir.\DIRECTORY_SEPARATOR.$object, $path);
|
||||
} else {
|
||||
unlink($dir.\DIRECTORY_SEPARATOR.$object);
|
||||
}
|
||||
}
|
||||
}
|
||||
reset($objects);
|
||||
if ($dir !== $path) {
|
||||
rmdir($dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rrmdir($path, $path);
|
||||
|
||||
// Execute command
|
||||
|
||||
new Generate($path);
|
Reference in New Issue
Block a user