You are here

public static function RealisticDummyContentEnvironment::getFileParts in Realistic Dummy Content 7.2

Same name and namespace in other branches
  1. 8.2 api/src/includes/RealisticDummyContentEnvironment.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentEnvironment::getFileParts()
  2. 3.x api/src/includes/RealisticDummyContentEnvironment.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentEnvironment::getFileParts()

Retrieves the parts constituting a filename.

2 calls to RealisticDummyContentEnvironment::getFileParts()
RealisticDummyContentEnvironment::addFileToArray in api/src/includes/RealisticDummyContentEnvironment.php
Adds a file to an array of file group parts.
RealisticDummyContentEnvironment::validCandidateFilename in api/src/includes/RealisticDummyContentEnvironment.php
Checks if a filename is valid.

File

api/src/includes/RealisticDummyContentEnvironment.php, line 290

Class

RealisticDummyContentEnvironment
The abstract base environment.

Namespace

Drupal\realistic_dummy_content_api\includes

Code

public static function getFileParts($name) {
  $return = array();
  $parts = explode('.', $name);
  if (count($parts) >= 4) {
    $return['attribute_extention'] = array_pop($parts);
    $return['attribute_name'] = array_pop($parts);
  }
  $return['base'] = implode('.', $parts);
  $return['base_extension'] = array_pop($parts);
  return $return;
}