Skip to content

Commit

Permalink
[administration] init administration bundle (#3239)
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmannmartin authored Jul 1, 2024
0 parents commit 3d64e9b
Show file tree
Hide file tree
Showing 14 changed files with 241 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/run-checks-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on: [push]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
name: "Checks and tests"
jobs:
checks-and-tests:
name: Run checks and tests
runs-on: ubuntu-22.04
steps:
- name: Sleep for 15 seconds to ensure that split packages has been promoted to packagist.org
run: sleep 15s
shell: bash
- name: GIT checkout branch - ${{ github.ref }}
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Install PHP, extensions and tools
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: bcmath, gd, intl, pdo_pgsql, redis, pgsql, zip
tools: composer
- name: Install Composer dependencies
run: composer install --optimize-autoloader --no-interaction
- name: Run PHPUnit
run: php vendor/bin/phpunit tests
- name: Run PHPStan level 5
run: php vendor/bin/phpstan analyze -c ./phpstan.neon ./src --level=5
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.php_cs.cache
/vendor
/composer.lock
/.phpunit.result.cache
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Contributing

Thank you for your contributions to Shopsys Platform Package.
Together we are making Shopsys Platform better.

This repository is READ-ONLY.
If you want to [report issues](https://github.com/shopsys/shopsys/issues/new) and/or send [pull requests](https://github.com/shopsys/shopsys/compare),
please use the main [Shopsys repository](https://github.com/shopsys/shopsys).

Please, check our [Contribution Guide](https://github.com/shopsys/shopsys/blob/HEAD/CONTRIBUTING.md) before contributing.
32 changes: 32 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Shopsys Platform Development License
version 2023-10-03

The software which includes this copyright notice and licensing agreement (“Agreement”)
and associated documentation files (“Software”) is protected by copyright.
The copyright holder is Shopsys s.r.o., a Czech company with Id. No. 27790487 (“Shopsys”).

By this Agreement Shopsys grants to any person obtaining a copy of the Software (“Licensee”)
a free of charge non-exclusive restricted license (“Development License”) to use the Software
for the purpose of evaluation and testing of the Software (“Permitted Purpose”), subject to the following conditions:

(1) Licensee shall not, and shall not allow any other person to, use the Software or any software
created by derivation from the Software for (i) processing actual orders, or (ii) any other purposes
except for the Permitted Purpose, in particular for any commercial use. If any instance of the Software
or any software created by derivation from the Software used by the Licensee or its affiliates processes
any order which results in a revenue for the Licensee or any of its affiliates the Development License shall
terminate immediately. Any entity directly or indirectly controlling, controlled by, or under common control
with the Licensee qualifies as a Licensee’s affiliate.

(2) This Agreement governing the terms of the Development License and including the above copyright notice
must be included in all copies or substantial portions of the Software, whether in its original or altered form.

(3) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The Licensee is welcomed to apply with Shopsys for a commercial license allowing the Licensee to use the Software
for other than Permitted Use and/or after the termination of the Development License.
By using the Software the Licensee agrees to this Agreement. This Agreement and the terms of the Development License
granted under this Agreement are governed by laws of the Czech Republic. This Agreement replaces any community,
licensing or similar non-commercial license agreement entered into between Shopsys and the Licensee.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Shopsys Administration

[![Downloads](https://img.shields.io/packagist/dt/shopsys/administration.svg)](https://packagist.org/packages/shopsys/administration)

This bundle for [Shopsys Platform](https://www.shopsys.com) adds the administration interface.
The bundle is dedicated for projects based on Shopsys Platform (i.e. created from [`shopsys/project-base`](https://github.com/shopsys/project-base)) exclusively.
This repository is maintained by [shopsys/shopsys](https://github.com/shopsys/shopsys) monorepo.

## Documentation

[Documentation](https://docs.shopsys.com/en/latest/) can be found in Shopsys Platform Knowledge Base.

## Installation

The plugin is a Symfony bundle and is installed in the same way:

### Download

First, you download the package using [Composer](https://getcomposer.org/):

```
composer require shopsys/administration
```

## Contributing

Thank you for your contributions to Shopsys Administration package.
Together, we are making Shopsys Platform better.

This repository is READ-ONLY.
If you want to [report issues](https://github.com/shopsys/shopsys/issues/new) and/or send [pull requests](https://github.com/shopsys/shopsys/compare),
please use the main [Shopsys repository](https://github.com/shopsys/shopsys).

Please, check our [Contribution Guide](https://github.com/shopsys/shopsys/blob/HEAD/CONTRIBUTING.md) before contributing.

## Support

What to do when you are in troubles or need some help?
The best way is to join our [Slack](https://join.slack.com/t/shopsysframework/shared_invite/zt-11wx9au4g-e5pXei73UJydHRQ7nVApAQ).

If you want to [report issues](https://github.com/shopsys/shopsys/issues/new), please use the main [Shopsys repository](https://github.com/shopsys/shopsys).
58 changes: 58 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "shopsys/administration",
"type": "library",
"description": "Administration interface for the Shopsys Platform",
"keywords": ["Shopsys Platform", "SSFW", "admin", "administration", "admin panel"],
"license": "proprietary",
"authors": [
{
"name": "Shopsys",
"homepage": "https://www.shopsys.com/"
}
],
"autoload": {
"psr-4": {
"Shopsys\\AdministrationBundle\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\AdministrationBundle\\": "tests/"
}
},
"require": {
"php": "^8.3",
"shopsys/form-types-bundle": "15.0.x-dev",
"shopsys/framework": "15.0.x-dev",
"shopsys/migrations": "15.0.x-dev",
"shopsys/plugin-interface": "15.0.x-dev",
"symfony/config": "^5.4",
"symfony/dependency-injection": "^5.4",
"symfony/form": "^5.4",
"symfony/http-foundation": "^5.4",
"symfony/http-kernel": "^5.4",
"symfony/routing": "^5.4",
"symfony/translation": "^5.4",
"twig/twig": "^3.5.0"
},
"require-dev": {
"phpstan/phpstan": "^1.6.8",
"phpstan/phpstan-doctrine": "^1.3.4",
"phpstan/phpstan-phpunit": "^1.1.1",
"phpstan/phpstan-symfony": "^1.1.8",
"phpunit/phpunit": "^9.5.20",
"shopsys/coding-standards": "15.0.x-dev"
},
"extra": {
"symfony": {
"require": "^5.4",
"docker": false
}
},
"config": {
"allow-plugins": {
"symfony/flex": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
8 changes: 8 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
parameters:
treatPhpDocTypesAsCertain: false
includes:
- vendor/phpstan/phpstan-doctrine/extension.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-symfony/extension.neon
- vendor/phpstan/phpstan-symfony/rules.neon
- vendor/shopsys/coding-standards/extension.neon
Empty file added src/Controller/.gitkeep
Empty file.
35 changes: 35 additions & 0 deletions src/DependencyInjection/ShopsysAdministrationExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

declare(strict_types=1);

namespace Shopsys\AdministrationBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

class ShopsysAdministrationExtension extends Extension implements PrependExtensionInterface
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container): void
{
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.yaml');
}

/**
* {@inheritdoc}
*/
public function prepend(ContainerBuilder $container): void
{
$container->prependExtensionConfig('doctrine_migrations', [
'migrations_paths' => [
'Shopsys\AdministrationBundle\Migrations' => __DIR__ . '/../Migrations',
],
]);
}
}
Empty file added src/Migrations/.gitkeep
Empty file.
13 changes: 13 additions & 0 deletions src/Resources/config/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
_defaults:
autoconfigure: true
autowire: true
public: false

Shopsys\AdministrationBundle\:
exclude: '../../{Command,Controller,DependencyInjection,Form,Migrations,Resources,Twig}'
resource: '../../**/*{Enum,Facade,Factory,Repository,Transformer}.php'

Shopsys\AdministrationBundle\Controller\:
resource: '../../Controller/'
tags: ['controller.service_arguments']
Empty file added src/Resources/views/.gitkeep
Empty file.
11 changes: 11 additions & 0 deletions src/ShopsysAdministrationBundle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace Shopsys\AdministrationBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class ShopsysAdministrationBundle extends Bundle
{
}
Empty file added tests/.gitkeep
Empty file.

0 comments on commit 3d64e9b

Please sign in to comment.