Your new project should be in its own repository, e.g.
The basic requirements are a
composer.json file in the extension directory root, and your code in a
Composer is used to define:
By default, Composer will install everything in directories in the
vendor/ directory. However, ApiOpenStudio will need to have processors and modules installed separately to use them. So we need to instruct composer to install your package to a separate location.
Composer does not easily allow installation of packages anywhere other than the
(How do I install a package to a custom path for my framework?). There is an implementation for pre-defined package types (see Current Supported Package Types).
However, using composer-installers-extender, we can create custom package installation types. This is taken care of by ApiOpenStudio, and all you need to be aware of is the four package types, the installation location, and it's usage:
"description": "Project description",
Minimum requirements are:
name- this is the namespace and project name of your extension. For example:
"name": "my_extension/my_processor"will be installed in
description- the description of your plugin.
librarywould be the usual type, but can be any of the following:
autoload- this tells the PHP autoloader where to look for your files. The namespacing reference tells composer to search in the
This directory will contain your source class and install/update files, e.g.
This contains the class for your processor.
This is optional and contains the
uninstall() functions. You Only need this if your processor needs additional data or configuration to be done when enabling or disabling it.
This is optional and is only required if there are data updates that need to be done between your package versions.
The main difference between core processors and 3rd party, is the
machineName (in the
By default, core will translate the machineName to the class namespace. However, this is not possible with 3rd party extensions, where the namespace is unknown.
Therefore, to help users know how to call your extension in their resources, please give the machineName the full namespace & class, e.g.
protected array $details = [
'machineName' => 'MyProject\MyProcessor',