Skip to content

Commit

Permalink
Merge branch 'QA_5_2'
Browse files Browse the repository at this point in the history
Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Oct 14, 2022
2 parents fbdca09 + dcdbcc0 commit 007915b
Show file tree
Hide file tree
Showing 24 changed files with 212 additions and 111 deletions.
2 changes: 1 addition & 1 deletion libraries/classes/Command/CacheWarmupCommand.php
Expand Up @@ -72,7 +72,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}

$output->writeln('Warming up all caches.', OutputInterface::VERBOSITY_VERBOSE);
$twigCode = $this->warmUptwigCache($output, $env, false);
$twigCode = $this->warmUpTwigCache($output, $env, false);
if ($twigCode !== 0) {
$output->writeln('Twig cache generation had an error.');

Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/Display/Results.php
Expand Up @@ -4041,7 +4041,7 @@ private function handleNonPrintableContents(
$transformationPlugin->getMIMESubtype(),
'Octetstream'
);
$posMimeText = strpos($transformationPlugin->getMIMEtype(), 'Text');
$posMimeText = strpos($transformationPlugin->getMIMEType(), 'Text');
if ($posMimeOctetstream || $posMimeText !== false) {
// Applying Transformations on hex string of binary data
// seems more appropriate
Expand Down
4 changes: 2 additions & 2 deletions libraries/classes/Gis/GisLineString.php
Expand Up @@ -161,8 +161,8 @@ public function prepareRowAsPdf($spatial, ?string $label, $line_color, array $sc

// print label
if ($label !== '') {
$pdf->SetXY($points_arr[1][0], $points_arr[1][1]);
$pdf->SetFontSize(5);
$pdf->setXY($points_arr[1][0], $points_arr[1][1]);
$pdf->setFontSize(5);
$pdf->Cell(0, 0, $label);
}

Expand Down
4 changes: 2 additions & 2 deletions libraries/classes/Gis/GisMultiLineString.php
Expand Up @@ -183,8 +183,8 @@ public function prepareRowAsPdf($spatial, ?string $label, $line_color, array $sc
unset($temp_point);
// print label
if ($label !== '' && $first_line) {
$pdf->SetXY($points_arr[1][0], $points_arr[1][1]);
$pdf->SetFontSize(5);
$pdf->setXY($points_arr[1][0], $points_arr[1][1]);
$pdf->setFontSize(5);
$pdf->Cell(0, 0, $label);
}

Expand Down
4 changes: 2 additions & 2 deletions libraries/classes/Gis/GisMultiPoint.php
Expand Up @@ -164,8 +164,8 @@ public function prepareRowAsPdf(

// print label for each point
if ((isset($label) && trim($label) != '') && ($points_arr[0][0] != '' && $points_arr[0][1] != '')) {
$pdf->SetXY($points_arr[0][0], $points_arr[0][1]);
$pdf->SetFontSize(5);
$pdf->setXY($points_arr[0][0], $points_arr[0][1]);
$pdf->setFontSize(5);
$pdf->Cell(0, 0, trim($label));
}

Expand Down
4 changes: 2 additions & 2 deletions libraries/classes/Gis/GisMultiPolygon.php
Expand Up @@ -225,8 +225,8 @@ public function prepareRowAsPdf($spatial, ?string $label, $fill_color, array $sc

// print label if applicable
if (isset($label_point)) {
$pdf->SetXY($label_point[0], $label_point[1]);
$pdf->SetFontSize(5);
$pdf->setXY($label_point[0], $label_point[1]);
$pdf->setFontSize(5);
$pdf->Cell(0, 0, $label);
}

Expand Down
4 changes: 2 additions & 2 deletions libraries/classes/Gis/GisPoint.php
Expand Up @@ -156,8 +156,8 @@ public function prepareRowAsPdf(
$pdf->Circle($points_arr[0][0], $points_arr[0][1], 2, 0, 360, 'D', $line);
// print label if applicable
if ($label !== '') {
$pdf->SetXY($points_arr[0][0], $points_arr[0][1]);
$pdf->SetFontSize(5);
$pdf->setXY($points_arr[0][0], $points_arr[0][1]);
$pdf->setFontSize(5);
$pdf->Cell(0, 0, $label);
}
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/classes/Gis/GisPolygon.php
Expand Up @@ -190,8 +190,8 @@ public function prepareRowAsPdf($spatial, ?string $label, $fill_color, array $sc
$pdf->Polygon($points_arr, 'F*', [], $color, true);
// print label if applicable
if ($label !== '') {
$pdf->SetXY($points_arr[2], $points_arr[3]);
$pdf->SetFontSize(5);
$pdf->setXY($points_arr[2], $points_arr[3]);
$pdf->setFontSize(5);
$pdf->Cell(0, 0, $label);
}

Expand Down
10 changes: 5 additions & 5 deletions libraries/classes/Pdf.php
Expand Up @@ -55,10 +55,10 @@ public function __construct(
$pdfa = false
) {
parent::__construct($orientation, $unit, $format, $unicode, $encoding, $diskcache, $pdfa);
$this->SetAuthor('phpMyAdmin ' . Version::VERSION);
$this->setAuthor('phpMyAdmin ' . Version::VERSION);
$this->AddFont('DejaVuSans', '', 'dejavusans.php');
$this->AddFont('DejaVuSans', 'B', 'dejavusansb.php');
$this->SetFont(self::PMA_PDF_FONT, '', 14);
$this->setFont(self::PMA_PDF_FONT, '', 14);
$this->setFooterFont([self::PMA_PDF_FONT, '', 14]);
}

Expand All @@ -73,8 +73,8 @@ public function Footer(): void
return;
}

$this->SetY(-15);
$this->SetFont(self::PMA_PDF_FONT, '', 14);
$this->setY(-15);
$this->setFont(self::PMA_PDF_FONT, '', 14);
$this->Cell(
0,
6,
Expand All @@ -85,7 +85,7 @@ public function Footer(): void
'C'
);
$this->Cell(0, 6, Util::localisedDate(), 0, 1, 'R');
$this->SetY(20);
$this->setY(20);

// set footerset
$this->footerset[$this->page] = 1;
Expand Down
38 changes: 19 additions & 19 deletions libraries/classes/Plugins/Export/Helpers/Pdf.php
Expand Up @@ -189,12 +189,12 @@ public function Header(): void
// Check if header for this page already exists
// phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
if (! isset($this->headerset[$this->page])) {
$this->SetY($this->tMargin - ($this->FontSizePt / $this->k) * 5);
$this->setY($this->tMargin - ($this->FontSizePt / $this->k) * 5);
$this->cellFontSize = $this->FontSizePt;
$this->SetFont(PdfLib::PMA_PDF_FONT, '', ($this->titleFontSize ?: $this->FontSizePt));
$this->setFont(PdfLib::PMA_PDF_FONT, '', ($this->titleFontSize ?: $this->FontSizePt));
$this->Cell(0, $this->FontSizePt, $this->titleText, 0, 1, 'C');
$this->SetFont(PdfLib::PMA_PDF_FONT, '', $this->cellFontSize);
$this->SetY($this->tMargin - ($this->FontSizePt / $this->k) * 2.5);
$this->setFont(PdfLib::PMA_PDF_FONT, '', $this->cellFontSize);
$this->setY($this->tMargin - ($this->FontSizePt / $this->k) * 2.5);
$this->Cell(
0,
$this->FontSizePt,
Expand All @@ -207,24 +207,24 @@ public function Header(): void
);
$l = $this->lMargin;
foreach ($this->colTitles as $col => $txt) {
$this->SetXY($l, $this->tMargin);
$this->setXY($l, $this->tMargin);
$this->MultiCell($this->tablewidths[$col], $this->FontSizePt, $txt);
$l += $this->tablewidths[$col];
$GLOBALS['maxY'] = $GLOBALS['maxY'] < $this->GetY() ? $this->GetY() : $GLOBALS['maxY'];
}

$this->SetXY($this->lMargin, $this->tMargin);
$this->SetFillColor(200, 200, 200);
$this->setXY($this->lMargin, $this->tMargin);
$this->setFillColor(200, 200, 200);
$l = $this->lMargin;
foreach ($this->colTitles as $col => $txt) {
$this->SetXY($l, $this->tMargin);
$this->setXY($l, $this->tMargin);
$this->Cell($this->tablewidths[$col], $GLOBALS['maxY'] - $this->tMargin, '', 1, 0, 'L', true);
$this->SetXY($l, $this->tMargin);
$this->setXY($l, $this->tMargin);
$this->MultiCell($this->tablewidths[$col], $this->FontSizePt, $txt, 0, 'C');
$l += $this->tablewidths[$col];
}

$this->SetFillColor(255, 255, 255);
$this->setFillColor(255, 255, 255);
// set headerset
$this->headerset[$this->page] = 1;
}
Expand Down Expand Up @@ -265,7 +265,7 @@ public function morepagestable($lineheight = 8): void
// write the content and remember the height of the highest col
foreach ($data as $col => $txt) {
$this->page = $currpage;
$this->SetXY($l, $h);
$this->setXY($l, $h);
if ($this->tablewidths[$col] > 0) {
$this->MultiCell($this->tablewidths[$col], $lineheight, $txt, 0, $this->colAlign[$col]);
$l += $this->tablewidths[$col];
Expand Down Expand Up @@ -370,9 +370,9 @@ public function getTriggers($db, $table): void

// Starting to fill table with required info

$this->SetY($this->tMargin);
$this->setY($this->tMargin);
$this->AddPage();
$this->SetFont(PdfLib::PMA_PDF_FONT, '', 9);
$this->setFont(PdfLib::PMA_PDF_FONT, '', 9);

$l = $this->lMargin;
$startheight = $h = $this->dataY;
Expand Down Expand Up @@ -400,7 +400,7 @@ public function getTriggers($db, $table): void
// write the content and remember the height of the highest col
foreach ($data as $col => $txt) {
$this->page = $currpage;
$this->SetXY($l, $h);
$this->setXY($l, $h);
if ($this->tablewidths[$col] > 0) {
$this->MultiCell(
$this->tablewidths[$col],
Expand Down Expand Up @@ -557,9 +557,9 @@ public function getTableDef(

// Starting to fill table with required info

$this->SetY($this->tMargin);
$this->setY($this->tMargin);
$this->AddPage();
$this->SetFont(PdfLib::PMA_PDF_FONT, '', 9);
$this->setFont(PdfLib::PMA_PDF_FONT, '', 9);

// Now let's start to write the table structure

Expand Down Expand Up @@ -636,7 +636,7 @@ public function getTableDef(
// write the content and remember the height of the highest col
foreach ($data as $col => $txt) {
$this->page = $currpage;
$this->SetXY($l, $h);
$this->setXY($l, $h);
if ($this->tablewidths[$col] > 0) {
$this->MultiCell(
$this->tablewidths[$col],
Expand Down Expand Up @@ -852,9 +852,9 @@ public function mysqlReport($query): void
DatabaseInterface::CONNECT_USER,
DatabaseInterface::QUERY_UNBUFFERED
);
$this->SetY($this->tMargin);
$this->setY($this->tMargin);
$this->AddPage();
$this->SetFont(PdfLib::PMA_PDF_FONT, '', 9);
$this->setFont(PdfLib::PMA_PDF_FONT, '', 9);
// phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
$this->morepagestable($this->FontSizePt);
}
Expand Down
22 changes: 11 additions & 11 deletions libraries/classes/Plugins/Schema/Pdf/Pdf.php
Expand Up @@ -196,7 +196,7 @@ public function lineScale($x1, $y1, $x2, $y2): void
/**
* Sets x and y scaled positions
*
* @see TCPDF::SetXY()
* @see TCPDF::setXY()
*
* @param float $x The x position
* @param float $y The y position
Expand All @@ -205,47 +205,47 @@ public function setXyScale($x, $y): void
{
$x = ($x - $this->xMin) / $this->scale + $this->leftMargin;
$y = ($y - $this->yMin) / $this->scale + $this->topMargin;
$this->SetXY($x, $y);
$this->setXY($x, $y);
}

/**
* Sets the X scaled positions
*
* @see TCPDF::SetX()
* @see TCPDF::setX()
*
* @param float $x The x position
*/
public function setXScale($x): void
{
$x = ($x - $this->xMin) / $this->scale + $this->leftMargin;
$this->SetX($x);
$this->setX($x);
}

/**
* Sets the scaled font size
*
* @see TCPDF::SetFontSize()
* @see TCPDF::setFontSize()
*
* @param float $size The font size (in points)
*/
public function setFontSizeScale($size): void
{
// Set font size in points
$size /= $this->scale;
$this->SetFontSize($size);
$this->setFontSize($size);
}

/**
* Sets the scaled line width
*
* @see TCPDF::SetLineWidth()
* @see TCPDF::setLineWidth()
*
* @param float $width The line width
*/
public function setLineWidthScale($width): void
{
$width /= $this->scale;
$this->SetLineWidth($width);
$this->setLineWidth($width);
}

/**
Expand Down Expand Up @@ -278,9 +278,9 @@ public function Header(): void
$pg_name = ucfirst($pageDesc);
}

$this->SetFont($this->ff, 'B', 14);
$this->setFont($this->ff, 'B', 14);
$this->Cell(0, 6, $pg_name, 'B', 1, 'C');
$this->SetFont($this->ff, '');
$this->setFont($this->ff, '');
$this->Ln();
}

Expand Down Expand Up @@ -346,7 +346,7 @@ public function row(array $data, array $links): void
// print text
$this->MultiCell($w, $il + 1, $data[$i], 0, 'L');
// go to right side
$this->SetXY($x + $w, $y);
$this->setXY($x + $w, $y);
}

// go to line
Expand Down

0 comments on commit 007915b

Please sign in to comment.