@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | require 'Developers/Log.php'; |
| 13 | 13 | |
| 14 | - $datas = ["usuario" => "Jeferson Souza", "email" => "[email protected]", "perfil"=> "Admin","sessao"=>"Logado"]; |
|
| 14 | + $datas = ["usuario" => "Jeferson Souza", "email" => "[email protected]", "perfil"=> "Admin", "sessao"=>"Logado"]; |
|
| 15 | 15 | |
| 16 | 16 | $log = new \Developers\Log(); |
| 17 | 17 | $log->LogCreate("Login", "success", $datas);
|
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | |
| 15 | 15 | $Name = "Acesso Simultâneo"; |
| 16 | 16 | $data = " |
| 17 | - URL: ".__DIR__." |
|
| 17 | + URL: ".__DIR__ . " |
|
| 18 | 18 | IP: {$_SERVER['REMOTE_ADDR']}
|
| 19 | 19 | NAVEGADOR: {$_SERVER['HTTP_USER_AGENT']}
|
| 20 | 20 | PORTA: {$_SERVER['REMOTE_PORT']}
|
@@ -81,12 +81,12 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | //Predefined and standard text |
| 83 | 83 | //Texto pré-definido e padrão |
| 84 | - $this->text = "[LOG - ". date("d/m/Y H:i:s")."]
|
|
| 84 | + $this->text = "[LOG - " . date("d/m/Y H:i:s") . "]
|
|
| 85 | 85 | |
| 86 | - URL: ".__DIR__." |
|
| 87 | - IP: ".$_SERVER['REMOTE_ADDR']." |
|
| 88 | - NAVEGADOR: ".$_SERVER['HTTP_USER_AGENT']." |
|
| 89 | - PORTA: ".$_SERVER['REMOTE_PORT'].""; |
|
| 86 | + URL: ".__DIR__ . " |
|
| 87 | + IP: ".$_SERVER['REMOTE_ADDR'] . " |
|
| 88 | + NAVEGADOR: ".$_SERVER['HTTP_USER_AGENT'] . " |
|
| 89 | + PORTA: ".$_SERVER['REMOTE_PORT'] . ""; |
|
| 90 | 90 | |
| 91 | 91 | //We retrieve the data reported through the array |
| 92 | 92 | //Resgatamos os dados informados através do array |
@@ -108,15 +108,15 @@ discard block |
||
| 108 | 108 | * @param $folderDir |
| 109 | 109 | * @param $text |
| 110 | 110 | */ |
| 111 | - public function CreateFile($FolderDir, $text){
|
|
| 111 | + public function CreateFile($FolderDir, $text) {
|
|
| 112 | 112 | |
| 113 | 113 | $this->CreateText(); |
| 114 | 114 | |
| 115 | - $this->$FolderDir = $FolderDir; |
|
| 115 | + $this->$FolderDir = $FolderDir; |
|
| 116 | 116 | |
| 117 | 117 | //Log File Creation |
| 118 | 118 | //Criação de Arquivo para o Log |
| 119 | - $file = $this->Name.'-' . date('Y-m-d') . '-'.time() .'.txt';
|
|
| 119 | + $file = $this->Name . '-' . date('Y-m-d') . '-' . time() . '.txt';
|
|
| 120 | 120 | |
| 121 | 121 | $dir = $this->$FolderDir . $file; |
| 122 | 122 | |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | * @param $Data |
| 138 | 138 | * @return bool |
| 139 | 139 | */ |
| 140 | - public function LogCreate($Name, $Status, $Data){
|
|
| 140 | + public function LogCreate($Name, $Status, $Data) {
|
|
| 141 | 141 | $this->Data = $Data; |
| 142 | - $this->Status= $Status; |
|
| 143 | - $this->Name= $Name; |
|
| 142 | + $this->Status = $Status; |
|
| 143 | + $this->Name = $Name; |
|
| 144 | 144 | |
| 145 | 145 | //We call the method to create the Log folder and subfolder, if it was not generated |
| 146 | 146 | //Chamamos o método para criar a pasta Log e subpasta, se não foi gerado |
@@ -157,16 +157,16 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - public function CreateManual($FolderDir, $text){
|
|
| 160 | + public function CreateManual($FolderDir, $text) {
|
|
| 161 | 161 | |
| 162 | - $this->$FolderDir = $FolderDir; |
|
| 163 | - $this->text = $text; |
|
| 162 | + $this->$FolderDir = $FolderDir; |
|
| 163 | + $this->text = $text; |
|
| 164 | 164 | |
| 165 | 165 | $dir = $this->$FolderDir; |
| 166 | 166 | |
| 167 | 167 | //Log File Creation |
| 168 | 168 | //Criação de Arquivo para o Log |
| 169 | - $file = $this->Name.'-' . date('Y-m-d') . '-'.time() .'.txt';
|
|
| 169 | + $file = $this->Name . '-' . date('Y-m-d') . '-' . time() . '.txt';
|
|
| 170 | 170 | |
| 171 | 171 | //We generate the file name and the content that will be printed on the file. |
| 172 | 172 | //Geramos o nome do arquivo e o conteúdo do mesmo. |
@@ -175,19 +175,19 @@ discard block |
||
| 175 | 175 | fclose($fopen); |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - public function LogManual($Name, $Data){
|
|
| 179 | - $this->Data= $Data; |
|
| 180 | - $this->Name= $Name; |
|
| 178 | + public function LogManual($Name, $Data) {
|
|
| 179 | + $this->Data = $Data; |
|
| 180 | + $this->Name = $Name; |
|
| 181 | 181 | |
| 182 | 182 | //We call the method to create the Log folder and subfolder, if it was not generated |
| 183 | 183 | //Chamamos o método para criar a pasta Log e subpasta, se não foi gerado |
| 184 | 184 | $this->CreateFolder(); |
| 185 | 185 | |
| 186 | 186 | //Texto Pré-definido |
| 187 | - $content = "[LOG - ". date("d/m/Y H:i:s")."]";
|
|
| 187 | + $content = "[LOG - " . date("d/m/Y H:i:s") . "]";
|
|
| 188 | 188 | |
| 189 | 189 | //Texto personalizado e encaminhado via parâmetro. |
| 190 | - $content.= "{$this->Data}";
|
|
| 190 | + $content .= "{$this->Data}";
|
|
| 191 | 191 | |
| 192 | 192 | //We define the name of the folder and its subfolders. |
| 193 | 193 | //Definimos o nome da pasta e suas subpastas. |