Module/plugin installation working #593 (#594)

* Remove the Sample module

* 593-Fix-Modules-From-Composer

* Fix pre/post install scripts in composer #593

* Formatting
This commit is contained in:
Nabeel S 2020-02-28 16:06:45 -05:00 committed by GitHub
parent dbaac04eea
commit 7e742518bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 343 additions and 642 deletions

View File

@ -0,0 +1,41 @@
<?php
namespace App\Console\Commands;
use App\Contracts\Command;
use Nwidart\Modules\Facades\Module;
class ClearCaches extends Command
{
protected $signature = 'phpvms:caches';
protected $description = 'Clear all caches';
/**
* {@inheritdoc}
*/
public function handle()
{
self::clearCaches();
}
public static function clearCaches()
{
self::clearBootstrapCache();
self::clearModuleCache();
}
/**
* Clear the bootstrap/cache dir
*/
private static function clearBootstrapCache()
{
}
/**
* Rescan for new modules
*/
private static function clearModuleCache()
{
Module::scan();
}
}

View File

@ -4,7 +4,8 @@
"keywords": ["phpvms", "virtual", "airlines"], "keywords": ["phpvms", "virtual", "airlines"],
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"type": "project", "type": "project",
"minimum-stability": "stable", "minimum-stability": "dev",
"prefer-stable": true,
"homepage": "http://www.phpvms.net", "homepage": "http://www.phpvms.net",
"require": { "require": {
"php": ">=7.2", "php": ">=7.2",
@ -13,11 +14,13 @@
"ext-simplexml": "*", "ext-simplexml": "*",
"ext-pdo": "*", "ext-pdo": "*",
"composer/composer": "~1.8.0", "composer/composer": "~1.8.0",
"composer/installers": "~1.0",
"laravel/framework": "~6.0", "laravel/framework": "~6.0",
"akaunting/money": "^1.0", "akaunting/money": "^1.0",
"anhskohbo/no-captcha": "^3.0", "anhskohbo/no-captcha": "^3.0",
"appstract/laravel-opcache": "^2.0", "appstract/laravel-opcache": "^2.0",
"arrilot/laravel-widgets": "~3.13.0", "arrilot/laravel-widgets": "~3.13.0",
"codedge/laravel-selfupdater": "^2.5",
"doctrine/dbal": "~2.9.2", "doctrine/dbal": "~2.9.2",
"elcobvg/laravel-opcache": "~0.4", "elcobvg/laravel-opcache": "~0.4",
"facade/ignition": "^1.6", "facade/ignition": "^1.6",
@ -50,7 +53,8 @@
"theiconic/php-ga-measurement-protocol": "2.7.*", "theiconic/php-ga-measurement-protocol": "2.7.*",
"tivie/php-os-detector": "~1.1.0", "tivie/php-os-detector": "~1.1.0",
"webpatser/laravel-uuid": "~3.0", "webpatser/laravel-uuid": "~3.0",
"codedge/laravel-selfupdater": "^2.5" "oomphinc/composer-installers-extender": "^1.1",
"phpvms/sample-module": "^1.0"
}, },
"require-dev": { "require-dev": {
"barryvdh/laravel-debugbar": "^3.0", "barryvdh/laravel-debugbar": "^3.0",
@ -86,17 +90,28 @@
] ]
}, },
"extra": { "extra": {
"installer-types": ["phpvms-module"],
"installer-paths": { "installer-paths": {
"modules/{$name}/": [ "modules/{$name}/": ["type:phpvms-module"]
"type:laravel-library", },
"type:phpvms-plugin" "module-dir": "modules"
]
}
}, },
"scripts": { "scripts": {
"pre-package-uninstall": [
"@php -r \"array_map('unlink', glob('bootstrap/cache/*'));\""
],
"post-package-uninstall": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi",
"@php artisan phpvms:caches"
],
"pre-autoload-dump": [
"@php -r \"array_map('unlink', glob('bootstrap/cache/*'));\""
],
"post-autoload-dump": [ "post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi" "@php artisan package:discover --ansi",
"@php artisan phpvms:caches"
] ]
}, },
"config": { "config": {

346
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "5f8a87c7717ad2b6ed1d6cf1c585cc3d", "content-hash": "30e2e357e76a813ae0179df9e40215e9",
"packages": [ "packages": [
{ {
"name": "akaunting/money", "name": "akaunting/money",
@ -358,7 +358,7 @@
{ {
"name": "Tobias Nyholm", "name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com", "email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/nyholm" "homepage": "https://github.com/Nyholm"
} }
], ],
"description": "Common classes for PSR-6 adapters", "description": "Common classes for PSR-6 adapters",
@ -413,7 +413,7 @@
"/Tests/" "/Tests/"
] ]
}, },
"notification-url": "http://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -426,7 +426,7 @@
{ {
"name": "Tobias Nyholm", "name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com", "email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/nyholm" "homepage": "https://github.com/Nyholm"
} }
], ],
"description": "A PSR-6 cache implementation using a php array. This implementation supports tags", "description": "A PSR-6 cache implementation using a php array. This implementation supports tags",
@ -475,7 +475,7 @@
"/Tests/" "/Tests/"
] ]
}, },
"notification-url": "http://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -488,7 +488,7 @@
{ {
"name": "Tobias Nyholm", "name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com", "email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/nyholm" "homepage": "https://github.com/Nyholm"
} }
], ],
"description": "A helper trait and interface to your PSR-6 cache to support hierarchical keys.", "description": "A helper trait and interface to your PSR-6 cache to support hierarchical keys.",
@ -530,7 +530,7 @@
"Cache\\TagInterop\\": "" "Cache\\TagInterop\\": ""
} }
}, },
"notification-url": "http://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -538,7 +538,7 @@
{ {
"name": "Tobias Nyholm", "name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com", "email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/nyholm" "homepage": "https://github.com/Nyholm"
}, },
{ {
"name": "Nicolas Grekas", "name": "Nicolas Grekas",
@ -760,6 +760,130 @@
], ],
"time": "2019-06-11T13:03:06+00:00" "time": "2019-06-11T13:03:06+00:00"
}, },
{
"name": "composer/installers",
"version": "v1.8.0",
"source": {
"type": "git",
"url": "https://github.com/composer/installers.git",
"reference": "7d610d50aae61ae7ed6675e58efeabdf279bb5e3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/installers/zipball/7d610d50aae61ae7ed6675e58efeabdf279bb5e3",
"reference": "7d610d50aae61ae7ed6675e58efeabdf279bb5e3",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0"
},
"replace": {
"roundcube/plugin-installer": "*",
"shama/baton": "*"
},
"require-dev": {
"composer/composer": "1.0.*@dev",
"phpunit/phpunit": "^4.8.36"
},
"type": "composer-plugin",
"extra": {
"class": "Composer\\Installers\\Plugin",
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-4": {
"Composer\\Installers\\": "src/Composer/Installers"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Kyle Robinson Young",
"email": "kyle@dontkry.com",
"homepage": "https://github.com/shama"
}
],
"description": "A multi-framework Composer library installer",
"homepage": "https://composer.github.io/installers/",
"keywords": [
"Craft",
"Dolibarr",
"Eliasis",
"Hurad",
"ImageCMS",
"Kanboard",
"Lan Management System",
"MODX Evo",
"MantisBT",
"Mautic",
"Maya",
"OXID",
"Plentymarkets",
"Porto",
"RadPHP",
"SMF",
"Thelia",
"Whmcs",
"WolfCMS",
"agl",
"aimeos",
"annotatecms",
"attogram",
"bitrix",
"cakephp",
"chef",
"cockpit",
"codeigniter",
"concrete5",
"croogo",
"dokuwiki",
"drupal",
"eZ Platform",
"elgg",
"expressionengine",
"fuelphp",
"grav",
"installer",
"itop",
"joomla",
"known",
"kohana",
"laravel",
"lavalite",
"lithium",
"magento",
"majima",
"mako",
"mediawiki",
"modulework",
"modx",
"moodle",
"osclass",
"phpbb",
"piwik",
"ppi",
"puppet",
"pxcms",
"reindex",
"roundcube",
"shopware",
"silverstripe",
"sydes",
"sylius",
"symfony",
"typo3",
"wordpress",
"yawik",
"zend",
"zikula"
],
"time": "2020-02-07T10:39:20+00:00"
},
{ {
"name": "composer/semver", "name": "composer/semver",
"version": "1.5.1", "version": "1.5.1",
@ -1792,7 +1916,7 @@
"src/functions_include.php" "src/functions_include.php"
] ]
}, },
"notification-url": "http://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -1915,7 +2039,7 @@
"Hashids\\": "src/" "Hashids\\": "src/"
} }
}, },
"notification-url": "http://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -2173,7 +2297,7 @@
"stubs/" "stubs/"
] ]
}, },
"notification-url": "http://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -2224,7 +2348,7 @@
"Joshbrw\\LaravelModuleInstaller\\": "src/" "Joshbrw\\LaravelModuleInstaller\\": "src/"
} }
}, },
"notification-url": "http://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -2397,16 +2521,16 @@
}, },
{ {
"name": "laravel/framework", "name": "laravel/framework",
"version": "v6.16.0", "version": "v6.17.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/framework.git", "url": "https://github.com/laravel/framework.git",
"reference": "b47217e41868d3049ec545cbb713aa94c6f39e55" "reference": "32d1ed55dd46dcd706ff2e45bb7965be7320b87d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/b47217e41868d3049ec545cbb713aa94c6f39e55", "url": "https://api.github.com/repos/laravel/framework/zipball/32d1ed55dd46dcd706ff2e45bb7965be7320b87d",
"reference": "b47217e41868d3049ec545cbb713aa94c6f39e55", "reference": "32d1ed55dd46dcd706ff2e45bb7965be7320b87d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2539,7 +2663,7 @@
"framework", "framework",
"laravel" "laravel"
], ],
"time": "2020-02-18T15:17:52+00:00" "time": "2020-02-26T14:23:01+00:00"
}, },
{ {
"name": "laravel/helpers", "name": "laravel/helpers",
@ -3444,6 +3568,48 @@
], ],
"time": "2019-11-12T18:38:48+00:00" "time": "2019-11-12T18:38:48+00:00"
}, },
{
"name": "oomphinc/composer-installers-extender",
"version": "v1.1.2",
"source": {
"type": "git",
"url": "https://github.com/oomphinc/composer-installers-extender.git",
"reference": "ca1c4b16b0905c81d1e77e608f36a2eff1a56f56"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/oomphinc/composer-installers-extender/zipball/ca1c4b16b0905c81d1e77e608f36a2eff1a56f56",
"reference": "ca1c4b16b0905c81d1e77e608f36a2eff1a56f56",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0",
"composer/installers": "^1.0"
},
"type": "composer-plugin",
"extra": {
"class": "OomphInc\\ComposerInstallersExtender\\Plugin"
},
"autoload": {
"psr-4": {
"OomphInc\\ComposerInstallersExtender\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Stephen Beemsterboer",
"email": "stephen@oomphinc.com",
"homepage": "https://github.com/balbuf"
}
],
"description": "Extend the composer/installers plugin to accept any arbitrary package type.",
"homepage": "http://www.oomphinc.com/",
"time": "2017-03-31T16:57:39+00:00"
},
{ {
"name": "opis/closure", "name": "opis/closure",
"version": "3.5.1", "version": "3.5.1",
@ -3645,7 +3811,7 @@
"PhpUnitsOfMeasure\\": "source/" "PhpUnitsOfMeasure\\": "source/"
} }
}, },
"notification-url": "http://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -3721,6 +3887,41 @@
], ],
"time": "2019-12-15T19:35:24+00:00" "time": "2019-12-15T19:35:24+00:00"
}, },
{
"name": "phpvms/sample-module",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/nabeelio/phpvms-module.git",
"reference": "6332c03a6d552c03a1b70d2f2c24da86c6a12132"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nabeelio/phpvms-module/zipball/6332c03a6d552c03a1b70d2f2c24da86c6a12132",
"reference": "6332c03a6d552c03a1b70d2f2c24da86c6a12132",
"shasum": ""
},
"require": {
"composer/installers": "~1.0"
},
"type": "phpvms-module",
"extra": {
"laravel": {
"providers": [
"Modules\\Sample\\Providers\\SampleServiceProvider",
"Modules\\Sample\\Providers\\EventServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Modules\\Sample\\": "."
}
},
"notification-url": "https://packagist.org/downloads/",
"description": "A sample phpvms module",
"time": "2020-02-28T15:42:04+00:00"
},
{ {
"name": "pragmarx/version", "name": "pragmarx/version",
"version": "v0.2.9", "version": "v0.2.9",
@ -3978,7 +4179,7 @@
"Psr\\Cache\\": "src/" "Psr\\Cache\\": "src/"
} }
}, },
"notification-url": "http://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -4024,7 +4225,7 @@
"Psr\\Container\\": "src/" "Psr\\Container\\": "src/"
} }
}, },
"notification-url": "http://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -4590,9 +4791,9 @@
"authors": [ "authors": [
{ {
"name": "Sebastiaan Luca", "name": "Sebastiaan Luca",
"role": "Author",
"email": "hello@sebastiaanluca.com", "email": "hello@sebastiaanluca.com",
"homepage": "https://www.sebastiaanluca.com" "homepage": "https://www.sebastiaanluca.com",
"role": "Author"
} }
], ],
"description": "An extensive set of Laravel framework helper functions and collection macros.", "description": "An extensive set of Laravel framework helper functions and collection macros.",
@ -6744,7 +6945,7 @@
"TheIconic\\Tracking\\GoogleAnalytics\\": "src/" "TheIconic\\Tracking\\GoogleAnalytics\\": "src/"
} }
}, },
"notification-url": "http://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -6832,7 +7033,7 @@
"Tivie\\OS\\": "src/" "Tivie\\OS\\": "src/"
} }
}, },
"notification-url": "http://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"APACHE 2.0" "APACHE 2.0"
], ],
@ -7028,26 +7229,26 @@
"packages-dev": [ "packages-dev": [
{ {
"name": "barryvdh/laravel-debugbar", "name": "barryvdh/laravel-debugbar",
"version": "v3.2.8", "version": "v3.2.9",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/barryvdh/laravel-debugbar.git", "url": "https://github.com/barryvdh/laravel-debugbar.git",
"reference": "18208d64897ab732f6c04a19b319fe8f1d57a9c0" "reference": "42d5da5379a7860093f8e4032167e4cb5ebec180"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/18208d64897ab732f6c04a19b319fe8f1d57a9c0", "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/42d5da5379a7860093f8e4032167e4cb5ebec180",
"reference": "18208d64897ab732f6c04a19b319fe8f1d57a9c0", "reference": "42d5da5379a7860093f8e4032167e4cb5ebec180",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"illuminate/routing": "^5.5|^6", "illuminate/routing": "^5.5|^6|^7",
"illuminate/session": "^5.5|^6", "illuminate/session": "^5.5|^6|^7",
"illuminate/support": "^5.5|^6", "illuminate/support": "^5.5|^6|^7",
"maximebf/debugbar": "~1.15.0", "maximebf/debugbar": "^1.15.1",
"php": ">=7.0", "php": ">=7.0",
"symfony/debug": "^3|^4", "symfony/debug": "^3|^4|^5",
"symfony/finder": "^3|^4" "symfony/finder": "^3|^4|^5"
}, },
"require-dev": { "require-dev": {
"laravel/framework": "5.5.x" "laravel/framework": "5.5.x"
@ -7092,37 +7293,37 @@
"profiler", "profiler",
"webprofiler" "webprofiler"
], ],
"time": "2019-08-29T07:01:03+00:00" "time": "2020-02-25T20:42:23+00:00"
}, },
{ {
"name": "barryvdh/laravel-ide-helper", "name": "barryvdh/laravel-ide-helper",
"version": "v2.6.6", "version": "v2.6.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/barryvdh/laravel-ide-helper.git", "url": "https://github.com/barryvdh/laravel-ide-helper.git",
"reference": "b91b959364d97af658f268c733c75dccdbff197e" "reference": "edd69c5e0508972c81f1f7173236de2459c45814"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/b91b959364d97af658f268c733c75dccdbff197e", "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/edd69c5e0508972c81f1f7173236de2459c45814",
"reference": "b91b959364d97af658f268c733c75dccdbff197e", "reference": "edd69c5e0508972c81f1f7173236de2459c45814",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"barryvdh/reflection-docblock": "^2.0.6", "barryvdh/reflection-docblock": "^2.0.6",
"composer/composer": "^1.6", "composer/composer": "^1.6",
"doctrine/dbal": "~2.3", "doctrine/dbal": "~2.3",
"illuminate/console": "^5.5|^6", "illuminate/console": "^5.5|^6|^7",
"illuminate/filesystem": "^5.5|^6", "illuminate/filesystem": "^5.5|^6|^7",
"illuminate/support": "^5.5|^6", "illuminate/support": "^5.5|^6|^7",
"php": ">=7" "php": ">=7.2"
}, },
"require-dev": { "require-dev": {
"illuminate/config": "^5.5|^6", "illuminate/config": "^5.5|^6|^7",
"illuminate/view": "^5.5|^6", "illuminate/view": "^5.5|^6|^7",
"phpro/grumphp": "^0.14", "mockery/mockery": "^1.3",
"phpunit/phpunit": "4.*", "orchestra/testbench": "^3|^4",
"scrutinizer/ocular": "~1.1", "phpro/grumphp": "^0.17.1",
"squizlabs/php_codesniffer": "^3" "squizlabs/php_codesniffer": "^3"
}, },
"type": "library", "type": "library",
@ -7163,7 +7364,7 @@
"phpstorm", "phpstorm",
"sublime" "sublime"
], ],
"time": "2019-10-30T20:53:27+00:00" "time": "2020-02-25T20:41:32+00:00"
}, },
{ {
"name": "barryvdh/reflection-docblock", "name": "barryvdh/reflection-docblock",
@ -7815,22 +8016,22 @@
}, },
{ {
"name": "maximebf/debugbar", "name": "maximebf/debugbar",
"version": "v1.15.1", "version": "v1.16.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/maximebf/php-debugbar.git", "url": "https://github.com/maximebf/php-debugbar.git",
"reference": "6c4277f6117e4864966c9cb58fb835cee8c74a1e" "reference": "58998b818c6567fac01e35b8a4b70c1a64530556"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/6c4277f6117e4864966c9cb58fb835cee8c74a1e", "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/58998b818c6567fac01e35b8a4b70c1a64530556",
"reference": "6c4277f6117e4864966c9cb58fb835cee8c74a1e", "reference": "58998b818c6567fac01e35b8a4b70c1a64530556",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.6", "php": "^7.1",
"psr/log": "^1.0", "psr/log": "^1.0",
"symfony/var-dumper": "^2.6|^3|^4" "symfony/var-dumper": "^2.6|^3|^4|^5"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^5" "phpunit/phpunit": "^5"
@ -7843,7 +8044,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.15-dev" "dev-master": "1.16-dev"
} }
}, },
"autoload": { "autoload": {
@ -7872,7 +8073,7 @@
"debug", "debug",
"debugbar" "debugbar"
], ],
"time": "2019-09-24T14:55:42+00:00" "time": "2019-11-24T09:46:11+00:00"
}, },
{ {
"name": "mockery/mockery", "name": "mockery/mockery",
@ -8210,16 +8411,16 @@
}, },
{ {
"name": "phpdocumentor/reflection-docblock", "name": "phpdocumentor/reflection-docblock",
"version": "5.0.0", "version": "5.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "a48807183a4b819072f26e347bbd0b5199a9d15f" "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/a48807183a4b819072f26e347bbd0b5199a9d15f", "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e",
"reference": "a48807183a4b819072f26e347bbd0b5199a9d15f", "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -8259,30 +8460,29 @@
} }
], ],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2020-02-09T09:16:15+00:00" "time": "2020-02-22T12:28:44+00:00"
}, },
{ {
"name": "phpdocumentor/type-resolver", "name": "phpdocumentor/type-resolver",
"version": "1.0.1", "version": "1.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git", "url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" "reference": "7462d5f123dfc080dfdf26897032a6513644fc95"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95",
"reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", "reference": "7462d5f123dfc080dfdf26897032a6513644fc95",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.1", "php": "^7.2",
"phpdocumentor/reflection-common": "^2.0" "phpdocumentor/reflection-common": "^2.0"
}, },
"require-dev": { "require-dev": {
"ext-tokenizer": "^7.1", "ext-tokenizer": "^7.2",
"mockery/mockery": "~1", "mockery/mockery": "~1"
"phpunit/phpunit": "^7.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -8306,7 +8506,7 @@
} }
], ],
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"time": "2019-08-22T18:11:29+00:00" "time": "2020-02-18T18:59:58+00:00"
}, },
{ {
"name": "phpspec/prophecy", "name": "phpspec/prophecy",
@ -9625,9 +9825,9 @@
} }
], ],
"aliases": [], "aliases": [],
"minimum-stability": "stable", "minimum-stability": "dev",
"stability-flags": [], "stability-flags": [],
"prefer-stable": false, "prefer-stable": true,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": ">=7.2", "php": ">=7.2",

