update php version

This commit is contained in:
Dennis Eichhorn 2022-04-19 23:37:06 +02:00
parent a8059d89f4
commit 7e05e57b5b
8 changed files with 38 additions and 31 deletions

View File

@ -335,7 +335,7 @@
}
],
"no-unused-vars": [
"error",
"warn",
{
"args": "none",
"caughtErrors": "none",
@ -353,7 +353,7 @@
],
"no-useless-call": "error",
"no-useless-computed-key": "error",
"no-useless-constructor": "error",
"no-useless-constructor": "warn",
"no-useless-rename": "error",
"no-useless-return": "error",
"no-void": "error",

View File

@ -6,7 +6,7 @@
"/**",
" * Karaka",
" *",
" * PHP Version 8.0",
" * PHP Version 8.1",
" *",
" * @package Modules\\\\$1",
" * @copyright Dennis Eichhorn",
@ -49,7 +49,7 @@
"/**",
" * Karaka",
" *",
" * PHP Version 8.0",
" * PHP Version 8.1",
" *",
" * @package Modules\\\\$1",
" * @copyright Dennis Eichhorn",
@ -83,7 +83,7 @@
"/**",
" * Karaka",
" *",
" * PHP Version 8.0",
" * PHP Version 8.1",
" *",
" * @package Modules\\\\$1",
" * @copyright Dennis Eichhorn",
@ -218,7 +218,7 @@
"/**",
" * Karaka",
" *",
" * PHP Version 8.0",
" * PHP Version 8.1",
" *",
" * @package Modules\\\\$1",
" * @copyright Dennis Eichhorn",

View File

@ -2,7 +2,7 @@
/**
* Karaka
*
* PHP Version 8.0
* PHP Version 8.1
*
* @package Helper
* @copyright Dennis Eichhorn

View File

@ -2,7 +2,7 @@
/**
* Karaka
*
* PHP Version 8.0
* PHP Version 8.1
*
* @package Helper
* @copyright Dennis Eichhorn
@ -59,7 +59,7 @@ foreach ($modules as $module) {
. '/**' . "\n"
. ' * Karaka' . "\n"
. ' *' . "\n"
. ' * PHP Version 8.0' . "\n"
. ' * PHP Version 8.1' . "\n"
. ' *' . "\n"
. ' * @package tests' . "\n"
. ' * @copyright Dennis Eichhorn' . "\n"

View File

@ -1,27 +1,34 @@
#!/bin/bash
SCRIPT=$(readlink -f "$0")
BPATH=$(dirname "$SCRIPT")
# html checks
find ./Web ./Install ./Modules -name "*tpl.php" | xargs grep -E '=\"[\#\$\%\^\&\*\(\)\\/\ ]*\"'
find ./Web ./Install ./Modules -name "*tpl.php" | xargs grep -P '(\<img)((?!.*?alt=).)*(>)'
find ./Web ./Install ./Modules -name "*tpl.php" | xargs grep -P '(<input)((?!.*?type=).)*(>)'
find ./Web ./Install ./Modules -name "*tpl.php" | xargs grep -P '(<input|<select|<textarea)((?!.*?name=).)*(>)'
find ./Web ./Install ./Modules -name "*tpl.php" | xargs grep -P '(style=)'
find ./Web ./Install ./Modules -name "*tpl.php" | xargs grep -P '(value|title|alt|aria\-label)(=\")((?!\<\?).)*(>)'
find ./Web ./Install ./Modules -name "*tpl.php" | xargs grep -P '(\<td\>|\<th\>|\<caption\>|\<label.*?(\"|l)\>)[0-9a-zA-Z\.\?]+)'
printf "\nHTML checks\n\n"
find ${BPATH}/../../Web ${BPATH}/../../Install ${BPATH}/../../Modules -name "*tpl.php" | xargs -0 grep -E '=\"[\#\$\%\^\&\*\(\)\\/\ ]*\"'
find ${BPATH}/../../Web ${BPATH}/../../Install ${BPATH}/../../Modules -name "*tpl.php" | xargs -0 grep -P '(\<img)((?!.*?alt=).)*(>)'
find ${BPATH}/../../Web ${BPATH}/../../Install ${BPATH}/../../Modules -name "*tpl.php" | xargs -0 grep -P '(<input)((?!.*?type=).)*(>)'
find ${BPATH}/../../Web ${BPATH}/../../Install ${BPATH}/../../Modules -name "*tpl.php" | xargs -0 grep -P '(<input|<select|<textarea)((?!.*?name=).)*(>)'
find ${BPATH}/../../Web ${BPATH}/../../Install ${BPATH}/../../Modules -name "*tpl.php" | xargs -0 grep -P '(style=)'
find ${BPATH}/../../Web ${BPATH}/../../Install ${BPATH}/../../Modules -name "*tpl.php" | xargs -0 grep -P '(value|title|alt|aria\-label)(=\")((?!\<\?).)*(>)'
find ${BPATH}/../../Web ${BPATH}/../../Install ${BPATH}/../../Modules -name "*tpl.php" | xargs -0 grep -P '(\<td\>|\<th\>|\<caption\>|\<label.*?(\"|l)\>)[0-9a-zA-Z\.\?]+)'
# php/js strict checks
grep -r -L "declare(strict_types=1);" --include=*.php --exclude={*.tpl.php,*Hooks.php,*Routes.php,*SearchCommands.php} ./phpOMS ./Web ./Modules ./Model
grep -r -L "\"use strict\";" --include=*.js ./jsOMS ./Modules ./Model
printf "\nStrict checks\n\n"
grep -r -L "declare(strict_types=1);" --include=*.php --exclude={*.tpl.php,*Hooks.php,*Routes.php,*SearchCommands.php} ${BPATH}/../../phpOMS ${BPATH}/../../Web ${BPATH}/../../Modules ${BPATH}/../../Model
# php/js has logs
find ./Web ./phpOMS ./Model ./Modules -name "*.js" | xargs grep 'console.log('
find ./Web ./jsOMS ./Model ./Modules -name "*.php" | xargs grep 'var_dump('
printf "\nLog checks\n\n"
find ${BPATH}/../../Web ${BPATH}/../../phpOMS ${BPATH}/../../Model ${BPATH}/../../Modules -name "*.js" | xargs -0 grep 'console.log('
find ${BPATH}/../../Web ${BPATH}/../../jsOMS ${BPATH}/../../Model ${BPATH}/../../Modules -name "*.php" | xargs -0 grep 'var_dump('
# js uses on actions
grep -rlni "onafterprint=\|onbeforeprint=\|onbeforeunload=\|onerror=\|onhaschange=\|onload=\|onmessage=\|onoffline=\|ononline=\|onpagehide=\|onpageshow=\|onpopstate=\|onredo=\|onresize=\|onstorage=\|onund=o\|onunload=\|onblur=\|onchage=\|oncontextmenu=\|onfocus=\|onformchange=\|onforminput=\|oninput=\|oninvalid=\|onreset=\|onselect=\|onsubmit=\|onkeydown=\|onkeypress=\|onkeyup=\|onclick=\|ondblclic=k\|ondrag=\|ondragend=\|ondragenter=\|ondragleave=\|ondragover=\|ondragstart=\|ondrop=\|onmousedown=\|onmousemove=\|onmouseout=\|onmouseover=\|onmouseup=\|onmousewheel=\|onscroll=\|onabor=t\|oncanplay=\|oncanplaythrough=\|ondurationchange=\|onemptied=\|onended=\|onerror=\|onloadeddata=\|onloadedmetadata=\|onloadstart=\|onpause=\|onplay=\|onplaying=\|onprogress=\|onratechange=\|onreadystatechange=\|onseeked=\|onseeking=\|onstalled=\|onsuspend=\|ontimeupdate=\|onvolumechange=" --include=*.js ./jsOMS ./Model ./Modules ./Web
printf "\nJs Action checks\n\n"
grep -rlni "onafterprint=\|onbeforeprint=\|onbeforeunload=\|onerror=\|onhaschange=\|onload=\|onmessage=\|onoffline=\|ononline=\|onpagehide=\|onpageshow=\|onpopstate=\|onredo=\|onresize=\|onstorage=\|onund=o\|onunload=\|onblur=\|onchage=\|oncontextmenu=\|onfocus=\|onformchange=\|onforminput=\|oninput=\|oninvalid=\|onreset=\|onselect=\|onsubmit=\|onkeydown=\|onkeypress=\|onkeyup=\|onclick=\|ondblclic=k\|ondrag=\|ondragend=\|ondragenter=\|ondragleave=\|ondragover=\|ondragstart=\|ondrop=\|onmousedown=\|onmousemove=\|onmouseout=\|onmouseover=\|onmouseup=\|onmousewheel=\|onscroll=\|onabor=t\|oncanplay=\|oncanplaythrough=\|ondurationchange=\|onemptied=\|onended=\|onerror=\|onloadeddata=\|onloadedmetadata=\|onloadstart=\|onpause=\|onplay=\|onplaying=\|onprogress=\|onratechange=\|onreadystatechange=\|onseeked=\|onseeking=\|onstalled=\|onsuspend=\|ontimeupdate=\|onvolumechange=" --include=*.js ${BPATH}/../../jsOMS ${BPATH}/../../Model ${BPATH}/../../Modules ${BPATH}/../../Web
# white spaces at end of line
find ./Web ./phpOMS ./jsOMS ./cOMS ./Model ./Build ./Modules \( -name "*.php" -o -name "*.js" -o -name "*.sh" -o -name "*.cpp" -o -name "*.h" -o -name "*.json" \) | xargs grep -P ' $'
printf "\nWhitespace check\n\n"
find ${BPATH}/../../Web ${BPATH}/../../phpOMS ${BPATH}/../../jsOMS ${BPATH}/../../cOMS ${BPATH}/../../Model ${BPATH}/../../Build ${BPATH}/../../Modules \( -name "*.php" -o -name "*.js" -o -name "*.sh" -o -name "*.cpp" -o -name "*.h" -o -name "*.json" \) | xargs -0 grep -P ' $'
# php cs + phpstan + eslint
./vendor/bin/phpcs ./ --standard="Build/Config/phpcs.xml"

View File

@ -20,7 +20,7 @@ The last feature is the backend and documentation generation based on the DocBlo
The build system will take care of most requirements, the following tools and commands have to be available on the system.
software-properties-common npm git php8.0 php8.0-dev php8.0-cli php8.0-common php8.0-mysql php8.0-pgsql php8.0-xdebug php8.0-opcache php8.0-pdo php8.0-sqlite php8.0-mbstring php8.0-curl php8.0-imap php8.0-bcmath php8.0-zip php8.0-dom php8.0-xml php8.0-phar php8.0-gd php-pear apache2 mysql-server postgresql postgresql-contrib vsftpd tesseract-ocr wget curl grep xarg sed composer
software-properties-common npm git php8.1 php8.1-dev php8.1-cli php8.1-common php8.1-mysql php8.1-pgsql php8.1-xdebug php8.1-opcache php8.1-pdo php8.1-sqlite php8.1-mbstring php8.1-curl php8.1-imap php8.1-bcmath php8.1-zip php8.1-dom php8.1-xml php8.1-phar php8.1-gd php-pear apache2 mysql-server postgresql postgresql-contrib vsftpd tesseract-ocr wget curl grep xarg sed composer
## Inspections

View File

@ -2,7 +2,7 @@
/**
* Karaka
*
* PHP Version 8.0
* PHP Version 8.1
*
* Inspect .lang.php files and check them for errors/optimization
*

View File

@ -6,18 +6,18 @@ Vagrant.configure("2") do |config|
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y lsb-release ca-certificates apt-transport-https software-properties-common
apt-get install -y lsb-release ca-certificates apt-transport-https software-properties-common
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install -y apache2 mysql-server php8.0 php8.0-mysql
apt-get install -y apache2 mysql-server php8.1 php8.1-mysql
cp /home/spl1nes/Orange-Management/Build/VM/oms.conf /etc/apache2/sites-available/oms.conf
a2ensite development.conf
a2dissite 000-default.conf
a2dissite 000-default.conf
systemctl reload apache2
echo "create database development" | mysql
echo "CREATE USER 'development'@'localhost' IDENTIFIED BY 'development'" | mysql
echo "GRANT ALL PRIVILEGES ON development.* TO 'development'@'localhost';" | mysql
echo "flush privileges" | mysql
echo "create database development" | mysql
echo "CREATE USER 'development'@'localhost' IDENTIFIED BY 'development'" | mysql
echo "GRANT ALL PRIVILEGES ON development.* TO 'development'@'localhost';" | mysql
echo "flush privileges" | mysql
SHELL
end