Skip to content

Instantly share code, notes, and snippets.

@tbaddade
Last active December 14, 2015 06:19
Show Gist options
  • Save tbaddade/5041321 to your computer and use it in GitHub Desktop.
Save tbaddade/5041321 to your computer and use it in GitHub Desktop.
Propel: Creating an XML Schema from a DB Structure under Mac OS 10.8. and Mamp

Installing Propel

http://propelorm.org/documentation/01-installation.html

Your Structure

your_application/
your_application/…
your_application/vendor/propel/propel_files

build.properties

Copy the file

your_application/vendor/propel/generator/build.properties-sample

in

your_application/

and rename it to

build.properties

Open the file and

search replace it in
# propel.project = bookstore propel.project = your_application
# propel.database = mysql propel.database = mysql
# propel.database.url = mysql:host=$host;dbname=$database propel.database.url = mysql:host=localhost;port=3306;dbname=your_database
# propel.database.user = [db username] propel.database.user = your_username
# propel.database.password = [db password] propel.database.password = your_password

Save the file

Symbolic links

Do you have symbolic link to your MAMP php files? Skip this step

Open the Terminal and go to

/usr/bin/

and rename the files

original name new name
php to php_old
php-config to php-config_old
phpize to phpize_old

Then create symbolic link

sudo ln -s /Applications/MAMP/bin/php/php5.4.4/bin/php php
sudo ln -s /Applications/MAMP/bin/php/php5.4.4/bin/php-config php-config
sudo ln -s /Applications/MAMP/bin/php/php5.4.4/bin/phpize phpize

phing

Do you have installed phing in your MAMP? Skip this step

Install phing, use the PEAR command as follows:

pear channel-discover pear.phing.info
pear install phing/phing
pear install Log

Apache restart

You are twice jumped? Skip this step

Restart the apache with

sudo apachectl restart

and quit the terminal.app (important)

Creating an XML Schema from your Database

Open the Terminal and go to

~/your/path/your_application/

and generate your schema.xml with

vendor/propel/generator/bin/propel-gen . reverse

The schema.xml file is located in the ~/your/path/your_application/ directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment