Added docs for composer

This commit is contained in:
Sam Minnee 2012-11-03 18:00:58 +13:00
parent 9fe99cfec9
commit c1ae8f9e7a
3 changed files with 120 additions and 8 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -0,0 +1,89 @@
<div markdown='1' style="float: right; margin-left: 20px">
![](../_images/composer.png)
</div>
# Installing and Upgrading SilverStipe with Composer
Composer is a package management tool for PHP that lets you install and upgrade SilverStripe and its modules. Although installing Composer is one extra step, it will give you much more flexibility than just downloading the file from silverstripe.org. This is our recommended way of downloading SilverStripe and managing your code.
For more information about Composer, visit [its website](http://getcomposer.org/).
## Installing composer
To install Composer, run the following command from your command-line.
curl -s https://getcomposer.org/installer | php
Or [download composer.phar](http://getcomposer.org/composer.phar) manually.
You can then run Composer commands by calling `php composer.phar`. For example:
php composer.phar help
## Create a site from the default installer template
Composer can create a new project for you, using the installer as a template. To do so, run this:
php composer.phar create-project silverstripe/installer ./my/website/folder
`./my/website/folder` should be the root directory where your site will live. For example, on OS X, you might use a subdirectory of `~/Sites`.
As long as your web server is up and running, this will get all the code that you need. Now visit the site in your web
browser, and the installation process will be completed.
## Adding modules to your project
Composer isn't only used to download SilverStripe CMS: it can also be used to manage all the modules. In the root of your project, there will be a file called `composer.json`. If you open it up, the contents will look something like this:
{
"name": "silverstripe/installer",
"description": "The SilverStripe Framework Installer",
"require": {
"php": ">=5.3.2",
"silverstripe/cms": "3.0.3",
"silverstripe/framework": "3.0.3",
"silverstripe-themes/simple": "*"
},
"require-dev": {
"silverstripe/compass": "*",
"silverstripe/docsviewer": "*"
},
}
To add modules, you should add more entries into the `"require"` section. For example, we might add the blog and forum modules. Be careful with the commas at the end of the lines!
{
"name": "silverstripe/installer",
"description": "The SilverStripe Framework Installer",
"require": {
"php": ">=5.3.2",
"silverstripe/cms": "3.0.3",
"silverstripe/framework": "3.0.3",
"silverstripe-themes/simple": "*",
"silverstripe/blog": "*",
"silverstripe/forum": "*"
},
"require-dev": {
"silverstripe/compass": "*",
"silverstripe/docsviewer": "*"
},
}
Save your file, and then run the following command:
php composer.phar update
We currently use [Packagist](https://packagist.org/) to download manage modules, as this is Composer's default repository. You can find other modules by searching for "SilverStripe" on Packagist.
## Preparing your project for working on SilverStripe
So you want to contribute to SilverStripe? Fantastic! There are a couple modules that are helpful
* The `compass` module will regenerate CSS if you update the SCSS files
* The `docsviewer` module will let you preview changes to the project documentation
By default, these modules aren't installed, but you can install them with a special version of composer's update command:
php composer.phar update --dev

View File

@ -5,24 +5,47 @@
SilverStripe is a web application. This means that you will need to have a webserver and database meeting its
[requirements](server-requirements). We will take you through the setup of the server environment as well the application itself.
You can [download](http://silverstripe.org/download) SilverStripe as an archive or from [version control](from-source).
<div markdown='1' style="float: right; margin-left: 20px">
![](../_images/composer.png)
</div>
If you already have an installed version of SilverStripe, please see our [upgrading](upgrading) guide.
## Getting the code
## Linux/Unix
The best way to get SilverStripe is with [Composer](composer). Composer is a package management tool for PHP that
lets you install and upgrade SilverStripe and its modules. Although installing Composer is one extra step, it will give you much more flexibility than just downloading the file from silverstripe.org.
Other ways to get SilverStripe:
* If you just want to get the code as quickly as possible, you can [download SilverStripe from our website](http://silverstripe.org/download).
* If you like doing things yourself, you can [download SilverStripe from source](from-source) manually.
* If you already have an installed version of SilverStripe, and you haven't used Composer to get it, please see our [upgrading](upgrading) guide. Note that [Composer](composer) provides its own tools for upgrading.
## Setting up a server
### Linux/Unix
To run SilverStripe on Linux/Unix, set up one of the following web servers:
* [Install using Apache](webserver) - our preferred platform
* [Install using Lighttpd](lighttpd) - fast, but a bit tricker to get going
* [Install using Nginx](nginx) - Super fast at serving static files. Great for large traffic sites.
## Windows
### Windows
We recommend that you use the free [Microsoft Web Platform installer](windows-pi).
The more technically inclined can [install using IIS](windows-manual-iis) or [install using Apache/WAMP](windows-wamp).
The most straightforward way to get SilverStripe running on Windows is with the [Microsoft Web Platform installer](windows-pi). You can skip the "getting the code" step.
## Mac OS X
For more flexibility, you can set up either of the following web servers, and use Composer to get the code:
Mac OS X comes with a built-in webserver, but you can also use MAMP [install using MAMP](mac-osx) or using MacPorts.
* [Install using IIS](windows-manual-iis)
* [Install using Apache/WAMP](windows-wamp)
### Mac OS X
Mac OS X comes with a built-in webserver, but there are a number of other options:
* [Install using MAMP](mac-osx)
* Install using the built-in webserver (no docs yet)
* Install using MacPorts (no docs yet)
## Troubleshooting