diff --git a/core/control/Controller.php b/core/control/Controller.php index e7f826861..b93df37f2 100644 --- a/core/control/Controller.php +++ b/core/control/Controller.php @@ -9,7 +9,7 @@ * @package sapphire * @subpackage control */ -class Controller extends RequestHandlingData { +class Controller extends RequestHandler { /** * @var array $urlParams An array of arguments extracted from the URL diff --git a/core/control/Director.php b/core/control/Director.php index 59dea7013..3fd651d7d 100644 --- a/core/control/Director.php +++ b/core/control/Director.php @@ -77,8 +77,8 @@ class Director { * request. * - Controller::handleRequest($request) is then called. This will find a rule to handle the URL, and call the rule * handling method. - * - RequestHandlingData::handleRequest($request) is recursively called whenever a rule handling method returns a - * RequestHandlingData object. + * - RequestHandler::handleRequest($request) is recursively called whenever a rule handling method returns a + * RequestHandler object. * * In addition to request processing, Director will manage the session, and perform the output of the actual response * to the browser. diff --git a/core/control/HTTPRequest.php b/core/control/HTTPRequest.php index 6494739e8..7dffc05a5 100644 --- a/core/control/HTTPRequest.php +++ b/core/control/HTTPRequest.php @@ -2,11 +2,11 @@ /** * Represents a HTTP-request, including a URL that is tokenised for parsing, and a request method (GET/POST/PUT/DELETE). - * This is used by {@link RequestHandlingData} objects to decide what to do. + * This is used by {@link RequestHandler} objects to decide what to do. * * The intention is that a single HTTPRequest object can be passed from one object to another, each object calling * match() to get the information that they need out of the URL. This is generally handled by - * {@link RequestHandlingData::handleRequest()}. + * {@link RequestHandler::handleRequest()}. * * @todo Accept X_HTTP_METHOD_OVERRIDE http header and $_REQUEST['_method'] to override request types (useful for webclients * not supporting PUT and DELETE) @@ -66,7 +66,7 @@ class HTTPRequest extends Object implements ArrayAccess { /** * @var array $allParams Contains an assiciative array of all - * arguments matched in all calls to {@link RequestHandlingData->handleRequest()}. + * arguments matched in all calls to {@link RequestHandler->handleRequest()}. * Its a "historical record" thats specific to the current call of * {@link handleRequest()}, and is only complete once the "last call" to that method is made. */ @@ -74,10 +74,10 @@ class HTTPRequest extends Object implements ArrayAccess { /** * @var array $latestParams Contains an associative array of all - * arguments matched in the current call from {@link RequestHandlingData->handleRequest()}, + * arguments matched in the current call from {@link RequestHandler->handleRequest()}, * as denoted with a "$"-prefix in the $url_handlers definitions. * Contains different states throughout its lifespan, so just useful - * while processed in {@link RequestHandlingData} and to get the last + * while processed in {@link RequestHandler} and to get the last * processes arguments. */ protected $latestParams = array(); @@ -330,7 +330,7 @@ class HTTPRequest extends Object implements ArrayAccess { if($varRequired && !isset($this->dirParts[$i])) return false; $arguments[$varName] = isset($this->dirParts[$i]) ? $this->dirParts[$i] : null; - if($part == '$Controller' && (!class_exists($arguments['Controller']) || !is_subclass_of($arguments['Controller'], 'RequestHandlingData'))) { + if($part == '$Controller' && (!class_exists($arguments['Controller']) || !is_subclass_of($arguments['Controller'], 'RequestHandler'))) { return false; } @@ -393,7 +393,7 @@ class HTTPRequest extends Object implements ArrayAccess { /** * Returns the unparsed part of the original URL - * separated by commas. This is used by {@link RequestHandlingData->handleRequest()} + * separated by commas. This is used by {@link RequestHandler->handleRequest()} * to determine if further URL processing is necessary. * * @return string Partial URL diff --git a/core/control/RequestHandlingData.php b/core/control/RequestHandler.php similarity index 94% rename from core/control/RequestHandlingData.php rename to core/control/RequestHandler.php index c9f1fb235..5359cd4b5 100644 --- a/core/control/RequestHandlingData.php +++ b/core/control/RequestHandler.php @@ -3,7 +3,7 @@ /** * This class is the base class of any Sapphire object that can be used to handle HTTP requests. * - * Any RequestHandlingData object can be made responsible for handling its own segment of the URL namespace. + * Any RequestHandler object can be made responsible for handling its own segment of the URL namespace. * The {@link Director} begins the URL parsing process; it will parse the beginning of the URL to identify which * controller is being used. It will then call {@link handleRequest()} on that Controller, passing it the parameters that it * parsed from the URL, and the {@link HTTPRequest} that contains the remainder of the URL to be parsed. @@ -17,15 +17,15 @@ * - Director will determine that admin/crm is controlled by a new ModelAdmin object, and pass control to that. * Matching Director Rule: "admin/crm" => "ModelAdmin" (defined in mysite/_config.php) * - ModelAdmin will determine that SearchForm is controlled by a Form object returned by $this->SearchForm(), and pass control to that. - * Matching $url_handlers: "$Action" => "$Action" (defined in RequestHandlingData class) + * Matching $url_handlers: "$Action" => "$Action" (defined in RequestHandler class) * - Form will determine that field/Groups is controlled by the Groups field, a TreeMultiselectField, and pass control to that. * Matching $url_handlers: 'field/$FieldName!' => 'handleField' (defined in Form class) * - TreeMultiselectField will determine that treesegment/36 is handled by its treesegment() method. This method will return an HTML fragment that is output to the screen. * Matching $url_handlers: "$Action/$ID" => "handleItem" (defined in TreeMultiSelectField class) * - * {@link RequestHandlingData::handleRequest()} is where this behaviour is implemented. + * {@link RequestHandler::handleRequest()} is where this behaviour is implemented. */ -class RequestHandlingData extends ViewableData { +class RequestHandler extends ViewableData { protected $request = null; /** @@ -72,7 +72,7 @@ class RequestHandlingData extends ViewableData { * @param $request The {@link HTTPRequest} object that is reponsible for distributing URL parsing * @uses HTTPRequest * @uses HTTPRequest->match() - * @return HTTPResponse|RequestHandlingData|string|array + * @return HTTPResponse|RequestHandler|string|array */ function handleRequest($request) { $this->request = $request; @@ -107,10 +107,10 @@ class RequestHandlingData extends ViewableData { return $result; } - // If we return a RequestHandlingData, call handleRequest() on that, even if there is no more URL to parse. + // If we return a RequestHandler, call handleRequest() on that, even if there is no more URL to parse. // It might have its own handler. However, we only do this if we haven't just parsed an empty rule ourselves, // to prevent infinite loops - if(!$request->isEmptyPattern($rule) && is_object($result) && $result instanceof RequestHandlingData) { + if(!$request->isEmptyPattern($rule) && is_object($result) && $result instanceof RequestHandler) { $returnValue = $result->handleRequest($request); // Array results can be used to handle @@ -143,7 +143,7 @@ class RequestHandlingData extends ViewableData { // Collate self::$allowed_actions from this class and all parent classes $access = null; $className = $this->class; - while($className != 'RequestHandlingData') { + while($className != 'RequestHandler') { // Merge any non-null parts onto $access. $accessPart = eval("return $className::\$allowed_actions;"); if($accessPart !== null) $access = array_merge((array)$access, $accessPart); diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index ceeb0da56..dd10a315a 100644 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -866,7 +866,7 @@ class SiteTree extends DataObject { $count = 1; while ( - (class_exists($this->URLSegment) && is_subclass_of($this->URLSegment, 'RequestHandlingData')) || + (class_exists($this->URLSegment) && is_subclass_of($this->URLSegment, 'RequestHandler')) || DataObject::get_one("SiteTree", "URLSegment = '$this->URLSegment' $idFilter") ) { $count++; diff --git a/dev/ModuleManager.php b/dev/ModuleManager.php index 9005cca6b..96ddf6bcf 100644 --- a/dev/ModuleManager.php +++ b/dev/ModuleManager.php @@ -11,7 +11,7 @@ * cd /my/project/ * sake dev/modules/add ecommerce */ -class ModuleManager extends RequestHandlingData { +class ModuleManager extends RequestHandler { protected $moduleBase = "http://svn.silverstripe.com/open/modules/"; static $allowed_actions = array( diff --git a/forms/ComplexTableField.php b/forms/ComplexTableField.php index d820602d7..ec7893fe4 100755 --- a/forms/ComplexTableField.php +++ b/forms/ComplexTableField.php @@ -587,7 +587,7 @@ JS; /** * @todo Tie this into ComplexTableField_Item better. */ -class ComplexTableField_ItemRequest extends RequestHandlingData { +class ComplexTableField_ItemRequest extends RequestHandler { protected $ctf; protected $itemID; protected $methodName; diff --git a/forms/Form.php b/forms/Form.php index a91d65cf2..2eddbe8e4 100644 --- a/forms/Form.php +++ b/forms/Form.php @@ -21,7 +21,7 @@ * @package forms * @subpackage core */ -class Form extends RequestHandlingData { +class Form extends RequestHandler { /** * @var boolean $includeFormTag Accessed by Form.ss; modified by {@link formHtmlContent()}. diff --git a/forms/FormField.php b/forms/FormField.php index 99dafaf28..9dbe9e7ed 100644 --- a/forms/FormField.php +++ b/forms/FormField.php @@ -7,7 +7,7 @@ * @package forms * @subpackage core */ -class FormField extends RequestHandlingData { +class FormField extends RequestHandler { protected $form; protected $name, $title, $value ,$message, $messageType, $extraClass; diff --git a/forms/HtmlEditorField.php b/forms/HtmlEditorField.php index 6b0307ab6..bb2bc263d 100755 --- a/forms/HtmlEditorField.php +++ b/forms/HtmlEditorField.php @@ -256,7 +256,7 @@ function HtmlEditorField_dataValue_processImage($parts) { * @package forms * @subpackage fields-formattedinput */ -class HtmlEditorField_Toolbar extends RequestHandlingData { +class HtmlEditorField_Toolbar extends RequestHandler { protected $controller, $name; function __construct($controller, $name) { diff --git a/forms/TableListField.php b/forms/TableListField.php index bc83151d4..ae882b009 100755 --- a/forms/TableListField.php +++ b/forms/TableListField.php @@ -1333,7 +1333,7 @@ class TableListField_Item extends ViewableData { } } -class TableListField_ItemRequest extends RequestHandlingData { +class TableListField_ItemRequest extends RequestHandler { protected $ctf; protected $itemID; protected $methodName; diff --git a/tests/RequestHandlingTest.php b/tests/RequestHandlingTest.php index 67efd0ce2..565d5bd70 100644 --- a/tests/RequestHandlingTest.php +++ b/tests/RequestHandlingTest.php @@ -1,7 +1,7 @@