<commit_before><?php
// +----------------------------------------------------------------------
// | Demo [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016 http://www.lmx0536.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: limx <<EMAIL>> <http://www.lmx0536.cn>
// +----------------------------------------------------------------------
// | Date: 2016/11/14 Time: 13:39
// +----------------------------------------------------------------------
namespace MyApp\Tasks\System;

use Phalcon\Cli\Task;
use limx\func\File;

class ClearTask extends Task
{
    public function mainAction()
    {
        echo "Please input the clear action" . PHP_EOL;
    }

    public function dataAction($params = [])
    {
        $dir = di('config')->application->cacheDir . 'data/';
        if (strtolower($params[0]) !== 'yes') {
            echo 'Do you want to delete cache of view?(yes or no)' . PHP_EOL;
            echo $dir . PHP_EOL;
            $arg = trim(fgets(STDIN));
            if (strtolower($arg) !== 'yes') {
                return;
            }
        }
        // 删除缓存
        File::rm($dir, false);
        echo 'delete cache success' . PHP_EOL;
    }

    /**
     * [viewAction desc]
     * @desc 清理视图缓存
     * @author limx
     * @param array $params
     */
    public function viewAction($params = [])
    {
        $dir = di('config')->application->cacheDir . 'view/';
        if (strtolower($params[0]) !== 'yes') {
            echo 'Do you want to delete cache of view?(yes or no)' . PHP_EOL;
            echo $dir . PHP_EOL;
            $arg = trim(fgets(STDIN));
            if (strtolower($arg) !== 'yes') {
                return;
            }
        }
        // 删除缓存
        File::rm($dir, false);
        echo 'delete cache success' . PHP_EOL;
    }

}<commit_msg>* 增加清理 元数据的命令<commit_after><?php
// +----------------------------------------------------------------------
// | Demo [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016 http://www.lmx0536.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: limx <<EMAIL>> <http://www.lmx0536.cn>
// +----------------------------------------------------------------------
// | Date: 2016/11/14 Time: 13:39
// +----------------------------------------------------------------------
namespace MyApp\Tasks\System;

use Phalcon\Cli\Task;
use limx\func\File;

class ClearTask extends Task
{
    public function mainAction()
    {
        echo "Please input the clear action" . PHP_EOL;
    }

    public function dataAction($params = [])
    {
        $dir = di('config')->application->cacheDir . 'data/';
        if (strtolower($params[0]) !== 'yes') {
            echo 'Do you want to delete cache of view?(yes or no)' . PHP_EOL;
            echo $dir . PHP_EOL;
            $arg = trim(fgets(STDIN));
            if (strtolower($arg) !== 'yes') {
                return;
            }
        }
        // 删除缓存
        File::rm($dir, false);
        echo 'delete cache success' . PHP_EOL;
    }

    /**
     * [viewAction desc]
     * @desc 清理视图缓存
     * @author limx
     * @param array $params
     */
    public function viewAction($params = [])
    {
        $dir = di('config')->application->cacheDir . 'view/';
        if (strtolower($params[0]) !== 'yes') {
            echo 'Do you want to delete cache of view?(yes or no)' . PHP_EOL;
            echo $dir . PHP_EOL;
            $arg = trim(fgets(STDIN));
            if (strtolower($arg) !== 'yes') {
                return;
            }
        }
        // 删除缓存
        File::rm($dir, false);
        echo 'delete cache success' . PHP_EOL;
    }

    /**
     * [metaAction desc]
     * @desc 清理元数据缓存
     * @author limx
     * @param array $params
     */
    public function metaAction($params = [])
    {
        $dir = di('config')->application->metaDataDir;
        if (strtolower($params[0]) !== 'yes') {
            echo 'Do you want to delete meta?(yes or no)' . PHP_EOL;
            echo $dir . PHP_EOL;
            $arg = trim(fgets(STDIN));
            if (strtolower($arg) !== 'yes') {
                return;
            }
        }
        // 删除缓存
        File::rm($dir, false);
        echo 'delete cache success' . PHP_EOL;
    }

}
{'fraction_non_alphanumeric': 0.29090094128193633, 'fraction_numerical': 0.011878081577767817, 'mean_word_length': 1.1313276026743075, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6319384', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1285, 'n_words': 304}