View File

@ -94,6 +94,7 @@ return [
'enabled' => false, 'enabled' => false,
'paths' => [ 'paths' => [
base_path('vendor/*/*'), base_path('vendor/*/*'),
base_path('modules/*'),
], ],
], ],
/* /*

1
modules/.gitignore vendored
View File

@ -6,6 +6,5 @@
!/Awards !/Awards
!/Importer !/Importer
!/Installer !/Installer
!/Sample
!/Updater !/Updater
!/Vacentral !/Vacentral

View File

@ -1,27 +0,0 @@
<?php
namespace Modules\Sample\Awards;
use App\Contracts\Award;
/**
* Class SampleAward
*/
class SampleAward extends Award
{
public $name = 'Sample Award';
/**
* This is the method that needs to be implemented.
* You have access to $this->user, which holds the current
* user the award is being checked against
*
* @param null $params Parameters passed in from the UI
*
* @return bool
*/
public function check($params = null): bool
{
return false;
}
}

View File

@ -1,5 +0,0 @@
<?php
return [
'name' => 'Sample',
];

View File

@ -1,21 +0,0 @@
<?php
namespace Modules\Sample\Database\Seeders;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Seeder;
class SampleDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
// $this->call("OthersTableSeeder");
}
}

View File

@ -1,65 +0,0 @@
<?php
namespace Modules\Sample\Http\Controllers\Admin;
use App\Contracts\Controller;
use Illuminate\Http\Request;
/**
* Class AdminController
*/
class AdminController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return view('sample::admin.index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('sample::admin.create');
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
}
/**
* Show the specified resource.
*/
public function show()
{
return view('sample::admin.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit()
{
return view('sample::admin.edit');
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request)
{
}
/**
* Remove the specified resource from storage.
*/
public function destroy()
{
}
}

View File

@ -1,38 +0,0 @@
<?php
namespace Modules\Sample\Http\Controllers\Api;
use App\Contracts\Controller;
use Illuminate\Http\Request;
/**
* Class SampleController
*/
class SampleController extends Controller
{
/**
* Just send out a message
*
* @param Request $request
*
* @return \Illuminate\Http\JsonResponse
*/
public function index(Request $request)
{
return $this->message('Hello, world!');
}
/**
* @param Request $request
*
* @return \Illuminate\Http\JsonResponse
*/
public function hello(Request $request)
{
// Another way to return JSON, this for a custom response
// It's recommended to use Resources for responses from the database
return response()->json([
'name' => Auth::user()->name,
]);
}
}

View File

@ -1,67 +0,0 @@
<?php
namespace Modules\Sample\Http\Controllers;
use App\Contracts\Controller;
use Illuminate\Http\Request;
/**
* Class SampleController
*/
class SampleController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return view('sample::index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('sample::create');
}
/**
* Store a newly created resource in storage.
*
* @param Request $request
*/
public function store(Request $request)
{
}
/**
* Show the specified resource.
*/
public function show()
{
return view('sample::show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit()
{
return view('sample::edit');
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request)
{
}
/**
* Remove the specified resource from storage.
*/
public function destroy()
{
}
}

View File

@ -1,8 +0,0 @@
<?php
// This is the admin path. Comment this out if you don't have
// an admin panel component.
Route::group([], function () {
Route::get('/', 'AdminController@index');
Route::get('/create', 'AdminController@create');
});

View File

@ -1,17 +0,0 @@
<?php
/**
* This is publicly accessible
*/
Route::group(['middleware' => []], function () {
Route::get('/', 'SampleController@index');
});
/*
* This is required to have a valid API key
*/
Route::group(['middleware' => [
'api.auth',
]], function () {
Route::get('/hello', 'SampleController@hello');
});

View File

@ -1,9 +0,0 @@
<?php
Route::group(['middleware' => [
'role:user', // leave blank to make this public
]], function () {
// all your routes are prefixed with the above prefix
// e.g. yoursite.com/sample
Route::get('/', 'SampleController@index');
});

View File

@ -1,17 +0,0 @@
<?php
namespace Modules\Sample\Listeners;
use App\Events\TestEvent;
use Log;
class TestEventListener
{
/**
* Handle the event.
*/
public function handle(TestEvent $event)
{
Log::info('Received event', [$event]);
}
}

View File

@ -1,15 +0,0 @@
<?php
namespace Modules\Sample\Models;
use App\Contracts\Model;
/**
* Class SampleTable
*/
class SampleTable extends Model
{
public $table = '';
protected $fillable = [];
}

View File

@ -1,25 +0,0 @@
<?php
namespace Modules\Sample\Providers;
use App\Events\TestEvent;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Modules\Sample\Listeners\TestEventListener;
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*/
protected $listen = [
TestEvent::class => [TestEventListener::class],
];
/**
* Register any events for your application.
*/
public function boot()
{
parent::boot();
}
}

View File

@ -1,153 +0,0 @@
<?php
namespace Modules\Sample\Providers;
use App\Services\ModuleService;
use Illuminate\Support\ServiceProvider;
use Route;
class SampleServiceProvider extends ServiceProvider
{
protected $moduleSvc;
/**
* Boot the application events.
*/
public function boot()
{
$this->moduleSvc = app(ModuleService::class);
$this->registerRoutes();
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->registerLinks();
$this->loadMigrationsFrom(__DIR__.'/../Database/migrations');
}
/**
* Register the service provider.
*/
public function register()
{
//
}
/**
* Add module links here
*/
public function registerLinks()
{
// Show this link if logged in
// $this->moduleSvc->addFrontendLink('Sample', '/sample', '', $logged_in=true);
// Admin links:
$this->moduleSvc->addAdminLink('Sample', '/admin/sample');
}
/**
* Register the routes
*/
protected function registerRoutes()
{
/*
* Routes for the frontend
*/
Route::group([
'as' => 'sample.',
'prefix' => 'sample',
// If you want a RESTful module, change this to 'api'
'middleware' => ['web'],
'namespace' => 'Modules\Sample\Http\Controllers',
], function () {
$this->loadRoutesFrom(__DIR__.'/../Http/Routes/web.php');
});
/*
* Routes for the admin
*/
Route::group([
'as' => 'sample.',
'prefix' => 'admin/sample',
// If you want a RESTful module, change this to 'api'
'middleware' => ['web', 'role:admin'],
'namespace' => 'Modules\Sample\Http\Controllers\Admin',
], function () {
$this->loadRoutesFrom(__DIR__.'/../Http/Routes/admin.php');
});
/*
* Routes for an API
*/
Route::group([
'as' => 'sample.',
'prefix' => 'api/sample',
// If you want a RESTful module, change this to 'api'
'middleware' => ['api'],
'namespace' => 'Modules\Sample\Http\Controllers\Api',
], function () {
$this->loadRoutesFrom(__DIR__.'/../Http/Routes/api.php');
});
}
/**
* Register config.
*/
protected function registerConfig()
{
$this->publishes([
__DIR__.'/../Config/config.php' => config_path('sample.php'),
], 'config');
$this->mergeConfigFrom(
__DIR__.'/../Config/config.php', 'sample'
);
}
/**
* Register views.
*/
public function registerViews()
{
$viewPath = resource_path('views/modules/sample');
$sourcePath = __DIR__.'/../Resources/views';
$this->publishes([
$sourcePath => $viewPath,
], 'views');
$paths = array_map(
function ($path) {
return $path.'/modules/sample';
},
\Config::get('view.paths')
);
$paths[] = $sourcePath;
$this->loadViewsFrom($paths, 'sample');
}
/**
* Register translations.
*/
public function registerTranslations()
{
$langPath = resource_path('lang/modules/sample');
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, 'sample');
} else {
$this->loadTranslationsFrom(__DIR__.'/../Resources/lang', 'sample');
}
}
/**
* Get the services provided by the provider.
*/
public function provides(): array
{
return [];
}
}

