Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Surkov committed Aug 28, 2021
1 parent 26bc324 commit 8f80a6a
Show file tree
Hide file tree
Showing 172 changed files with 656 additions and 651 deletions.
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 3-Clause BSD License
Copyright © 2021 DissonancePHP.
Copyright © 2021 SymbioticPHP.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
Expand All @@ -11,7 +11,7 @@ met:
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of DissonancePHP nor the names of its
* Neither the name of SymbioticPHP nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

Expand Down
76 changes: 40 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Dissonance Web (MVP, BETA-PRE-ZERO EDITION)
# Symbiotic Web (MVP, BETA-PRE-ZERO EDITION)
### Описание
**Фреймфорк создан с целью упростить интеграцию независимых небольших приложений в другие CMS и фреймворки, а также для расширения функциональности пакетов для композера.**

Expand Down Expand Up @@ -55,11 +55,11 @@

## Установка
```
composer require dissonance/full
composer require symbiotic/full
```
Сразу ставьте и пакет для разработки
```
composer require dissonance/develop
composer require symbiotic/develop
```

## Запуск
Expand All @@ -68,14 +68,14 @@ composer require dissonance/develop

Если вы используете уже фреймворк, то необходимо включить режим симбиоза в конфиге
```php
$config['symbiosis'] = true;
$config['symbiotic'] = true;
```
##### Инициализация
```php
$basePath = dirname(__DIR__);// корневая папка проекта
include_once $basePath . '/vendor/autoload.php';

include $basePath.'/vendor/dissonance/full/src/dissonance.php';
include $basePath.'/vendor/symbiotic/full/src/symbiotic.php';

// Дальше может идти код инициализации и отработки другого фреймворка...
//....
Expand All @@ -91,40 +91,44 @@ include_once $basePath. '/vendor/autoload.php';

$config = [
'debug' => true,
'symbiosis' => true, // Режим симбиоза, если включен и фреймворк не найдет обработчик,
'symbiotic' => true, // Режим симбиоза, если включен и фреймворк не найдет обработчик,
// то он ничего не вернет и основной фреймворк смодет сам обработать запрос
'default_host' => 'localhost',// для консоли , но ее пока нет
'uri_prefix' => 'dissonance', // Префикс в котором работет фреймворк, если пустой то работае от корня
'uri_prefix' => 'symbiotic', // Префикс в котором работет фреймворк, если пустой то работае от корня
'base_path' => $basePath, // базовая папка проекта
'assets_prefix' => '/assets',
'storage_path' => $basePath . '/storage', // Если убрать то кеш отключится
'packages_paths' => [
$basePath . '/vendor', // Папка для приложений
],
'bootstrappers' => [
\Dissonance\Develop\Bootstrap\DebugBootstrap::class,/// debug only
\Dissonance\Core\Bootstrap\EventBootstrap::class,
\Dissonance\SimpleCacheFilesystem\Bootstrap::class,
\Dissonance\Packages\PackagesLoaderFilesystemBootstrap::class,
\Dissonance\Packages\PackagesBootstrap::class,
\Dissonance\Packages\ResourcesBootstrap::class,
\Dissonance\Apps\Bootstrap::class,
\Dissonance\Http\Bootstrap::class,
\Dissonance\Http\Kernel\Bootstrap::class,
\Dissonance\View\Blade\Bootstrap::class,
],
'providers' => [
\Dissonance\Http\Cookie\CookiesProvider::class,
\Dissonance\Routing\SettlementsRoutingProvider::class,
\Dissonance\Session\NativeProvider::class,
],
'bootstrappers' => [
\Symbiotic\Develop\Bootstrap\DebugBootstrap::class,/// debug only
\Symbiotic\Bootstrap\EventBootstrap::class,
\Symbiotic\SimpleCacheFilesystem\Bootstrap::class,
\Symbiotic\PackagesLoaderFilesystem\Bootstrap::class,
\Symbiotic\Packages\PackagesBootstrap::class,
\Symbiotic\Packages\ResourcesBootstrap::class,
\Symbiotic\Apps\Bootstrap::class,
\Symbiotic\Http\Bootstrap::class,
\Symbiotic\HttpKernel\Bootstrap::class,
\Symbiotic\CacheRouting\Bootstrap::class,
\Symbiotic\ViewBlade\Bootstrap::class,
],
'providers' => [
\Symbiotic\Http\Cookie\CookiesProvider::class,
\Symbiotic\SettlementsRouting\Provider::class,
\Symbiotic\Session\NativeProvider::class,
],
'providers_exclude' => [
\Symbiotic\Routing\Provider::class,
]
];

// Базовая постройка контейнера
$core = new \Dissonance\Core\Core($config);
$core = new \Symbiotic\Core($config);
// Или через билдер с кешем
$cache = new Dissonance\SimpleCacheFilesystem\SimpleCache($basePath . '/storage/cache/core');
$core = (new \Dissonance\Core\ContainerBuilder($cache))
$cache = new Symbiotic\SimpleCacheFilesystem\SimpleCache($basePath . '/storage/cache/core');
$core = (new \Symbiotic\CachedContainer\ContainerBuilder($cache))
->buildCore($config);

// Запуск
Expand All @@ -146,20 +150,20 @@ $core->run();
},
// Добавляем описание пакета для фреймворка
"extra": {
"dissonance": {
"symbiotic": {
"id": "wso.my_package_id", // ID пакета формируется на сайте фреймворка, но можно локально любой ставить
// Описание приложения, пакет может и не иметь секцию приложения, а быть лишь расширением
"app": {
"id": "my_package_id", // Id приложения, указывается без префикса родительского приложения
"parent_app": "wso", // ID родительсского приложения, если приложение плагин
"name": "WSO Users exporter", // Имя приложения, используется в списке приложений и меню
"routing": "\\\\MyVendor\\\\MySuperPackage\\\\Routing", // Класс роутинга, не обязательно
"controllers_namespace": "\\\\Dissonance\\\\Develop\\\\Controllers", // Базовый неймспейс для контроллеров, не обязательно
"controllers_namespace": "\\\\Symbiotic\\\\Develop\\\\Controllers", // Базовый неймспейс для контроллеров, не обязательно
"version": "1.0.0", // Версия, не обязательно, плагины могут проверять и подстаиваться под изменения
"providers": [ // Провайдеры приложения, не обязательно
"MyVendor\\\\MySuperPackage\\\\Providers\\\\AppProvider"
],
// Не обязательно! Наследник от \\Dissonance\\App\\Application
// Не обязательно! Наследник от \\Symbiotic\\App\\Application
"app_class": "MyVendor\\\\MySuperPackage\\\\MyAppContainer"
},

Expand Down Expand Up @@ -192,7 +196,7 @@ $core->run();
// ...
},
"extra": {
"dissonance": {
"symbiotic": {
"id": "my_super_theme_2",
// Можно указать что то одно или все вместе
"public_path": "assets", // Папка со статикой, относительно корня пакета
Expand Down Expand Up @@ -222,11 +226,11 @@ $core->run();
// ...
},
"extra": {
"dissonance": {
"symbiotic": {
"app": {
"id": "my_package_id", // Id приложения
"routing": "\\\\MyVendor\\\\MySuperPackage\\\\Routing",
"controllers_namespace": "\\\\Dissonance\\\\Develop\\\\Controllers"
"controllers_namespace": "\\\\Symbiotic\\\\Develop\\\\Controllers"
},
}
}
Expand Down Expand Up @@ -256,13 +260,13 @@ vendor/
-/composer.json
```

