Skip to content

Setting up Hydrogen on your server

cyrilmengin edited this page Jun 14, 2012 · 10 revisions

Setting up Hydrogen

Intro

There are several ways to set up a new Hydrogen app, here are a few ways below. Before getting started with anything using hydrogen, you must remember two things. 1. Hydrogen is in alpha and many things are likely to change 2. you must have a clear understanding on php and at least some object oriented programming. If you do not know php, I recommended learning it from http://www.webdevrefinery.com/. Theres a chance you know php, and some oop, but do you know the MVC architecture that Hydrogen is based off of? You can learn the basics of MVC here: http://www.webdevrefinery.com/forums/topic/600-an-introduction-to-mvc-architecture/. The last thing you need to know is the basics of object oriented php, you can learn that here: http://www.webdevrefinery.com/forums/topic/2525-getting-started-with-object-oriented-php/

Method 1

The Kyek Method

Kyek's method for setting up Hydrogen is actually much more in depth than the rest of these guides, it's a bit harder to follow, but you'll learn how to do much more then just set up Hydrogen. You can read that guide here: http://www.webdevrefinery.com/forums/topic/1440-hydrogen-overview, it is recommended you read the entire guide carefully and then ask questions in the forum. You may very well enjoy Kyek's guide a lot, and it may very well be the solution for you; but if you want something else on setting up hydrogen, then keep reading.

Using "Hydrogen-MVC-Starter"

gibbonweb likes this method

Probably the easiest way of starting a Hydrogen-powered project is by using the Hydrogen-MVC-Starter project. This allows you to get started with an existing file structure and fully functional routing and class autoloading out of the box (very useful if, like me, you're a lazy ape who doesn't want to reinvent the wheel all the time). Just follow this recipe:

  1. create a new, empty git repository for your project
  2. download the zip file of Hydrogen-MVC-Starter and extract it to your project (do not commit anything yet!), making sure the hidden .gitmodules and .gitignore files are in place.
  3. run git submodule init and git submodule update from your project root to fetch the latest version of the Hydrogen framework.
  4. open index.php and follow all instructions. Replace every occurence of "myapp" in this file with the name of your project (or whatever directory/app name you choose for your project). Attention: You'll have to change filenames aswell as all occurrences of the word "myapp" inside of the files!
  5. Hydrogen-MVC-Starter is a very basic "blog" site example. You'll find corresponding controllers and models in the appropriate directories inside lib/myapp, which may be a good point to start with. Depending on your needs, you might want to either throw out ArticleController and the corresponding models or develop them in order to get "real" functionality.
  6. Take a look at themes/default and adapt it to your needs.

This might not be the best way to describe this method, regard this as a "temporary" description. Direct any critique to gibbonweb who might no be a good writer, but has successfully set up a few projects using the above method.