Permalink
Browse files

Merge remote-tracking branch 'origin/3.0' into 3.1

Conflicts:
	control/HTTP.php
  • Loading branch information...
2 parents fc3239e + d888ea5 commit bea1b9002d389f5bc9ac0c7d1fc9b320e119cfe0 @chillu chillu committed Feb 26, 2013
@@ -1,5 +1,5 @@
if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
- if(typeof(console) != 'undefined') console.error('Class ss.i18n not defined');
+ if(typeof(console) != 'undefined') console.error('Class ss.i18n not defined');
} else {
ss.i18n.addDictionary('nl_NL', {
'LeftAndMain.CONFIRMUNSAVED': "Weet u zeker dat u deze pagina wilt verlaten?\n\WAARSCHUWING: Uw veranderingen zijn niet opgeslagen.\n\nKies OK om te verlaten, of Cancel om op de huidige pagina te blijven.",
View
@@ -674,8 +674,8 @@ public static function forceSSL($patterns = null) {
$matched = false;
if($patterns) {
- // Calling from the command-line?
- if(!isset($_SERVER['REQUEST_URI'])) return;
+ // Calling from the command-line?
+ if(!isset($_SERVER['REQUEST_URI'])) return;
// protect portions of the site based on the pattern
$relativeURL = self::makeRelative(Director::absoluteURL($_SERVER['REQUEST_URI']));
View
@@ -107,7 +107,7 @@ public static function urlRewriter($content, $code) {
}
return $matches[1] . $rewritten . $matches[3];
};
-
+
// Execute each expression
foreach($regExps as $regExp) {
$content = preg_replace_callback($regExp, $callback, $content);
@@ -314,7 +314,8 @@ public static function add_cache_headers($body = null) {
$responseHeaders["Cache-Control"] = "max-age=" . self::$cache_age . ", must-revalidate, no-transform";
$responseHeaders["Pragma"] = "";
- // To do: User-Agent should only be added in situations where you *are* actually varying according to it.
+ // To do: User-Agent should only be added in situations where you *are* actually
+ // varying according to user-agent.
$responseHeaders['Vary'] = 'Cookie, X-Forwarded-Protocol, User-Agent, Accept';
} else {
@@ -324,14 +325,12 @@ public static function add_cache_headers($body = null) {
if(self::$modification_date && self::$cache_age > 0) {
$responseHeaders["Last-Modified"] = self::gmt_date(self::$modification_date);
- /* Chrome ignores Varies when redirecting back (http://code.google.com/p/chromium/issues/detail?id=79758)
- which means that if you log out, you get redirected back to a page which Chrome then checks against
- last-modified (which passes, getting a 304) when it shouldn't be trying to use that page at all because
- it's the "logged in" version.
-
- By also using and etag that includes both the modification date and all the varies values which we also
- check against we can catch this and not return a 304
- */
+ // Chrome ignores Varies when redirecting back (http://code.google.com/p/chromium/issues/detail?id=79758)
+ // which means that if you log out, you get redirected back to a page which Chrome then checks against
+ // last-modified (which passes, getting a 304)
+ // when it shouldn't be trying to use that page at all because it's the "logged in" version.
+ // By also using and etag that includes both the modification date and all the varies
+ // values which we also check against we can catch this and not return a 304
$etagParts = array(self::$modification_date, serialize($_COOKIE));
if (isset($_SERVER['HTTP_X_FORWARDED_PROTOCOL'])) $etagParts[] = $_SERVER['HTTP_X_FORWARDED_PROTOCOL'];
if (isset($_SERVER['HTTP_USER_AGENT'])) $etagParts[] = $_SERVER['HTTP_USER_AGENT'];
View
@@ -161,7 +161,8 @@ public function isError() {
public function setBody($body) {
$this->body = $body;
- // Set content-length in bytes. Use mbstring to avoid problems with mb_internal_encoding() and mbstring.func_overload
+ // Set content-length in bytes. Use mbstring to avoid problems with
+ // mb_internal_encoding() and mbstring.func_overload
$this->headers['Content-Length'] = mb_strlen($this->body,'8bit');
}
@@ -244,17 +245,21 @@ public function output() {
<meta http-equiv=\"refresh\" content=\"1; url=$url\" />
<script type=\"text/javascript\">setTimeout('window.location.href = \"$url\"', 50);</script>";
} else {
- $line = $file = null;
+ $line = $file = null;
if(!headers_sent($file, $line)) {
header($_SERVER['SERVER_PROTOCOL'] . " $this->statusCode " . $this->getStatusDescription());
foreach($this->headers as $header => $value) {
header("$header: $value", true, $this->statusCode);
}
} else {
- // It's critical that these status codes are sent; we need to report a failure if not.
- if($this->statusCode >= 300) {
- user_error("Couldn't set response type to $this->statusCode because of output on line $line of $file", E_USER_WARNING);
- }
+ // It's critical that these status codes are sent; we need to report a failure if not.
+ if($this->statusCode >= 300) {
+ user_error(
+ "Couldn't set response type to $this->statusCode because " .
+ "of output on line $line of $file",
+ E_USER_WARNING
+ );
+ }
}
// Only show error pages or generic "friendly" errors if the status code signifies
View
@@ -240,7 +240,7 @@ public static function noticeHandler($errno, $errstr, $errfile, $errline, $errco
if(Director::isDev()) {
return self::showError($errno, $errstr, $errfile, $errline, $errcontext, "Notice");
} else {
- return false;
+ return false;
}
}
@@ -258,7 +258,15 @@ public static function warningHandler($errno, $errstr, $errfile, $errline, $errc
ini_set('display_errors', 0);
if(self::$send_warnings_to) {
- return self::emailError(self::$send_warnings_to, $errno, $errstr, $errfile, $errline, $errcontext, "Warning");
+ return self::emailError(
+ self::$send_warnings_to,
+ $errno,
+ $errstr,
+ $errfile,
+ $errline,
+ $errcontext,
+ "Warning"
+ );
}
// Send out the error details to the logger for writing
@@ -280,8 +288,8 @@ public static function warningHandler($errno, $errstr, $errfile, $errline, $errc
if(Director::isDev()) {
return self::showError($errno, $errstr, $errfile, $errline, $errcontext, "Warning");
} else {
- return false;
- }
+ return false;
+ }
}
/**
@@ -0,0 +1,13 @@
+# 3.0.5 (2013-02-20)
+
+## Overview
+
+ * Fixes unpublish and "delete" actions in CMS (regression from $allowed_actions changes in 3.0.4)
+
+### Bugfixes
+
+ * 2013-02-18 [16d0c18](https://github.com/silverstripe/sapphire/commit/16d0c18) Find Form actions in CompositeFields for access checks (Ingo Schommer)
+
+### Other
+
+ * 2013-02-19 [9e7c622](https://github.com/silverstripe/sapphire/commit/9e7c622) fixed error property $ of object is not a function (roed)
@@ -7,6 +7,7 @@
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/).
+We also have separate instructions for [installing modules with Composer](/topics/modules).
# Basic usage
@@ -40,7 +41,7 @@ Composer updates regularly, so you should run this command fairly often. These i
## Create a new site
-Composer can create a new site for you, using the installer as a template. To do so, run this:
+Composer can create a new site for you, using the installer as a template:
composer create-project silverstripe/installer ./my/website/folder
@@ -50,7 +51,7 @@ As long as your web server is up and running, this will get all the code that yo
Now visit the site in your web browser, and the installation process will be completed.
By default composer will download the latest stable version. You can also specify
-a version to download that version explicitly, i.e. this will download 3.0.3:
+a version to download that version explicitly, i.e. this will download the older `3.0.3` release:
composer create-project silverstripe/installer ./my/website/folder 3.0.3
@@ -74,7 +75,7 @@ This will return a list of package names of the forum `vendor/package`. If you
The second part after the colon, `*`, is a version string. `*` is a good default: it will give you the latest version that works with the other modules you have installed. Alternatively, you can specificy a specific version, or a constraint such as `>=3.0`. For more information, read the [Composer documentation](http://getcomposer.org/doc/01-basic-usage.md#the-require-key).
<div class="warning" markdown="1">
-`master` is not a legal version string - it's a branch name. These are different things. The version string that would get you the branch is `dev-master`. The version string that would get you a numeric branch is a little different. The version string for the `3.0` branch is `3.0.x-dev`. But, frankly, maybe you should just use `*`.
+`master` is not a legal version string - it's a branch name. These are different things. The version string that would get you the branch is `dev-master`. The version string that would get you a numeric branch is a little different. The version string for the `3.0` branch is `3.0.x-dev`.
</div>
## Updating dependencies
@@ -100,7 +101,7 @@ So, your deployment process, as it relates to Composer, should be as follows:
* Deploy your project code base, using the deployment tool of your choice.
* Run `composer install` on your production version.
-# Setting up an environment for contributing to SilverStripe {#contributing}
+# Dev Environments for Contributing Code {#contributing}
So you want to contribute to SilverStripe? Fantastic! You can do this with composer too.
You have to tell composer three things in order to be able to do this:
@@ -109,20 +110,28 @@ You have to tell composer three things in order to be able to do this:
- Include dependancies marked as "developer" requirements
- Use the development version, not the latest stable version
-The first two steps are done as part of the initial create project using additional arguments. For instance:
+The first two steps are done as part of the initial create project using additional arguments.
+
composer create-project --keep-vcs --dev silverstripe/installer ./my/website/folder 3.0.x-dev
-The process will take a bit longer, since all modules are checked out as full git repositories which you can work on.
+The process will take a bit longer, since all modules are checked out as full git repositories which you can work on. The command checks out from the 3.0 release line. To check out from master instead,
+replace `3.0.x-dev` with `dev-master` (more info on [composer version naming](http://getcomposer.org/doc/02-libraries.md#specifying-the-version)).
The `--keep-vcs` flag will make sure you have access to the git history of the installer and the requirements
-The `--dev` flag will add a couple modules which are useful for SilverStripe development:
+The `--dev` flag is optional, and can be used to add a couple modules which are useful for
+SilverStripe development:
+ * The `behat-extension` module allows running [Behat](http://behat.org) integration tests
* The `docsviewer` module will let you preview changes to the project documentation
* The `buildtools` module which adds [phing](http://phing.info) tasks for creating SilverStripe releases
-Note that you can also include those into an existing project by running `composer update --dev`.
+Once the `create-project` command completes, you need to edit the `composer.json` in the project root
+and remove the `@stable` markers from the `silverstripe/cms` and `silverstripe/framework` version entries.
+Another `composer update --dev` call will now fetch from the development branch instead.
+Note that you can also convert an existing composer project with these steps.
+
Please read the ["Contributing Code"](/misc/contributing/code) documentation to find out how to
create forks and send pull requests.
@@ -235,3 +244,58 @@ Both the version and the alias are specified as Composer versions, not branch na
This is not the only way to set things up in Composer. For more information on this topic, read the ["Aliases" chapter of the Composer documentation](http://getcomposer.org/doc/articles/aliases.md).
+## FAQ
+
+### How do I convert an existing module to using Composer?
+
+Simply decide on a [unique name and vendor prefix](https://packagist.org/about),
+create a `composer.json`, and either commit it or send a pull request to the module author.
+Look at existing modules like the ["blog" module](https://github.com/silverstripe/silverstripe-blog/blob/master/composer.json) for good examples on what this file should contain.
+It's important that the file contains a custom "type" to declare it as a
+`silverstripe-module` or `silverstripe-theme` (see [custom installers](http://getcomposer.org/doc/articles/custom-installers.md)).
+Then register the module on [packagist.org](http://packagist.org).
+
+### How should I name my module?
+
+Follow the packagist.org advice on choosing a [unique name and vendor prefix](https://packagist.org/about). Please don't use the `silverstripe/<modulename>` vendor prefix, since that's reserved
+for modules produced by SilverStripe Ltd. In order to declare that your module is
+in fact a SilverStripe module, use the "silverstripe" tag in the composer.json file,
+and set the "type" to "silverstripe-module".
+
+### What about themes?
+
+Themes are technically just "modules" which are placed in the `themes/` subdirectory.
+We denote a special type for them in the `composer.json` (`"type": "silverstripe-theme"`),
+which triggers their installation into the correct path.
+
+### How do I convert an existing project to Composer?
+
+The easiest way is to follow the [upgrading](/installation/upgrading) instructions
+and switch to a newer release. Alternatively, copy the `composer.json` file from
+a newer release, and adjust the version settings in the "require" section to your needs.
+You'll also need to update your webserver configuration
+from there (`.htaccess` or `web.config` files), in order to prevent
+web access to the composer-generated files.
+
+### Do I need composer on my live server?
+
+It depends on your deployment process. If you copy or rsync files to your live server,
+the process stays the same. If the live server hosts a git repository checkout,
+which is updated to push a newer version, you'll also need to run `composer install` afterwards.
+We recommend looking into [Composer "lock" files](http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file) for this purpose.
+
+### Can I keep using Downloads, Subversion Externals or Git Submodules?
+
+Yes and no. Composer comes with additional features such as
+[autoloading](http://getcomposer.org/doc/01-basic-usage.md#autoloading)
+or [scripts](http://getcomposer.org/doc/articles/scripts.md)
+which some modules will start relying on.
+Please check the module README for specific installation instructions.
+
+### I don't want to get development versions of everything!
+
+You don't have to, Composer is designed to work on the constraints you set.
+You can declare the ["minimum-stability"](http://getcomposer.org/doc/04-schema.md#minimum-stability)
+on your project as suitable, or even whitelist specific modules as tracking
+a development branch while keeping others to their stable release.
+Read up on [Composer "lock" files](http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file) on how this all fits together.
@@ -16,9 +16,19 @@ For all modules listed there, we automatically import new master strings as they
## FAQ
-### How do I translate substituted strings? (e.g. '%s')
+### How do I translate a module not listed on getlocalization?
-You don't have to - if the english master-string reads 'Hello %s', your german translation would be 'Hallo %s'. Strings prefixed by a percentage-sign are automatically replaced by silverstripe with dynamic content. See http://php.net/sprintf for details.
+At the moment, only the core modules ("framework" and "cms") are managed through
+the getlocalization service.
+For other modules, have a look in the module README if there's any specific instructions.
+If there aren't, you'll need to translate the YAML files directly. If the module is on github,
+you can create a fork, edit the files, and send back your pull request all directly on
+the website ([instructions](https://help.github.com/articles/fork-a-repo)).
+
+### How do I translate substituted strings? (e.g. '%s' or '{my-variable}')
+
+You don't have to - if the english master-string reads 'Hello %s', your german translation would be 'Hallo %s'. Strings prefixed by a percentage-sign are automatically replaced by silverstripe with dynamic content. See http://php.net/sprintf for details. The newer `{my-variable}` format works the same way,
+but makes its intent clearer, and allows reordering of placeholders in your translation.
### Do I need to convert special characters (e.g. HTML-entities)?
Oops, something went wrong.

0 comments on commit bea1b90

Please sign in to comment.