Download the PHP package propel/propel-service-provider without Composer
On this page you can find all versions of the php package propel/propel-service-provider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package propel-service-provider
PropelServiceProvider
The PropelServiceProvider provides integration with Propel.
Parameters
-
propel.path (optional): The path in which Propel.php will be found. Usually, for PEAR installation, it is
propel
while for Git installation it isvendor/propel/runtime/lib
. Default is/full/project/path/vendor/propel/propel1/runtime/lib
. -
propel.config_file (optional): The name of Propel configuration file with full path. Default is
/full/project/path/build/conf/projectname-conf.php
- propel.model_path (optional): Path to where model classes are located.
Default is
/full/project/path/build/classes
It's strongly recommanded to use absolute paths for previous options.
Services
No service is provided.
Propel configures and manages itself by using static methods, so no service is registered into Application. Actually, the PropelServiceProvider class initializes Propel in a more "Silex-ian" way.
Registering
Make sure you place a copy of Propel in vendor/propel
or install it through PEAR, or Composer.
For more informations consult the Propel documentation:
Alternatively, if you 've installed Propel by Git in vendor/propel
and
you built your model with default Propel generator options:
We can consider "default" Propel generator options:
-
Put
build.properties
andschema.xml
files into the main directory project, usually where fileindex.php
is located. - In
build.properties
file, define onlypropel.database
,propel.project
andpropel.namespace.autopackage
properties.
Usage
You'll have to build the model by yourself. According to Propel documentation, you'll need three files:
-
schema.xml
which contains your database schema; -
build.properties
more information below; runtime-conf.xml
which contains the database configuration.
Use the propel-gen
script to create all files (SQL, configuration, Model classes).
By default, the PropelServiceProvider relies on the Silex autoloader you have to configure to load
model classes. Of course, the Silex autoloader needs the model to be built with namespaces,
so be sure to set this property into the build.properties
file:
If you plan to build your model without using namespaces, you need to force Propel to use
its internal autoloader. Do this by setting the option propel.internal_autoload
to true
.
For more information, consult the Propel documentation.