View File

@ -1,14 +0,0 @@
@extends('sample::layouts.admin')
@section('title', 'Sample Create')
@section('actions')
@endsection
@section('content')
<div class="card border-blue-bottom">
<div class="content">
<div class="header"><h4 class="title">Create something!</h4></div>
<p>Add a form!</p>
</div>
</div>
@endsection

View File

@ -1,18 +0,0 @@
@extends('sample::layouts.admin')
@section('title', 'Sample')
@section('actions')
<li>
<a href="{{ url('/admin/sample/create') }}">
<i class="ti-plus"></i>
Add New</a>
</li>
@endsection
@section('content')
<div class="card border-blue-bottom">
<div class="content">
<div class="header"><h4 class="title">Admin Scaffold!</h4></div>
<p>This view is loaded from module: {{ config('sample.name') }}</p>
</div>
</div>
@endsection

View File

@ -1,9 +0,0 @@
@extends('sample::layouts.frontend')
@section('content')
<h1>Hello World</h1>
<p>
This view is loaded from module: {{ config('sample.name') }}
</p>
@endsection

View File

@ -1,5 +0,0 @@
{{--
You probably don't want to edit anything here. Just make
sure to extend this in your views. It will pass the content section through
--}}
@extends('admin.app')

View File

@ -1,5 +0,0 @@
{{--
You probably don't want to edit anything here. Just make
sure to extend this in your views. It will pass the content section through
--}}
@extends('app')

