butterfly/inc/fileversion.class.php
Claude 26127bf736 Baseline: plugin butterfly v2.1.0 como recebido (pré-fixes GLPI 11)
Estado original vindo do servidor de origem via tar.gz, antes da
rodada de conformidade com a knowledge-base e fixes de GLPI 11.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 15:34:10 -03:00

25 lines
576 B
PHP

<?php
class PluginButterflyFileVersion {
private $_file = "";
private $_initialized = false;
public function __construct($file = "") {
$this->_file = $file;
}
public function __toString() {
// First call is inside of "file_exists", so it is necessary to return a valid file
if (!$this->_initialized) {
$this->_initialized = true;
return $this->_file;
}
// Second call is inside concatenation
$timestamp = PluginButterflyToolbox::getTimestamp();
return $this->_file . "?_=" . $timestamp;
}
}