Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- *
- */
- //@#$ |
- @defined("LOCK", 1) or ('Você não tem permissão para acessar esse arquivo.');
- //@#$ |
- class GeradorHacker extends html_erro
- {
- public $Estilo;
- public $Especial;
- private $Texto;
- public $ContarCaracteres;
- public $erro = null;
- public function __construct($Estilo, $Especial, $Texto, $ContarCaracteres)
- {
- $this->Estilo = $Estilo;
- $this->Especial = $Especial;
- $this->Texto = $Texto;
- $this->ContarCaracteres = $ContarCaracteres;
- $this->erro = $erro;
- //@#$ | Chamar funções...
- $this->ValidarDados();
- $this->TratarDados();
- $this->EscritaHacker();
- $this->AdicionarEspecial();
- $this->ImprimirTexto();
- }
- public function ValidarDados()
- {
- //@#$ | validando estilo...
- if ( empty($this->Estilo) )
- new html_erro('Você não definiu o estilo em que o texto será gerado. Somente dois estilos são permitidos: <b>simples</b> ou <b>ultra</b>. Escolha o seu e gere seu texto!');
- //@#$ | validando contagem de caractéres...
- if ( empty($this->ContarCaracteres) )
- new html_erro('Você não decidiu... Se vai contar os caractéres: <b>sim</b> ou <b>não</b>?');
- //@#$ | validando texto...
- if ( empty($this->Texto) )
- new html_erro('Você não digitou o <strong>texto</strong> a ser gerado, digite o texto.');
- } // $this->ValidarDados();
- private function TratarDados()
- {
- //@#$ | retira possiveis espaços antes e depois do texto.
- //@#$ | retira tags HTML e/ou PHP, do texto...
- //@#$ | transforma o texto inteiro em letras maiusculas.
- $this->Texto = trim($this->Texto);
- $this->Texto = strip_tags($this->Texto);
- $this->Texto = strtoupper($this->Texto);
- //@#$ | retira possiveis espaços antes e depois do $this->estilo.
- //@#$ | retira tags HTML e/ou PHP, do $this->estilo...
- $this->Estilo = trim($this->Estilo);
- $this->Estilo = strip_tags($this->Estilo);
- } // $this->TratarDados();
- private function NumeroCaracteres()
- {
- //@#$ | retorna o numero de caracteres de uma string...
- $this->Caracteres = strlen($this->Texto);
- switch ( $this->ContarCaracteres ) :
- case 'sim':
- //@#$ | Exibe o numero de caracteres após texto gerado....
- $this->TextoFinal .= " [ O texto gerado, contém: ".$this->Caracteres." caractéres. ] ";
- break;
- case 'nao':
- //apenas continua o código...
- break;
- default:
- new html_erro('Você não decidiu... Se vai contar os caractéres: <b>sim</b> ou <b>não</b>?');
- endswitch;
- } // $this->NumeroCaracteres();
- private function EscritaHacker()
- {
- switch ( $this->Estilo ) :
- case 'simples' :
- $this->search = array('A', 'E', 'G', 'I', 'O', 'S', 'T');
- $this->replace = array('4', '3', '6', '1', '0', '5', '7');
- $this->TextoTemp = str_replace($this->search, $this->replace, $this->Texto);
- break;
- case 'ultra' :
- $this->search = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'Y', 'X', 'Z');
- $this->replace = array('@', '|}', '(', '[)', '3', '|=', '6', '|-|', '1', 'J', '|<', '|', '|\/|', '|\|', '0', '|*', 'q', '|2', '$', '+', '|_|', '\/', '\X/', '`/', '><', 'Z');
- $this->TextoTemp = str_replace($this->search, $this->replace, $this->Texto);
- break;
- default:
- new html_erro('Você definiu um estilo não suportado pela APi. Somente dois estilos são suportados: <b>simples</b> ou <b>ultra</b>.');
- endswitch;
- } // $this->EscritaHacker();
- private function AdicionarEspecial()
- {
- $this->Especial = explode(':', $this->Especial);
- if ( !empty($this->Especial['1']) ) :
- $this->TextoFinal .= $this->Especial['0'];
- $this->TextoFinal .= " " . $this->TextoTemp . " ";
- $this->TextoFinal .= $this->Especial['1'];
- $this->NumeroCaracteres();
- else:
- $this->TextoFinal = $this->TextoTemp;
- $this->NumeroCaracteres();
- endif;
- } // $this->AdicionarEspecial();
- private function ImprimirTexto()
- {
- print($this->TextoFinal);
- } // $this->ImprimirTexto();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement