Download the PHP package xervice/core without Composer
On this page you can find all versions of the php package xervice/core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package core
Xervice: Core
Core classes for Xervice services
Installation
Configuration
You need no configuration to use this package. But you can define the namespaces.
Main Projectnamespace
Usage
You can create your own Xervice packages. For that you have to use a project namespace and create a module directory. In that directory you can use some predefined patterns like Facade, Factory, DependencyProvider, Config and Client.
Structure .
- src
- MyNamespace
- MyModule
- Business
- MyModuleFacade.php
- MyModuleBusinessFactory.php
- Communication
- MyModuleCommunicationFactory.php
- MyModuleDependencyProvider.php (For the communication layer)
- Persistence
- MyModuleReader.php
- MyModuleWriter.php
- MyModuleConfig.php
- MyModuleDependencyProvider.php (For the business layer)
- Business
- MyModule
- MyNamespace
If you don't need one of these classes, you can remove them.
To use your Module you can use the core locator in your application:
Dynamic Locator
There are two dynamic locator traits:
- DynamicBusinessLocator
- DynamicCommunicationLocator
Layer
Communication -> Business -> Persistence
- In the communication layer you can access the communication factory
- In the communication layer you can access the facade from your BusinessLayer.
- In the BusinessLayer facade you can access the business factory
- In the business factory you can access the reader and writer from the persistence layer
Business and communication have their own dependency container. You can access them from the factory.
Extending
To extend a module, you can create a directory with the same name in an upper level namespace. The order of the namespaces is:
- Core-Namespaces in defined order (Default: Xervice)
- Project namespace in defined order (Default: App)
If you have an module in the Xervice namespace, you can overwrite the classes in your Projectnamespaces. And that logic you can also extend in lower projectnamespaces.
Auto generating
To generate a module you can use the xervicecli package.