Download the PHP package openpsa/midgard-portable without Composer

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

midgard-portable Code Coverage

This library provides an ActiveRecord ORM built on top of Doctrine 2 and is modeled after the Midgard API.

In a Nutshell

You can define your entities in XML (usually referred to MgdSchema):

Running midgard-portable schema will create a corresponding database table and a PHP class (usually referred to as the MgdSchema class). You can use this to read from and write to the DB:

midgard-portable automatically adds metadata to the record:

It also supports soft-delete:

You can query entries like this:

Or, you simply use Doctrine's builtin QueryBuilder.

Then, there's object trees, links, working with files, import/export of data and lots more, but until there is time to document all that, you'll have to read the source to find out (the unit tests might also be a good starting point).

Usage

To include midgard-portable in your application, simply require it in your composer.json. You can bootstrap the adapter like this:

Change the parameters as required. After calling connection::initialize(), you can interact with the database through Midgard API as outlined above.

CLI tools

midgard-portable needs to generate entity classes as well as ClassMetadata and Proxy classes for Doctrine. In development setups, this is done automatically on each request. For production installations, you can run the following CLI command:

It works very much like the midgard-schema tool of old, i.e. it will generate midgard_object classes based on MgdSchema XML files, the accompanying mapping data and proxy classes, and also create/update the corresponding database tables. You will need to run this once during initial installation, and then again each time the MgdSchemas change.

You can also use Doctrine's CLI runner and all the functionality it provides if you create a file under the name cli-config.php, with this content:


All versions of midgard-portable with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
doctrine/orm Version ^2.13
doctrine/dbal Version ^3.5
symfony/console Version >=3.0.0
symfony/cache Version >=4.4.0
monolog/monolog Version ^1.15 || ^2.0
ext-xml Version *
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 openpsa/midgard-portable contains the following files

Loading the files please wait ....