Download the PHP package totara/installer without Composer

On this page you can find all versions of the php package totara/installer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package installer

Totara Composer Installer Plugin

Unit Tests

A Composer plugin that installs Totara plugins into the correct location inside a Totara codebase.

Totara has a fixed directory layout: a block lives under server/blocks, a local plugin under server/local, an authentication plugin under server/auth, and so on. Composer, by default, would drop every dependency into vendor/. This plugin overrides that behaviour so that a package declaring a Totara plugin type is placed where Totara expects to find it, ready to be detected and upgraded by the Totara plugin system.

In addition to placing the server-side code, the plugin understands the Totara UI (TUI) client convention: if a package ships a client component it is moved into the shared client/component tree during installation, and cleaned up again on uninstall. A lock file (totara-client.lock) records what was installed so that updates and removals can be handled reliably.

Installing

Add the plugin to the Totara project (the codebase you are installing plugins into):

Composer plugins must be allowed to run, so the project's composer.json should also list this plugin under config.allow-plugins.

Declaring a package so it uses this installer

For a package to be handled by this installer it must set its type in composer.json to totara-{plugintype}, where {plugintype} is a recognised Totara plugin type. This type value is the single most important field: it is how the installer recognises the package and decides where the code belongs. A package without a totara- type is ignored and installed by Composer in the default way.

The plugin type maps to a fixed location, with {name} substituted (see Install location and naming below). A few examples:

type Install location
totara-block server/blocks/{name}
totara-local server/local/{name}
totara-mod server/mod/{name}
totara-tool server/admin/tool/{name}
totara-auth server/auth/{name}
totara-weka server/lib/editor/weka/extensions/{name}

The full list of supported types and their locations is defined in src/installers/DropInLocations.php. If a package uses a totara- type that is not in this list it will not be installed.

Install location and naming

The {name} segment of the install path is, in order of preference:

  1. the value of extra.installer-name in the package's composer.json, if set; or
  2. the package name with its vendor prefix removed (e.g. totara/block_certificates becomes block_certificates).

The example above installs to server/lib/editor/weka/extensions/ai_assistant.

The .client directory

A Totara plugin may ship a single TUI client component alongside its server-side code. This is done by including a .client directory in the root of the package.

When a package is installed or updated, the installer looks for a .client directory. If one is present, its contents are placed at:

{name} here is taken from the component field of the .client/tui.json file (see below). By convention this matches the package name without its vendor prefix, but the value the installer actually uses is the one declared in tui.json — it is independent of extra.installer-name, which only affects the server-side path.

A package may provide at most one client component. The .client directory is moved as a whole, so it cannot describe more than a single TUI component.

Contents of .client

The .client directory should contain:

For example, a package installed at server/local/cpd_diary with a .client directory whose tui.json declares "component": "local_cpd_diary" results in its client component being installed to client/component/local_cpd_diary.

Symlinking for development

When a package is installed from source as a symlink (for example with composer install --prefer-source against a path repository), the client component is symlinked rather than copied, so local edits are picked up immediately. Forcing a symlink can be opted into per developer with the TOTARA_DEV_SYMLINK environment variable:

The lock file

Each time a client component is installed, the installer records it in totara-client.lock at the root of the project (the component name, the source path, and the destination path). This lets the installer remove the correct client/component directory when the package is updated or uninstalled. The file is managed automatically and should not be edited by hand.


All versions of installer with dependencies

PHP Build Version
Package Version
Requires composer-plugin-api Version ^2.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package totara/installer contains the following files

Loading the files please wait ...