diff --git a/.gitea/workflows/lint.yml b/.forgejo/workflows/lint.yml similarity index 95% rename from .gitea/workflows/lint.yml rename to .forgejo/workflows/lint.yml index acf819b..7f90f20 100644 --- a/.gitea/workflows/lint.yml +++ b/.forgejo/workflows/lint.yml @@ -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 }}." - diff --git a/.gitignore b/.gitignore index ebc626f..586efff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ modules/goldbook/*.csv modules/timers/*.csv tmp/ +vendor/ +composer.* diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..77b7371 --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,5 @@ +setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) +; diff --git a/include/standard.inc.php b/include/standard.inc.php index 5cecde0..93d18df 100644 --- a/include/standard.inc.php +++ b/include/standard.inc.php @@ -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])); diff --git a/index.php b/index.php index adff58d..0adfacf 100644 --- a/index.php +++ b/index.php @@ -81,7 +81,7 @@ echo "