views:

61

answers:

4

I have a php application ( http://github.com/tchalvak/ninjawars ), essentially a php-based webgame that I run at http://ninjawars.net . I frequently configure and install the app for myself for localhost development, and it's a somewhat trial-and-error hacked-up process. Now that I've open sourced the app, I've got some users wishing to install it and make edits, submit patches, etc, and I want to make that as simple as I can for them.

I've heard of Ruby Gems, which I take to be a kind of package management system for ruby apps. Is there anything useful like that for php? Otherwise, what should I do to make installing as simple as I can?

Right now I think that a general idea of the install process may be as simple as:

All Deployments
---------------
1. Copy a live database (probably the easiest) or run any outstanding migrations off of a skeleton database.
2. Set permissions in pg_hba for the database, host, and user to match your configuration


Manually from within the /ninjawars/ folder of your working copy
-----------------------
1. ln -s docs/harkSAMPLEhtaccess deploy/www/.htaccess
3. ln -s docs/tchalvakSAMPLEresources.php deploy/resources.php
4. mkdir -p deploy/resources/logs
6. mkdir deploy/templates/compiled
7. chmod 777 deploy/templates/compiled

5. configure a virtualhost in apache (should be optional, this may be able to be handled by the .htaccess, I'm not sure)

So the biggies are chmodding, copying the database, and editing a virtualhost.

Simplifying that as much as I can on linux would be great, even more so simplifying it on windows as well (that unfamiliar land where many of my users currently reside). Suggestions?

+1  A: 

For linux make an install.sh script file and tell people to chmod +x ./install.sh it then execute or double click it. That file would be some prompts for mysql username and password to use with mysql -u root -p -D db_name < ./db_install.sql then cp (copy) the install template into /var/www/ or the path they type in at a prompt.

No idea for windows sorry.

Question Mark
A: 

for linux, you can create a rpm or similar

Itay Moav
+2  A: 

PHP PHAR might be useful: http://www.php.net/manual/en/intro.phar.php

Tatu Ulmanen
A: 

The best way for your users would be to write an installation routine of your own and bundle it with the application similarly to Drupal, Joomla, etc.

The quickest way would probably to write an installation shell script for linux/osx and a batch script for windows.

Craig Gardner