You are here

private function SpiController::isManifestType in Acquia Connector 8

Same name and namespace in other branches
  1. 8.2 src/Controller/SpiController.php \Drupal\acquia_connector\Controller\SpiController::isManifestType()
  2. 3.x src/Controller/SpiController.php \Drupal\acquia_connector\Controller\SpiController::isManifestType()

Determine if a path is a file type we care about for modifications.

File

src/Controller/SpiController.php, line 726

Class

SpiController
SPI Controller class.

Namespace

Drupal\acquia_connector\Controller

Code

private function isManifestType($path) {
  $extensions = [
    'yml' => 1,
    'php' => 1,
    'php4' => 1,
    'php5' => 1,
    'module' => 1,
    'inc' => 1,
    'install' => 1,
    'test' => 1,
    'theme' => 1,
    'engine' => 1,
    'profile' => 1,
    'css' => 1,
    'js' => 1,
    'info' => 1,
    'sh' => 1,
    // SSL certificates.
    'pem' => 1,
    'pl' => 1,
    'pm' => 1,
  ];
  $pathinfo = pathinfo($path);
  return isset($pathinfo['extension']) && isset($extensions[$pathinfo['extension']]);
}