Skip to content

PHP 7.4 fixes #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ SITECONFPHP="../inc/siteconf.php"
perl -p -e "s:\@DRIVERDIR\@:$DRIVERDIR:" | \
perl -p -e "s:\@DRIVERDIRURL\@:$DRIVERDIRURL:" | \
perl -p -e "s:\@PPDDIRURL\@:$PPDDIRURL:" | \
perl -p -e "s:\@WORKDIR\@:$WORKDIR:" | \
perl -p -e "s:\@LIBDIR\@:$ALIBDIR:" > ${file%.in}
chmod +x ${file%.in}
done
Expand Down
21 changes: 21 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "openprinting/foomatic-db-webapp",
"description": "Web application for openprinting.org",
"type": "project",
"require": {
"smarty/smarty": "^5.3",
"apereo/phpcas": "^1.3"
},
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Lance Albertson",
"email": "[email protected]"
}
],
"config": {
"platform": {
"php": "7.4"
}
}
}
229 changes: 229 additions & 0 deletions composer.lock

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

20 changes: 10 additions & 10 deletions driver_detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
exit;
}

$drivertypes = array(
$drivertypes = [
"ghostscript" => 'Ghostscript built-in',
"uniprint" => 'Ghostscript Uniprint',
"filter" => 'Filter',
"ijs" => 'IJS',
"cups" => 'CUPS Raster',
"opvp" => 'OpenPrinting Vector',
"postscript" => 'PostScript');
"postscript" => 'PostScript'];

$driverparameters = array(
$driverparameters = [
"text" => 'Text',
"lineart" => 'Line Art',
"graphics" => 'Graphics',
"photo" => 'Photo',
"load_time" => 'System Load',
"speed" => 'Speed');
"speed" => 'Speed'];

$PAGE->setPageTitle('Driver: ' . $_GET['driver']);
$PAGE->setActiveID('driver');
Expand Down Expand Up @@ -56,7 +56,7 @@
// printer ID in such a case.
foreach($printers as $pr) {
if (strlen($pr['make']) == 0) {
$matches = array();
$matches = [];
if (preg_match("/^([^\-]+)\-(.*)$/", $pr['id'], $matches) != 0) {
$printers[$pr['id']]['make'] =
preg_replace("/_+/", " ", $matches[1]);
Expand Down Expand Up @@ -96,7 +96,7 @@
$mask = "{$_GET['driver']};openprinting-{$_GET['driver']};" .
"openprinting-ppds-{$_GET['driver']}";
}
$out = array();
$out = [];
exec("cd foomatic; ./packageinfo " . escapeshellarg($mask), $out, $ret_value);
if (sizeof($out) > 0)
$packagedownloads = $out[0];
Expand Down Expand Up @@ -244,7 +244,7 @@
$infobox .= "</font></td>" .
"<td width=\"2%\"></td></tr>";
}
if (is_array($contacts) and count($contacts) > 0) {
if (is_[$contacts] and count($contacts) > 0) {
$infobox .= "<tr valign=\"top\"><td width=\"2%\"></td>" .
"<td width=\"16%\"><font size=\"-2\">" .
"User support:" .
Expand Down Expand Up @@ -289,8 +289,8 @@
strlen($driver['graphics']) > 0 or strlen($driver['photo']) > 0 or
strlen($driver['load_time']) > 0 or strlen($driver['speed']) > 0) {
$infobox .= "<tr valign=\"top\"><td width=\"2%\"></td>";
foreach(array('text', 'graphics', 'load_time',
'lineart', 'photo', 'speed') as $par) {
foreach(['text', 'graphics', 'load_time',
'lineart', 'photo', 'speed'] as $par) {
$infobox .= "<td width=\"16%\"><font size=\"-2\">" .
"{$driverparameters[$par]}:</font></td>" .
"<td width=\"16%\"><font size=\"-2\">";
Expand Down Expand Up @@ -332,7 +332,7 @@
"</font></td>" .
"<td width=\"2%\"></td></tr>";
}
if (is_array($dependencies) and count($dependencies) > 0) {
if (is_[$dependencies] and count($dependencies) > 0) {
$infobox .= "<tr valign=\"top\"><td width=\"2%\"></td>" .
"<td width=\"16%\"><font size=\"-2\">" .
"<b>Dependencies:</b>" .
Expand Down
4 changes: 2 additions & 2 deletions driver_list.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
include('inc/common.php');

$drivertypes = array(
$drivertypes = [
"ghostscript" => 'Ghostscript&nbsp;built-in',
"uniprint" => 'Ghostscript&nbsp;Uniprint',
"filter" => 'Filter',
"ijs" => 'IJS',
"cups" => 'CUPS&nbsp;Raster',
"opvp" => 'OpenPrinting&nbsp;Vector',
"postscript" => 'PostScript');
"postscript" => 'PostScript'];

$SMARTY->assign("drivertypes",$drivertypes);

Expand Down
1 change: 1 addition & 0 deletions foomatic/query.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Digest::MD5 qw(md5_hex);
use strict;

use lib "@WORKDIR@";
use lib "@LIBDIR@";
use Foomatic::Defaults;
use Foomatic::DB;
Expand Down
9 changes: 4 additions & 5 deletions inc/common.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<?php

require __DIR__ . '/../vendor/autoload.php';

// TODO: do we have to include PHPMailer on every page?
include('PHPMailer/class.phpmailer.php');

include('inc/siteconf.php');
$CONF = new SiteConfig();
include($CONF->casModulePath . '/CAS.php');

include('inc/db.php');
include('inc/smarty/SmartyBC.class.php');
include('inc/page.php');

session_start();
error_reporting(E_ALL);

$SMARTY = new SmartyBC();
$SMARTY->clear_compiled_tpl();
use Smarty\Smarty;
$SMARTY = new Smarty();

$PAGE = Page::getInstance();
$PAGE->setSmarty($SMARTY);
Expand Down
Loading