Skip to content
This repository has been archived by the owner on Jul 28, 2018. It is now read-only.

Commit

Permalink
Updated readme to talk on the different editors used, and some instru…
Browse files Browse the repository at this point in the history
…ctions on how to go about configuring balcms.
  • Loading branch information
balupton committed Jan 5, 2011
1 parent 9d92b62 commit a02668e
Showing 1 changed file with 43 additions and 37 deletions.
80 changes: 43 additions & 37 deletions README.md
Expand Up @@ -19,6 +19,7 @@ BalCMS is different from other CMS's as we can extend it directly by just adding
- JavaScript and CSS Bundling
- Scaffold for CSS (SASS like Syntax for CSS)
- Automatic and Dynamic Image Resizing and Compression
- Edit content using: [TinyMCE](http://tinymce.moxiecode.com/), [Aloha Editor](http://aloha-editor.com/) or [Bespin](http://mozillalabs.com/bespin/).


## Before you Start
Expand Down Expand Up @@ -69,18 +70,18 @@ These installations will provide you with the following requirements:
0. Firstly, we'll need to ensure that your environment is correctly configured. For this run `./cli check-env`. If it does not return any error messages, then you may proceed. If it does then please attend to the messages. If you get the message saying that your git installation is not configured, then the easiest way to configure it is to setup a new free account on [GitHub](https://github.com), create a new repository with them, follow their instructions on using and setting up the repository - once done your git installation will have been configured, so run `./cli check-env` again and make sure that there is nothing else it finds, if it doesn't find anything, then woohoo and we can now proceed to installing BalCMS.

1. Run the following commands:

mkdir mywebsite
cd mywebsite
curl -OL http://github.com/balupton/balcms/raw/master/cli
./cli birth

> Explanation: What we are doing here is creating our new website directory (folder), then fetching our application's [Command Line Interface](http://en.wikipedia.org/wiki/Command-line_interface). Having this file, we can then run `./cli birth`. The `./cli birth` command is actually comprised of three other view important commands which are:

> - `./cli init-new` which initialises our local repository (as a new repository), and grabs the core of the CMS
> - `./cli configure` which fetches the CMS's dependencies and requirements and configures the directory structure
> - `./cli install` which installs the CMS's database, adjusts the permissions and runs any cron jobs.

> We will be using these commands and similar later on.

2. While that is running, your website will need it's own public or private Git Repository.
Expand All @@ -89,9 +90,9 @@ These installations will provide you with the following requirements:
3. Once those commands have run, and your remote git repository is set up. We want to associate our local repository with the remote repository. We do this by copying our remote repository's read+write url, it should look something like this `git@github.com:balupton/balcms.git`. With that we will run the following commands:

git remote add origin {your git repos read/write url} ; make deploy

> Explanation: The second command here `./cli deploy` will send our changes from our development branch to our stable branch, then from the stable branch to the `master` branch. Finally, it'll then send all those changes to our remote repository.

> We want to send our changes to the remote repository as that we can deploy to our remote server (where our website will actually be hosted and accessed). Other benefits are also in case our development environment crashes, we will have a remote backup. The last benefit and perhaps the best one, is that if we are working with other people, it allows us to all collaborate together seamlessly.

3. Once all that is done, you'll now be able to visit your new BalCMS website. So lets navigate to our localhost and the directory we installed it in (e.g. `http://localhost/sites/mywebsite`).
Expand All @@ -106,55 +107,55 @@ The structure of BalCMS is based off the [standard modular zend framework struct
So let's take a look at the structure:

.gitignore - Used to tell Git about the files that we do not want committed to our repository (e.g. cache files)

.htaccess - Used to tell Apache about how requests should be handled

application/
config/

data/
cache/
database/ - Contains our SQLite Databases
dump/
fixtures/ - Contains our Initial Database Data
logs/
schema/ - Contains our Database Structure

layouts/

models/ - Contains the Models we actually use, these inherit from the models in the following sub-directories
Bal/ - Core models included by the BalPHP Library
Balcms/ - Core models used by BalCMS (these typically inherit the Bal models)
Base/ - Autogenerated by Doctrine ORM

modules/
balcms/
config/ - Our module specific Configuration

controllers/ - Our module specific Business Logic
BackController.php - For our Adminstration/Back Area
FeedController.php - For our News/RSS/Atom/Subscription Feeds
FrontController.php - For our Public/Front Area

views/ - Our module specific View Logic
helpers/ - Contains our Standard Content Widgets (used within our posts)
scripts/ - Contains our View Scripts

default/ - Contains our Default/Base Modules (used for Error Handling)

cli - BalCMS's Command Line Interface

common/ - Used to contain our submodules/requirements/dependencies used by BalCMS (e.g. zend framework)

config.php

il8n/ - Contains our Localisation/Language files.

index.php

public/
images/

media/
cache/ - Used by the inbuilt bundlers (View Helpers: HeadScriptBundler, HeadLinkBundler)
scripts/
Expand All @@ -164,22 +165,22 @@ So let's take a look at the structure:
images/ - Where the generated/compressed/resized images go
invoices/ - Used for our invoicing functionality (not documented)
uploads/ - Where user uploads go

scripts/

styles/

themes/ - Where our applications themes go, if you want to customise the look and feel of the application, this is where it's at.
albeo/ - The default theme. Creamy green.
balcms/ - The adminstration theme.
titan - A creamy brown theme.

README.md - This readme that you're reading right now.

robots.txt - What to tell Search Engines. Read up on google.

scripts/ - Contains scripts used by our CLI to perform specific actions

tests/ - Unit tests for our application.


Expand Down Expand Up @@ -210,21 +211,26 @@ BalCMS has configuration files in the following locations:

The files that you will be interested in are mainly `config.php` and `application.yml`, sometimes `nav.yml`. Unless you plan on extending BalCMS to add custom functionality, you will not ever need to touch the other configuration files.

The documentation files either include inline documentation (docs inside them) or they are self explanatory. After you have modified your configuration files, you will want to run `./cli clean-config` to ensure that the updated configuration is applied correctly - we do try to autodetect, but pedanticness can come in handy sometimes.
The documentation files either include inline documentation (docs inside them) or they are self explanatory. The process of changing the editor that we would like to use for our content would go like this:

1. Look in `application/config/default/application.yml`, find the appropriate property - in this case it's `editor.code`.
2. Insert the property into the our appropriate environment in `application/config/application.yml` - such that we are editing our config file, not the default one.
3. Modify the property value and save.
4. Run `./cli clean-config` to ensure the change is applied - we do try to auto-detect changes, but pedanticness can come in handy sometimes.


## Committing your Changes

1. To commit your changes, you'll want to run the following commands:

cd mywebsite
git status
git add -u
git status
git add {the untracked files reported by the git status}
git commit -m "My Changes... {this is your message}" (note: this commits your changes)
git push origin --all (note: this sends your changes to the remote repository)

> Explanation: What the `git status` does is show us the changes we have made, we use this the first time to check what changes are being made (so we can tell whether or not we want to make those changes). We can actually see the changes in detail by running `git diff`. We then add the files we want to the next commit by using `git add`. In the above example we use `git add -u` as that will save us a lot of typing, it automatically adds the changes to all tracked files (files that the git repository already knows about). After running the `git add -u`.


Expand All @@ -235,11 +241,11 @@ Setting up the live server can be done by either of the following two ways.
- **Recommended Option:** SSH+Git. This option is purely awesome, it's speedy, simple, easy to use, and allows us to edit files on the remote server. Although, few servers support both SSH and Git (your server needs both) - but the benefits are massive. We recommend hosting with [MediaTemple](http://mediatemple.net/) as they too are pure awesome, so they do support this pure awesome feature (their plans are also extremely cheap for what they offer, support is fantastic, and their system is extremely flexible and customisable for all your needs) - again, they are pure awesome. If your server does not support SSH+Git, then that is fine, as we can use the fallback option. Let's cover how we will do this.

1. You'll want to login to your server via SSH (refer to your server's manual for how to do this).

2. Once done, you'll then want to `cd` into your websites directory (eg. `public_html`).

3. This directory should be empty as we are doing a clean install (if it is not empty, back it up, and empty it). Now that it is empty, we want to run the following commands:

curl -OL http://github.com/balupton/balcms/raw/master/cli
git init
git remote add origin {your git repos read/write url}
Expand All @@ -260,11 +266,11 @@ Setting up the live server can be done by either of the following two ways.
*Note: Before you deploy to the live site, you will need to have added a production environment to your `config.php` file, and set up your database for the production environment in the `application/config/application.yml` file.*

1. Once we are happy with our local copy and we want to deploy it to the live site, we just have to run the already familiar command `./cli deploy` in our websites directory.

2. Once we have deployed our changes to our remote git repository, we will then want to pull those changes onto our live server. This depends on the option we chose.

- Using the fallback option (3rd Party System): With this option, deployment from our remote git repository to our live server may either happen automatically, or we may need to login to their system and manually deploy the changes and wait a very long time.

- Using the recommended option (SSH+Git): We will want to ssh into our web server and cd into our live sites directory (as we did when we setup the git repository). Once there will want to simply run the command `./cli update`. That will fetch all the recent changes, and ensure that our configuration is up-to-date.


Expand All @@ -273,7 +279,7 @@ Setting up the live server can be done by either of the following two ways.
1. To upgrade your application to the latest BalCMS version, you'll just need to run `./cli upgrade` in your application's directory.

> Explanation: What this will do is fetch the latest BalCMS version into the balcms branch, and merge it into our dev branch.

2. If you have any conflicts you can use `git mergetool` to sort them out.

3. Once all the conflicts are resolved, and the upgrade went successfully you'll want to run `./cli configure` to update any submodules/dependencies/requirements that we use.
Expand Down

0 comments on commit a02668e

Please sign in to comment.