Download the PHP package pomm/pomm-service-provider without Composer

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


PommServiceProvider for Silex

This is the Pomm service provider for the Silex microframework.

Installation

There are numerous ways to install PommServiceProvider. The sortest one being to use this script. It will create directory tree structure and your composer.json file (See Composer section below).

Composer

Composer is the easiest way to get the Service provider installed and running. Just add your composer.json the following:

"pomm/pomm-service-provider":    "dev-master"

in the require section. Invoke « composer.phar install » and it should be installed with the Pomm library.

Git submodules

If you use git, use the submodules:

$ mkdir vendor
$ git submodule add git://github.com/chanmix51/PommServiceProvider.git vendor/ghub/PommServiceProvider
$ git submodule add git://github.com/chanmix51/Pomm.git vendor/pomm

Otherwise, you can just download the archive, expand it in a subdirectory and tell the autoloader that GHub\Silex\Pomm namespace is under the src project subdirectory.

Using Pomm Service

It is advised to split your application in 3 files:

bootstrap.php Where extensions are loaded and configured application.php Where you define your controllers. generate_model.php The CLI tool to scan the postgresql's schemas and generate the model files.

This way, the index.php file is reduced to its simplest expression:

<?php #index.php

require(__DIR__.'/../application.php');

$app->run();

The application.php itself is just composed by your controllers. It includes the configuration by requiring the bootstrap.php file:

<?php #bootstrap.php

require_once __DIR__.'/vendor/autoload.php';

$app = new Silex\Application();

// EXTENSIONS
...
# pomm
$app->register(
    new Pomm\Silex\PommServiceProvider(),
    array(
        'pomm.class_path' => __DIR__.'/vendor/pomm',
        'pomm.databases' => array(
            'default' => array(
                'dsn' => 'pgsql://user:pass@host:port/dbname',
            )))
        );

The PommServiceProvider class takes the following arguments:

The extension will instanciate the Database class for each of your connection which does not mean it will open connections. Connections are opened if you perform a statement in a connection. If you want to use your own Database class, provide its full path in the class parameter. By default, this parameter is set to Pomm\Connection\Database.

In the example above, we register a Model namespace to the autoloader so generated files would be places in Model\DbName\SchemaName namespace.

Generating Map files

Create the following script:

<?php #generate_model.php

require __DIR__.'/bootstrap.php';

$scan = new Pomm\Tools\ScanSchemaTool(array(
    'schema' => 'YOUR SCHEMA',
    'database' => $app['pomm']->getDatabase(),
    'prefix_dir' => __DIR__.'/Model',
    ));
$scan->execute();

All versions of pomm-service-provider with dependencies

PHP Build Version
Package Version
Requires pomm/pomm Version 1.2.*
silex/silex Version ~1.0
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 pomm/pomm-service-provider contains the following files

Loading the files please wait ....