Same name in other branches
- 5.0.x src/Form/InfoForm.php \Drupal\advagg\Form\InfoForm::getFileInfo()
- 6.0.x src/Form/InfoForm.php \Drupal\advagg\Form\InfoForm::getFileInfo()
- 8.x-3.x src/Form/InfoForm.php \Drupal\advagg\Form\InfoForm::getFileInfo()
- 8.x-4.x src/Form/InfoForm.php \Drupal\advagg\Form\InfoForm::getFileInfo()
Get detailed info about the given filename.
Parameters
string $filename: Name of file to lookup.
Return value
array Returns an array of detailed info about this file.
2 calls to InfoForm::getFileInfo()
- InfoForm::getFileInfoAjax in src/
Form/ InfoForm.php - Display file info via ajax callback.
- InfoForm::getFileInfoSubmit in src/
Form/ InfoForm.php - Display file info in a drupal message.
File
-
src/
Form/ InfoForm.php, line 353
Class
- InfoForm
- View AdvAgg information for this site.
Namespace
Drupal\advagg\FormCode
private function getFileInfo($filename) {
// Strip quotes and trim.
$filename = trim(str_replace([
'"',
"'",
], '', $filename));
if (substr_compare($filename, 'css_', 0) > 0 || substr_compare($filename, 'js_', 0) > 0) {
$results = array_column($this->advaggAggregates
->getAll(), NULL, 'uid');
if (isset($results[$filename])) {
return $results[$filename];
}
else {
return "Aggregate name unrecognized, confirm spelling, otherwise likely a very old aggregate that has been expunged.";
}
}
elseif ($data = $this->advaggFiles
->get($filename)) {
$data['File modification date'] = $this->dateFormatter
->format($data['mtime'], 'html_datetime');
$data['Information last update'] = $this->dateFormatter
->format($data['updated'], 'html_datetime');
return $data;
}
else {
return "File not found and AdvAgg has no record of it. Confirm spelling of the path.";
}
}