Skip to content

Commit 719299a

Browse files
committed
Upgrade
1 parent 1f2328a commit 719299a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+477
-88
lines changed

CHANGELOG.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,44 @@
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.0.9] - 2024/01/22
6+
7+
### What's Changed
8+
9+
- [x] Add Bash Script File
10+
- [x] Update Example CI/CD with GitLab
11+
- [x] Refactor Structure Project
12+
513
## [1.0.8] - 2024/01/21
614

7-
### Update
15+
### What's Changed
816

917
- [x] Update vendor `nguyenanhung/codeigniter-framework` latest version
1018
- [x] Update vendor `nguyenanhung/codeigniter-basic-helper` latest version
1119

1220
## [1.0.7] - 2023/03/22
1321

14-
### Update
22+
### What's Changed
1523

1624
- [x] Update vendor `nguyenanhung/codeigniter-framework` latest version
1725
- [x] Update vendor `nguyenanhung/codeigniter-basic-helper` latest version
1826

1927
## [1.0.6] - 2023/02/13
2028

21-
### Update
29+
### What's Changed
2230

2331
- [x] Update vendor `nguyenanhung/codeigniter-framework` latest version
2432
- [x] Update config PHP Zend Opcache
2533

2634
## [1.0.5] - 2023/01/17
2735

28-
### Update
36+
### What's Changed
2937

3038
- [x] Bổ sung tính năng
3139

3240
## [1.0.1]-[1.0.4] - 2022/07/21
3341

34-
### Added
42+
### What's Changed
3543

3644
- [x] Fixed bug và bổ sung tính năng
3745

@@ -42,8 +50,10 @@ Change Log được viết theo biểu mẫu tại đây: https://keepachangelog
4250
- [x] Init Project
4351
- [x] Thiết kế Base cho CodeIgniter v3
4452

45-
## Liên hệ
53+
## Contact
54+
55+
If you have any questions related to the use of this source code, please contact me through the following information:
4656

47-
| Name | Email | Skype | Facebook |
48-
|-------------|----------------------|------------------|---------------|
49-
| Hung Nguyen | dev@nguyenanhung.com | nguyenanhung5891 | @nguyenanhung |
57+
| Name | Email | GitHub | Facebook |
58+
|-------------|----------------------|---------------|---------------|
59+
| Hung Nguyen | dev@nguyenanhung.com | @nguyenanhung | @nguyenanhung |

CONTRIBUTING.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# CONTRIBUTING
22

3-
## Liên hệ
3+
## Contact
44

5-
| Name | Email | Skype | Facebook |
6-
|-------------|----------------------|------------------|---------------|
7-
| Hung Nguyen | dev@nguyenanhung.com | nguyenanhung5891 | @nguyenanhung |
5+
If you have any questions related to the use of this source code, please contact me through the following information:
6+
7+
| Name | Email | GitHub | Facebook |
8+
|-------------|----------------------|---------------|---------------|
9+
| Hung Nguyen | dev@nguyenanhung.com | @nguyenanhung | @nguyenanhung |

LICENSE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
631631
state the exclusion of warranty; and each file should have at least
632632
the "copyright" line and a pointer to where the full notice is found.
633633

634-
project-website-of-nguyenanhung-com
635-
Copyright (C) 2018 hung-nguyen
634+
nguyenanhung/codeigniter3-skeleton
635+
Copyright (C) 2018-2024 Nguyen An Hung <dev@nguyenanhung.com>
636636

637637
This program is free software: you can redistribute it and/or modify
638638
it under the terms of the GNU General Public License as published by
@@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
652652
If the program does terminal interaction, make it output a short
653653
notice like this when it starts in an interactive mode:
654654

