ci2 #3

Merged
n merged 3 commits from ci2 into main 2024-09-14 21:24:36 +02:00
8 changed files with 28 additions and 21 deletions

View file

@ -1,3 +1,4 @@
---
name: lint
run-name: lint is launched by ${{ github.actor }}
on: [push]
@ -7,12 +8,12 @@ jobs:
name: lint
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Forgejo!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- name: Install linters using Composer
run: |
run: |
export COMPOSER_HOME=/tmp
echo "{}" > composer.json
composer config --no-interaction allow-plugins.bamarni/composer-bin-plugin true
@ -24,4 +25,3 @@ jobs:
- name: PHP CS Fixer
run: vendor/bin/php-cs-fixer fix --dry-run --verbose --diff .
- run: echo "🍏 This job's status is ${{ job.status }}."

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
modules/goldbook/*.csv
modules/timers/*.csv
tmp/
vendor/
composer.*

5
.php-cs-fixer.php Normal file
View file

@ -0,0 +1,5 @@
<?php
return (new PhpCsFixer\Config())
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
;

View file

@ -113,7 +113,7 @@ function formcaller()
function splitchar($Number)
{
$byte = strval(dechex($Number));
switch(strlen($byte)) {
switch (strlen($byte)) {
case 1:
$byte0 = $byte;
$byte1 = $byte2 = $byte3 = 0;
@ -260,7 +260,7 @@ function password($folder)
$fd = fopen("$folder/password.txt", "r");
$titre = fgetcsv($fd, 10000, ",");
while($fd) {
while ($fd) {
$data = fgetcsv($fd, 10000, ",");
$login[$i] = $data[0];
$mdp[$i] = $data[1];
@ -361,13 +361,13 @@ function nb_visiteurs_connecte($time, $filename = "/tmp/nbweb.dat")
$ii = 0;
$bool = 0;
if(file_exists($filename)) {
if($fichier = fopen($filename, "r")) {
while(!feof($fichier)) {
if (file_exists($filename)) {
if ($fichier = fopen($filename, "r")) {
while (!feof($fichier)) {
$ligne = fgets($fichier, 4096);
$tab = explode("|", $ligne);
if($tab[1] > 0) {
if ($tab[1] > 0) {
$tab_de_tab[$i][0] = $tab[0];
$tab_de_tab[$i][1] = $tab[1];
@ -378,8 +378,8 @@ function nb_visiteurs_connecte($time, $filename = "/tmp/nbweb.dat")
}
}
for($j = 0;$j < $i;$j++) {
if(($date - chop($tab_de_tab[$j][1])) > $time) {
for ($j = 0;$j < $i;$j++) {
if (($date - chop($tab_de_tab[$j][1])) > $time) {
//on ne fait rien
} else {
$tab_de_tab_actualise[$ii][0] = $tab_de_tab[$j][0];
@ -388,20 +388,20 @@ function nb_visiteurs_connecte($time, $filename = "/tmp/nbweb.dat")
}
}
for($j = 0;$j < $ii;$j++) {
if($tab_de_tab_actualise[$j][0] == $ip) {
for ($j = 0;$j < $ii;$j++) {
if ($tab_de_tab_actualise[$j][0] == $ip) {
$bool = 1;
}
}
if($bool == 0) {
if ($bool == 0) {
$tab_de_tab_actualise[$ii][0] = $ip;
$tab_de_tab_actualise[$ii][1] = $date;
$ii++;
}
if($fichier = fopen($filename, "w")) {
for($j = 0;$j < $ii;$j++) {
if ($fichier = fopen($filename, "w")) {
for ($j = 0;$j < $ii;$j++) {
fputs($fichier, chop($tab_de_tab_actualise[$j][0]));
fputs($fichier, "|");
fputs($fichier, chop($tab_de_tab_actualise[$j][1]));

View file

@ -81,7 +81,7 @@ echo "<td class='pageseparator'><img src='/modules/share/trans.gif' alt='' title
// --- gestion des modules ---
if (isset($modulepage)) {
//include "include/logo.inc.php";
switch($modulepage) {
switch ($modulepage) {
case "sondage":
extract($themeset, EXTR_OVERWRITE);

View file

@ -89,7 +89,7 @@ if ((!isset($NbMaxPost)) || ($NbMaxPost > $Cpt)) {
echo "<hr /><div class='left'>";
if ($NbMaxPost) {
for($i = 0;$i <= $NbMaxPost - 1;$i++) {
for ($i = 0;$i <= $NbMaxPost - 1;$i++) {
if ($VisitorName[$i] == "") {
$VisitorName[$i] = "Anonyme";
}

View file

@ -45,7 +45,7 @@ if ($Cpt <= 0) {
<?php
echo "<select name='ListeLiens'>";
for($i = 0;$i <= $NbMaxPost - 1;$i++) {
for ($i = 0;$i <= $NbMaxPost - 1;$i++) {
echo "<option value='$url[$i]'>$linkname[$i]</option>\n";
}
@ -53,7 +53,7 @@ if ($Cpt <= 0) {
} else {
// affichage des liens
echo "<div class='left'>";
for($i = 0;$i <= $NbMaxPost - 1;$i++) {
for ($i = 0;$i <= $NbMaxPost - 1;$i++) {
if ($level[$i] == 1) {
echo "<b>";
if ($url[$i] != "") {

View file

@ -1,6 +1,6 @@
<?php
$randimg = rand(1, 3);
switch($randimg) {
switch ($randimg) {
case '1': $logo = "yoyo.png";
$logodesc = "Y8000";
break;