Readme.ru.md рскоedit описан masuk
composer require symbiotic/full
Untuk pekerjaan yang lebih cepat pada hosting tanpa optimasi PHP, bangun dalam satu file simbiotik/full-single
Kerangka kerja ini dibuat untuk menyederhanakan integrasi aplikasi kecil independen ke dalam CM dan kerangka kerja lainnya, serta untuk memperluas fungsionalitas paket komposer.
Ideologi adalah ekosistem terpisah dari aplikasi kecil untuk kolaborasi dengan kerangka kerja lainnya dan integrasi fungsionalitas tambahan yang nyaman.
Ada banyak paket dan aplikasi tertulis secara terpisah yang memberikan fungsionalitas yang bermanfaat, memiliki logika bisnis sendiri dan kadang -kadang bahkan memiliki antarmuka web mereka sendiri yang terpisah.
Dalam paket Laravel, dalam bundel simfony, dalam berbagai CM dalam bentuk plugin dan add-on, semuanya memiliki implementasi rute, peristiwa, caching, dll. Paket yang ditulis untuk Laravel untuk mengintegrasikan kerangka kerja atau CMS lain akan bermasalah dalam kebanyakan kasus, dan dalam beberapa kasus tidak mungkin karena ketergantungan tertentu pada kerangka kerja.
Pengembang aplikasi sendiri harus menulis adaptasi untuk setiap kerangka kerja dan CMS, yang menciptakan banyak masalah dan tidak mencakup semua ekosistem.
Juga, aplikasi semacam itu harus melakukan berbagai integrasi ke dalam sistem:
Aplikasi semacam itu meliputi:
Kerangka kerja ini dioptimalkan untuk bekerja dengan sejumlah besar aplikasi, serta bekerja sebagai subsistem untuk kerangka kerja utama.
Setiap aplikasi adalah paket komposer, dengan deskripsi tambahan langsung di file 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 ;Kerangka kerja dilampirkan dari komposer langsung ke index.php Anda.
$ 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(); Skema minimum deskripsi aplikasi dalam file 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 "
}
}
}
}
Saat mengkonfigurasi aplikasi, Anda tidak dapat menentukan jalur untuk statika dan sumber daya, maka jalur default akan ditentukan.:
Templat harus selalu ada di /view/ direktori di folder sumber daya!
Semua paket untuk kerangka ini dapat dibagi menjadi beberapa kategori logis:
Paket apa pun dapat menggabungkan semua hal di atas.
Tidak ada struktur wajib yang jelas, Anda dapat menggunakan siapa pun. Jika Anda membuat aplikasi berdasarkan paket komposer (perpustakaan), untuk menghindari kebingungan, disarankan untuk meletakkan semua kode untuk aplikasi di folder 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