A solution to install Propel in a xampp environment
To make spooXe better the milestone is to use Propel in future.
About Propel:
Propel is an open-source Object-Relational Mapping (ORM) for PHP5. It allows you to access your database using a set of objects, providing a simple API for storing and retrieving data.
So i work with xampp and pear is already installed.
First i need is a update from pear. I will first explain how to update pear, install propel and phing and what problems can appear.
Next step i will connect to the database to make a reverse engineering to schema.xml from my existing mysql database. Propel generates PHP classes based on a relational description of your data model. This "schema" uses XML to describe tables, columns and relationships.
Navigate to the root
cd..
Go to your installed php.exe
cd C:\my\path\to\xampp\php
Make a pear upgrade
C:\my\path\to\xampp\php>pear upgrade
This will upgrade phing too
Version is now 2.4.2.1
Open a channel
C:\my\path\to\xampp\php>pear channel-discover pear.propelorm.org
Channel "pear.propelorm.org" is already initialized
Install the Propel Generator with all dependencies
C:\my\path\to\xampp\php>pear install -a propel/propel_generator
Install the Propel Runtime with all dependencies
C:\my\path\to\xampp\php>pear install -a propel/propel_runtime
Version is now 1.5.4
Create a project folder in your htdocs directory
C:\my\path\to\xampp\htdocs>mkdir spooxe
Create a file and name it build.properties in your project folder spooxe with the following parameters
propel.project = spooxe
propel.database = mysql
propel.database.url = mysql:dbname=
propel.database.user =
propel.database.password =
Next step will be a build:
We generate the schema.xml file:
C:\my\path\to\xampp\php>propel-gen C:\my\path\to\xampp\htdocs\spooxe reverse
If you have a message like this:
Fatal error: Call to undefined method domdocument::appendChild()
Comment in your php.ini ;extension=php_domxml.dll
Next step is to generate the PHP model based on the XML schema:
C:\my\path\to\xampp\php>propel-gen C:\my\path\to\xampp\htdocs\spooxe -D
If the output is something like that:
[propel-sql] Processing: schema.xml
Execution of target "sql-template" failed for the following reason: C:\my\path\to\xampp\php\data\propel_generator\build-propel.xml:194:10: Table 'spooxe_bb_for
um_access' does not have a primary key defined. Propel requires all tables to ha
ve a primary key.
Give your tables a primary key
Thats all ;-)
:-o missing ?> from php Tag is not a bug is a feature
Link: http://www.spooxe.com