Exemple #1
0
 protected function buildFinder()
 {
     $adapter = new ehough_finder_adapter_BsdFindAdapter();
     if (!$adapter->isSupported()) {
         $this->markTestSkipped(get_class($adapter) . ' is not supported.');
     }
     return ehough_finder_Finder::create()->removeAdapters()->addAdapter($adapter);
 }
 /**
  * Create a list of migrations to execute for a particular plugin.
  *
  * @param BWP_Framework_V3 $plugin
  * @return BWP_Framework_Migration[]
  */
 public static function create_migrations(BWP_Framework_V3 $plugin)
 {
     $finder = new ehough_finder_Finder();
     $migration_directory = dirname($plugin->plugin_file) . '/migrations';
     // no migrations, nothing to do
     if (!file_exists($migration_directory)) {
         return array();
     }
     $iterator = $finder->files()->name('/^[0-9]{5,}(-(beta|rc)[0-9]+)?(_[0-9]{5,}(-(beta|rc)[0-9]+)?)?\\.php$/')->depth(0)->in($migration_directory);
     $migrations = array();
     /* @var $file SplFileInfo */
     foreach ($iterator as $file) {
         $filepath = $migration_directory . '/' . $file->getFilename();
         if (!($migration = self::create_migration($plugin, $filepath))) {
             continue;
         }
         $migrations[] = $migration;
     }
     usort($migrations, array('BWP_Framework_Migration_Factory', 'compare_migrations'));
     return $migrations;
 }
 /**
  * Adds VCS patterns.
  *
  * @see ignoreVCS
  *
  * @param string|string[] $pattern VCS patterns to ignore
  */
 public static function addVCSPattern($pattern)
 {
     foreach ((array) $pattern as $p) {
         self::$vcsPatterns[] = $p;
     }
     self::$vcsPatterns = array_unique(self::$vcsPatterns);
 }
Exemple #4
0
 protected function buildFinder()
 {
     $adapter = new ehough_finder_adapter_PhpAdapter();
     return ehough_finder_Finder::create()->removeAdapters()->addAdapter($adapter);
 }
Exemple #5
0
 protected function buildFinder()
 {
     return ehough_finder_Finder::create();
 }