readme.ru.md рускоеисание
composer require symbiotic/full
สำหรับการทำงานที่เร็วขึ้นในการโฮสติ้งโดยไม่ต้องเพิ่มประสิทธิภาพ PHP ให้สร้างไฟล์ symbiotic/เต็มรูปแบบหนึ่งไฟล์เดียว
เฟรมเวิร์กถูกสร้างขึ้นเพื่อลดความซับซ้อนของการรวมแอปพลิเคชันขนาดเล็กอิสระเข้ากับ CMS และเฟรมเวิร์กอื่น ๆ รวมถึงการขยายการทำงานของแพ็คเกจนักแต่งเพลง
อุดมการณ์เป็นระบบนิเวศแยกต่างหากของแอพพลิเคชั่นขนาดเล็กสำหรับการทำงานร่วมกันกับกรอบอื่น ๆ และการรวมฟังก์ชั่นเพิ่มเติมที่สะดวก
มีแพ็คเกจมากมายและแอปพลิเคชันที่เขียนแยกต่างหากที่ให้ฟังก์ชั่นที่เป็นประโยชน์มีตรรกะทางธุรกิจของตัวเองและบางครั้งก็มีเว็บอินเตอร์เฟสแยกต่างหาก
ในแพ็คเกจ Laravel ใน Symfony Bundles ใน CMS ต่าง ๆ ในรูปแบบของปลั๊กอินและ Add-ons ทั้งหมดมีการใช้งานการกำหนดเส้นทางเหตุการณ์การแคช ฯลฯ แพคเกจที่เขียนขึ้นสำหรับ 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(); รูปแบบขั้นต่ำของคำอธิบายแอปพลิเคชันในไฟล์นักแต่งเพลง 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/ ไดเรกทอรีในโฟลเดอร์ทรัพยากรเสมอ!
แพ็คเกจทั้งหมดสำหรับเฟรมเวิร์กสามารถแบ่งออกเป็นหลายประเภทเชิงตรรกะ:
แพ็คเกจใด ๆ สามารถรวมทั้งหมดข้างต้น
ไม่มีโครงสร้างบังคับที่ชัดเจนคุณสามารถใช้งานใดก็ได้ หากคุณกำลังสร้างแอปพลิเคชันตามแพ็คเกจนักแต่งเพลง (ไลบรารี) เพื่อหลีกเลี่ยงความสับสนขอแนะนำให้ใส่รหัสทั้งหมดสำหรับแอปพลิเคชันในโฟลเดอร์ 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