-
Notifications
You must be signed in to change notification settings - Fork 1
PackageSystem
Cleared for editing
This page has the goal to collect ideas about the architecture and specific functionality of the package system. In specific it is important to know how a package is structured (e.g. XML files, source files) and how such a package is installed.
There is no classical package structure. A 'package' is basically just an entry in an XML file with some meta information including but not limited to composer-relevant info, description, license.
The system gets this information with a monitored XML file that only contains tested and approved packages.
The distribution will work as a virtual bundle that requires all installed packages. That way we can use Composer even though it can only handle requirements.
In the following you will see the steps for the installation (user perspective).
- Search for package
- Click on install
- Package requirements check
- Download the package
- Performing the installation
- Fire successful installation event
- Finish installation and show success message to admin
- Optional packages offer (packages can offer recommended/optional packages, here you can select them for installation)
- Optional: Rate installation experience and give your opinion (will be used to improve the product)
Step 8 might not be implemented as it could require an own dependency management which will be avoided.
- Download the bundle
- Adding the bundle to the requirements of the virtual bundle
- Install bundle (composer)
- Adding the bundle to the plugin directory
- Finish the installation
The system doesn't use it's own dependency management. Instead it will use Composer for that purpose.
To circumvent the problematic alteration of the AppKernel file, it will be modified in the web-platform-edition to dynamically include additional bundles. For that purpose it will search through a plugin directory which contains an index file and various definition files that begin with a numeric index. The index file contains the highest not yet used integer and will be updated whenever a new bundle file is added into the directory.
The integer from the index file is taken to form the new filename. It starts with the integer, followed by an underscore, followed by the Composer identifier of the bundle. The slash is translated to an underscore.
The default contents of this plugin directory are the bundles that are shipped with the 2martens Web Platform Edition and by default enabled.
This way is the cleanest one to achieve our goals. The downside is that you MUST use the 2martens Web Platform Edition to use the automatic bundle registration. In the Symfony Standard Edition (with the Web Platform installed) you can install packages from ACP. but they won't be loaded upon the next request. You have to manually edit the AppKernel file to register them.
The installation process contains several areas. The first area contains predefined forms and pages before the actual installation. Next is the installation via Composer. Last is a phase which shows predefined forms and pages again.
There will be one official package server that provides an XML file with all approved packages. To add a package here, a formal addition process will be developed. For this process a package.xml will be used. The information of this file will be added to the package server xml on approval. Admins can search the available packages through the ACP.