readme.ru.md陶器o
composer require symbiotic/full
PHPの最適化なしでホスティングのより速い作業を行うには、1つのファイル共生/フルシングルに組み込みます
このフレームワークは、独立した小さなアプリケーションの他のCMSおよびフレームワークへの統合を簡素化し、作曲家パッケージの機能を拡大するために作成されました。
イデオロギーは、他のフレームワークとのコラボレーションと追加の機能の便利な統合のための小さなアプリケーションの個別のエコシステムです。
多くのパッケージがあり、有用な機能を提供し、独自のビジネスロジックを持ち、時には独自のWebインターフェイスを持つことさえあるパッケージがたくさんあり、個別に書かれたアプリケーションがあります。
Laravelパッケージ、Symfonyバンドル、プラグインとアドオンの形のさまざまなCMSでは、すべてがルーティング、イベント、キャッシュなどの実装を持っています。ララヴェルが別のフレームワークまたはCMSを統合するために書かれたパッケージは、ほとんどの場合問題があり、場合によってはフレームワークの特定の依存関係により不可能です。
アプリケーション開発者自体は、各フレームワークとCMSの適応を作成する必要があります。これにより、多くの問題が発生し、すべてのエコシステムをカバーするわけではありません。
また、そのようなアプリケーションは、システムにさまざまな統合を行う必要があります。
このようなアプリケーションには次のものが含まれます。
このフレームワークは、大量のアプリケーションを使用し、メインフレームワークのサブシステムとして機能するように最適化されています。
各アプリケーションはComposer.jsonファイルに直接追加の説明があるComposerパッケージです。
// If you are already using the framework, then you need to enable the symbiosis mode in the config
// In this mode of operation, the framework will respond only to requests related to it and will not block work for "other" requests.
$ config [ ' symbiosis ' ] = true ;フレームワークは、作曲家からindex.phpに直接添付されています。
$ basePath = dirname ( __DIR__ ); // root folder of the project
include_once $ basePath . ' /vendor/autoload.php ' ;
include $ basePath . ' /vendor/symbiotic/full/src/symbiotic.php ' ;
// Then the initialization code and the work of another framework can go on when the symbiosis mode is enabled...
//.... $laravel->handle();
$ basePath = dirname ( __DIR__ ); // root folder of the project
include_once $ basePath . ' /vendor/autoload.php ' ;
$ config = include $ basePath . ' /vendor/symbiotic/full/src/config.sample.php ' ;
//.. Redefining the configuration array
// Basic construction of the Core container
$ core = new Symbiotic Core Core ( $ config );
/**
* When installing the symbiotic/full package, a cached container is available
* Initialization in this case occurs through the Builder:
*/
$ cache = new Symbiotic Cache FilesystemCache ( $ config [ ' storage_path ' ] . ' /cache/core ' );
$ core = ( new Symbiotic Core ContainerBuilder ( $ cache ))
-> buildCore ( $ config );
// Starting request processing
$ core -> run ();
// Then the initialization code and the work of another framework can go on when the symbiosis mode is enabled...
// $laravel->handle(); composer.jsonファイルのアプリケーション説明の最小スキーム:
{
"name" : " vendor/package " ,
"require" : {
// ...
},
"autoload" : {
// ...
},
"extra" : {
"symbiotic" : {
"app" : {
// Application ID
"id" : " my_package_id " ,
// Routing provider
"routing" : " \ MyVendor \ MySuperPackage \ Routing " ,
// Basic namespace for application controllers
"controllers_namespace" : " \ MyVendor \ MySuperPackage \ Http \ Controllers "
}
}
}
}
{
"name" : " vendor/package " ,
"require" : {
// ...
},
"autoload" : {
// ...
},
// Adding a description of the package for the symbiotic
"extra" : {
"symbiotic" : {
// Package ID
"id" : " my_super_package " ,
// Application description, the package may not have an application section
"app" : {
// Application ID, specified without the prefix of the parent application
"id" : " image_optimizer " ,
// ID of the parent application (optional)
"parent_app" : " media " ,
// Application name, used in the application list and menu
"name" : " Media images optimizer " ,
// Routing class (optional)
"routing" : " \ MyVendor \ MySuperPackage \ Routing " ,
// Basic namespace for controllers (optional)
"controllers_namespace" : " \ Symbiotic \ Develop \ Controllers " ,
// Application providers (optional)
"providers" : [
" MyVendor \ MySuperPackage \ Providers \ AppProvider "
],
// Application container class (optional)
// Heir from \Symbiotic\App\Application
"app_class" : " MyVendor \ MySuperPackage \ MyAppContainer "
},
// Folder with static relative to the package root (will be accessible via the web) (optional)
"public_path" : " assets " ,
// Folder with templates and other resources (not accessible via the Web) (optional)
"resources_path" : " my_resources " ,
// Framework Core Extensions
// Bootstrappers (optional)
"bootstrappers" : [
" MyVendor \ MySuperPackage \ CoreBootstrap "
],
// Providers (optional)
"providers" : [
" MyVendor \ MySuperPackage \ MyDbProvider "
],
// Exclusion of kernel providers (optional)
"providers_exclude" : [
// Exclusion of providers from downloading
// For example, with two packages of the same library, it allows you to exclude unnecessary
],
// Event subscribers (optional)
"events" : {
"handlers" : {
"Symbiotic \ Form \ FormBuilder" : " MyVendor \ MyApp \ Events \ FilesystemFieldHandler " ,
"Symbiotic \ Settings \ FieldTypesRepository" : " MyVendor \ MyApp \ Events \ FieldsHandler " ,
"Symbiotic \ UIBackend \ Events \ MainSidebar" : " MyVendor \ MyApp \ Events \ Menu "
}
},
//Package settings fields (optional)
"settings_fields" : [
{
"title" : " Fields group 1 " ,
"name" : " group_1 " ,
"collapsed" : 0 ,
"type" : " group " ,
"fields" : [
{
"label" : " Field 1 " ,
"name" : " filed_name_1 " ,
"type" : " text "
},
{
"label" : " Select 1 " ,
"name" : " select_1 " ,
"type" : " select " ,
"variants" : {
"value1" : " title1 " ,
"value12" : " title2 "
}
},
{
"label" : " Boolean checkbox " ,
"name" : " debug " ,
"description" : " Debug mode " ,
"type" : " boolean "
}
]
}
],
// Default settings (optional)
"settings" : {
"filed_name_1" : " demo_value " ,
"select_1" : " value12 " ,
"debug" : " 0 "
},
// Console commands (optional)
"commands" : {
"worker" : " MyVendor \ MyApp \ Commands \ Worker " ,
"stop" : " MyVendor \ MyApp \ Commands \ Stop "
}
}
}
}
アプリケーションを構成する場合、staticsとリソースのパスを指定することはできません。デフォルトのパスが定義されます。
テンプレートは、常にリソースフォルダーの/view/ディレクトリにある必要があります!
フレームワークのすべてのパッケージは、いくつかの論理カテゴリに分類できます。
任意のパッケージは、上記のすべてを組み合わせることができます。
明確な必須構造はありません。任意の構造を使用できます。 Composerパッケージ(ライブラリ)に基づいてアプリケーションを作成している場合は、混乱を避けるために、アプリケーションのすべてのコードをsrc/Symbioticフォルダーに配置することをお勧めします。
vendor/
-/my_vendor
-/my_package_name
-/assets - Public files
-/js
-/css
-/...
-/resources - Resources
-/views - View templates
-/...
-/src - php code
-/Http
-/Cоntrollers
-/...
-/Services
...
-/Routing.php
-/composer.json