diff --git a/README.md b/README.md index 5276763..33c86c4 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,111 @@ # robo-joomla -Robo tasks for Joomla! development, build, testing and everything +Robo tasks for Joomla! development, build, testing and everything + + +## Installation (Standalone): + + * `composer install` + * Initialized here. Please run `vendor/bin/robo init` to create a new RoboFile. + +Read more about [how to install composer](https://getcomposer.org/doc/00-intro.md) here. + +## Function overview: + +# Scaffold + * `vendor/bin/robo Scaffold:Component` Scaffold a component extensions + * `vendor/bin/robo Scaffold:Module` Scaffold a module extensions + * `vendor/bin/robo Scaffold:Plugin` Scaffold a plugin extensions +# self + * `vendor/bin/robo self:update` [update] Updates the robo.phar to the latest version. + +## How-to create extension + +#### Components + +Use the command `vendor/bin/robo Scaffold:Component com_test` for creating the folders for a component. + +``` +$ vendor/bin/robo Scaffold:Component com_test + [JoomlaScaffold\ScaffoldComponent] Creating Component com_test in code + [Filesystem\FilesystemStack] mkdir ["code"] + [Filesystem\FilesystemStack] mkdir ["code/administrator"] + [Filesystem\FilesystemStack] mkdir ["code/administrator"] + [Filesystem\FilesystemStack] mkdir ["code/administrator/components"] + [Filesystem\FilesystemStack] mkdir ["code/administrator/components/com_com_test"] + [Filesystem\FilesystemStack] mkdir ["code/administrator/language"] + [Filesystem\FilesystemStack] mkdir ["code/administrator/language/en-GB"] + [Filesystem\FilesystemStack] mkdir ["code/administrator/language/de-DE"] + [Filesystem\FilesystemStack] mkdir ["code/components"] + [Filesystem\FilesystemStack] mkdir ["code/components/com_com_test"] + [Filesystem\FilesystemStack] mkdir ["code/language"] + [Filesystem\FilesystemStack] mkdir ["code/language/en-GB"] + [Filesystem\FilesystemStack] mkdir ["code/language/de-DE"] +``` + +#### Modules + +``` +$ vendor/bin/robo Scaffold:Module mod_test + [JoomlaScaffold\ScaffoldModule] Creating Module mod_test in code + [Filesystem\FilesystemStack] mkdir ["code/modules"] + [Filesystem\FilesystemStack] mkdir ["code/modules/mod_mod_test"] + [Filesystem\FilesystemStack] mkdir ["code/modules/language"] + [Filesystem\FilesystemStack] mkdir ["code/modules/language/en-GB"] + [Filesystem\FilesystemStack] mkdir ["code/modules/language/de-DE"] + + +``` + +#### Plugins + +``` +$ vendor/bin/robo Scaffold:Plugin test system + [JoomlaScaffold\ScaffoldPlugin] Creating Plugin (system) test in code + [Filesystem\FilesystemStack] mkdir ["code/plugins"] + [Filesystem\FilesystemStack] mkdir ["code/plugins/system"] + [Filesystem\FilesystemStack] mkdir ["code/plugins/system/test"] + [Filesystem\FilesystemStack] mkdir ["code/plugins/system/test/language"] + [Filesystem\FilesystemStack] mkdir ["code/plugins/system/test/language/en-GB"] + [Filesystem\FilesystemStack] mkdir ["code/plugins/system/test/language/de-DE"] + +``` + + +## Usage in your own extension + +### Directory setup + +In order to use Robo-Joomla you should use the following directory structure (it's like the "common" joomla one) + +#### Components + +``` +source/administrator/components/com_name/ +source/administrator/components/com_name/name.xml +source/administrator/components/com_name/script.php (Optional) +source/components/com_name/ +source/administrator/language/en-GB/en-GB.com_name.ini +source/administrator/language/en-GB/en-GB.com_name.sys.ini +source/language/en-GB/en-GB.com_name.ini +source/media/com_name +``` + +#### Modules + +``` +source/modules/mod_something +source/media/mod_something +source/language/en-GB/en-GB.mod_something.ini +``` + +#### Plugins + +``` +source/plugins/type/name +source/media/plg_type_name +source/administrator/language/en-GB/en-GB.plg_type_name.ini +``` + +### Extension setup + +Either use the sample RoboFile or extend your own with it. diff --git a/RoboFile.php b/RoboFile.php new file mode 100644 index 0000000..6e5d2b5 --- /dev/null +++ b/RoboFile.php @@ -0,0 +1,10 @@ +=5.4.0", + "psr/log": "^1", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4.8", + "satooshi/php-coveralls": "^1.0.2 | dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\AnnotatedCommand\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Initialize Symfony Console commands from annotated command class methods.", + "time": "2018-02-23T16:32:04+00:00" + }, + { + "name": "consolidation/config", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/consolidation/config.git", + "reference": "34ca8d7c1ee60a7b591b10617114cf1210a2e92c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/config/zipball/34ca8d7c1ee60a7b591b10617114cf1210a2e92c", + "reference": "34ca8d7c1ee60a7b591b10617114cf1210a2e92c", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "grasmash/expander": "^1", + "php": ">=5.4.0" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4", + "satooshi/php-coveralls": "^1.0", + "squizlabs/php_codesniffer": "2.*", + "symfony/console": "^2.5|^3|^4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "suggest": { + "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Provide configuration services for a commandline tool.", + "time": "2017-12-22T17:28:19+00:00" + }, + { + "name": "consolidation/log", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/consolidation/log.git", + "reference": "dbc7c535f319a4a2d5a5077738f8eb7c10df8821" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/log/zipball/dbc7c535f319a4a2d5a5077738f8eb7c10df8821", + "reference": "dbc7c535f319a4a2d5a5077738f8eb7c10df8821", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "psr/log": "~1.0", + "symfony/console": "^2.8|^3|^4" + }, + "require-dev": { + "phpunit/phpunit": "4.*", + "satooshi/php-coveralls": "dev-master", + "squizlabs/php_codesniffer": "2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "time": "2017-11-29T01:44:16+00:00" + }, + { + "name": "consolidation/output-formatters", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/output-formatters.git", + "reference": "da889e4bce19f145ca4ec5b1725a946f4eb625a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/da889e4bce19f145ca4ec5b1725a946f4eb625a9", + "reference": "da889e4bce19f145ca4ec5b1725a946f4eb625a9", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" + }, + "require-dev": { + "g-1-a/composer-test-scenarios": "^2", + "phpunit/phpunit": "^5.7.27", + "satooshi/php-coveralls": "^2", + "squizlabs/php_codesniffer": "^2.7", + "symfony/console": "3.2.3", + "symfony/var-dumper": "^2.8|^3|^4", + "victorjonsson/markdowndocs": "^1.3" + }, + "suggest": { + "symfony/var-dumper": "For using the var_dump formatter" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Format text by applying transformations provided by plug-in formatters.", + "time": "2018-03-20T15:18:32+00:00" + }, + { + "name": "consolidation/robo", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/consolidation/Robo.git", + "reference": "9ef2724f72feb017517a755564516dbde99e15e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/9ef2724f72feb017517a755564516dbde99e15e4", + "reference": "9ef2724f72feb017517a755564516dbde99e15e4", + "shasum": "" + }, + "require": { + "consolidation/annotated-command": "^2.8.2", + "consolidation/config": "^1.0.1", + "consolidation/log": "~1", + "consolidation/output-formatters": "^3.1.13", + "grasmash/yaml-expander": "^1.3", + "league/container": "^2.2", + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/filesystem": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4", + "symfony/process": "^2.5|^3|^4" + }, + "replace": { + "codegyre/robo": "< 1.0" + }, + "require-dev": { + "codeception/aspect-mock": "^1|^2.1.1", + "codeception/base": "^2.3.7", + "codeception/verify": "^0.3.2", + "goaop/framework": "~2.1.2", + "greg-1-anderson/composer-test-scenarios": "^1", + "natxet/cssmin": "3.0.4", + "patchwork/jsqueeze": "~2", + "pear/archive_tar": "^1.4.2", + "phpunit/php-code-coverage": "~2|~4", + "satooshi/php-coveralls": "^2", + "squizlabs/php_codesniffer": "^2.8" + }, + "suggest": { + "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", + "natxet/CssMin": "For minifying CSS files in taskMinify", + "patchwork/jsqueeze": "For minifying JS files in taskMinify", + "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively." + }, + "bin": [ + "robo" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev", + "dev-state": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Robo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "description": "Modern task runner", + "time": "2018-02-28T01:03:54+00:00" + }, + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" + }, + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + }, + { + "name": "grasmash/expander", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/expander.git", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\Expander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in PHP arrays file.", + "time": "2017-12-21T22:14:55+00:00" + }, + { + "name": "grasmash/yaml-expander", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/yaml-expander.git", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "reference": "3f0f6001ae707a24f4d9733958d77d92bf9693b1", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0.2|dev-master", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in a yaml file.", + "time": "2017-12-16T16:06:03+00:00" + }, + { + "name": "league/container", + "version": "2.4.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2", + "php": "^5.4.0 || ^7.0" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://www.philipobenito.com", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "time": "2017-05-10T09:20:27+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "067339e9b8ec30d5f19f5950208893ff026b94f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/067339e9b8ec30d5f19f5950208893ff026b94f7", + "reference": "067339e9b8ec30d5f19f5950208893ff026b94f7", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.3|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.3|~4.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-02-26T15:46:28+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "9b1071f86e79e1999b3d3675d2e0e7684268b9bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/9b1071f86e79e1999b3d3675d2e0e7684268b9bc", + "reference": "9b1071f86e79e1999b3d3675d2e0e7684268b9bc", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-02-28T21:49:22+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v3.4.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "58990682ac3fdc1f563b7e705452921372aad11d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/58990682ac3fdc1f563b7e705452921372aad11d", + "reference": "58990682ac3fdc1f563b7e705452921372aad11d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2018-02-14T10:03:57+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.4.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "253a4490b528597aa14d2bf5aeded6f5e5e4a541" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/253a4490b528597aa14d2bf5aeded6f5e5e4a541", + "reference": "253a4490b528597aa14d2bf5aeded6f5e5e4a541", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2018-02-22T10:48:49+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.4.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "a479817ce0a9e4adfd7d39c6407c95d97c254625" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/a479817ce0a9e4adfd7d39c6407c95d97c254625", + "reference": "a479817ce0a9e4adfd7d39c6407c95d97c254625", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2018-03-05T18:28:11+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-01-30T19:27:44+00:00" + }, + { + "name": "symfony/process", + "version": "v3.4.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "cc4aea21f619116aaf1c58016a944e4821c8e8af" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/cc4aea21f619116aaf1c58016a944e4821c8e8af", + "reference": "cc4aea21f619116aaf1c58016a944e4821c8e8af", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2018-02-12T17:55:00+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.4.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "6af42631dcf89e9c616242c900d6c52bd53bd1bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/6af42631dcf89e9c616242c900d6c52bd53bd1bb", + "reference": "6af42631dcf89e9c616242c900d6c52bd53bd1bb", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-02-16T09:50:28+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.5.0" + }, + "platform-dev": [] +} diff --git a/src/Robo/Plugin/Commands/ScaffoldCommands.php b/src/Robo/Plugin/Commands/ScaffoldCommands.php index e7e5679..55ddc9b 100644 --- a/src/Robo/Plugin/Commands/ScaffoldCommands.php +++ b/src/Robo/Plugin/Commands/ScaffoldCommands.php @@ -1,56 +1,71 @@ taskScaffoldComponent($name) - ->setBaseDir($baseDir) - ->run(); - } + /** + * Scaffold a component extensions + * + * @command Scaffold:Component + * + * @param string $name Name + * @param string $baseDir Base dir + * + * @return void + */ + public function Component($name, $baseDir = 'code') + { + $this->taskScaffoldComponent($name) + ->setBaseDir($baseDir) + ->run(); + } - /** - * Scaffold a module extensions - * - * @command Scaffold:Module - * - * @param string $name - * @param string $baseDir - */ - public function Module($name, $baseDir = 'code') - { - $this->taskScaffoldModule($name) - ->setBaseDir($baseDir) - ->run(); - } + /** + * Scaffold a module extensions + * + * @command Scaffold:Module + * + * @param string $name Name + * @param string $baseDir Base Dir + * + * @return void + */ + public function Module($name, $baseDir = 'code') + { + $this->taskScaffoldModule($name) + ->setBaseDir($baseDir) + ->run(); + } - /** - * Scaffold a plugin extensions - * - * @command Scaffold:Plugin - * - * @param string $name - * @param string $type - * @param string $baseDir - */ - public function Plugin($name, $type, $baseDir = 'code') - { - $this->taskScaffoldPlugin($name) - ->setBaseDir($baseDir) - ->setType($type) - ->run(); - } + /** + * Scaffold a plugin extensions + * + * @command Scaffold:Plugin + * + * @param string $name Name + * @param string $type Type + * @param string $baseDir Base dir + * + * @return void + */ + public function Plugin($name, $type, $baseDir = 'code') + { + $this->taskScaffoldPlugin($name, $type) + ->setBaseDir($baseDir) + ->setType($type) + ->run(); + } } diff --git a/src/Task/Scaffold/Scaffold.php b/src/Task/Scaffold/Scaffold.php index 905ec8e..7005e4c 100644 --- a/src/Task/Scaffold/Scaffold.php +++ b/src/Task/Scaffold/Scaffold.php @@ -8,7 +8,7 @@ /** * Scaffolding extensions - * + * * @since 0.1.0 */ abstract class Scaffold extends BaseTask implements \Robo\Contract\BuilderAwareInterface @@ -26,7 +26,7 @@ abstract class Scaffold extends BaseTask implements \Robo\Contract\BuilderAwareI * @var string $baseDir */ protected $baseDir = null; - + /** * Class constructor * @@ -39,7 +39,7 @@ public function __construct($name) /** * Set the base directory - * + * * @param string $baseDir */ public function setBaseDir($baseDir) @@ -62,10 +62,10 @@ protected function createBaseDir() ); } - if (!file_exists($this->baseDir)) + if (!file_exists($this->baseDir)) { $collection = $this->collectionBuilder(); - + $collection->taskFileSystemStack() ->mkdir($this->baseDir) ->run(); diff --git a/src/Task/Scaffold/ScaffoldComponent.php b/src/Task/Scaffold/ScaffoldComponent.php index d0cc220..4fc2442 100644 --- a/src/Task/Scaffold/ScaffoldComponent.php +++ b/src/Task/Scaffold/ScaffoldComponent.php @@ -1,35 +1,47 @@ printTaskInfo('Creating Component ' . $this->name . ' in ' . $this->baseDir); + /** + * Runs the command + * + * @return bool + */ + public function run() + { + $this->printTaskInfo('Creating Component ' . $this->name . ' in ' . $this->baseDir); - $this->createBaseDir(); + $this->createBaseDir(); - $collection = $this->collectionBuilder(); + $collection = $this->collectionBuilder(); - $collection->taskFileSystemStack() - ->mkdir($this->baseDir . '/administrator') - ->mkdir($this->baseDir . '/administrator') - ->mkdir($this->baseDir . '/administrator/components') - ->mkdir($this->baseDir . '/administrator/components/com_' . $this->name) - ->mkdir($this->baseDir . '/administrator/language') - ->mkdir($this->baseDir . '/administrator/language/en-GB') - ->mkdir($this->baseDir . '/administrator/language/de-DE') - ->mkdir($this->baseDir . '/components') - ->mkdir($this->baseDir . '/components/com_' . $this->name) - ->mkdir($this->baseDir . '/language') - ->mkdir($this->baseDir . '/language/en-GB') - ->mkdir($this->baseDir . '/language/de-DE'); + $collection->taskFileSystemStack() + ->mkdir($this->baseDir . '/administrator') + ->mkdir($this->baseDir . '/administrator') + ->mkdir($this->baseDir . '/administrator/components') + ->mkdir($this->baseDir . '/administrator/components/com_' . $this->name) + ->mkdir($this->baseDir . '/administrator/language') + ->mkdir($this->baseDir . '/administrator/language/en-GB') + ->mkdir($this->baseDir . '/administrator/language/de-DE') + ->mkdir($this->baseDir . '/components') + ->mkdir($this->baseDir . '/components/com_' . $this->name) + ->mkdir($this->baseDir . '/language') + ->mkdir($this->baseDir . '/language/en-GB') + ->mkdir($this->baseDir . '/language/de-DE'); - $collection->run(); - } + $collection->run(); + } } diff --git a/src/Task/Scaffold/ScaffoldModule.php b/src/Task/Scaffold/ScaffoldModule.php index 73ff5d0..92c2299 100644 --- a/src/Task/Scaffold/ScaffoldModule.php +++ b/src/Task/Scaffold/ScaffoldModule.php @@ -1,28 +1,40 @@ printTaskInfo('Creating Module ' . $this->name . ' in ' . $this->baseDir); + /** + * Run the command + * + * @return bool + */ + public function run() + { + $this->printTaskInfo('Creating Module ' . $this->name . ' in ' . $this->baseDir); - $this->createBaseDir(); + $this->createBaseDir(); - $collection = $this->collectionBuilder(); + $collection = $this->collectionBuilder(); - $collection->taskFileSystemStack() - ->mkdir($this->baseDir . '/modules') - ->mkdir($this->baseDir . '/modules/mod_' . $this->name) - ->mkdir($this->baseDir . '/modules/language') - ->mkdir($this->baseDir . '/modules/language/en-GB') - ->mkdir($this->baseDir . '/modules/language/de-DE'); + $collection->taskFileSystemStack() + ->mkdir($this->baseDir . '/modules') + ->mkdir($this->baseDir . '/modules/mod_' . $this->name) + ->mkdir($this->baseDir . '/modules/language') + ->mkdir($this->baseDir . '/modules/language/en-GB') + ->mkdir($this->baseDir . '/modules/language/de-DE'); - $collection->run(); - } + $collection->run(); + } } diff --git a/src/Task/Scaffold/ScaffoldPlugin.php b/src/Task/Scaffold/ScaffoldPlugin.php index b9e6b43..ed99221 100644 --- a/src/Task/Scaffold/ScaffoldPlugin.php +++ b/src/Task/Scaffold/ScaffoldPlugin.php @@ -1,46 +1,57 @@ printTaskInfo('Creating Plugin (' . $this->type . ') ' . $this->name . ' in ' . $this->baseDir); - - $this->createBaseDir(); - - $collection = $this->collectionBuilder(); - - $collection->taskFileSystemStack() - ->mkdir($this->baseDir . '/plugins') - ->mkdir($this->baseDir . '/plugins/' . $this->type) - ->mkdir($this->baseDir . '/plugins/' . $this->type . '/' . $this->name) - ->mkdir($this->baseDir . '/plugins/' . $this->type . '/' . $this->name . '/language') - ->mkdir($this->baseDir . '/plugins/' . $this->type . '/' . $this->name . '/language/en-GB') - ->mkdir($this->baseDir . '/plugins/' . $this->type . '/' . $this->name . '/language/de-DE'); - - $collection->run(); - } - - /** - * Set the base directory - * - * @param string $baseDir - */ - public function setType($type) - { - $this->type = $type; - } + /** + * Type of the plugin + * @var string $type + */ + protected $type = null; + + /** + * Run the command + * + * @return bool + */ + public function run() + { + $this->printTaskInfo('Creating Plugin (' . $this->type . ') ' . $this->name . ' in ' . $this->baseDir); + $this->createBaseDir(); + + $collection = $this->collectionBuilder(); + + $collection->taskFileSystemStack() + ->mkdir($this->baseDir . '/plugins') + ->mkdir($this->baseDir . '/plugins/' . $this->type) + ->mkdir($this->baseDir . '/plugins/' . $this->type . '/' . $this->name) + ->mkdir($this->baseDir . '/plugins/' . $this->type . '/' . $this->name . '/language') + ->mkdir($this->baseDir . '/plugins/' . $this->type . '/' . $this->name . '/language/en-GB') + ->mkdir($this->baseDir . '/plugins/' . $this->type . '/' . $this->name . '/language/de-DE'); + $collection->run(); + } + + /** + * Set the type of the plugin + * + * @param string $type type of the plugin + * + * @return bool + */ + public function setType($type) + { + $this->type = $type; + } } diff --git a/src/Task/Scaffold/Tasks.php b/src/Task/Scaffold/Tasks.php index 28e9cf0..c2e988b 100644 --- a/src/Task/Scaffold/Tasks.php +++ b/src/Task/Scaffold/Tasks.php @@ -1,4 +1,10 @@ task(ScaffoldComponent::class, $name); } + + /** + * Scaffold a component extensions + * + * @param string $name + * @param string $baseDir + * + * @return JoomlaRobo\Task\Scaffold\ScaffoldComponent + */ + protected function taskScaffoldModule($name, $baseDir='src') + { + return $this->task(ScaffoldModule::class, $name); + } + + /** + * Scaffold a component extensions + * + * @param string $name + * @param string $type + * @param string $baseDir + * + * @return JoomlaRobo\Task\Scaffold\ScaffoldComponent + */ + protected function taskScaffoldPlugin($name, $type, $baseDir='src') + { + return $this->task(ScaffoldPlugin::class, $name, $type); + } } diff --git a/src/Tasks.php b/src/Tasks.php index 98636a0..8858f22 100644 --- a/src/Tasks.php +++ b/src/Tasks.php @@ -1,7 +1,14 @@