diff --git a/.gitignore b/.gitignore index c26c9a5..1dda020 100755 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ !.gitignore composer.phar -composer.lock vendor diff --git a/author/project/system/models/traits/files.php b/author/project/system/models/traits/files.php deleted file mode 100755 index fab633e..0000000 --- a/author/project/system/models/traits/files.php +++ /dev/null @@ -1,66 +0,0 @@ - - */ -trait files -{ - /** - * Delete - * - * Delete files recursively - * - * @param string $$directory Directory - * @param array &$$errors Registry of errors - * - * @return void - */ - private static function delete(string $$directory, array &$$errors = []): void - { - try { - if (file_exists($$directory)) { - // Directory exists - - // Deleting descendant files and directories (enter to the recursion) - foreach (scandir($$directory) as $$file) { - if ($$file === '.' || $$file === '..') continue; - else if (is_dir("$$directory/$$file")) static::delete("$$directory/$$file", $$errors); - else unlink("$$directory/$$file"); - } - - // Deleting the directory - rmdir($$directory); - - // Exit (success) - return; - } else throw new exception('Directory does not exist'); - } catch (exception $$e) { - // Writing to the registry of errors - $$errors[] = [ - 'text' => $$e->getMessage(), - 'file' => $$e->getFile(), - 'line' => $$e->getLine(), - 'stack' => $$e->getTrace() - ]; - } - - // Exit (fail) - return; - } -} diff --git a/composer.json b/composer.json index ae84905..af543fc 100755 --- a/composer.json +++ b/composer.json @@ -26,11 +26,15 @@ "mirzaev/minimal": "^3.7", "mirzaev/baza": "^3.3", "mirzaev/languages": "^1", - "mirzaev/currencies": "^1", "twig/twig": "^3.2", "twig/extra-bundle": "^3.7", "twig/intl-extra": "^3.10" }, + "suggest": { + "mirzaev/files": "Easy working with files", + "mirzaev/currencies": "Easy currencies integration" + + }, "autoload": { "psr-4": { "${REPO_OWNER}\\${REPO_NAME}\\": "${REPO_OWNER}/${REPO_NAME}/system"