Cosmetics : remove spaces at the end of lines and correct lines with more than 80 chars
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1643 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
18
route.php
18
route.php
@@ -15,21 +15,21 @@ class route
|
||||
public $method = "";
|
||||
/** The module name */
|
||||
public $module = NULL;
|
||||
/** The debug mode :
|
||||
/** The debug mode :
|
||||
0:NoDebug, 1:routing, 2:more debug (developpement)*/
|
||||
public $debug=0;
|
||||
//public $defaultOutput = "html"; // Default renderer : html
|
||||
|
||||
/** Return the baseURL of the site
|
||||
Always finish with a slash
|
||||
@param string|null $module The module name (if thereis one) */
|
||||
@param string|null $module The module name (if thereis one) */
|
||||
function baseURL ($module = FALSE)
|
||||
{
|
||||
if ($this->module === NULL)
|
||||
$this->module = $module;
|
||||
if ($this->baseURL !== "")
|
||||
return $this->baseURL;
|
||||
|
||||
|
||||
if (!isset ($_SERVER["SERVER_PORT"]))
|
||||
$_SERVER["SERVER_PORT"] = "80";
|
||||
$port = ":".$_SERVER["SERVER_PORT"];
|
||||
@@ -132,7 +132,7 @@ class route
|
||||
if (substr ($destURL, 0, strlen ($baseURL)) !== $baseURL)
|
||||
throw new Exception ("Can't redirect outside this site (Base $baseURL)",
|
||||
405);
|
||||
|
||||
|
||||
if ($this->debug)
|
||||
{
|
||||
echo "<pre>\n";
|
||||
@@ -183,7 +183,7 @@ class route
|
||||
ob_flush ();
|
||||
flush ();
|
||||
}
|
||||
|
||||
|
||||
$class = $action[0];
|
||||
$method = $action[1];
|
||||
$params = array_slice ($action, 2);
|
||||
@@ -298,7 +298,7 @@ class route
|
||||
$rc = @include_once ("controllers/controller_$class.php");
|
||||
// For loading framework classes
|
||||
if ($rc === FALSE) @include_once ("$class.php");
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
$reflection = new ReflectionMethod ($class, $method);
|
||||
@@ -364,13 +364,13 @@ class route
|
||||
catch (Exception $e)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//echo "passConstruct=";print_r ($passConstruct);
|
||||
// Check if the method need parameters
|
||||
$reflection = new ReflectionMethod ($class, $method);
|
||||
$passMethod = array();
|
||||
//echo "getParameters=";var_dump ($reflection->getParameters());
|
||||
foreach($reflection->getParameters() as $key=>$param)
|
||||
foreach($reflection->getParameters() as $key=>$param)
|
||||
{
|
||||
if (isset ($matches[$param->getName ()]))
|
||||
$passMethod[] = $matches[$param->getName ()];
|
||||
@@ -426,7 +426,7 @@ class route
|
||||
Throw an exception in case of error */
|
||||
public function method ()
|
||||
{
|
||||
if (isset ($_POST["_METHOD"]) &&
|
||||
if (isset ($_POST["_METHOD"]) &&
|
||||
($_POST["_METHOD"] === "GET" ||
|
||||
$_POST["_METHOD"] === "POST" ||
|
||||
$_POST["_METHOD"] === "PUT" ||
|
||||
|
||||
Reference in New Issue
Block a user