full
1.0.0
readme.ru.mdn。
composer require symbiotic/full
對於無PHP優化託管的更快工作,請在一個文件共生/全單位上構建
創建該框架是為了簡化獨立的小應用程序集成到其他CMS和框架中,並擴展了作曲家軟件包的功能。
意識形態是與其他框架合作的小型應用程序的單獨生態系統,並方便地集成了其他功能。
有許多軟件包和單獨編寫的應用程序提供有用的功能,具有自己的業務邏輯,有時甚至具有自己的單獨的Web界面。
在laravel套件中,以symfony捆綁包,各種插件和附加組件形式的各種CMS,都有自己的路由,事件,緩存等的實現。為Laravel編寫的軟件包以集成另一個框架或CMS在某些情況下是有問題的,並且在某些情況下,由於某些依賴性是不可能的。
應用程序開發人員本身必須為每個框架和CMS編寫改編,這會引起很多問題,並且不涵蓋所有生態系統。
此外,此類應用程序必須在系統中進行各種集成:
此類應用程序包括:
該框架已被優化,可與大量應用一起使用,並作為主框架的子系統工作。
每個應用程序都是一個作曲家軟件包,直接在Composer.json文件中具有附加說明。
// 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 "
}
}
}
}
配置應用程序時,您無法為靜態和資源指定路徑,然後將定義默認路徑。
模板應始終在資源文件夾中的/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