Same name in other branches
  1. 5.0.x src/Form/InfoForm.php \Drupal\advagg\Form\InfoForm::getFileInfo()
  2. 6.0.x src/Form/InfoForm.php \Drupal\advagg\Form\InfoForm::getFileInfo()
  3. 8.x-2.x src/Form/InfoForm.php \Drupal\advagg\Form\InfoForm::getFileInfo()
  4. 8.x-3.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

string Detailed info about this file.

1 call to InfoForm::getFileInfo()
InfoForm::getFileInfoSubmit in src/Form/InfoForm.php
Display file info in a drupal message.

File

src/Form/InfoForm.php, line 239

Class

InfoForm
View AdvAgg information for this site.

Namespace

Drupal\advagg\Form

Code

private function getFileInfo($filename) {
    if (substr_compare($filename, 'css_', 0) || substr_compare($filename, 'js_', 0)) {
        $cid = str_replace([
            'css_',
            'js_',
            '.css',
            '.js',
        ], '', $filename);
        $cid = substr($cid, 0, strpos($cid, '.'));
        if ($cached = $this->cache
            ->get($cid, TRUE)) {
            return print_r($cached->data, TRUE);
        }
    }
    return $this->t('Optimized file information not found, confirm spelling of the path. Alternatively, that could be an outdated file.');
}