Skip to content

Commit e273ecf

Browse files
authored
Merge pull request #1 from codeigniter4/develop
update merged
2 parents 23063a0 + b510f7d commit e273ecf

File tree

487 files changed

+6390
-5836
lines changed

Some content is hidden

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

487 files changed

+6390
-5836
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
language: php
22

33
php:
4-
- 7.1
54
- 7.2
65
- 7.3
76
- nightly
87

98
matrix:
109
fast_finish: true
1110
allow_failures:
12-
- php: 7.3
1311
- php: nightly
1412

1513
global:

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<br>
66

77
## What is CodeIgniter?
8+
89
CodeIgniter is a PHP full-stack web framework that is light, fast, flexible, and secure.
910
More information can be found at the [official site](http://codeigniter.com).
1011

@@ -35,6 +36,7 @@ framework are exposed.
3536
The user guide updating and deployment is a bit awkward at the moment, but we are working on it!
3637

3738
## Repository Management
39+
3840
We use Github issues to track **BUGS** and to track approved **DEVELOPMENT** work packages.
3941
We use our [forum](http://forum.codeigniter.com) to provide SUPPORT and to discuss
4042
FEATURE REQUESTS.
@@ -57,6 +59,7 @@ Remember that some components that were part of CodeIgniter 3 are being moved
5759
to optional packages, with their own repository.
5860

5961
## Contributing
62+
6063
We **are** accepting contributions from the community, specifically those identified as part of phase 2.
6164

6265
We will try to manage the process somewhat, by adding a "Help wanted" label to those that we are
@@ -68,7 +71,9 @@ We are not looking for out-of-scope contributions, only those that would be cons
6871
Please read the [*Contributing to CodeIgniter*](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing.md) section in the user guide
6972

7073
## Server Requirements
71-
PHP version 7.1 or higher is required, with the following extensions installed:
74+
75+
PHP version 7.2 or higher is required, with the following extensions installed:
76+
7277

7378
- [intl](http://php.net/manual/en/intl.requirements.php)
7479
- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library
@@ -81,4 +86,5 @@ Additionally, make sure that the following extensions are enabled in your PHP:
8186
- xml (enabled by default - don't turn it off)
8287

8388
## Running CodeIgniter Tests
89+
8490
Information on running CodeIgniter test suite can be found in the [README.md](tests/README.md) file in the tests directory.

Vagrantfile.dist

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# https://github.com/hashicorp/vagrant/issues/9442#issuecomment-374785457
5+
unless Vagrant::DEFAULT_SERVER_URL.frozen?
6+
Vagrant::DEFAULT_SERVER_URL.replace('https://vagrantcloud.com')
7+
end
8+
9+
Vagrant.configure("2") do |config|
10+
# VM Box
11+
config.vm.box = "ubuntu/bionic64"
12+
# Automatic box update checking
13+
config.vm.box_check_update = true
14+
15+
# CodeIgniter virtual host
16+
config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
17+
# Code Coverage virtual host
18+
config.vm.network "forwarded_port", guest: 81, host: 8081, host_ip: "127.0.0.1"
19+
# User Guide virtual host
20+
config.vm.network "forwarded_port", guest: 82, host: 8082, host_ip: "127.0.0.1"
21+
# MySQL server
22+
#config.vm.network "forwarded_port", guest: 3306, host: 3307, host_ip: "127.0.0.1"
23+
# PostgreSQL server
24+
#config.vm.network "forwarded_port", guest: 5432, host: 5433, host_ip: "127.0.0.1"
25+
# Memcached server
26+
#config.vm.network "forwarded_port", guest: 11211, host: 11212, host_ip: "127.0.0.1"
27+
# Redis server
28+
#config.vm.network "forwarded_port", guest: 6379, host: 6380, host_ip: "127.0.0.1"
29+
30+
# Add "192.168.10.10 ${VIRTUALHOST}" in your host file to access by domain
31+
#config.vm.network "private_network", ip: "192.168.10.10"
32+
33+
# Same path set in the $CODEIGNITER_PATH Provision
34+
# "virtualbox" type allow auto-sync host to guest and guest to host
35+
# but chmod does not work... tests will fail.
36+
# Default rsync__args except "--copy-links", to allow phpunit correctly works by symlink
37+
config.vm.synced_folder ".", "/var/www/codeigniter", type: "rsync", rsync__args: ["--verbose", "--archive", "--delete", "-z"]
38+
39+
# Provider-specific configuration
40+
config.vm.provider "virtualbox" do |vb|
41+
# Display the VirtualBox GUI when booting the machine
42+
vb.gui = false
43+
# Customize the amount of memory on the VM:
44+
vb.memory = "1024"
45+
end
46+
47+
# Provision
48+
config.vm.provision "shell", inline: <<-SHELL
49+
MYSQL_ROOT_PASS="password"
50+
PGSQL_ROOT_PASS="password"
51+
VIRTUALHOST="localhost"
52+
CODEIGNITER_PATH="/var/www/codeigniter"
53+
PHP_VERSION=7.2
54+
PGSQL_VERSION=10
55+
#APT_PROXY="192.168.10.1:3142"
56+
57+
grep -q "127.0.0.1 ${VIRTUALHOST}" /etc/hosts || echo "127.0.0.1 ${VIRTUALHOST}" >> /etc/hosts
58+
59+
# Creates a swap file if necessary
60+
RAM=`awk '/MemTotal/ {print $2}' /proc/meminfo`
61+
if [ $RAM -lt 1000000 ] && [ ! -f /swap/swapfile ]; then
62+
echo "================================================================================"
63+
echo "Adding swap"
64+
echo "================================================================================"
65+
echo "This process may take a few minutes. Please wait..."
66+
mkdir /swap
67+
dd if=/dev/zero of=/swap/swapfile bs=1024 count=1000000
68+
chmod 600 /swap/swapfile
69+
mkswap /swap/swapfile
70+
swapon /swap/swapfile
71+
echo "/swap/swapfile swap swap defaults 0 0" >> /etc/fstab
72+
echo "Done."
73+
fi
74+
75+
# Prepare to use APT Proxy
76+
if [ ! -z $APT_PROXY ]; then
77+
if [ ! -f /etc/apt/sources.list-origin ]; then
78+
cp /etc/apt/sources.list /etc/apt/sources.list-origin
79+
fi
80+
sed -i "s/archive.ubuntu.com/${APT_PROXY}/" /etc/apt/sources.list
81+
sed -i "s/security.ubuntu.com/${APT_PROXY}/" /etc/apt/sources.list
82+
fi
83+
84+
export DEBIAN_FRONTEND=noninteractive
85+
86+
echo "================================================================================"
87+
echo "Updating and Installing Required Packages"
88+
echo "================================================================================"
89+
90+
apt-get update
91+
92+
debconf-set-selections <<< "mysql-server mysql-server/root_password password ${MYSQL_ROOT_PASS}"
93+
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password ${MYSQL_ROOT_PASS}"
94+
95+
apt-get install -y \
96+
php$PHP_VERSION apache2 composer \
97+
php-intl php-mbstring php-xml php-zip php-xdebug \
98+
php-mysql mysql-server mysql-client \
99+
php-pgsql postgresql-$PGSQL_VERSION \
100+
php-sqlite3 sqlite3 \
101+
php-memcached memcached \
102+
php-redis redis-server \
103+
php-curl curl \
104+
php-gd php-imagick \
105+
python-pip
106+
107+
pip install sphinx sphinxcontrib-phpdomain
108+
109+
apt-get autoclean
110+
111+
echo "================================================================================"
112+
echo "Preparing User Guide"
113+
echo "================================================================================"
114+
115+
cd "${CODEIGNITER_PATH}/user_guide_src/cilexer"
116+
python setup.py install
117+
cd ..
118+
make html
119+
120+
echo "================================================================================"
121+
echo "Configuring Databases"
122+
echo "================================================================================"
123+
124+
sed -i "s/^bind-address/#bind-address/" /etc/mysql/mysql.conf.d/mysqld.cnf
125+
mysql -e "CREATE DATABASE IF NOT EXISTS codeigniter COLLATE 'utf8_general_ci';
126+
UPDATE mysql.user SET Host='%' WHERE user='root';
127+
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
128+
FLUSH PRIVILEGES;" -uroot -p$MYSQL_ROOT_PASS
129+
systemctl restart mysql
130+
131+
sed -i "s/^#listen_addresses = 'localhost'/listen_addresses = '*'/" /etc/postgresql/$PGSQL_VERSION/main/postgresql.conf
132+
grep -q "host all root all md5" /etc/postgresql/$PGSQL_VERSION/main/pg_hba.conf || echo "host all root all md5" >> /etc/postgresql/$PGSQL_VERSION/main/pg_hba.conf
133+
sudo -u postgres psql -tc "SELECT 1 FROM pg_roles WHERE rolname='root'" | grep -q 1 || sudo -u postgres psql -c "CREATE ROLE root WITH SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN"
134+
sudo -u postgres psql -c "ALTER ROLE root WITH PASSWORD '${PGSQL_ROOT_PASS}'"
135+
sudo -u postgres psql -tc "SELECT 1 FROM pg_database WHERE datname='codeigniter'" | grep -q 1 ||sudo -u postgres psql -c "CREATE DATABASE codeigniter"
136+
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE codeigniter TO root"
137+
systemctl restart postgresql
138+
139+
echo "================================================================================"
140+
echo "Configuring Memcached and Redis"
141+
echo "================================================================================"
142+
143+
sed -i "s/^bind 127.0.0.1/#bind 127.0.0.1/" /etc/redis/redis.conf
144+
sed -i "s/^protected-mode yes/protected-mode no/" /etc/redis/redis.conf
145+
sed -i "s/^-l 127.0.0.1/#-l 127.0.0.1/" /etc/memcached.conf
146+
systemctl restart redis
147+
systemctl restart memcached
148+
149+
echo "================================================================================"
150+
echo "Configuring Virtual Hosts"
151+
echo "================================================================================"
152+
153+
mkdir -p "${CODEIGNITER_PATH}/build/coverage-html"
154+
mkdir -p "${CODEIGNITER_PATH}/public"
155+
mkdir -p "${CODEIGNITER_PATH}/user_guide_src/build/html"
156+
mkdir -p "${CODEIGNITER_PATH}/writable/apache"
157+
chown -R vagrant:vagrant $CODEIGNITER_PATH
158+
159+
# Creates a symlink in the user home
160+
if [ ! -d /home/vagrant/codeigniter ]; then
161+
ln -s $CODEIGNITER_PATH /home/vagrant/codeigniter
162+
fi
163+
164+
sed -i "s/APACHE_RUN_USER=www-data/APACHE_RUN_USER=vagrant/" /etc/apache2/envvars
165+
sed -i "s/APACHE_RUN_GROUP=www-data/APACHE_RUN_GROUP=vagrant/" /etc/apache2/envvars
166+
grep -q "Listen 81" /etc/apache2/ports.conf || sed -i "s/^Listen 80/Listen 80\\nListen 81\\nListen 82/" /etc/apache2/ports.conf
167+
sed -i "s/^display_errors = Off/display_errors = On/" /etc/php/7.2/apache2/php.ini
168+
sed -i "s/^display_startup_errors = Off/display_startup_errors = On/" /etc/php/7.2/apache2/php.ini
169+
170+
echo "ServerName ${VIRTUALHOST}
171+
<Directory ${CODEIGNITER_PATH}>
172+
DirectoryIndex index.html index.php
173+
Options All
174+
AllowOverride All
175+
</Directory>
176+
<VirtualHost *:80>
177+
ServerAdmin vagrant@localhost
178+
DocumentRoot ${CODEIGNITER_PATH}/public
179+
ErrorLog ${CODEIGNITER_PATH}/writable/apache/error.log
180+
CustomLog ${CODEIGNITER_PATH}/writable/apache/custom.log combined
181+
</VirtualHost>
182+
<VirtualHost *:81>
183+
DocumentRoot ${CODEIGNITER_PATH}/build/coverage-html
184+
</VirtualHost>
185+
<VirtualHost *:82>
186+
DocumentRoot ${CODEIGNITER_PATH}/user_guide_src/build/html
187+
</VirtualHost>
188+
" > /etc/apache2/sites-available/codeigniter.conf
189+
190+
a2enmod rewrite
191+
a2dissite 000-default.conf
192+
a2ensite codeigniter.conf
193+
systemctl restart apache2
194+
195+
echo "================================================================================"
196+
echo "Services Status"
197+
echo "================================================================================"
198+
service --status-all
199+
200+
SHELL
201+
end

admin/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#CodeIgniter 4 Admin
1+
# CodeIgniter 4 Admin
22

33
This folder contains tools or docs useful for project maintainers.
44

5-
##Repositories inside https://github.com/codeigniter4
5+
## Repositories inside https://github.com/codeigniter4
66

77
- **CodeIgniter4** is the main development repository.
88
It supports issues and pull requests, and has a rule to enforce GPG-signed commits.
@@ -35,23 +35,23 @@ This folder contains tools or docs useful for project maintainers.
3535
It is community-maintained, and accepts issues and pull requests.
3636
It could be downloaded, forked or composer-installed.
3737

38-
##Contributor Scripts
38+
## Contributor Scripts
3939

4040
- **setup.sh** installs a git pre-commit hook into a contributor's
4141
local clone of their fork of the `CodeIgniter4` repository.
4242
- **pre-commit** runs PHP Lint and PHP CodeSniffer on any files
4343
to be added as part of a git commit, ensuring that they conform to the
4444
framework coding style standards, and automatically fixing what can be.
4545

46-
##Maintainer Scripts
46+
## Maintainer Scripts
4747

4848
- **release-config** holds variables used for the maintainer & release building
4949
- **docbot** re-builds the user guide from the RST source for it,
5050
and optionally deploys it to the `gh-pages` branch of the main
5151
repository (if the user running it has maintainer rights on that repo).
5252
See the [writeup](./docbot.md).
5353

54-
##Release Building Scripts
54+
## Release Building Scripts
5555

5656
The release workflow is detailed in its own writeup; these are the main
5757
scripts used by the release manager:
@@ -79,7 +79,7 @@ scripts used by the release manager:
7979
Remember to be polite when running it.
8080

8181

82-
##Other Stuff
82+
## Other Stuff
8383

8484
- **release-notes.bb** is a boilerplate for forum announcements of a new release.
8585
It is marked up using [BBcode](https://en.wikipedia.org/wiki/BBCode).

admin/docbot

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
#!/bin/bash
22

3-
# Rebuild and deploy CodeIgniter4 user guide
3+
# Rebuild and deploy CodeIgniter4 under-development user guide
4+
#
5+
# This is a quick way to test user guide changes, and if they
6+
# look good, to push them to the gh-pages branch of the
7+
# development repository.
8+
#
9+
# This is not meant for updating the "stable" user guide.
410

5-
. config
11+
UPSTREAM=https://github.com/bcit-ci/CodeIgniter4.git
612

713
# Prepare the nested repo clone folder
814
cd user_guide_src

admin/framework/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# CodeIgniter 4 Framework
22

33
## What is CodeIgniter?
4+
45
CodeIgniter is a PHP full-stack web framework that is light, fast, flexible, and secure.
56
More information can be found at the [official site](http://codeigniter.com).
67

@@ -29,6 +30,7 @@ framework are exposed.
2930
The user guide updating and deployment is a bit awkward at the moment, but we are working on it!
3031

3132
## Repository Management
33+
3234
We use Github issues to track **BUGS** and to track approved **DEVELOPMENT** work packages.
3335
We use our [forum](http://forum.codeigniter.com) to provide SUPPORT and to discuss
3436
FEATURE REQUESTS.
@@ -51,12 +53,14 @@ Remember that some components that were part of CodeIgniter 3 are being moved
5153
to optional packages, with their own repository.
5254

5355
## Contributing
56+
5457
We welcome contributions from the community.
5558

5659
Please read the [*Contributing to CodeIgniter*](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing.md) section in the development repository.
5760

5861
## Server Requirements
59-
PHP version 7.1 or higher is required, with the following extensions installed:
62+
63+
PHP version 7.2 or higher is required, with the following extensions installed:
6064

6165
- [intl](http://php.net/manual/en/intl.requirements.php)
6266
- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library

admin/framework/composer.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
"homepage": "https://codeigniter.com",
66
"license": "MIT",
77
"require": {
8-
"php": ">=7.1",
8+
"php": ">=7.2",
99
"ext-curl": "*",
1010
"ext-intl": "*",
1111
"kint-php/kint": "^2.1",
12+
"psr/log": "^1.1",
1213
"zendframework/zend-escaper": "^2.5"
1314
},
1415
"require-dev": {
@@ -19,15 +20,13 @@
1920
},
2021
"autoload": {
2122
"psr-4": {
22-
"CodeIgniter\\": "system/",
23-
"Psr\\Log\\": "system/ThirdParty/PSR/Log/"
23+
"CodeIgniter\\": "system/"
2424
}
2525
},
2626
"scripts": {
2727
"post-update-cmd": [
2828
"composer dump-autoload",
29-
"CodeIgniter\\ComposerScripts::postUpdate",
30-
"bash admin/setup.sh"
29+
"CodeIgniter\\ComposerScripts::postUpdate"
3130
]
3231
},
3332
"support": {

0 commit comments

Comments
 (0)