public function delete($filename)
    {
        $this->request->allowMethod(['post', 'delete']);

        $success = (new File($this->getPath($filename, false)))->delete();
        $serialized = $this->getPath($filename, true);

        //Deletes the serialized log copy, if it exists
        if (file_exists($serialized)) {
            $successSerialized = (new File($serialized))->delete();
        }

        if ($success && $successSerialized) {
            $this->Flash->success(I18N_OPERATION_OK);
        } else {
            $this->Flash->error(I18N_OPERATION_NOT_OK);
        }

        return $this->redirect(['action' => 'index']);
    }
public function delete($filename)
    {
        $this->request->allowMethod(['post', 'delete']);

        $success = (new File($this->getPath($filename, false)))->delete();
        $serialized = $this->getPath($filename, true);

        //Deletes the serialized log copy, if it exists
        if (file_exists($serialized)) {
            $successSerialized = (new File($serialized))->delete();
        }

        if ($success && $successSerialized) {
            $this->Flash->success(I18N_OPERATION_OK);
        } else {
            $this->Flash->error(I18N_OPERATION_NOT_OK);
        }

        return $this->redirect(['action' => 'index']);
    }
public function delete ( $ filename ) { $ this -> request -> allowMethod ( [ 'post' , 'delete' ] ) ; $ success = ( new File ( $ this -> getPath ( $ filename , false ) ) ) -> delete ( ) ; $ serialized = $ this -> getPath ( $ filename , true ) ; //Deletes the serialized log copy, if it exists if ( file_exists ( $ serialized ) ) { $ successSerialized = ( new File ( $ serialized ) ) -> delete ( ) ; } if ( $ success && $ successSerialized ) { $ this -> Flash -> success ( I18N_OPERATION_OK ) ; } else { $ this -> Flash -> error ( I18N_OPERATION_NOT_OK ) ; } return $ this -> redirect ( [ 'action' => 'index' ] ) ; }
Deletes a log.
If there's even a serialized log copy, it also deletes that.
@param string $filename Filename
@return \Cake\Network\Response|null
@uses getPath()
Deletes a log . If there s even a serialized log copy it also deletes that .