PHP Classes

File: examples/user/admin.php

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil   PHP Skeleton Framework   examples/user/admin.php   Download  
File: examples/user/admin.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Skeleton Framework
Extensive Web application development framework
Author: By
Last change:
Date: 8 years ago
Size: 1,283 bytes
 

Contents

Class file image Download
<?php
require_once 'config.php';

// Init autoload using Locator
require dirname(__FILE__) . '/../../A/Locator.php';
$Locator = new A_Locator();
$Locator->autoload();

$Request = new A_Http_Request();
$Response = new A_Http_Response();
$Session = new A_Session();
$Session->start();
$UserSession = new A_User_Session($Session);
$UserSession->getAuth();
$UserSession->setTimestamp(time());

$Locator->set('Request', $Request);
$Locator->set('Response', $Response);
$Locator->set('Session', $Session);
$Locator->set('UserSession', $UserSession);

#$UserSession->login('test', 'member|editor');
#$UserSession->logout();
#$rule = new A_Rule_UserIsLevel(15);

$UserAccess = new A_User_Access($UserSession);
$UserAccess->addRule(new A_User_Rule_Isloggedin(array('', 'login', 'index')));
#$UserAccess->addRule(new A_User_Rule_Ingroup(array('manager'), 'error'));
$UserAccess->run($Locator);

#dump($UserAccess);
#dump($Locator);

$Mapper = new A_Controller_Mapper('', array('', 'example', 'index'));
// dump($Mapper);
//dump2($Request);
$Controller = new A_Controller_Front($Mapper, array('', 'error', 'index'));
$Controller->run($Locator);
dump($Controller->getRoutes(), 'ROUTES: ');
#dump($Response);
$Response->out();
dump($_SESSION);
dump();