Jump to content

Making a program to automatically install PHP frameworks


CrimpJiggler

Recommended Posts

Its a pain in the ass setting up frameworks like CakePHP or WordPress repeatedly on your local machine, it would be nice to have a program that automatically sets it up for you. Does a program like this exist? I started making a bash script which automatically installs CakePHP but it turned out to be a lot of work, I don't have the time to do it on my own. What would be cool is if this site had a system where a person starts an editable script, then other users that the person invites are able to edit the script, that way a group of us could pitch in and make new scripts rapidly.

Link to comment
Share on other sites

I do a lot of trial and error to learn how to use the frameworks, and sometimes I install lots of plugins and make lots of modifications so things get confusing. When that happens, I prefer to start a fresh install so I can be sure that plugins or whatever don't interfere with the new things I'm testing. The shell script I made does a fair bit of the work, it sets up the config file, edits the salt and cipher, sets up MySQL databases and installs jquery. It does it all in one go though and doesn't give you options (i.e. some people don't want jquery), I couldn't be bothered making an interface for all that. 

Edited by CrimpJiggler
Link to comment
Share on other sites

there is also phing which can be used as the build language and then a combination of vagrant and chef to setup the dependicies. puphpet.com will do alot of the heavy liftning but the framework part you have to do yourself.

Link to comment
Share on other sites

  • 4 weeks later...

I started learning how to use composer, I read about it numerous times in the past but didn't realise that this is what it does. Does it have built in functions to set the cipher + seed of a new CakePHP project, bootstrap the plugins for you, setup the database, add jquery to webroot/js + include it in layouts/default.ctp etc? I only started learning it recently so I don't know how to use it yet, but the little I do know is gonna make things a whole lot easier for me. An issue I've run into is I don't know how to make it download plugins that don't have composer.json files.  To work around that can you just create your own composer.json file for the plugin, then plug it into composer?  I'll look into phing, thanks. I'm guessing it would be easy to make a script that controls composer and bake to do the heavy lifting and framework part for you.

Edited by CrimpJiggler
Link to comment
Share on other sites

Using CakePHP as an example, the steps I'm talking abot are enabling URL rewriting, chmod 777ing the app/tmp directory, including the plugins in bootstrap.php, setting up a new database + user for the site, enabling jquery etc. All these little things add up and become time consuming. NetBeans has a CakePHP plugin which installs the framework for you and lets you choose which javascript frameworks you wanna install with it and stuff like that, but its still not something that sets the whole thing up for you with the click of a button.

Link to comment
Share on other sites

Vagrant is a popular solution for all these problems. With that said, composer does do much of the heavy lifting. With vagrant, and some puppet or chef configuration files, you can have complete self contained virtual machines you can start or stop as needed. It automates the creation of a VM and all the initialization can be automated.

 

What I really like about it among other things, is that it keeps all that configuration in a shared-nothing environment -- so if you need a complete vanilla LAMP environment with a basic cakephp environment, you could set that up, and tomorrow if you need a 2nd environment, you can simply use the same vagrant file.

 

You do need a fairly beefy machine with plenty of available memory, but Vagrant has packaged and simplified most everything else.

 

For example, I found these 2 vagrant files to look at:

 

https://github.com/FriendsOfCake/vagrant-chef

https://github.com/rehabstudio/vagrant-puppet-cakephp

 

From what I saw there are many more to investigate.

 

Just to be clear, if you had vagrant setup on your workstation, you could grab one of these vagrant file projects, copy the structure to a new project directory you make, change to the directory and vagrant up, and you'd have a full working system where you could iteratively work and develop new code.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.