This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function MYMODULE_import() { | |
// Path relative to document root | |
$csv_filepath = backdrop_get_path('module', 'MYMODULE'); | |
$csv_filepath .= '/user_list.csv'; | |
if ($handle = fopen($csv_filepath, 'r') ) { | |
// Read from CSV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Load file from disk. | |
echo 'Managing unmanaged files:\n'; | |
// Change the DIRECTORY_NAME below for each directory you'd like to process. | |
foreach (new DirectoryIterator('DIRECTORY_NAME') as $unmanaged_file) { | |
if(($unmanaged_file->isDir()) | ($unmanaged_file->isDot()) | (!$unmanaged_file->valid())) continue; | |
$filename = $unmanaged_file->getFilename(); | |
if($filename == '.htaccess') continue; | |
$pathname = $unmanaged_file->getPathname(); |