655-
project-website-of-nguyenanhung-com Copyright (C) 2018 hung-nguyen
655+
nguyenanhung/codeigniter3-skeleton Copyright (C) 2018-2024 Nguyen An Hung <dev@nguyenanhung.com>
656656
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657657
This is free software, and you are welcome to redistribute it
658658
under certain conditions; type `show c' for details.

README.md

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,79 +2,85 @@
22

33
# CodeIgniter v3 Framework - Skeleton Application
44

5-
Bản Skeleton phục vụ triển khai ứng dụng web bằng `CodeIgniter v3 Framework`. Được đóng gói lại thành packages nhằm mục
6-
đích triển khai ứng dụng nhanh chóng.
5+
The Skeleton version serves the deployment of web applications using the `CodeIgniter v3 Framework`. It has been
6+
repackaged into packages for the purpose of rapid application deployment.
77

8-
Source này được đóng gói để hỗ trợ cả mô hình MVC, HMVC với các lớp BaseControllers BaseModule, dễ triển khai, mở
9-
rộng nhanh chóng và mạnh mẽ
8+
This source is packaged to support both the MVC and HMVC models with BaseControllers and BaseModule classes, making it
9+
easy to deploy, extend quickly, and robust.
1010

1111
## CHANGELOG
1212

13-
Thông tin Changelog được cập nhật tại https://github.com/nguyenanhung/codeigniter3-skeleton/blob/master/CHANGELOG.md
13+
The Changelog information is updated at: https://github.com/nguyenanhung/codeigniter3-skeleton/blob/master/CHANGELOG.md
1414

1515
## Install
1616

17-
Chạy command sau để tiến hành cài đặt ứng dụng `nguyenanhung/codeigniter3-skeleton` và triển khai 1 dự án mới
17+
Run the following command to install the `nguyenanhung/codeigniter3-skeleton` application and deploy a new
18+
project:
1819

1920
```shell
2021
composer create-project nguyenanhung/codeigniter3-skeleton [my-app-name]
2122
```
2223

23-
Thay thế `[my-app-name]` bằng thư mục dự án mới cần triển khai, ví dụ: `my-website`
24+
Replace `[my-app-name]` with the name of your new project directory, for example, `my-website`:
2425

2526
```shell
2627
composer create-project nguyenanhung/codeigniter3-skeleton my-website
2728
```
2829

29-
## Start Application
30+
## Start Application on Docker
3031

31-
Triển khai ứng dụng nhanh với Docker được build sẵn
32+
Quickly deploy the application with a pre-built Docker container:
3233

33-
1. Build docker
34+
Build the Docker container:
3435

3536
```shell
3637
docker-compose build
3738
```
3839

39-
2. Khởi chạy ứng dụng
40+
Start the application on Docker:
4041

4142
```shell
4243
docker-compose up -d
4344
```
4445

45-
3. Add url to hosts file
46+
Add url to hosts file
4647

4748
```shell
4849
sudo vi /etc/hosts
4950
```
5051

51-
thêm dòng
52+
Add the following line:
5253

5354
```shell
5455
127.0.0.1 app.codeigniter3.io
5556
```
5657

57-
4. Open Service in URL
58+
Open Service in URL
5859

5960
```shell
6061
http://app.codeigniter3.io/
6162
```
6263

63-
5. Screenshot Page
64+
## Screenshot Page
6465

6566
![https://i.imgur.com/eMddCEJ.jpg](https://i.imgur.com/eMddCEJ.jpg)
6667

67-
## Điều khoản & Từ chối trách nhiệm
68+
## Serverless Version
6869

69-
Bộ skeleton này được public dưới dạng open source, bất cứ ai cũng có thể sử dụng open source này cho mục đích của riêng
70-
mình dưới giấy phép `GNU GENERAL PUBLIC LICENSE v3 or later`.
70+
I have released a packaged distribution ready for deployment on Vercel Serverless
71+
here: https://github.com/nguyenanhung/codeigniter3-vercel-skeleton
7172

72-
Tôi không chịu trách nghiệm về việc bộ source này có thể được sử dụng cho các mục đích riêng biệt nào đó
73+
## Terms & Disclaimer
7374

74-
## Liên hệ
75+
This skeleton is publicly available as open source, and anyone can use it for their own purposes under
76+
the `GNU GENERAL PUBLIC LICENSE v3 or later`.
7577

76-
Nếu có câu hỏi nào liên quan đến việc sử dụng bộ source này, vui lòng liên hệ tới thông tin sau đây
78+
I am not responsible for any specific use of this source code.
7779

78-
| Name | Email | Skype | Facebook |
79-
|-------------|----------------------|------------------|---------------|
80-
| Hung Nguyen | dev@nguyenanhung.com | nguyenanhung5891 | @nguyenanhung |
80+
## Contact
81+
82+
If you have any questions related to the use of this source code, please contact me through the following information:
83+
84+
| Name | Email | GitHub | Facebook |
85+
|-------------|----------------------|---------------|---------------|
86+
| Hung Nguyen | dev@nguyenanhung.com | @nguyenanhung | @nguyenanhung |

bash/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Bash & Shell Script

bash/script/clean-releases.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
echo "==================================================="
3+
echo "Powered by Hung Nguyen - dev@nguyenanhung.com"
4+
echo "==================================================="
5+
6+
# Kiểm tra xem có tham số được truyền vào không
7+
if [ -z "$1" ]; then
8+
echo "Cần chỉ định thư mục releases!"
9+
exit 1
10+
fi
11+
12+
parent_folder="$1"
13+
14+
echo "============|| Clean folder Releases ||============"
15+
echo "Folder Releases: $parent_folder"
16+
echo "Script xoá các thư mục releases cũ cho nó nhẹ folder"
17+
18+
echo "Danh sách các folder hiện tại".
19+
echo "==================================================="
20+
ls -la "$parent_folder"
21+
22+
echo "==================================================="
23+
# Lấy danh sách thư mục con
24+
subfolders=($(ls -d $parent_folder/*))
25+
26+
# Sắp xếp thư mục con theo tên giảm dần
27+
IFS=$'\n' sorted_subfolders=($(sort -r <<<"${subfolders[*]}"))
28+
29+
echo "==================================================="
30+
echo "Giữ lại 5 thư mục được releases gần nhất"
31+
echo "==================================================="
32+
33+
# Giữ lại 3 thư mục có tên lớn nhất, xoá các thư mục khác
34+
for ((i = 0; i < ${#sorted_subfolders[@]}; i++)); do
35+
subfolder=${sorted_subfolders[i]}
36+
37+
# Điều chỉnh số bản releases được giữ lại tại đây
38+
if [ $i -lt 5 ]; then
39+
echo "Giữ lại thư mục: $subfolder"
40+
else
41+
echo "Xoá thư mục: $subfolder với lệnh (sudo rm -rf: $subfolder)"
42+
# Thêm lệnh để xoá thư mục khi bạn đã kiểm tra và chắc chắn rằng script hoạt động đúng
43+
sudo rm -rf "$subfolder"
44+
fi
45+
done
46+
47+
echo "==================================================="
48+
ls -la "$parent_folder"
49+
50+
echo "==================================================="
51+
echo "Finished script"
52+
echo "==================================================="

bash/script/telegram.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
echo "==================================================="
3+
echo "Powered by Hung Nguyen - dev@nguyenanhung.com"
4+
echo "==================================================="
5+
6+
# Kiểm tra xem có đủ 3 tham số không
7+
if [ $# -ne 3 ]; then
8+
echo "Use: $0 <project_name> <message> <url>"
9+
exit 1
10+
fi
11+
12+
# Lưu các tham số vào biến
13+
project_name="$1"
14+
message="$2"
15+
url="$3"
16+
17+
# Cấu hình token của bot Telegram
18+
telegram_bot_token="xxx"
19+
20+
# Gửi tin nhắn tới bot Telegram
21+
curl -s -X POST "https://api.telegram.org/bot$telegram_bot_token/sendMessage" \
22+
-d "chat_id=xxx" \
23+
-d "text=Project: $project_name%0AMessage: $message%0AURL: $url"
24+
25+
echo ""
26+
#echo "Đã gửi thông báo thành công!"

bash/script/truncate-log.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
echo "==================================================="
3+
echo "Powered by Hung Nguyen - dev@nguyenanhung.com"
4+
echo "==================================================="
5+
6+
# Kiểm tra xem đã truyền đúng số lượng tham số hay chưa
7+
if [ "$#" -ne 1 ]; then
8+
echo "Sử dụng: $0 <đường dẫn thư mục logs>"
9+
exit 1
10+
fi
11+
12+
# Lấy đường dẫn đến thư mục logs từ tham số
13+
logs_folder="$1"
14+
15+
# Kiểm tra xem thư mục logs tồn tại
16+
if [ ! -d "$logs_folder" ]; then
17+
echo "Thư mục logs không tồn tại."
18+
exit 1
19+
fi
20+
21+
# Mảng tên các tệp log
22+
log_files=(
23+
"access.log"
24+
"error.log"
25+
)
26+
27+
# Duyệt qua từng tệp log và truncate chúng
28+
for log_file in "${log_files[@]}"; do
29+
if [ -f "$logs_folder/$log_file" ]; then
30+
truncate -s 0 "$logs_folder/$log_file"
31+
echo "Đã truncate tệp log $log_file."
32+
else
33+
echo "Tệp log $log_file không tồn tại trong thư mục logs."
34+
fi
35+
done
36+
37+
echo "Đã truncate các tệp log trong thư mục logs."

composer.json

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
{
2-
"description": "CodeIgniter v3 Skeleton Application",
32
"name": "nguyenanhung/codeigniter3-skeleton",
3+
"description": "CodeIgniter v3 Skeleton Application",
4+
"keywords": [
5+
"php",
6+
"library",
7+
"helper",
8+
"skeleton",
9+
"startapp",
10+
"codeigniter",
11+
"codeigniter3",
12+
"codeigniter3-skeleton",
13+
"codeigniter-helper",
14+
"codeigniter-library",
15+
"codeigniter-startapp",
16+
"codeigniter-skeleton",
17+
"docker-php",
18+
"vercel-php",
19+
"vercel-codeigniter",
20+
"vercel-codeigniter-skeleton"
21+
],
422
"type": "project",
523
"license": "GPL-3.0-or-later",
624
"homepage": "https://github.com/nguyenanhung/codeigniter3-skeleton",
@@ -20,12 +38,12 @@
2038
"nguyenanhung/codeigniter-framework": "^3.2",
2139
"nguyenanhung/my-debug": "^3.0",
2240
"nguyenanhung/requests": "^3.0",
23-
"nguyenanhung/basic-firewall": "^2.0",
24-
"bear8421/gravatar": "^1.0"
41+
"nguyenanhung/basic-firewall": "^2.0"
2542
},
2643
"require-dev": {
27-
"roave/security-advisories": "dev-latest",
44+
"bear8421/gravatar": "^1.0",
2845
"tramtro/make-some-noise": "^1.0",
46+
"roave/security-advisories": "dev-latest",
2947
"nesbot/carbon": "^2",
3048
"kint-php/kint": "^4"
3149
},
@@ -44,6 +62,19 @@
4462
"ext-json": "Needs for support JSON",
4563
"ext-zend opcache": "Needs for support OpCache",
4664
"ext-xml": "Needs for support XML",
47-
"ext-simplexml": "Needs for support SimpleXML"
65+
"ext-simplexml": "Needs for support SimpleXML",
66+
"nguyenanhung/codeigniter3-vercel-skeleton": "Deploying this package on Vercel with full compatibility",
67+
"nguyenanhung/helpers": "Awesome Helpers - Powerful Library, Helpers and Tools",
68+
"nguyenanhung/security": "Awesome Helpers - Wrapper for Security, Encrypt, Encode, Purifier",
69+
"nguyenanhung/validation": "Awesome Validation - A fast, extensible & stand-alone PHP input validation class that allows you to validate any data",
70+
"nguyenanhung/image": "Need support for Image Service",
71+
"nguyenanhung/seo": "Need support for SEO",
72+
"nguyenanhung/my-cache": "Need support for Powerful Cache Implement",
73+
"nguyenanhung/my-debug": "Need support for Powerful Logger (Extend from Monolog)",
74+
"nguyenanhung/requests": "Need support for Powerful HTTP Request",
75+
"nguyenanhung/database": "Need support for Powerful SQL Database Tools (Customize Laravel Database)",
76+
"nguyenanhung/monitor": "Need support for Send Monitor Message to Monitor Service",
77+
"nguyenanhung/markdown": "Parser for Markdown",
78+
"nguyenanhung/basic-firewall": "PHP Basic Firewall - Library providing IP filtering features"
4879
}
4980
}

0 commit comments

Comments
 (0)