Add some of the basic REST API class hierarchies: * EntryPoint * Router * Request * Response * Handler The actual entry point file rest.php has been moved to a separate commit, so this is just an unused library and service. Bug: T221177 Change-Id: Ifca6bcb8a304e8e8b7f52b79c607bdcebf805cd1
21 lines
615 B
PHP
21 lines
615 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Rest\PathTemplateMatcher;
|
|
|
|
use Exception;
|
|
|
|
class PathConflict extends Exception {
|
|
public $newTemplate;
|
|
public $newUserData;
|
|
public $existingTemplate;
|
|
public $existingUserData;
|
|
|
|
public function __construct( $template, $userData, $existingNode ) {
|
|
$this->newTemplate = $template;
|
|
$this->newUserData = $userData;
|
|
$this->existingTemplate = $existingNode['template'];
|
|
$this->existingUserData = $existingNode['userData'];
|
|
parent::__construct( "Unable to add path template \"$template\" since it conflicts " .
|
|
"with the existing template \"{$this->existingTemplate}\"" );
|
|
}
|
|
}
|