Skip to content

Commit 486ec8a

Browse files
committed
Add simple CodeIgniter Command
1 parent eb14c32 commit 486ec8a

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

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

5+
## [1.1.8] - 2024/10/13
6+
7+
### What's Changed
8+
9+
- [x] Add simple CodeIgniter Command
10+
511
## [1.1.7] - 2024/09/08
612

713
### What's Changed

app/controllers/Command.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
defined('BASEPATH') or exit('No direct script access allowed');
4+
5+
/**
6+
* Class Command
7+
*
8+
* @author 713uk13m <dev@nguyenanhung.com>
9+
* @copyright 713uk13m <dev@nguyenanhung.com>
10+
*/
11+
class Command extends HungNG_CI_Base_Controllers
12+
{
13+
public function __construct()
14+
{
15+
parent::__construct();
16+
$this->load->helper('directory');
17+
}
18+
19+
public function index(): void
20+
{
21+
if (!is_cli()) {
22+
show_404();
23+
}
24+
ResponseOutput::writeLn('CodeIgniter Command Interface');
25+
}
26+
27+
public function clean_cache()
28+
{
29+
if (!is_cli()) {
30+
show_404();
31+
}
32+
$this->command_clean_cache_file();
33+
}
34+
35+
public function clean_opcache()
36+
{
37+
if (!is_cli()) {
38+
show_404();
39+
}
40+
$this->opcache_flush_reset();
41+
}
42+
43+
public function flush_logs()
44+
{
45+
if (!is_cli()) {
46+
show_404();
47+
}
48+
$this->default_base_flush_logs();
49+
}
50+
}

0 commit comments

Comments
 (0)