Skip to content

Commit 18877d9

Browse files
authored
Merge pull request #52 from nguyenanhung/v3.2.0-develop
Add command_create_encryption_key
2 parents af1ed64 + 1ebecb5 commit 18877d9

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

hungng/HungNG_CI_Base_Controllers.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,24 @@ protected function command_clean_cache_apc()
552552
}
553553
}
554554

555+
/**
556+
* Function command_create_encryption_key
557+
*
558+
* @author : 713uk13m <dev@nguyenanhung.com>
559+
* @copyright: 713uk13m <dev@nguyenanhung.com>
560+
* @time : 09/01/2021 52:11
561+
*/
562+
protected function command_create_encryption_key(): void
563+
{
564+
if (is_cli()) {
565+
$this->load->library('encryption');
566+
$key = bin2hex($this->encryption->create_key(32));
567+
ResponseOutput::writeLn($key);
568+
exit();
569+
}
570+
show_404();
571+
}
572+
555573
/**
556574
* Check is human by recaptcha from request
557575
*

hungng/HungNG_CI_Base_Module.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,23 @@ protected function command_clean_cache_apc()
552552
}
553553
}
554554

555+
/**
556+
* Function command_create_encryption_key
557+
*
558+
* @author : 713uk13m <dev@nguyenanhung.com>
559+
* @copyright: 713uk13m <dev@nguyenanhung.com>
560+
* @time : 09/01/2021 52:11
561+
*/
562+
protected function command_create_encryption_key(): void
563+
{
564+
if (is_cli()) {
565+
$this->load->library('encryption');
566+
$key = bin2hex($this->encryption->create_key(32));
567+
ResponseOutput::writeLn($key);
568+
exit();
569+
}
570+
show_404();
571+
}
555572
/**
556573
* Check is human by recaptcha from request
557574
*

0 commit comments

Comments
 (0)