projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Several improvements on how PHP errors are managed.
[platal.git]
/
classes
/
platal.php
diff --git
a/classes/platal.php
b/classes/platal.php
index
4560f6e
..
e5187e4
100644
(file)
--- a/
classes/platal.php
+++ b/
classes/platal.php
@@
-23,6
+23,7
@@
define('PL_DO_AUTH', 300);
define('PL_FORBIDDEN', 403);
define('PL_NOT_FOUND', 404);
define('PL_WIKI', 500);
define('PL_FORBIDDEN', 403);
define('PL_NOT_FOUND', 404);
define('PL_WIKI', 500);
+define('PL_JSON', 501);
abstract class PlHook
{
abstract class PlHook
{
@@
-361,7
+362,8
@@
abstract class Platal
try {
$page->assign('platal', $this);
try {
$page->assign('platal', $this);
- switch ($this->call_hook($page)) {
+ $res = $this->call_hook($page);
+ switch ($res) {
case PL_FORBIDDEN:
$this->mods['core']->handler_403($page);
break;
case PL_FORBIDDEN:
$this->mods['core']->handler_403($page);
break;
@@
-385,7
+387,11
@@
abstract class Platal
}
$page->assign('platal', $this);
}
$page->assign('platal', $this);
- $page->run();
+ if ($res == PL_JSON) {
+ $page->runJSon();
+ } else {
+ $page->run();
+ }
}
public function error403()
}
public function error403()