Skip to content

Commit 7f6b5eb

Browse files
committed
Merge branch 'release-4.0.0-alpha.4'
2 parents 3b7f73e + 55c2fe4 commit 7f6b5eb

File tree

267 files changed

+3468
-1471
lines changed

Some content is hidden

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

267 files changed

+3468
-1471
lines changed

Vagrantfile.dist

+201
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/docbot

+8-2
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/composer.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
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": {

admin/next.rst

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Version |version|
2+
====================================================
3+
4+
Release Date: Not released
5+
6+
**Next alpha release of CodeIgniter4**
7+
8+
9+
The list of changed files follows, with PR numbers shown.
10+
11+
12+
PRs merged:
13+
-----------
14+

admin/release

+19-2
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,14 @@ sed -i "/Release Date/s/Not Released/$(date +'%B %d, %Y')/" user_guide_src/sourc
5656
sed -i "/|version|/s/|version|/${RELEASE}/" user_guide_src/source/changelogs/index.rst
5757

5858
# version & date in user_guide_src/source/next.rst
59-
sed -i "/|release|/s/|.*|/${RELEASE}/" user_guide_src/source/changelogs/next.rst
6059
sed -i "/Release Date/s/Not Released/$(date +'%B %d, %Y')/" user_guide_src/source/changelogs/next.rst
6160
sed -i "/|version|/s/|version|/${RELEASE}/" user_guide_src/source/changelogs/next.rst
6261

6362
# establish version-specific changelog
64-
mv user_guide_src/source/changelogs/next.rst user_guide_src/source/changelogs/${RELEASE}.rst
63+
sed -i "|changelogs/next|s|changeslog/next|changelogs/v{$RELEASE}|" user_guide_src/source/changelogs/index.rst
64+
mv user_guide_src/source/changelogs/next.rst user_guide_src/source/changelogs/v${RELEASE}.rst
65+
touch user_guide_src/source/changelogs/next.rst
66+
cp admin/next.rst user_guide_src/source/changelogs/next.rst
6567

6668
#---------------------------------------------------
6769
# Setup the distribution folders
@@ -91,6 +93,15 @@ setup_repo framework
9193
setup_repo userguide
9294
setup_repo appstarter
9395

96+
#---------------------------------------------------
97+
# Housekeeping - make sure writable is flushed of test files
98+
# at least, test files that crop up on my system :-/
99+
rm -f writable/cache/H*
100+
rm -f writable/cache/d*
101+
rm -f writable/cache/s*
102+
rm -f writable/debugbar/debug*
103+
rm -f writable/logs/log*
104+
94105
#---------------------------------------------------
95106
# Generate the user guide
96107
echo -e "${BOLD}Generate the user guide${NORMAL}"
@@ -101,6 +112,7 @@ cd user_guide_src
101112
rm -rf build/*
102113
echo -e "${BOLD}... HTML version${NORMAL}"
103114
make html
115+
touch build/html/.nojekyll
104116
echo -e "${BOLD}... epub version${NORMAL}"
105117
make epub
106118

@@ -119,6 +131,11 @@ sed -i "11 G" $file
119131
sed -i "12 a :doc:\`See all the changes. </changelogs/next>\`" $file
120132
sed -i "13 G" $file
121133

134+
#---------------------------------------------------
135+
echo -e "${BOLD}Commit the release branch${NORMAL}"
136+
git add .
137+
git commit -S -m "Release ${RELEASE}"
138+
122139
#---------------------------------------------------
123140
# Build the distributables
124141

admin/release-appstarter

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ git checkout $branch
1212
echo -e "${BOLD}Build the framework distributable${NORMAL}"
1313

1414
echo -e "${BOLD}Copy the main files/folders...${NORMAL}"
15-
releasable='application public writable README.md contributing.md env license.txt spark'
15+
releasable='app public writable README.md contributing.md env license.txt spark'
1616
for fff in $releasable ; do
1717
if [ -d "$fff" ] ; then
1818
rm -rf $fff
@@ -23,8 +23,9 @@ done
2323
echo -e "${BOLD}Override as needed...${NORMAL}"
2424
cp -rf ${CI_DIR}/admin/starter/* .
2525

26-
echo -e "${BOLD}Fix paths...${NORMAL}"
27-
sed -i "/public $systemDirectory = 'system';/s/'system'/'vendor/codeigniter4/framework/system'/" application/Config/Paths.php
26+
############# this can only happen after composer create-project/update
27+
#echo -e "${BOLD}Fix paths...${NORMAL}"
28+
#sed -i "/public $systemDirectory = 'system';/s/'system'/'vendor/codeigniter4/framework/system'/" app/Config/Paths.php
2829

2930
#---------------------------------------------------
3031
# And finally, get ready for merging

admin/release-deploy

-3
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,14 @@ git push ${CI_ORG}/CodeIgniter4 develop
2222
echo -e "${BOLD}Pushing to the user guide repository${NORMAL}"
2323
cd ${CI_DIR}/dist/userguide
2424
git push origin master
25-
git push ${CI_ORG}/userguide master
2625

2726
echo -e "${BOLD}Pushing to the framework repository${NORMAL}"
2827
cd ${CI_DIR}/dist/framework
2928
git push origin master
30-
git push ${CI_ORG}/framework master
3129

3230
echo -e "${BOLD}Pushing to the app starter repository${NORMAL}"
3331
cd ${CI_DIR}/dist/appstarter
3432
git push origin master
35-
git push ${CI_ORG}/appstarter master
3633

3734
cd ${CI_DIR}
3835

admin/release-framework

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ git checkout $branch
1212
echo -e "${BOLD}Build the framework distributable${NORMAL}"
1313

1414
echo -e "${BOLD}Copy the main files/folders...${NORMAL}"
15-
releasable='application docs public system writable README.md composer.json contributing.md env license.txt spark'
15+
releasable='app docs public system writable contributing.md env license.txt spark'
1616
for fff in $releasable ; do
1717
if [ -d "$fff" ] ; then
1818
rm -rf $fff

admin/release-notes.bb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
CAUTION: THIS FILE IS A MIX OF BBCODE & MARKDOWN... NEEDS PROOFING
2+
13
CodeIgniter-4.0.0-alpha.1 launches today, after a lengthy build-up :)
24

35
Huge shoutout to Lonnie Ezell for all of his hard work getting the vision

admin/starter/composer.json

+1-11
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,12 @@
66
"license": "MIT",
77
"require": {
88
"php": ">=7.1",
9-
"codeigniter4/framework": "^4",
10-
"ext-curl": "*",
11-
"ext-intl": "*",
12-
"kint-php/kint": "^2.1",
13-
"zendframework/zend-escaper": "^2.5"
9+
"codeigniter4/framework": "^4@alpha"
1410
},
1511
"require-dev": {
1612
"mikey179/vfsStream": "1.6.*",
1713
"phpunit/phpunit": "^7.0"
1814
},
19-
"autoload": {
20-
"psr-4": {
21-
"CodeIgniter\\": "vendor/codeigniter4/framework/system/",
22-
"Psr\\Log\\": "vendor/codeigniter4/framework/system/ThirdParty/PSR/Log/"
23-
}
24-
},
2515
"scripts": {
2616
"post-update-cmd": [
2717
"composer dump-autoload"
File renamed without changes.

0 commit comments

Comments
 (0)