Skip to content

Commit

Permalink
Add simple CodeIgniter Command
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenanhung committed Oct 13, 2024
1 parent eb14c32 commit 486ec8a
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Change Log được viết theo biểu mẫu tại đây: https://keepachangelog.com/en/1.0.0/

## [1.1.8] - 2024/10/13

### What's Changed

- [x] Add simple CodeIgniter Command

## [1.1.7] - 2024/09/08

### What's Changed
Expand Down
50 changes: 50 additions & 0 deletions app/controllers/Command.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

defined('BASEPATH') or exit('No direct script access allowed');

/**
* Class Command
*
* @author 713uk13m <[email protected]>
* @copyright 713uk13m <[email protected]>
*/
class Command extends HungNG_CI_Base_Controllers
{
public function __construct()
{
parent::__construct();
$this->load->helper('directory');
}

public function index(): void
{
if (!is_cli()) {
show_404();
}
ResponseOutput::writeLn('CodeIgniter Command Interface');
}

public function clean_cache()
{
if (!is_cli()) {
show_404();
}
$this->command_clean_cache_file();
}

public function clean_opcache()
{
if (!is_cli()) {
show_404();
}
$this->opcache_flush_reset();
}

public function flush_logs()
{
if (!is_cli()) {
show_404();
}
$this->default_base_flush_logs();
}
}

0 comments on commit 486ec8a

Please sign in to comment.