Delete the log.

@param  string  $date

@return bool

@throws \Arcanedev\LogViewer\Exceptions\FilesystemException
511454
public function delete($date)
    {
        $path = $this->getLogPath($date);

        // @codeCoverageIgnoreStart
        if ( ! $this->filesystem->delete($path)) {
            throw new FilesystemException('There was an error deleting the log.');
        }
        // @codeCoverageIgnoreEnd

        return true;
    }
802584
public function date($date)
    {
        if ($date instanceof \DateTime) {
            $date = $date->format('Y-m-d H:i:s');
        }
        $this->arguments[] = '--date=' . $date;
        return $this;
    }
195360
public function read($date)
    {
        try {
            $path = $this->getLogPath($date);

            return $this->filesystem->get($path);
        } catch (Exception $e) {
            Log::emergency($e);
            throw new Exception($e->getMessage());
        }
    }
873890
public function download($date)
    {
        app('antares.logger')->setOld(['name' => $this->logViewer->get($date)->getFilename()])->keep('medium');
        return $this->logViewer->download($date);
    }
1181067
public function date($date)
    {
        $events = $this->repository->findEventsByDate($date);

        if (empty($events)) {
            abort(404);
        }

        return view('cms-frontend::events.date')->with('events', $events);
    }
26240
public function date_strtotime($date)
	{
		$strtotime = strtotime($date);
		if ($strtotime === -1 || $strtotime === false)
		{
			return false;
		}
		else
		{
			return $strtotime;
		}
	}
384611
private function getLogPath($date)
    {
        $path = "{$this->storagePath}/http-{$date}.log";

        if (!$this->filesystem->exists($path)) {
            throw new Exception(
            'The log(s) could not be located at : ' . $path
            );
        }

        return realpath($path);
    }
863262
public function delete($date, IndexListener $listener)
    {
        try {
            app('antares.logger')->setOld(['name' => $this->logViewer->get($date)->getFilename()])->keep('high');
            $this->logViewer->delete($date);
            return $listener->deleteSuccess();
        } catch (Exception $ex) {
            return $listener->deleteFailed();
        }
    }
743449
public function delete( $filePath )
    {
        $map = $this->mapFilePathArray( (array)$filePath );

        $returnValue = true;
        /** @var eZDFSFileHandlerDFSBackendInterface $handler */
        foreach ( $map['handlers'] as $handlerClass => $handler )
        {
            $returnValue &= $handler->delete( $map['files'][$handlerClass] );
        }

        return (bool)$returnValue;
    }
1208022
public function dontSeeDateIsThursday($date) {
        \PHPUnit_Framework_Assert::assertFalse($this->_ParseDate($date)->dayOfWeek == Carbon::THURSDAY);
    }
1238215
public static function delete($file)
	{
		$files = (array) $file;

		foreach ($files as $file) {
			$file = FileHelper::cleanPath($file);

			// Try making the file writable first. If it's read-only, it can't be deleted
			// on Windows, even if the parent folder is writable
			@chmod($file, 0777);

			// In case of restricted permissions we zap it one way or the other
			// as long as the owner is either the webserver or the ftp
			if (!@ unlink($file)) {
				throw new Exception(__METHOD__ . ': Failed deleting ' . basename($file));
			}
		}

		return true;
	}
1159764
public static function isValidDate($date, $formats = array('Y-m-d')) {
		$unixTime = strtotime($date);
		if (!$unixTime) { //strtotime转换不对，日期格式显然不对。
			return false;
		}
	
		//校验日期的有效性，只要满足其中一个格式就OK
		foreach ($formats as $format) {
			if (date($format, $unixTime) == $date) {
				return true;
			}
		}
		
		return false;
	}
91025
public static function isDate($date = false, $format = 'Y-m-d H:i:s') {

        if($date) {

            $DateTime = DateTime::createFromFormat($format, $date);
            return $DateTime && $DateTime->format($format) == $date;
        }
        
        return false;
    }
762240
public function dontSeeDateIsSunday($date) {
        \PHPUnit_Framework_Assert::assertFalse($this->_ParseDate($date)->dayOfWeek == Carbon::SUNDAY);
    }
156415
public function matchDate($date)
    {
        return $this->matchPart(
            $date,
        $this->formatRegex[$this->format][self::STRDATE]
        );
    }
1280558
protected function _formatDate($date)
    {
        $clearDate = trim($date, '\'" ');
        //brak daty, pusty zwrot
        if (!$clearDate || $clearDate == 'false') {
            return;
        }
        return date($this->getFormat(), strtotime($clearDate));
    }
1039701
protected function parse_date($date) {
        if($date instanceof \Carbon\Carbon) return $date;

        try {
            $date = Carbon::parse($date);
        } catch (\Exception $e) {
            throw new MessageSearchValidationException();
        }

        return $date;
    }