src/Phinx/Util/Util.php
public static function getExistingMigrationClassNames($path)
    {
        $classNames = [];

        if (!is_dir($path)) {
            return $classNames;
        }

        // filter the files to only get the ones that match our naming scheme
        $phpFiles = glob($path . DIRECTORY_SEPARATOR . '*.php');

        foreach ($phpFiles as $filePath) {
            if (preg_match('/([0-9]+)_([_a-z0-9]*).php/', basename($filePath))) {
                $classNames[] = static::mapFileNameToClassName(basename($filePath));
            }
        }

        return $classNames;
    }
public static function getExistingMigrationClassNames($path)
    {
        $classNames = [];

        if (!is_dir($path)) {
            return $classNames;
        }

        // filter the files to only get the ones that match our naming scheme
        $phpFiles = glob($path . DIRECTORY_SEPARATOR . '*.php');

        foreach ($phpFiles as $filePath) {
            if (preg_match('/([0-9]+)_([_a-z0-9]*).php/', basename($filePath))) {
                $classNames[] = static::mapFileNameToClassName(basename($filePath));
            }
        }

        return $classNames;
    }
public static function getExistingMigrationClassNames ( $ path ) { $ classNames = [ ] ; if ( ! is_dir ( $ path ) ) { return $ classNames ; } // filter the files to only get the ones that match our naming scheme $ phpFiles = glob ( $ path . DIRECTORY_SEPARATOR . '*.php' ) ; foreach ( $ phpFiles as $ filePath ) { if ( preg_match ( '/([0-9]+)_([_a-z0-9]*).php/' , basename ( $ filePath ) ) ) { $ classNames [ ] = static :: mapFileNameToClassName ( basename ( $ filePath ) ) ; } } return $ classNames ; }
Gets an array of all the existing migration class names.

@return string[]
Gets an array of all the existing migration class names .