Skip to content

Commit

Permalink
Update for newer versions of PHP
Browse files Browse the repository at this point in the history
Required an update on the dependencies included in the "vendor"
subfolder.
  • Loading branch information
sylvainhalle committed Jul 2, 2024
1 parent bfe9852 commit 92c3d15
Show file tree
Hide file tree
Showing 167 changed files with 11,052 additions and 1,512 deletions.
15 changes: 0 additions & 15 deletions content/posts/post3-en.rst

This file was deleted.

15 changes: 0 additions & 15 deletions content/posts/post3-fr.rst

This file was deleted.

9 changes: 5 additions & 4 deletions fw/composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"require": {
"ivopetkov/html5-dom-document-php": "^0.4.4"
}
}
"require" : {
"ivopetkov/html5-dom-document-php": "2.*",
"michelf/php-markdown": "2.*"
}
}
89 changes: 75 additions & 14 deletions fw/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 5 additions & 17 deletions fw/fw.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**************************************************************************
Fantastic Windmill
Copyright (C) 2013-2017 Sylvain Hallé
Copyright (C) 2013-2024 Sylvain Hallé
A simple static web site generator for PHP programmers.
Expand All @@ -22,10 +22,10 @@
**************************************************************************/

// Version string (used for version tracking)
define("VERSION_STRING", "1.1");
define("VERSION_STRING", "1.2");
$HELLO_MSG = "Fantastic Windmill v".
VERSION_STRING." - A static web site generator for PHP programmers\n".
"(C) 2013-2017 Sylvain Hallé, Université du Québec à Chicoutimi";
"(C) 2013-2024 Sylvain Hallé, Université du Québec à Chicoutimi";

$usage_string = <<<EOD
Expand All @@ -41,8 +41,7 @@
/*----------------------*/

// Includes
require_once("fw/Michelf/MarkdownExtra.inc.php");
use \Michelf\MarkdownExtra;
use Michelf\MarkdownExtra;
require_once("fw/rendering.inc.php");
require_once("fw/site.inc.php");
require_once("fw/page.inc.php");
Expand Down Expand Up @@ -190,18 +189,7 @@
}

// Get basic metadata from file contents
if ($ext == "md")
{
//$html_contents = Markdown($contents);
$html_contents = MarkdownExtra::defaultTransform($contents);
}
else
{
$tmp_rst_file = "tmp_rst_file.rst";
file_put_contents($tmp_rst_file, $contents);
$html_contents = shell_exec("rst2html.py --syntax-highlight=short $tmp_rst_file");
unlink("tmp_rst_file.rst");
}
$html_contents = MarkdownExtra::defaultTransform($contents);
$page->parse($html_contents);
$nodelist = $page->dom->getElementsByTagName("h1");
$heading1 = $nodelist->item(0);
Expand Down
22 changes: 20 additions & 2 deletions fw/vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

// autoload.php @generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';
if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
}

return ComposerAutoloaderInit0b00d96111f4f81b7762d99b17ef2389::getLoader();
require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInitee0fde13326ad2d21097f98956376d09::getLoader();
Loading

0 comments on commit 92c3d15

Please sign in to comment.