Campustream 1.0
A social network MQP for WPI
application/controllers/debug.php
Go to the documentation of this file.
00001 <?
00002 
00006 class Debug_Controller extends Controller implements REST {
00007         public $enable_session = true;
00008         
00009         public function phpinfo() {
00010                 echo phpinfo();
00011         }
00012         
00013         public function auth_test() {
00014                 if (!$this->session->get('authenticated')) {
00015                         return Hub::http_error(403, "Unauthorized");
00016                 } else {
00017                         View::respond_to('json', function () {
00018                                 echo json_encode(array('success' => 1));
00019                         });
00020                         
00021                         View::respond_to('html', function () {
00022                                 echo 1;
00023                         });
00024                 }
00025         }
00026         
00027         public function flockdb() {
00028                 $flock = FlockDBManager::connection();
00029                 $cursor = $flock->select(1, 'follows', null);
00030                 $page1 = $cursor->currentPage();
00031                 print_r($page1);
00032         }
00033         
00034         public function sphinx() {
00035                 $sphinx = SphinxManager::connection();
00036                 $res = $sphinx->Query("update", "*");
00037                 echo "<pre>";
00038                 print_r($res);
00039                 echo "</pre>";
00040         }
00041         
00042         public function rss() {
00043                 $rss = rssreader::load('http://blog.meltingice.net/feed');
00044                 
00045                 echo "<pre>";
00046                 echo $rss->generator . "\n";
00047                 print_r($rss->posts);
00048                 echo "</pre>";
00049         }
00050         
00051         public function notify() {
00052                 $n = new notifications();
00053                 //$n->send(sess::getUserID(), "This is a test!");
00054                 
00055                 echo "<pre>";
00056                 print_r($n->get());
00057                 
00058                 //$n->markAllAsRead();
00059                 //print_r($n->get());
00060                 echo "</pre>";
00061         }
00062         
00063 }