View File

@ -1,24 +0,0 @@
{
"name": "phpvms/sample-module",
"type": "laravel-module",
"description": "",
"require": {
"joshbrw/laravel-module-installer": "0.1.x"
},
"extra": {
"laravel": {
"providers": [
"Modules\\Sample\\Providers\\SampleServiceProvider",
"Modules\\Sample\\Providers\\EventServiceProvider"
],
"aliases": {
}
}
},
"autoload": {
"psr-4": {
"Modules\\Sample\\": ""
}
}
}

View File

@ -1,15 +0,0 @@
{
"name": "Sample",
"alias": "sample",
"description": "",
"keywords": [],
"active": 1,
"order": 0,
"providers": [
"Modules\\Sample\\Providers\\SampleServiceProvider",
"Modules\\Sample\\Providers\\EventServiceProvider"
],
"aliases": {},
"files": [],
"requires": []
}

View File

@ -1,6 +1,6 @@
{ {
"name": "VENDOR/$LOWER_NAME$-module", "name": "VENDOR/$LOWER_NAME$-module",
"type": "laravel-module", "type": "phpvms-module",
"description": "", "description": "",
"authors": [ "authors": [
{ {
@ -9,7 +9,7 @@
} }
], ],
"require": { "require": {
"joshbrw/laravel-module-installer": "0.1.x" "composer/installers": "~1.0"
}, },
"extra": { "extra": {
"laravel": { "laravel": {
@ -24,7 +24,7 @@
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"$MODULE_NAMESPACE$\\$STUDLY_NAME$\\": "" "$MODULE_NAMESPACE$\\$STUDLY_NAME$\\": "."
} }
} }
} }

View File

@ -6,7 +6,9 @@ use App\Services\PirepService;
class AwardsTest extends TestCase class AwardsTest extends TestCase
{ {
/** @var AwardService */
private $awardSvc; private $awardSvc;
private $pirepSvc; private $pirepSvc;
public function setUp(): void public function setUp(): void