Skip to content
This repository has been archived by the owner on May 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #13 from rodrigoaguilera/master
Browse files Browse the repository at this point in the history
Accept .yml and yaml files
  • Loading branch information
rvilar committed Mar 9, 2015
2 parents 93a8e8f + 38fb1ef commit 3ae41ba
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions migrate_default_content.module
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php
/**
* @file
* Provides functionality for migration default content.
*/

/**
* Implements hook_libraries_info().
Expand Down Expand Up @@ -44,9 +48,10 @@ function migrate_default_content_requirements($phase) {
* Returns an array with all the configuration saved into the yaml files.
*
* @param string $content_path
* Internal path where the yaml and data files are stored.
* Internal path where the yaml and data files are stored.
*
* @return array
* @return array $config
* Configuration from the yaml in an array.
*/
function migrate_default_content_get_config_files($content_path = '') {
$config = &drupal_static(__FUNCTION__, array());
Expand All @@ -55,7 +60,7 @@ function migrate_default_content_get_config_files($content_path = '') {
if (empty($content_path)) {
$content_path = variable_get('migrate_default_content_path', 'sites/default/files/default_content');
}
$files = file_scan_directory($content_path, '/^.+\.yaml/');
$files = file_scan_directory($content_path, '/^.+\.(yaml|yml)/');
foreach ($files as $file) {
$config[] = Spyc::YAMLLoad($file->uri);
}
Expand All @@ -67,7 +72,8 @@ function migrate_default_content_get_config_files($content_path = '') {
/**
* Fetches the migration files and returns its information.
*
* @return array
* @return array $migrations
* Data structure with all its information.
*/
function migrate_default_content_fetch_migrations() {
$migrations = &drupal_static(__FUNCTION__);
Expand Down

0 comments on commit 3ae41ba

Please sign in to comment.