Readme.ru
composer require symbiotic/full
Erstellen Sie für schnellere Arbeiten am Hosting ohne PHP
Das Framework wurde erstellt, um die Integration unabhängiger kleiner Anwendungen in andere CMS und Frameworks zu vereinfachen und die Funktionalität der Komponistenpakete zu erweitern.
Die Ideologie ist ein separates Ökosystem kleiner Anwendungen für die Zusammenarbeit mit anderen Rahmenbedingungen und eine bequeme Integration zusätzlicher Funktionen.
Es gibt viele Pakete und separat schriftliche Anwendungen, die nützliche Funktionen liefern, eine eigene Geschäftslogik haben und manchmal sogar über eine eigene Weboberfläche verfügen.
In Laravel-Paketen, in Symfony-Bündeln, in verschiedenen CMs in Form von Plugins und Add-Ons haben alle ihre eigene Implementierung von Routing, Ereignissen, Caching usw. Ein Paket, das für Laravel geschrieben wurde, um einen anderen Rahmen oder CMS in den meisten Fällen aufgrund bestimmter Abhängigkeiten des Rahmens nicht zu integrieren.
Anwendungsentwickler selbst müssen Anpassungen für jedes Framework und CMS schreiben, was viele Probleme verursacht und nicht alle Ökosysteme abdeckt.
Solche Anwendungen müssen auch verschiedene Integrationen in das System durchführen:
Solche Anwendungen umfassen:
Das Framework ist optimiert, um mit einer großen Anzahl von Anwendungen und als Subsystem für den Hauptgerüst zu arbeiten.
Jede Anwendung ist ein Composer -Paket mit einer zusätzlichen Beschreibung direkt in der Datei 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 ;Das Framework wird vom Komponisten direkt an Ihren index.php angehängt.
$ 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(); Das Mindestschema der Anwendungsbeschreibung in der Datei 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 "
}
}
}
}
Bei der Konfiguration der Anwendung können Sie keine Pfade für Statik und Ressourcen angeben, und dann werden Standardpfade definiert .:
Vorlagen sollten sich immer im Ordner Ressourcenordner /view/ Verzeichnis befinden!
Alle Pakete für das Framework können in mehrere logische Kategorien unterteilt werden:
Jedes Paket kann alle oben genannten kombiniert.
Es gibt keine klare obligatorische Struktur, Sie können jemanden verwenden. Wenn Sie eine Anwendung basierend auf dem Composer -Paket (Bibliothek) erstellen, um Verwirrung zu vermeiden, wird empfohlen, den gesamten Code für die Anwendung in den src/Symbiotic -Ordner einzustellen.
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