2017 © Pedro Peláez
 

library propel-service-provider-2

Propel 2 integration for Silex 2.

image

propel/propel-service-provider-2

Propel 2 integration for Silex 2.

  • Monday, June 6, 2016
  • by cristianoc72
  • Repository
  • 3 Watchers
  • 4 Stars
  • 4,722 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 6 % Grown

The README.md

PropelServiceProvider2

Build Status, (*1)

The PropelServiceProvider2 provides Silex 2 integration with Propel, (*2)

Set up

If you want to use PropelServiceProvider2, you will need:, (*3)

  • Silex 2.x
  • PHP 5.5 or greater
  • Composer

To setup the project in your Silex application, you have to rely on composer ; just add the following to your composer.json file:, (*4)

``` json "require": { "propel/propel-service-provider-2": "dev-master" }, (*5)


Then register you model namespace in Composer autoload: ``` json "autoload": { "psr-0": { "Your\\Model\\Namespace": "path/of/your/model" } }

Then install Composer and all dependencies:, (*6)

wget http://getcomposer.org/composer.phar

php composer.phar install

Parameters

  • propel.config_file (optional): The name of Propel configuration file with full path. Default is /full/project/path/generated-conf/config.php

It's strongly recommanded to use absolute paths for previous option., (*7)

Services

No service is provided., (*8)

Propel configures and manages itself by using static methods and its own service container, so no service is registered into Application. Actually, the PropelServiceProvider class initializes Propel in a more "Silex-ian" way., (*9)

Registering

After you've installed PropelServiceProvider and its dependencies, you can register PropelServiceProvider in your application:, (*10)

``` php <?php, (*11)

$app->register(new Propel\Silex\PropelServiceProvider(), array( 'propel.config_file' => DIR.'/path/to/myproject-conf.php' ));, (*12)


Alternatively, if you built your model with default Propel generator options: ``` php <?php $app->register(new Propel\Silex\PropelServiceProvider());

We can consider "default" Propel generator options:, (*13)

  • Put schema.xml files into the main directory project
  • Run vendor/bin/propel model:build command without specify any options about directories and namespace package.

Usage

You'll have to build the model by yourself. According to Propel documentation, you'll need two files:, (*14)

  • schema.xml which contains your database schema;, (*15)

  • runtime-conf.xml which contains the database configuration., (*16)

Use the vendor/bin/propel script to create all files (SQL, configuration, Model classes)., (*17)

vendor/bin/propel model:build
vendor/bin/propel config:convert-xml
vendor/bin/propel sql:build
.................

Propel2 documentation can be found here., (*18)

The Versions

06/06 2016

dev-master

9999999-dev

Propel 2 integration for Silex 2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Cristiano Cinotti
by Rafael Nery

silex propel