Download the PHP package srag/dic without Composer

On this page you can find all versions of the php package srag/dic. 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 dic

srag/dic Library for ILIAS Plugins

Use all ILIAS globals in your class

This project is licensed under the GPL-3.0-only license

Usage

Composer

First add the following to your composer.json file:

And run a composer install.

If you deliver your plugin, the plugin has it's own copy of this library and the user doesn't need to install the library.

Tip: Because of multiple autoloaders of plugins, it could be, that different versions of this library exists and suddenly your plugin use an older or a newer version of an other plugin!

So I recommand to use srag/librariesnamespacechanger in your plugin.

ILIAS 7 core ilCtrl patch

For make some plugins work with ilCtrl in ILIAS 7, you may need to patch the core, before you update the plugin (At your own risk)

Start at the plugin directory

Use trait

Declare your class like follow:

ilXPlugin is the name of your plugin class.

Use

You can now access the DIC interface, in instance and in static places:

For instance you can access the ilCtrl global like:

You can access the plugin interface, in instance and in static places:

The plugin interface has the follow methods:

For plugin dir use:

For output HTML or GUI use:

For output JSON:

For get HTML of GUI:

For get a template use:

For translate use:

Hints:

If you really need the ILIAS plugin object use but avoid this:

You can access ILIAS version informations, in instance and in static places:

If you really need DICTrait outside a class (For instance in dbupdate.php), use DICStatic::dic() or DICStatic::plugin(ilXPlugin::class).

Clean up

You can now remove all usages of ILIAS globals in your class and replace it with this library. Please avoid to store in variables or class variables.

Database

This library delivers also a custom ilDB decorator class with spec. functions, restricted to PDO (Because to make access more core functions), access via self:.dic()->database()

If you realy need to access to original ILIAS ilDB instance, use self:.dic()->databaseCore() instead

Native AutoIncrement (MySQL) / Native Sequence (PostgreSQL)

Use auto increment on a spec. field (in dbupdate.php):

Reset auto increment:

Drop auto increment table (Needed for PostgreSQL) (in ilXPlugin uninstaller):

Store (In repository)

Automatic factory (In repository)

Create or update table

Same thing like ILIAS ActiveRecord: If the table not exists, create it, otherwise add missing columns

Multiple insert

PluginVersionParameter

Force reload css or js files on a plugin update (Browser Cache)

Optimal, it's also possible to pass a second URL which used if ILIAS Dev-Mode is enabled (For instance non-min version)

Requirements


All versions of dic with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
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 srag/dic contains the following files

Loading the files please wait ....