You are here

private function InfoForm::getFileInfo in Advanced CSS/JS Aggregation 8.3

Same name and namespace in other branches
  1. 8.4 src/Form/InfoForm.php \Drupal\advagg\Form\InfoForm::getFileInfo()
  2. 8.2 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 268

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.');
}