From 733a23d820816bba30a26195d0383a08ebb22487 Mon Sep 17 00:00:00 2001 From: retroluxfilm Date: Thu, 24 Feb 2022 12:30:24 +0100 Subject: [PATCH] Updated readme --- README.md | 27 +++++++++++++++++------ src/Task/GenerateFolderRepositoryTask.php | 6 ++--- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 47e10fc..1749078 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,8 @@ This is a PHP Web library to manage remote repositories for the - Ability to issue repository tasks over the command line (cron jobs etc.) - Package and Repository object handling allowing easy extension to build it into your web frontend - ## Requirements -- PHP 7.4+ +- PHP 7.4+ (using PHP 8.1+ will speed up the library) - ImageMagick - DOM Extension - SimpleXML Extension @@ -29,15 +28,29 @@ latest version of this package. Install it as a global library in case you only composer global require retrolux/omm-php-library ``` -## Use Examples +## Command Line options + +### generateFolderRepository +Generates a networked repository from a folder structure with the contained mod archives. + +**Note:** +Needs to be called within the folder that is accessible through the web server and located side by side the folder +it should be looked for mod archives. -### Command Line -**generateFolderRepository** +*Usage Options:* -Generates the `Mod Download Repository` saved into `repository.xml` scanning for the packages in the `mods` folder (relative to the xml). +```` +OMMTask generateFolderRepository () +Arguments: + xmlName : name and path of the repository xml + repositoryName : name for the repository + packageRootPath : root path where the mod packages are placed relative to repository xml location + recursive : true if the sub folders should be processed as well (Default: true) +```` -*Note:* Needs to be called within the folder that is accessible through the web server. +The example below will generate the `Mod Download Repository` saved into `repository.xml` scanning for the packages +in the `mods` folder and subdirectories (relative to the xml). ```bash OMMTask generateFolderRepository "repository.xml" "Mod Download Repository" "mods" diff --git a/src/Task/GenerateFolderRepositoryTask.php b/src/Task/GenerateFolderRepositoryTask.php index f8ae9b0..8ff3e73 100644 --- a/src/Task/GenerateFolderRepositoryTask.php +++ b/src/Task/GenerateFolderRepositoryTask.php @@ -46,8 +46,8 @@ public static function showHelp(): void echo "Arguments:\n"; echo " xmlName : name and path of the repository xml\n"; echo " repositoryName : name for the repository\n"; - echo " packageRootPath : root path where the mod packages are placed\n"; - echo " recursive : true if the sub folders should be processed as well (Default: false)\n"; + echo " packageRootPath : root path where the mod packages are placed relative to repository xml location\n"; + echo " recursive : true if the sub folders should be processed as well (Default: true)\n"; // TODO parse from php doc the possible params? // $class = new ReflectionClass(FolderRepositoryTask::class); @@ -87,7 +87,7 @@ public static function generateFolderRepository( string $xmlName, string $repositoryName, string $repositoryRootPath, - bool $recursive = false + bool $recursive = true ) { // check if the root patch a valid directory if (!is_dir($repositoryRootPath)) {