Add test/install for shop

This commit is contained in:
Dennis Eichhorn 2019-06-05 22:03:12 +02:00
commit 6a03db2ffc
24 changed files with 429 additions and 0 deletions

View File

View File

View File

0
Admin/Install/db.json Normal file
View File

49
Admin/Installer.php Normal file
View File

@ -0,0 +1,49 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Shop\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Shop\Admin;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\InfoManager;
use phpOMS\Module\InstallerAbstract;
use phpOMS\System\File\PathException;
use phpOMS\System\File\PermissionException;
use phpOMS\Utils\Parser\Php\ArrayParser;
use phpOMS\System\File\Local\Directory;
/**
* Installer class.
*
* @package Modules\Shop\Admin
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class Installer extends InstallerAbstract
{
/**
* {@inheritdoc}
*/
public static function install(DatabasePool $dbPool, InfoManager $info) : void
{
if (\file_exists(__DIR__ . '/../../../Web/Shop')) {
Directory::delete(__DIR__ . '/../../../Web/Shop');
}
Directory::copy(__DIR__ . '/Install/Shop', __DIR__ . '/../../../Web/Shop');
parent::install($dbPool, $info);
}
}

9
Admin/Routes/Web/Api.php Normal file
View File

@ -0,0 +1,9 @@
<?php declare(strict_types=1);
use Modules\Shop\Controller\ApiController;
use Modules\Shop\Models\PermissionState;
use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
];

View File

@ -0,0 +1,3 @@
<?php declare(strict_types=1);
return [];

20
Admin/Routes/Web/Shop.php Normal file
View File

@ -0,0 +1,20 @@
<?php declare(strict_types=1);
use Modules\Shop\Controller\ShopController;
use Modules\Shop\Models\PermissionState;
use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^(\/)(\?.*)*$' => [
[
'dest' => '\Modules\Shop\Controller\ShopController:viewWelcome',
'verb' => RouteVerb::GET,
'permission' => [
'module' => ShopController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::SHOP,
],
],
],
];

30
Admin/Status.php Normal file
View File

@ -0,0 +1,30 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Shop\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Shop\Admin;
use phpOMS\Module\StatusAbstract;
/**
* Shop class.
*
* @package Modules\Shop\Admin
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class Status extends StatusAbstract
{
}

29
Admin/Uninstaller.php Normal file
View File

@ -0,0 +1,29 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Shop\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Shop\Admin;
use phpOMS\Module\UninstallerAbstract;
/**
* Uninstaller class.
*
* @package Modules\Shop\Admin
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class Uninstaller extends UninstallerAbstract
{
}

30
Admin/Updater.php Normal file
View File

@ -0,0 +1,30 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Shop\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Shop\Admin;
use phpOMS\Module\UpdaterAbstract;
/**
* Updater class.
*
* @package Modules\Shop\Admin
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class Updater extends UpdaterAbstract
{
}

View File

@ -0,0 +1,35 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Shop
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Shop\Controller;
use phpOMS\ApplicationAbstract;
use phpOMS\Router\Router;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\System\MimeType;
use phpOMS\Message\NotificationLevel;
/**
* Api controller
*
* @package Modules\Shop
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
final class ApiController extends Controller
{
}

View File

@ -0,0 +1,35 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Shop
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Shop\Controller;
use phpOMS\ApplicationAbstract;
use phpOMS\Router\Router;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\System\MimeType;
use phpOMS\Message\NotificationLevel;
/**
* Backend controller.
*
* @package Modules\Shop
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
final class BackendController extends Controller
{
}

80
Controller/Controller.php Normal file
View File

@ -0,0 +1,80 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Shop
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Shop\Controller;
use Modules\Shop\Models\Shop;
use phpOMS\Module\ModuleAbstract;
use phpOMS\Module\WebInterface;
/**
* Shop class.
*
* @package Modules\Shop
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class Controller extends ModuleAbstract implements WebInterface
{
/**
* Module path.
*
* @var string
* @since 1.0.0
*/
public const MODULE_PATH = __DIR__ . '/../';
/**
* Module version.
*
* @var string
* @since 1.0.0
*/
public const MODULE_VERSION = '1.0.0';
/**
* Module name.
*
* @var string
* @since 1.0.0
*/
public const MODULE_NAME = 'Shop';
/**
* Module id.
*
* @var int
* @since 1.0.0
*/
public const MODULE_ID = 1007700000;
/**
* Providing.
*
* @var string[]
* @since 1.0.0
*/
protected static $providing = [
];
/**
* Dependencies.
*
* @var string[]
* @since 1.0.0
*/
protected static $dependencies = [];
}

View File

@ -0,0 +1,35 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Shop
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Shop\Controller;
use phpOMS\ApplicationAbstract;
use phpOMS\Router\Router;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\System\MimeType;
use phpOMS\Message\NotificationLevel;
/**
* Shop controller.
*
* @package Modules\Shop
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
final class ShopController extends Controller
{
}

2
Docs/introduction.md Normal file
View File

@ -0,0 +1,2 @@
# Introduction

View File

@ -0,0 +1,33 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Shop
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Shop\Models;
use phpOMS\Stdlib\Base\Enum;
/**
* Permision state enum.
*
* @package Modules\Shop
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
abstract class PermissionState extends Enum
{
public const ARTICLE = 1;
public const BUYER = 2;
public const SELLER = 3;
public const SHOP = 4;
}

1
README.md Normal file
View File

@ -0,0 +1 @@
# Search

BIN
img/module_teaser_small.png Normal file

Binary file not shown.

38
info.json Normal file
View File

@ -0,0 +1,38 @@
{
"name": {
"id": 1007700000,
"internal": "Shop",
"external": "Shop"
},
"category": "General",
"version": "1.0.0",
"requirements": {
"phpOMS": "1.0.0",
"phpOMS-db": "1.0.0"
},
"creator": {
"name": "Orange Management",
"website": "www.spl1nes.com"
},
"description": "The search module.",
"directory": "Shop",
"dependencies": {
"Admin": "1.0.0"
},
"providing": {
},
"load": [
{
"pid": [
"/"
],
"type": 4,
"for": "Content",
"file": "Shop",
"from": "Admin"
}
],
"lang": false,
"js": true,
"css": false
}