From 201506e2991d81e4b76280bf5faf50ae2efceba5 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 21 Feb 2011 18:55:31 +1300 Subject: [PATCH 01/70] MINOR Added deprecated SapphireTest->assertType() in order to support PHPUnit 3.5 or newer, but stay backwards compatible to PHPUnit 3.4 --- dev/SapphireTest.php | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dev/SapphireTest.php b/dev/SapphireTest.php index f41d1988a..aac12ccac 100755 --- a/dev/SapphireTest.php +++ b/dev/SapphireTest.php @@ -574,6 +574,45 @@ class SapphireTest extends PHPUnit_Framework_TestCase { } } + /** + * Backported from PHPUnit 3.4 in order to maintain backwards + * compatibility: assertType() is deprecated in PHPUnit 3.5 (with PHP 5.2.7+), + * but as SilverStripe 2.3 and 2.4 support PHP 5.1 we can't require it. + */ + public static function assertType($expected, $actual, $message = '') { + // PHPUnit_Util_DeprecatedFeature_Logger::log( + // 'assertType() will be removed in PHPUnit 3.6 and should no longer ' . + // 'be used. assertInternalType() should be used for asserting ' . + // 'internal types such as "integer" or "string" whereas ' . + // 'assertInstanceOf() should be used for asserting that an object is ' . + // 'an instance of a specified class or interface.' + // ); + + if (is_string($expected)) { + if (PHPUnit_Util_Type::isType($expected)) { + $constraint = new PHPUnit_Framework_Constraint_IsType( + $expected + ); + } + + else if (class_exists($expected) || interface_exists($expected)) { + $constraint = new PHPUnit_Framework_Constraint_IsInstanceOf( + $expected + ); + } + + else { + throw PHPUnit_Util_InvalidArgumentHelper::factory( + 1, 'class or interface name' + ); + } + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + self::assertThat($actual, $constraint, $message); + } + /** * Helper function for the DOS matchers */ From b559b9ba53c7efc2521a503c2a6312d5e0569cd7 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Fri, 25 Feb 2011 13:56:09 +1300 Subject: [PATCH 02/70] MINOR Fixed broken CSVParserTest on Windows because of newline character differences --- tests/dev/CSVParserTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/dev/CSVParserTest.php b/tests/dev/CSVParserTest.php index 384a96035..8033cf3cb 100644 --- a/tests/dev/CSVParserTest.php +++ b/tests/dev/CSVParserTest.php @@ -19,7 +19,7 @@ class CSVParserTest extends SapphireTest { $this->assertEquals(array( "He's a good guy", - "She is awesome.\nSo awesome that she gets multiple rows and \"escaped\" strings in her biography", + sprintf("She is awesome.%sSo awesome that she gets multiple rows and \"escaped\" strings in her biography", PHP_EOL), "Pretty old, with an escaped comma", "Unicode FTW"), $biographies); $this->assertEquals(array("31/01/1988","31/01/1982","31/01/1882","31/06/1982"), $birthdays); @@ -49,7 +49,7 @@ class CSVParserTest extends SapphireTest { $this->assertEquals(array('John','Jane','Jamie','Järg'), $firstNames); $this->assertEquals(array( "He's a good guy", - "She is awesome.\nSo awesome that she gets multiple rows and \"escaped\" strings in her biography", + sprintf("She is awesome.%sSo awesome that she gets multiple rows and \"escaped\" strings in her biography", PHP_EOL), "Pretty old, with an escaped comma", "Unicode FTW"), $biographies); $this->assertEquals(array("31/01/1988","31/01/1982","31/01/1882","31/06/1982"), $birthdays); @@ -77,7 +77,7 @@ class CSVParserTest extends SapphireTest { $this->assertEquals(array( 'Biography', "He's a good guy", - "She is awesome.\nSo awesome that she gets multiple rows and \"escaped\" strings in her biography", + sprintf("She is awesome.%sSo awesome that she gets multiple rows and \"escaped\" strings in her biography", PHP_EOL), "Pretty old, with an escaped comma", "Unicode FTW"), $biographies); $this->assertEquals(array("Birthday","31/01/1988","31/01/1982","31/01/1882","31/06/1982"), $birthdays); From ff63ba97fb3d9d777216470667ce00d4b4780219 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Fri, 25 Feb 2011 15:15:27 +1300 Subject: [PATCH 03/70] MINOR Fixed broken i18nTest on Windows because of newline character differences --- tests/i18n/i18nTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/i18n/i18nTest.php b/tests/i18n/i18nTest.php index 13e631147..c4b17deb8 100644 --- a/tests/i18n/i18nTest.php +++ b/tests/i18n/i18nTest.php @@ -176,11 +176,11 @@ class i18nTest extends SapphireTest { $viewer = new SSViewer('i18nTestModule'); $parsedHtml = $viewer->process(new ArrayData(array('TestProperty' => 'TestPropertyValue'))); $this->assertContains( - "Layout Template\n", + sprintf("Layout Template%s", PHP_EOL), $parsedHtml ); $this->assertContains( - "Layout Template no namespace\n", + sprintf("Layout Template no namespace%s", PHP_EOL), $parsedHtml ); @@ -197,11 +197,11 @@ class i18nTest extends SapphireTest { $viewer = new SSViewer('i18nTestModule'); $parsedHtml = $viewer->process(new ArrayData(array('TestProperty' => 'TestPropertyValue'))); $this->assertContains( - "TRANS Main Template\n", + sprintf("TRANS Main Template%s", PHP_EOL), $parsedHtml ); $this->assertContains( - "TRANS Layout Template\n", + sprintf("TRANS Layout Template%s", PHP_EOL), $parsedHtml ); $this->assertContains( From 5d87f2929e467fd1c1858ac2d26a85252601efb6 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 8 Mar 2011 13:30:41 +1300 Subject: [PATCH 04/70] MINOR Added fix to test troubleshooting docs about PHPUnit 3.5 missing MockObject class --- docs/en/topics/testing/testing-guide-troubleshooting.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/en/topics/testing/testing-guide-troubleshooting.md b/docs/en/topics/testing/testing-guide-troubleshooting.md index 8f088b12b..3c615ce0b 100644 --- a/docs/en/topics/testing/testing-guide-troubleshooting.md +++ b/docs/en/topics/testing/testing-guide-troubleshooting.md @@ -6,3 +6,12 @@ Part of the [SilverStripe Testing Guide](testing-guide). If you've just added a test class, but you can't see it via the web interface, chances are, you haven't flushed your manifest cache - append `?flush=1` to the end of your URL querystring. + +## Class 'PHPUnit_Framework_MockObject_Generator' not found + +This is due to an upgrade in PHPUnit 3.5 which PEAR doesn't handle correctly.
+It can be fixed by running the following commands: + + pear install -f phpunit/DbUnit + pear install -f phpunit/PHPUnit_MockObject + pear install -f phpunit/PHPUnit_Selenium From de1f07045ba35273174907404c92aa0e9d7f1d9a Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 9 Mar 2011 15:49:41 +1300 Subject: [PATCH 05/70] BUGFIX Avoid privilege escalation from EDIT_PERMISSIONS to ADMIN through TreeMultiselectField (in Member->getCMSFields()) by checking for admin groups in Member->onChangeGroups() --- security/Member.php | 18 ++++++++++++++++++ tests/security/MemberTest.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/security/Member.php b/security/Member.php index e45e3d922..a26a75d93 100755 --- a/security/Member.php +++ b/security/Member.php @@ -693,6 +693,24 @@ class Member extends DataObject { MemberPassword::log($this); } } + + /** + * If any admin groups are requested, deny the whole save operation. + * + * @param Array $ids Database IDs of Group records + * @return boolean + */ + function onChangeGroups($ids) { + // Filter out admin groups to avoid privilege escalation, + // unless the current user is an admin already + if(!Permission::checkMember($this, 'ADMIN')) { + $adminGroups = Permission::get_groups_by_permission('ADMIN'); + $adminGroupIDs = ($adminGroups) ? $adminGroups->column('ID') : array(); + return count(array_intersect($ids, $adminGroupIDs)) == 0; + } else { + return true; + } + } /** diff --git a/tests/security/MemberTest.php b/tests/security/MemberTest.php index 2c50ef49c..e7d5a8b9a 100644 --- a/tests/security/MemberTest.php +++ b/tests/security/MemberTest.php @@ -527,6 +527,35 @@ class MemberTest extends FunctionalTest { $this->assertFalse($adminMember->canEdit($securityAdminMember), 'Security-Admins can not edit other admins'); $this->assertTrue($ceoMember->canEdit($securityAdminMember), 'Security-Admins can edit other members'); } + + function testOnChangeGroups() { + $staffGroup = $this->objFromFixture('Group', 'staffgroup'); + $adminGroup = $this->objFromFixture('Group', 'admingroup'); + $staffMember = $this->objFromFixture('Member', 'staffmember'); + $adminMember = $this->objFromFixture('Member', 'admin'); + $newAdminGroup = new Group(array('Title' => 'newadmin')); + $newAdminGroup->write(); + Permission::grant($newAdminGroup->ID, 'ADMIN'); + $newOtherGroup = new Group(array('Title' => 'othergroup')); + $newOtherGroup->write(); + + $this->assertTrue( + $staffMember->onChangeGroups(array($staffGroup->ID)), + 'Adding existing non-admin group relation is allowed for non-admin members' + ); + $this->assertTrue( + $staffMember->onChangeGroups(array($newOtherGroup->ID)), + 'Adding new non-admin group relation is allowed for non-admin members' + ); + $this->assertFalse( + $staffMember->onChangeGroups(array($newAdminGroup->ID)), + 'Adding new admin group relation is not allowed for non-admin members' + ); + $this->assertTrue( + $adminMember->onChangeGroups(array($newAdminGroup->ID)), + 'Adding new admin group relation is allowed for admin members' + ); + } /** * Add the given array of member extensions as class names. From c6992f33df9fe1a789e925f69b1554459cfa7fed Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 11 Feb 2011 10:37:18 +1300 Subject: [PATCH 06/70] ENHANCEMENT Adjusted from-source documentation to github and piston --- docs/en/installation/from-source.md | 310 +++++++++++++++++++++++++--- 1 file changed, 285 insertions(+), 25 deletions(-) diff --git a/docs/en/installation/from-source.md b/docs/en/installation/from-source.md index 94b3cd2dc..f2901b922 100644 --- a/docs/en/installation/from-source.md +++ b/docs/en/installation/from-source.md @@ -1,36 +1,277 @@ # Installation from Source Control # -For getting a project up and running with a release, you are typically best off -with the official [silverstripe.org/download](http://silverstripe.org/download). If you want to get the get the "latest and greatest" pre-release code (either -on a release brank, or on "trunk"), you need to use our version control. +## Introduction -We also require you to use this method for any [patch contributions](/misc/contributing), +SilverStripe core (and most of its modules) use git to version control their source code. +We require you to use this method for any [patch contributions](/misc/contributing), to ensure you're working on the latest codebase, and the problem you're looking at is not already fixed. -## SilverStripe Core ## +For getting a project up and running quickly with a release, you are typically best off +with the official [silverstripe.org/download](http://silverstripe.org/download). +If you want to get the "latest and greatest" pre-release code (either +on a release brank, or on "trunk"), you need to use our version control. -SilverStripe core is currently hosted on Subversion at [svn.silverstripe.org](http://svn.silverstripe.org). -You can get subversion clients for any operating system, see the [subversion website](http://subversion.tigris.org). - -SilverStripe projects are created by combining the "cms" and "sapphire" -modules along with any other modules that your site might need. - -These modules are prepackaged in a "phpinstaller" project through [svn:externals](http://svnbook.red-bean.com/en/1.5/svn.advanced.externals.html). - -To check out the installer project, use one of the following commands: - - # Check out the latest release branch - svn checkout http://svn.silverstripe.org/open/phpinstaller/branches/2.4 - - # Check out trunk - svn checkout http://svn.silverstripe.org/open/phpinstaller/trunk - -
-Please note that you will need Subversion 1.5.0 or greater +
+**Warning**: These instructions are for intermediate to advanced users only, +and require some knowledge of version control and using command line tools.
-## Other Modules ## +See [frequently asked questions](/installation/from-source#frequently-asked-questions) below. + +## The core and its parts + +SilverStripe core is currently hosted on [github.com/silverstripe](http://github.com/silverstripe). The core consists of four parts: + + * The `installer` project ([github.com/silverstripe/silverstripe-installer](http://github.com/silverstripe/silverstripe-installer)) + * The `sapphire` module ([github.com/silverstripe/sapphire](http://github.com/silverstripe/sapphire)) + * The `cms` module ([github.com/silverstripe/silverstripe-cms](http://github.com/silverstripe/silverstripe-cms)) + * A sample theme called `blackcandy` (you can remove or customize this later) + +First, you'll have to decide what you want to do with your project: + + * [Option 1: Start a new project on your own](/installation/from-source#option-1-installation-for-new-projects) + * [Option 2: Contribute back patches to SilverStripe](/installation/from-source#option-2-installation-for-contributions) + +These options aren't very clear cut, you can mix-and-match approaches to suit your needs +(e.g. core modules are downloaded as files, but your own modules are still managed through `svn:externals`). + +### Requirements ### + + * A **git client** to check out the core repositories, see ["Getting started with Git and Github"](http://help.github.com/). + * A **webserver+database environment** to run SilverStripe (see [server requirements](/misc/server-requirements)). + * The **php commandline utility** (to run scripts in the `tools/` folder) + * (optional) **Piston** ([website](http://piston.rubyforge.org)): A thirdparty tool to manage files from an external repository. It is our recommended way to start your own project, and still provide an easy way to update from our repository. You will need Ruby and the ["Rubygems"](http://rubygems.org/) package manager to install it: `gem install piston` +Note for Windows users: The installation process assumes a Linux/Unix/OSX system. +Most commands are the same for Windows, but you will have to use the `*.bat` scripts instead for anything in the `tools/` folder +(e.g. `tools/new-project.bat` instead of `tools/new-project`). + +
+Scripts in the `tools/` folder are still under development and might change over time. +
+ +## Option 1: Installation for new projects ## + +Your own projects are typically hosted in a version control system of your choice, +with SilverStripe files copied or linked into that repository. We assume you already +have an empty repository set up, either in git or subversion. + +If you don't use version control, we recommend that you stick to the official [silverstripe.org/download](http://silverstripe.org/download) instead. + +### Additional Requirements ### + + * The **php commandline utility** (to run scripts in the `tools/` folder) + * A **git client** to check out the core repositories, see ["Getting started with Git and Github"](http://help.github.com/). + * (optional) **Piston** ([website](http://piston.rubyforge.org)): A thirdparty tool to manage files from an external repository. +It is our recommended way to include modules when you start your own project, and still provide an easy way to update from our repository. +You will need Ruby and the ["Rubygems"](http://rubygems.org/) package manager to install it: `gem install piston` **MS: this is duplicated from the above section** + * A **webserver+database environment** to run SilverStripe (see [server requirements](/misc/server-requirements)). + +Note for Windows users: The installation process assumes a Linux/Unix/OSX system. +Most commands are the same for Windows, but you will have to use the `*.bat` scripts instead for anything in the `tools/` folder +(e.g. `tools/new-project.bat` instead of `tools/new-project`). + +
+Scripts in the `tools/` folder are still under development and might change over time. +
+ +### Step 1: Getting the installer + + * Create a new project repository in your own version control (we assume the working copy folder is called `my-silverstripe-project/`) + * Download and extract silverstripe-installer [master](https://github.com/silverstripe/silverstripe-installer/zipball/master) + or the [latest release](https://github.com/silverstripe/silverstripe-installer/zipball/2.4). + * Add and commit the files to your repository + +### Step 2: Getting the required modules ### + +Run the following command to download all core dependencies via [Piston](http://piston.rubyforge.org): + + cd my-silverstripe-project/ + tools/new-project + +This will add `sapphire`, `cms` and the `blackcandy` theme to your project. + +As a fallback solution, you can simply download all necessary files without any dependency management through piston. +This is handy if you have an existing project in version control, and want a one-off snapshot +of the modules that won't be updated frequently. + + cd my-silverstripe-project/ + tools/new-project -m flat + +
+The `tools` scripts are just getting you started - to maintain your installation, +you will need to learn how to add and update modules via the `git` commandline utility. +
+ +### Step 3: Committing the modules ### + +Regardless of using Piston or not, all files in your project will be unversioned, +and need to be added to your own repository. The commands depend on your repository type: + + # for subversion + cd my-silverstripe-project/ + svn add * + svn commit -m "adding dependencies" + + # for git + cd my-silverstripe-project/ + git add * + git commit -m "adding dependencies" + +### Step 4: Switch branches ### + +The `tools/new-project` script doesn't allow you to switch branches easily, +it is designed as a helper to get you started. The script is based on a `template.php` +located in `tools/lib/template.php`. To switch branches (before running the script), +create your own `template.php` and adjust the paths: + +`tools/new-project --template /path/to/template.php` + +If your project is managed by piston, you can run a `piston import --force` to switch branches. + +### Step 5: Running the web-based installer ### + +You can now run through the web-based installer for your operating system of choice ([instructions](/installation)). + + + + + + + +## Option 2: Installation for contributions ## + +This way of installing SilverStripe will allow you to commit back directly to version control for a module. +We recommend it for module and core development (as opposed to development on a client project). + +### Step 1: Forking the installer and projects + +First of all, you need to [fork](http://help.github.com/forking/) the installer and modules +into your own github account, so you can push changes (github.com/silverstripe is only writeable by the core team). + +A fork gives you write access to your own repository copy, and makes it efficient to +contribute back changes. This approach won't add the modules to version control in the containing `installer` folder, +which means it only works for local development. + +Note: You only need to fork the modules you actually plan to work on, +feel free to keep the original repository URLs for all other modules. + +### Step 2: Getting the installer and required modules ### + +To get started you just need to check out your fork of the `installer` project (this will take a minute or two). +This folder will be your webroot, and eventually contain all other modules. +Please replace `` below with your github username. + + git clone git@github.com:/silverstripe-installer.git my-silverstripe-project + cd my-silverstripe-project + git clone git@github.com:/sapphire.git sapphire + git clone git@github.com:/silverstripe-cms.git cms + git clone git@github.com:/silverstripe-blackcandy.git themes/blackcandy + +Now you need to add the original repository as `upstream`, so you can keep your fork updated later on. + + cd my-silverstripe-project + (git remote add upstream git://github.com/silverstripe/silverstripe-installer.git && git fetch upstream) + (cd sapphire && git remote add upstream git://github.com/silverstripe/sapphire.git && git fetch upstream) + (cd cms && git remote add upstream git://github.com/silverstripe/silverstripe-cms.git && git fetch upstream) + (cd themes/blackcandy && git remote add upstream git://github.com/silverstripe/silverstripe-blackcandy.git) + +Now you can learn how to [update your fork](http://help.github.com/forking/) from the `upstream` repository. You should do this regularly, at least before submitting any pull requests. + +Please read ["Module installation"](/topics/modules) to find out how to install additional modules like `blog` or `forum`. + +### Step 3: Committing the modules ### + +You don't need to commit the module code into the repository, as our project is only for local development. +Changes within the module code are committed back directly to their own repository, not into the `installer` project. To the `installer` project, these modules are unversioned files (although you can explicitly add them to `.gitignore` as well). + +### Step 4: Switch branches ### + +By default, the "master" is checked out, which contains the latest code. +You can optionally select a ["release branch"](https://github.com/silverstripe/silverstripe-installer/branches) to work on. Any work happens on a local branch, that you have to create first: + + cd my-silverstripe-project + git checkout -b 2.4 origin/2.4 + (cd sapphire && git checkout -b 2.4 origin/2.4) + (cd cms && git checkout -b 2.4 origin/2.4) + (cd themes/blackcandy && git checkout -b 2.4 origin/2.4) + # repeat for all modules in your project... + +After creating the local branch, you can simply switch between branches: + + cd my-silverstripe-project + git checkout 2.4 + (cd sapphire && git checkout 2.4) + (cd cms && git checkout 2.4) + (cd themes/blackcandy && git checkout 2.4) + # repeat for all modules in your project... + +To switch back to master: + + cd my-silverstripe-project + git checkout master + (cd sapphire && git checkout master) + (cd cms && git checkout master) + (cd themes/blackcandy && git checkout master) + # repeat for all modules in your project... + +You can't switch branches if your working copy has local changes (typically in `mysite/_config.php`). +Either revert these changes before switching, or temporarily store them with `git stash`. +Once you switch back you can retrieve these changes via `git stash pop` (see further [instructions on `git stash`](http://progit.org/book/ch6-3.html)). + +### Step 5: Running the web-based installer ### + +You can now run through the web-based installer for your operating system of choice ([instructions](/installation)). + +## Updating from source ## + +The `tools/` scripts provide an easy start, but don't allow you to add, remove or update modules. +Please read the following instruction on how to udpate modules and the installer depending +on your setup. + +### Updating the installer ### + +If you've done a straight `git clone` as described above, the update process is very simple: + + cd my-silverstripe-project/ + git pull origin + +If you have copied the installer files into a new project, we recommend to repeat the copying process manually. + +### Updating modules via git ### + +In case you chose the "Installation for contributions" option, all modules in your project +will be standard git repositories, and you can update them as usual. + + cd my-silverstripe-project/sapphire + git pull + +### Updating modules via piston or download ### + +For the "Installation for a new project" option, modules like `sapphire` or `cms` +are added as plain files without a direct link to their originating repository. +If these plain files are managed by piston, the update process is simple: + + cd my-silverstripe-project + piston update sapphire + # Use "svn" instead of "git" for subversion repositories + git add sapphire/* + git commit -m "udpated dependencies" + +For file downloads without piston, you can simply download the source code again and replace it. + +## Contributing changes from piston ## + +If you have started your own project, and made improvements to code +managed through piston within this - great! While it is a bit easier +to contribute code from direct git repositories, there is another way +to get these changes back to the original module repository: [piston-export](http://github.com/sminnee/piston-export). + +This script finds all changes to a certain module and exports them as patch +files that you can send to the module author (either as "pull requests" from your own fork, +or as flat files through tickets or emails). + +## Manual installation of other modules ## Modules listed on [silverstripe.org/modules](http://silverstripe.org/modules) can be hosted in any version control system (typically subversion or git). Please read the module @@ -40,6 +281,25 @@ page for source code locations and installation instructions. The general proces A good place to start looking for the source code of popular modules are the [github.com/silverstripe](http://github.com/silverstripe) and [github.com/silverstripe-labs](http://github.com/silverstripe-labs) project pages. +## Using Piston ## + +See [piston.rubyforge.org](http://piston.rubyforge.org/import.html). + +## Frequently Asked Questions ## + + * **I'm not a big fan of git, can I use Subversion for my own projects?**: Of course, you can manage your own project files any way you want. + To get SilverStripe modules from version control, you will have to use git to check out the code, and then add it to your own version control. + * **Can I use svn:externals?**: If your project is hosted on subversion, you can add your own svn:externals as usual. + To include most SilverStripe modules and themes from github, you have two options: Copying the files directly into your + own version control, or use ["piston"](http://piston.rubyforge.org) to manage this for you. + * **Some modules I use are still in subversion, can I mix and match with git?**: Yes, through ["piston"](http://piston.rubyforge.org). + * **I've cloned a module repository and now I want to make changes to it (that shouldn't go into the main version)**: + You can either run `piston import` and then apply your changes to the imported source, or edit your "git remote" for those modules. + * **Why don't you use git submodules or subtree merging instead of piston?**: In our experience, [Git submodules](http://progit.org/book/ch6-6.html) only work well if used in a readonly way, not for committing to the submodule repository. + ## Related ## - * [Contributing: Submitting patches](/misc/contributing) \ No newline at end of file + * [Contributing: Submitting patches](/misc/contributing) + * [Pro git - free online book](http://progit.org/book/) + * [Git cheat sheet - github.com](https://github.com/guides/git-cheat-sheet) + * [Git - SVN Crash Course - git.or.cz](http://git.or.cz/course/svn.html) \ No newline at end of file From 5bfc7226242b054c1f315395ca2c29187943714d Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 12 Feb 2011 12:19:04 +1300 Subject: [PATCH 07/70] MINOR Removed duplicated 'additional requirements' from docs --- docs/en/installation/from-source.md | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/docs/en/installation/from-source.md b/docs/en/installation/from-source.md index f2901b922..f6b5781d6 100644 --- a/docs/en/installation/from-source.md +++ b/docs/en/installation/from-source.md @@ -58,23 +58,6 @@ have an empty repository set up, either in git or subversion. If you don't use version control, we recommend that you stick to the official [silverstripe.org/download](http://silverstripe.org/download) instead. -### Additional Requirements ### - - * The **php commandline utility** (to run scripts in the `tools/` folder) - * A **git client** to check out the core repositories, see ["Getting started with Git and Github"](http://help.github.com/). - * (optional) **Piston** ([website](http://piston.rubyforge.org)): A thirdparty tool to manage files from an external repository. -It is our recommended way to include modules when you start your own project, and still provide an easy way to update from our repository. -You will need Ruby and the ["Rubygems"](http://rubygems.org/) package manager to install it: `gem install piston` **MS: this is duplicated from the above section** - * A **webserver+database environment** to run SilverStripe (see [server requirements](/misc/server-requirements)). - -Note for Windows users: The installation process assumes a Linux/Unix/OSX system. -Most commands are the same for Windows, but you will have to use the `*.bat` scripts instead for anything in the `tools/` folder -(e.g. `tools/new-project.bat` instead of `tools/new-project`). - -
-Scripts in the `tools/` folder are still under development and might change over time. -
- ### Step 1: Getting the installer * Create a new project repository in your own version control (we assume the working copy folder is called `my-silverstripe-project/`) From 753a4549bca56efd6475e2981fd04a2b47ebbacc Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 12 Feb 2011 12:20:57 +1300 Subject: [PATCH 08/70] MINOR Fixed spacing in docs --- docs/en/installation/from-source.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/en/installation/from-source.md b/docs/en/installation/from-source.md index f6b5781d6..a3331cc57 100644 --- a/docs/en/installation/from-source.md +++ b/docs/en/installation/from-source.md @@ -80,12 +80,12 @@ of the modules that won't be updated frequently. cd my-silverstripe-project/ tools/new-project -m flat - +
The `tools` scripts are just getting you started - to maintain your installation, you will need to learn how to add and update modules via the `git` commandline utility.
- + ### Step 3: Committing the modules ### Regardless of using Piston or not, all files in your project will be unversioned, @@ -95,12 +95,12 @@ and need to be added to your own repository. The commands depend on your reposit cd my-silverstripe-project/ svn add * svn commit -m "adding dependencies" - + # for git cd my-silverstripe-project/ git add * git commit -m "adding dependencies" - + ### Step 4: Switch branches ### The `tools/new-project` script doesn't allow you to switch branches easily, @@ -111,7 +111,7 @@ create your own `template.php` and adjust the paths: `tools/new-project --template /path/to/template.php` If your project is managed by piston, you can run a `piston import --force` to switch branches. - + ### Step 5: Running the web-based installer ### You can now run through the web-based installer for your operating system of choice ([instructions](/installation)). @@ -150,7 +150,7 @@ Please replace `` below with your github username. git clone git@github.com:/sapphire.git sapphire git clone git@github.com:/silverstripe-cms.git cms git clone git@github.com:/silverstripe-blackcandy.git themes/blackcandy - + Now you need to add the original repository as `upstream`, so you can keep your fork updated later on. cd my-silverstripe-project @@ -158,7 +158,7 @@ Now you need to add the original repository as `upstream`, so you can keep your (cd sapphire && git remote add upstream git://github.com/silverstripe/sapphire.git && git fetch upstream) (cd cms && git remote add upstream git://github.com/silverstripe/silverstripe-cms.git && git fetch upstream) (cd themes/blackcandy && git remote add upstream git://github.com/silverstripe/silverstripe-blackcandy.git) - + Now you can learn how to [update your fork](http://help.github.com/forking/) from the `upstream` repository. You should do this regularly, at least before submitting any pull requests. Please read ["Module installation"](/topics/modules) to find out how to install additional modules like `blog` or `forum`. @@ -167,7 +167,7 @@ Please read ["Module installation"](/topics/modules) to find out how to install You don't need to commit the module code into the repository, as our project is only for local development. Changes within the module code are committed back directly to their own repository, not into the `installer` project. To the `installer` project, these modules are unversioned files (although you can explicitly add them to `.gitignore` as well). - + ### Step 4: Switch branches ### By default, the "master" is checked out, which contains the latest code. @@ -179,7 +179,7 @@ You can optionally select a ["release branch"](https://github.com/silverstripe/s (cd cms && git checkout -b 2.4 origin/2.4) (cd themes/blackcandy && git checkout -b 2.4 origin/2.4) # repeat for all modules in your project... - + After creating the local branch, you can simply switch between branches: cd my-silverstripe-project @@ -188,7 +188,7 @@ After creating the local branch, you can simply switch between branches: (cd cms && git checkout 2.4) (cd themes/blackcandy && git checkout 2.4) # repeat for all modules in your project... - + To switch back to master: cd my-silverstripe-project @@ -197,7 +197,7 @@ To switch back to master: (cd cms && git checkout master) (cd themes/blackcandy && git checkout master) # repeat for all modules in your project... - + You can't switch branches if your working copy has local changes (typically in `mysite/_config.php`). Either revert these changes before switching, or temporarily store them with `git stash`. Once you switch back you can retrieve these changes via `git stash pop` (see further [instructions on `git stash`](http://progit.org/book/ch6-3.html)). @@ -240,7 +240,7 @@ If these plain files are managed by piston, the update process is simple: # Use "svn" instead of "git" for subversion repositories git add sapphire/* git commit -m "udpated dependencies" - + For file downloads without piston, you can simply download the source code again and replace it. ## Contributing changes from piston ## From 629aa9b33e4b1bf441af8c7ea13be00df552fd1b Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 14 Feb 2011 11:09:40 +1300 Subject: [PATCH 09/70] MINOR Removed reference to additional CSS download in tutorial 4, moved to the silverstripe-installer project --- docs/en/tutorials/4-site-search.md | 5 +---- docs/en/tutorials/_images/search-file.gif | Bin 170 -> 0 bytes 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 docs/en/tutorials/_images/search-file.gif diff --git a/docs/en/tutorials/4-site-search.md b/docs/en/tutorials/4-site-search.md index 63586d875..fb7adb8cb 100644 --- a/docs/en/tutorials/4-site-search.md +++ b/docs/en/tutorials/4-site-search.md @@ -5,10 +5,7 @@ This is a short tutorial demonstrating how to add search functionality to a SilverStripe site. It is recommended that you have completed the earlier tutorials, especially the tutorial on forms, before attempting this tutorial. While this tutorial will add search functionality to the site built in the previous tutorials, it should be straight forward to -follow this tutorial on any site of your own. If you are adding the search form to the tutorial site, please get -[this updated css file](http://doc.silverstripe.org/src/github/master/sapphire/docs/en/tutorials/_images/layout.css) and place it in *themes/tutorial/css* (as layout.css) and this -![search file tree icon](_images/search-file.gif) search file tree icon and place it in *themes/tutorial/images/treeicons* (as -search-file.gif). +follow this tutorial on any site of your own. ## What are we working towards? diff --git a/docs/en/tutorials/_images/search-file.gif b/docs/en/tutorials/_images/search-file.gif deleted file mode 100644 index 5788fd18d8c7a7227846698a82524906927f6c64..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 170 zcmZ?wbhEHb6krfw*v!q~@8k3L?^ln#e_C2vx}N>~k Date: Mon, 14 Feb 2011 11:16:24 +1300 Subject: [PATCH 10/70] MINOR Fixed blackcandy github links in docs --- docs/en/installation/from-source.md | 4 ++-- docs/en/topics/themes.md | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/en/installation/from-source.md b/docs/en/installation/from-source.md index a3331cc57..76a2e0832 100644 --- a/docs/en/installation/from-source.md +++ b/docs/en/installation/from-source.md @@ -26,7 +26,7 @@ SilverStripe core is currently hosted on [github.com/silverstripe](http://github * The `installer` project ([github.com/silverstripe/silverstripe-installer](http://github.com/silverstripe/silverstripe-installer)) * The `sapphire` module ([github.com/silverstripe/sapphire](http://github.com/silverstripe/sapphire)) * The `cms` module ([github.com/silverstripe/silverstripe-cms](http://github.com/silverstripe/silverstripe-cms)) - * A sample theme called `blackcandy` (you can remove or customize this later) + * A sample theme called `blackcandy` ([github.com/silverstripe-themes/silverstripe-blackcandy](http://github.com/silverstripe-themes/silverstripe-blackcandy)) First, you'll have to decide what you want to do with your project: @@ -157,7 +157,7 @@ Now you need to add the original repository as `upstream`, so you can keep your (git remote add upstream git://github.com/silverstripe/silverstripe-installer.git && git fetch upstream) (cd sapphire && git remote add upstream git://github.com/silverstripe/sapphire.git && git fetch upstream) (cd cms && git remote add upstream git://github.com/silverstripe/silverstripe-cms.git && git fetch upstream) - (cd themes/blackcandy && git remote add upstream git://github.com/silverstripe/silverstripe-blackcandy.git) + (cd themes/blackcandy && git remote add upstream git://github.com/silverstripe-themes/silverstripe-blackcandy.git) Now you can learn how to [update your fork](http://help.github.com/forking/) from the `upstream` repository. You should do this regularly, at least before submitting any pull requests. diff --git a/docs/en/topics/themes.md b/docs/en/topics/themes.md index aa967d42d..58915029f 100644 --- a/docs/en/topics/themes.md +++ b/docs/en/topics/themes.md @@ -36,6 +36,8 @@ Your theme file must be in a .tar.gz format. A useful tool for this is - [7 Zip] must select the your_theme folder and Add to archive, select TAR and create. Then after you have the TAR file right click it -> Add to Archive (again) -> Then use the archive format GZIP. -## Discussing +## Links -Head over to the [ Themes Forum ](http://www.silverstripe.org/themes-2/) + * [Themes Listing on silverstripe.org](http://silverstripe.org/themes) + * [Themes Forum on silverstripe.org](http://www.silverstripe.org/themes-2/) + * [Themes repository on github.com](http://github.com/silverstripe-themes) From f15f083f225559d7747649113d6e69706b66a6d5 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 16 Feb 2011 08:53:51 +1300 Subject: [PATCH 11/70] MINOR Updated 'from source' docs --- docs/en/installation/from-source.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/installation/from-source.md b/docs/en/installation/from-source.md index 76a2e0832..2d974e968 100644 --- a/docs/en/installation/from-source.md +++ b/docs/en/installation/from-source.md @@ -76,7 +76,7 @@ This will add `sapphire`, `cms` and the `blackcandy` theme to your project. As a fallback solution, you can simply download all necessary files without any dependency management through piston. This is handy if you have an existing project in version control, and want a one-off snapshot -of the modules that won't be updated frequently. +of the modules. The only way to update this codebase later is to overwrite the whole folder, with no easy way to track and re-apply any changes made to it since. cd my-silverstripe-project/ tools/new-project -m flat From 8ad630d5a13526c1e9d29e4a48c6014d4585626b Mon Sep 17 00:00:00 2001 From: Michael Andrewartha Date: Tue, 22 Feb 2011 10:23:22 +1300 Subject: [PATCH 12/70] MINOR: formatting changes and fixes to original document formatting --- docs/en/changelogs/2.2.0.md | 3 +-- docs/en/changelogs/2.3.6.md | 2 +- docs/en/changelogs/2.3.7.md | 2 +- docs/en/changelogs/2.3.8.md | 4 ++-- docs/en/changelogs/2.4.1.md | 2 +- docs/en/changelogs/2.4.2.md | 2 +- docs/en/changelogs/rc/2.3.8-rc1.md | 2 +- docs/en/changelogs/rc/2.4.0-rc1.md | 2 +- docs/en/changelogs/rc/2.4.0-rc2.md | 2 +- docs/en/changelogs/rc/2.4.0-rc3.md | 2 +- docs/en/changelogs/rc/2.4.1-rc1.md | 2 +- docs/en/changelogs/rc/2.4.2-rc1.md | 2 +- docs/en/howto/csv-import.md | 2 +- docs/en/howto/dynamic-default-fields.md | 1 - docs/en/howto/grouping-dataobjectsets.md | 5 +++-- docs/en/howto/index.md | 10 ++++------ docs/en/howto/phpunit-configuration.md | 10 +++++----- docs/en/installation/common-problems.md | 19 +++++++++++++------ docs/en/installation/from-source.md | 2 +- docs/en/installation/upgrading.md | 4 ++-- docs/en/installation/webserver.md | 2 +- docs/en/misc/contributing.md | 16 ++++++++-------- docs/en/misc/index.md | 1 + docs/en/misc/module-release-process.md | 18 +++++++++--------- docs/en/misc/release-process.md | 2 +- docs/en/misc/ss-markdown.md | 10 ++++++---- docs/en/misc/subversion.md | 2 +- 27 files changed, 69 insertions(+), 62 deletions(-) diff --git a/docs/en/changelogs/2.2.0.md b/docs/en/changelogs/2.2.0.md index 027a47693..f341fd761 100644 --- a/docs/en/changelogs/2.2.0.md +++ b/docs/en/changelogs/2.2.0.md @@ -72,7 +72,7 @@ Sitemap.php * Portuguese (Portugal) translation * Support for multilingual content * Added a Statistics area showing the following reports - * Page views + * Page views * User activity * Trends * Operating Systems @@ -120,7 +120,6 @@ Sitemap.php * Replace the 'reorganise' button with 'Allowing drag & drog reordering' checkbox * Delete and Unpublish buttons turn red on hover * Added the ability to align images 'left on their own' - ## Enhancements diff --git a/docs/en/changelogs/2.3.6.md b/docs/en/changelogs/2.3.6.md index 27cc80f27..867d4e75f 100644 --- a/docs/en/changelogs/2.3.6.md +++ b/docs/en/changelogs/2.3.6.md @@ -37,4 +37,4 @@ ### Other Created with: -{![](_images/./sscreatechangelog --version 2.3.6 --branch branches/2.3 --stopbranch tags/2.3.5)} \ No newline at end of file +./sscreatechangelog --version 2.3.6 --branch branches/2.3 --stopbranch tags/2.3.5 \ No newline at end of file diff --git a/docs/en/changelogs/2.3.7.md b/docs/en/changelogs/2.3.7.md index 6e2a6746e..9128dcde6 100644 --- a/docs/en/changelogs/2.3.7.md +++ b/docs/en/changelogs/2.3.7.md @@ -9,4 +9,4 @@ * [rev:100744] Fixing Member_ProfileForm to validate for existing members via Member_Validator to avoid CMS users to switch to another existing user account by using their email address (from r100704) (from r100717) Created with: -./sscreatechangelog --version 2.3.7 --branch branches/2.3 --stopbranch tags/2.3.6) \ No newline at end of file +./sscreatechangelog --version 2.3.7 --branch branches/2.3 --stopbranch tags/2.3.6 \ No newline at end of file diff --git a/docs/en/changelogs/2.3.8.md b/docs/en/changelogs/2.3.8.md index 490286fd5..ecc0b2a62 100644 --- a/docs/en/changelogs/2.3.8.md +++ b/docs/en/changelogs/2.3.8.md @@ -49,7 +49,7 @@ See [2.4.1](2.4.1#securitydisallow_direct_execution_of_php_files) * [rev:103447] Fixed js applying to non-tinymce textarea fields in !ModelAdmin.js (fixes #5453) * [rev:103362] Fixed js applying to non-tinymce textarea fields in !ModelAdmin.js (fixes #5453) * [rev:103348] added moderation message for non-ajax mode - * [rev:101258] Fixed missing closing
in !ContentController->successfullyinstalled() (from r101254) + * [rev:101258] Fixed missing closing `
` in !ContentController->successfullyinstalled() (from r101254) -./sscreatechangelog --version 2.3.8 --branch branches/2.3 --stopbranch tags/2.3.7 \ No newline at end of file +`./sscreatechangelog --version 2.3.8 --branch branches/2.3 --stopbranch tags/2.3.7` \ No newline at end of file diff --git a/docs/en/changelogs/2.4.1.md b/docs/en/changelogs/2.4.1.md index c60a49afa..8745e9c56 100644 --- a/docs/en/changelogs/2.4.1.md +++ b/docs/en/changelogs/2.4.1.md @@ -343,7 +343,7 @@ existing pages when their title is changed. * [rev:104720] Fixed installation problem where version error didn't show * [rev:104679] Make URLs lowercase * [rev:104678] Fixed Translatable::canEdit() to suit new permission customisation scheme - * [rev:104675] Prevent !DataDifferencer from creating empty and takes that confuse the browser. + * [rev:104675] Prevent !DataDifferencer from creating empty `` and `` takes that confuse the browser. * [rev:104672] Make !RsyncMultiHostPublisher protected; give default value. * [rev:104670] Director::test() shouldn't break if $_SESSION isn't set. * [rev:104666] Removed references to php5 binary in Makefile diff --git a/docs/en/changelogs/2.4.2.md b/docs/en/changelogs/2.4.2.md index a882b3759..40a2cfd77 100644 --- a/docs/en/changelogs/2.4.2.md +++ b/docs/en/changelogs/2.4.2.md @@ -48,7 +48,7 @@ * [110857] Enforcing canEdit() checks in !ComplexTableField_Popup - making form readonly if the current user can't edit * [110838] Case insensitive !DateField value navigation (fixes #5990, thanks gw0( * [110835] Passing $name in !MoneyField->!FieldCurrency() (fixes #5982, thanks andersw) - * [110809] Removing "typography" class from HTMLEditorField container (should just apply to the contained