
WebRequest oraz WebController - dop. ActivePlayer
<?php include("chameleon.class.php"); $chameleon = new chameleon; $chameleon->chamaleon(); ?>
<?php class modul extends chameleon { i tutaj klasa modulu } ?>
<?php class templates extends nazwaklasysystemutemplatow { } ?>
<?php class Renderer { var $core; # Tu rozne dziwne rzeczy... function setCore( $ClassName = 'smarty' ) { $this->core = $ClassName; } function render() { # tu pare dziwnych rzeczy eval(' class View extends ' . $this->core . ' { function execute() { $error = 'die()'; trigger_error($error, E_USER_ERROR); } } '); } } ?>
<?php class webRequest { var $bHTML; var $bMaGic; var $bRGbyScript; var $bSQL; var $aKey; var $aType; var $aString; public function __contruct() {} private function RGbyScript($bRGbyScript,$aKey,$aType) { if(strolower($bRGbyScript == 'true')) { switch(strolower($aType)) { case 'get': $$aKey = $_GET[$aKey]; return $$aKey; break; case 'post': $$aKey = $_POST[$aKey]; return $$aKey; break; case 'cookie' $$aKey = $_COOKIES[$aKey]; return $$aKey; break; } } else { return; } } public function getRequest($aType,$aKey,$bMaGic,$bHTML,$bRGbyScript,$bSQL) { switch(strolower($aType)) { case 'get': $this->Prepare($_GET[$aKey],$bMaGic,$bHTML,$bRGbyScript,$bSQL); break; case 'post': $this->Prepare($_POST[$aKey],$bMaGic,$bHTML,$bRGbyScript,$bSQL); break; case 'cookie': $this->Prepare($_COOKIES[$aKey],$bMaGic,$bHTML,$bRGbyScript,$bSQL); break; } } private function Prepare($aString,$bMaGic,$bHTML,bRGbyScript,$bSQL,$aType,$aKey) { if(strolower($RGbyScript) == 'true') { $this->$RGbyScript('true',$aKey,$aType); } if(strolower($bMaGic) == 'true') { $aString = jakas_funkcja; } if(strolower($bHTML) == 'true') { $aString = oczyszcza z HTMLa; } if(strolower($bSQL) == 'true') { $aString = oczyszcza z SQL; } return } } ?>
<?php class webRequest { var $bHTML; var $bMaGic; var $bRGbyScript; var $bSQL; var $aKey; var $aType; var $aString; public function __contruct() {} private function RGbyScript($bRGbyScript,$aKey,$aType) { if(strolower($bRGbyScript == 'true')) { switch(strolower($aType)) { case 'get': $$aKey = $_GET[$aKey]; return $$aKey; break; case 'post': $$aKey = $_POST[$aKey]; return $$aKey; break; case 'cookie' $$aKey = $_COOKIES[$aKey]; return $$aKey; break; } } else { return; } } public function getRequest($aType,$aKey,$bMaGic,$bHTML,$bRGbyScript,$bSQL) { switch(strolower($aType)) { case 'get': $this->Prepare($bMaGic,$bHTML,$bRGbyScript,$bSQL,$aType,$aKey); break; case 'post': $this->Prepare($bMaGic,$bHTML,$bRGbyScript,$bSQL,$aType,$aKey); break; case 'cookie': $this->Prepare($bMaGic,$bHTML,$bRGbyScript,$bSQL,$aType,$aKey); break; } } private function Prepare($bMaGic,$bHTML,bRGbyScript,$bSQL,$aType,$aKey) { if(strolower($RGbyScript) == 'true') { $this->$RGbyScript('true',$aKey,$aType); } if(strolower($bMaGic) == 'true') { $$aKey = jakas_funkcja; } if(strolower($bHTML) == 'true') { $$aKey = oczyszcza z HTMLa; } if(strolower($bSQL) == 'true') { $$aKey = oczyszcza z SQL; } return $$aKey; } } ?>
To klasa.
<?php class webRequest { var $bHTML; var $bMaGic; var $bRGbyScript; var $bSQL; var $aKey; var $aType; var $aString; public function __construct() { } private function RGbyScript($bRGbyScript,$aKey,$aType) { if(strolower($bRGbyScript == 'true')) { switch(strolower($aType)) { case 'get': $$aKey = $_GET[$aKey]; return $$aKey; break; case 'post': $$aKey = $_POST[$aKey]; return $$aKey; break; case 'cookie': $$aKey = $_COOKIES[$aKey]; return $$aKey; break; } } else { return; } } public function getRequest($aType,$aKey,$bHTML = "false",$bRGbyScript = "false",$bSQL = "false",$bMaGic = "false") { switch(strolower($aType)) { case 'get': $this->Prepare($bMaGic,$bHTML,$bRGbyScript,$bSQL,$aType,$aKey); break; case 'post': $this->Prepare($bMaGic,$bHTML,$bRGbyScript,$bSQL,$aType,$aKey); break; case 'cookie': $this->Prepare($bMaGic,$bHTML,$bRGbyScript,$bSQL,$aType,$aKey); break; } } private function Prepare($bMaGic,$bHTML,bRGbyScript,$bSQL,$aType,$aKey) { if(strolower($RGbyScript) == 'true') { $this->$RGbyScript('true',$aKey,$aType); } if(strolower($bMaGic) == 'true') { } if(strolower($bHTML) == 'true') { } if(strolower($bSQL) == 'true') { } return $$aKey; } } ?>
<?php if(strolower($bMaGic) == 'true') { } ?>
<?php class webRequest { var $bHTML; var $bMaGic; var $bRGbyScript; var $bSQL; var $aKey; var $aType; var $aString; public function __construct() { } private function RGbyScript($bRGbyScript,$aKey,$aType) { if(strolower($bRGbyScript == 'true')) { switch(strolower($aType)) { case 'get': $$aKey = $_GET[$aKey]; return $$aKey; break; case 'post': $$aKey = $_POST[$aKey]; return $$aKey; break; case 'cookie': $$aKey = $_COOKIES[$aKey]; return $$aKey; break; } } else { return; } } public function getRequest($aType,$aKey,$bHTML = "false",$bSQL = "false",$bMaGic = "false") { switch(strolower($aType)) { case 'get': $this->Prepare($bMaGic,$bHTML,$bSQL,$aType,$aKey); break; case 'post': $this->Prepare($bMaGic,$bHTML,$bSQL,$aType,$aKey); break; case 'cookie': $this->Prepare($bMaGic,$bHTML,$bSQL,$aType,$aKey); break; } } private function Prepare(&$bMaGic,$bHTML,$bSQL,$aType,$aKey) { $this->$RGbyScript('true',$aKey,$aType); if(strolower($bMaGic) == 'true') { } if(strolower($bHTML) == 'true') { } if(strolower($bSQL) == 'true') { } return $$aKey; } } ?>
<?php class webRequest { var $bHTML; var $bMaGic; var $bRGbyScript; var $bSQL; var $aKey; var $aType; var $aString; public function __construct() { } public function getRequest($aType,$aKey,$bHTML = "false",$bSQL = "false",$bMaGic = "false") { { case 'get': $aType = "$_GET"; $this->Prepare($bMaGic,$bHTML,$bSQL,$aType,$aKey); break; case 'post': $this->Prepare($bMaGic,$bHTML,$bSQL,$aType,$aKey); break; case 'cookie': $this->Prepare($bMaGic,$bHTML,$bSQL,$aType,$aKey); break; } } private function Prepare(&$bMaGic,$bHTML,$bSQL,$aType,$aKey) { { } { } { } return $_$aType[$aKey]; } } ?>
<?php include("../library/WebRequest.class.php"); $WebRequest = new WebRequest; $WebRequest->getRequest('get','turgon','true','true','true'); ?>
<?php class webRequest { var $bHTML; var $bMaGic; var $bSQL; var $aKey; var $Zmienna; var $Zmienna2; public function __construct() { } public function getRequest($aKey,$bSQL = "false",$bHTML = "false") { { $Zmienna2 = $_GET[$aKey]; $this->Prepare($Zmienna2,$bSQL,$bHTML); $Zmienna = $_GET[$aKey]; return $_GET[$aKey]; } { $Zmienna2 = $_POST[$aKey]; $this->Prepare($Zmienna2,$bSQL,$bHTML); $Zmienna = $_POST[$aKey]; return $_POST[$aKey]; } { $Zmienna2 = $_COOKIES[$aKey]; $this->Prepare($Zmienna2,$bSQL,$bHTML); $Zmienna = $_COOKIES[$aKey]; return $_COOKIES[$aKey]; } } private function Prepare($Zmienna,$bSQL,$bHTML) { { } { } { } return $Zmienna; } } ?>
<?php class webController { var $Action; var $StandardAction; function __construct() { include("./module.list.php"); } public function Execute($Action = null,$StandardAction = "index") { { { { if(file_exist($Modules[$this->Action])) { include($Modules[$this->Action]); } else { } } else { } } else { { if(file_exist($Modules[$this->StandardAction])) { include($Modules[$this->StandardAction]); } else { } } else { } } } else { } } } ?>
<?php include("webController.class.php"); $webRequest = new webRequest; $webController->Execute(); ?>
<?php $Modules['index'] = 'index.php'; ?>
<?php include("./module.list.php"); // juz masz lokalnie w kostruktorze widoczna tablice $Modules // "pokaz" ja teraz reszcie metod klasy: $this->Modules = $Modules; ?>
<?php //zmieniasz na ?>
<?php class sessionHandler { var $sessname; var $sessvalue; var $time; function __construct() { } function start_sess($sessname,$sessvalue,$time) { } function is_sess($sessname) { { { return 'true'; } } else { return 'false'; } } function kill_sess($sessname,$time) { } } ?>