00001 <?php 00024 class WebLogoutCommand extends BaseCommand implements Commandable { 00030 protected function __construct () { 00031 // Call parent constructor 00032 parent::__construct(__CLASS__); 00033 } 00034 00041 public final static function createWebLogoutCommand (CommandResolver $resolverInstance) { 00042 // Get new instance 00043 $commandInstance = new WebLogoutCommand(); 00044 00045 // Set the application instance 00046 $commandInstance->setResolverInstance($resolverInstance); 00047 00048 // Return the prepared instance 00049 return $commandInstance; 00050 } 00051 00059 public function execute (Requestable $requestInstance, Responseable $responseInstance) { 00060 // Get an auth instance for checking and updating the auth cookies 00061 $authInstance = ObjectFactory::createObjectByConfiguredName('auth_method_class', array($responseInstance)); 00062 00063 // Set request instance 00064 $authInstance->setRequestInstance($requestInstance); 00065 00066 // Destroy the auth data 00067 $authInstance->destroyAuthData(); 00068 00069 // Redirect to "logout done" page 00070 $responseInstance->redirectToConfiguredUrl('logout_done_url'); 00071 00072 // Exit here 00073 exit(); 00074 } 00075 00083 public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { 00084 // Empty for now 00085 } 00086 } 00087 00088 // [EOF] 00089 ?>
1.5.6