承接 erdaldemirci/laravel-geoip-log-cleaner 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

erdaldemirci/laravel-geoip-log-cleaner

Composer 安装命令:

composer require erdaldemirci/laravel-geoip-log-cleaner

包简介

Simple laravel package for clearing GeoIP logs.

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License

Documentation

Installation

You can install this package through Composer.

  • First, edit your project's composer.json file to require erdaldemirci/laravel-geoip-log-cleaner:
"require": {
    // other require packages
    "laravel-geoip-log-cleaner": "1.*"
},
  • Next, run the composer update command in your command line interface:
$ composer update

Note: Instead of performing the above two steps, you can perform faster with the command line $ composer require erdaldemirci/laravel-geoip-log-cleaner:1.*.

  • Add following code to app\Console\Kernel.php.
protected $commands = [
    // other kernel commands
    \ErdalDemirci\GeoIPLogCleaner\Command\LogClearCommand::class,
];

Usage

Working with facade

Laravel Log Cleaner has a facade with name is ErdalDemirci\GeoIPLogCleaner\Facades\Cleaner. You can do any operation through this facade. For example:

<?php

namespace YourNamespace;

// your code

use ErdalDemirci\GeoIPLogCleaner\Facades\Cleaner;

class YourClass
{
    public function yourMethod()
    {
        Cleaner::doSomething();
    }
}

Method chaining

Some functions of loading, writing, backing up, restoring are implementation and usage of method chaining. So these functions can be called to chained together in a single statement. Examples:

$cleaner = Cleaner::rotate(14);

if ($cleaner->clear()) {
    echo 'GeoIP Log files older than 14 days in default folder were cleared successfully.';
} else {
    echo 'GeoIP Log files older than 14 days in default folder were cleared with errors.';
}

if ($cleaner->dir('path_to_logs')->clear()) {
    echo 'GeoIP Log files older than 14 days in `path_to_logs` folder were cleared successfully.';
} else {
    echo 'GeoIP Log files older than 14 days in `path_to_logs` folder were cleared with errors.';
}
if (Cleaner::dir('path_to_logs')->clear()) {
    echo 'Log files in `path_to_logs` folder were cleared successfully.';
} else {
    echo 'Log files in `path_to_logs` folder were cleared with errors.';
}

Working with Artisan CLI

Laravel GeoIP Log Cleaner have command can use easily with Artisan CLI. Example:

$ php artisan geoiplog:clear --path=/path/to/log/files --rotate=14

Please use each above command with option --help for details of usage. Example:

$ php artisan geoiplog:clear --help

License

The Laravel GeoIP Log Cleaner is open-source software licensed under the MIT license.

Thanks for use

Hopefully, this package is useful to you.

统计信息

  • 总下载量: 355
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-09-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固