Neos\Flow\Core\Migrations\Git::logContains PHP Method

logContains() public static method

Checks if the git repository for the given $path has a log entry matching $searchTerm
public static logContains ( string $path, string $searchTerm ) : boolean
$path string
$searchTerm string
return boolean
    public static function logContains($path, $searchTerm)
    {
        return self::getLog($path, $searchTerm) !== array();
    }

Usage Example

 /**
  * Whether or not the given $migration has been applied to the current package
  *
  * @param AbstractMigration $migration
  * @return boolean
  */
 protected function hasMigrationApplied(AbstractMigration $migration)
 {
     // if the "applied-flow-migrations" section doesn't exist, we fall back to checking the git log for applied migrations for backwards compatibility
     if (!isset($this->currentPackageData['composerManifest']['extra']['applied-flow-migrations'])) {
         return Git::logContains($this->currentPackageData['path'], 'Migration: ' . $migration->getIdentifier());
     }
     return in_array($migration->getIdentifier(), $this->currentPackageData['composerManifest']['extra']['applied-flow-migrations']);
 }