При необходимости можно поселить все классы для приложения фреймворка в подпапку src/Dissonance. Так не будет путаницы с функционалом вашего пакета.
При необходимости можно поселить все классы для приложения фреймворка в подпапку src/Symbiotic. Так не будет путаницы с функционалом вашего пакета.

```text
vendor/
-/my_vendor
-/my_package_name
-/dissonance
-/symbiotic
-/assets - Статика
-/js
-/css
Expand All @@ -271,7 +275,7 @@ vendor/
-/views
-/...
-/src - Ваш пакет
-/Dissonance
-/Symbiotic
-/Http
-/Cоntrollers
-/...
Expand Down
62 changes: 31 additions & 31 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
{
"name": "dissonance/full",
"description": "Полная сборка пакетов фреймворка Dissonance.",
"name": "symbiotic/full",
"description": "Полная сборка пакетов фреймворка Symbiotic.",
"license": "BSD-3-Clause",
"version": "1.1.1",
"authors": [{
"name": "Surkov Sergey",
"role": "creator"
}],
"keywords": [
"dissonance",
"symbiotic",
"composer apps framework",
"dissonance web"
"symbiotic web"
],
"require": {
"php": ">=7.2",
"php": ">=8.0",
"psr/http-server-handler": "1.0.*",
"psr/http-server-middleware": "1.0.1",
"psr/http-factory": "1.0.1",
"psr/event-dispatcher": "1.0.*",
"psr/container": "^1.0",
"psr/simple-cache": "1.*",
"nyholm/psr7": ">=1.3.2",
"dissonance/ui_http_kernel": "1.*",
"symbiotic/ui_http_kernel": "1.*",
"ext-json": "*"
},
"autoload": {
"psr-4":{
"Dissonance\\": "src/"
"Symbiotic\\": "src/"
},
"files": [
"src/core_helpers.php",
"src/http_kernel_helpers.php"
]
},
"suggest": {
"dissonance/full-single": "Полная сборка в одном файле",
"dissonance/develop": " Dev app"
"symbiotic/full-single": "Полная сборка в одном файле",
"symbiotic/develop": " Dev app"
},
"replace": {
"dissonance/apps": "1.0.*",
"dissonance/cached-container": "1.0.*",
"dissonance/container": "1.0.*",
"dissonance/container-contracts": "1.0.*",
"dissonance/container-traits": "1.0.*",
"dissonance/core": "1.0.*",
"dissonance/event": "1.0.*",
"dissonance/http": "1.0.*",
"dissonance/http-kernel": "1.0.*",
"dissonance/http-middlewares": "1.0.*",
"dissonance/http-response-mutable": "1.0.*",
"dissonance/mimetypes-mini": "1.0.*",
"dissonance/packages": "1.0.*",
"dissonance/packages-contracts": "1.0.*",
"dissonance/routing": "1.0.*",
"dissonance/routing-cache": "1.0.*",
"dissonance/routing-settlements": "1.0.*",
"dissonance/simple-cache-filesystem": "1.0.*",
"dissonance/http-cookie": "1.0.*",
"dissonance/contracts": "1.0.*",
"dissonance/session-native": "1.0.*",
"dissonance/view-blade": "1.0.*"
"symbiotic/apps": "1.0.*",
"symbiotic/cached-container": "1.0.*",
"symbiotic/container": "1.0.*",
"symbiotic/container-contracts": "1.0.*",
"symbiotic/container-traits": "1.0.*",
"symbiotic/core": "1.0.*",
"symbiotic/event": "1.0.*",
"symbiotic/http": "1.0.*",
"symbiotic/http-kernel": "1.0.*",
"symbiotic/http-middlewares": "1.0.*",
"symbiotic/http-response-mutable": "1.0.*",
"symbiotic/mimetypes-mini": "1.0.*",
"symbiotic/packages": "1.0.*",
"symbiotic/packages-contracts": "1.0.*",
"symbiotic/routing": "1.0.*",
"symbiotic/routing-cache": "1.0.*",
"symbiotic/routing-settlements": "1.0.*",
"symbiotic/simple-cache-filesystem": "1.0.*",
"symbiotic/http-cookie": "1.0.*",
"symbiotic/contracts": "1.0.*",
"symbiotic/session-native": "1.0.*",
"symbiotic/view-blade": "1.0.*"
}
}
6 changes: 3 additions & 3 deletions src/Apps/AppConfig.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace Dissonance\Apps;
namespace Symbiotic\Apps;

use Dissonance\Container\{ArrayAccessTrait, ItemsContainerTrait};
use Symbiotic\Container\{ArrayAccessTrait, ItemsContainerTrait};

/**
* Class AppConfig
* @package Dissonance\Apps
* @package Symbiotic\Apps
* @deprecated не нужная прослойка, все есть в самом приложении
*/
class AppConfig implements AppConfigInterface
Expand Down
10 changes: 5 additions & 5 deletions src/Apps/AppConfigInterface.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<?php

namespace Dissonance\Apps;
namespace Symbiotic\Apps;

use Dissonance\Container\ArrayContainerInterface;
use Symbiotic\Container\ArrayContainerInterface;

/**
* Interface AppConfigInterface
*
* @package dissonance/apps-contracts
* @package symbiotic/apps-contracts
*/
interface AppConfigInterface extends ArrayContainerInterface
{
/**
* The app ID is based on its alias and parent ID
* @return string
* @see \Dissonance\Apps\AppsRepository::addApp();
* @see \Symbiotic\Apps\AppsRepository::addApp();
*/
public function getId(): string;

public function getAppName(): string;

/**
* @return string|null
* @uses \Dissonance\Routing\AppRouting
* @uses \Symbiotic\Routing\AppRouting
*/
public function getRoutingProvider(): ?string;

Expand Down
6 changes: 3 additions & 3 deletions src/Apps/Application.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace Dissonance\Apps;
namespace Symbiotic\Apps;

use Dissonance\Container\{DIContainerInterface, SubContainerTrait, ServiceContainerTrait};
use Symbiotic\Container\{DIContainerInterface, SubContainerTrait, ServiceContainerTrait};


/**
* Class Application
* @package Dissonance\App
* @package Symbiotic\App
* @property AppConfigInterface $config
* @property $this = [
* 'config' => new AppConfig()
Expand Down
10 changes: 5 additions & 5 deletions src/Apps/ApplicationInterface.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php

namespace Dissonance\Apps;
namespace Symbiotic\Apps;

use Dissonance\Container\DIContainerInterface;
use Dissonance\Container\ServiceContainerInterface;
use Symbiotic\Container\DIContainerInterface;
use Symbiotic\Container\ServiceContainerInterface;


/**
* Interface ApplicationInterface
* @package dissonance/apps-сontracts
* @package symbiotic/apps-сontracts
*
* @property \Dissonance\Core\Core|ApplicationInterface $app для плагинов контейнером будет роджительское приложение
* @property \Symbiotic\Core\Core|ApplicationInterface $app для плагинов контейнером будет роджительское приложение
*
*/
interface ApplicationInterface extends AppConfigInterface, DIContainerInterface, ServiceContainerInterface
Expand Down
Loading

0 comments on commit 8f80a6a

Please sign in to comment.