Skip to content
Snippets Groups Projects
Commit c9e9c0e1 authored by Alex Barth's avatar Alex Barth
Browse files

Convert file_check_directory().

parent 9148b2cb
No related branches found
No related tags found
No related merge requests found
...@@ -190,7 +190,7 @@ class FeedsImportBatch extends FeedsBatch { ...@@ -190,7 +190,7 @@ class FeedsImportBatch extends FeedsBatch {
public function getFilePath() { public function getFilePath() {
if (!isset($this->file_path)) { if (!isset($this->file_path)) {
$dir = file_directory_path() .'/feeds'; $dir = file_directory_path() .'/feeds';
if (!file_check_directory($dir, TRUE)) { if (!file_prepare_directory($dir, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS)) {
throw new Exception(t('Feeds directory either cannot be created or is not writable.')); throw new Exception(t('Feeds directory either cannot be created or is not writable.'));
} }
$dest = file_destination($dir . '/' . get_class($this) .'_'. drupal_get_token($this->url) .'_'. time(), FILE_EXISTS_RENAME); $dest = file_destination($dir . '/' . get_class($this) .'_'. drupal_get_token($this->url) .'_'. time(), FILE_EXISTS_RENAME);
......
...@@ -88,7 +88,7 @@ class FeedsFileFetcher extends FeedsFetcher { ...@@ -88,7 +88,7 @@ class FeedsFileFetcher extends FeedsFetcher {
*/ */
public function sourceFormValidate(&$values) { public function sourceFormValidate(&$values) {
$feed_dir = file_directory_path() .'/feeds'; $feed_dir = file_directory_path() .'/feeds';
file_check_directory($feed_dir, TRUE); file_prepare_directory($dir, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
// If there is a file uploaded, save it, otherwise validate input on // If there is a file uploaded, save it, otherwise validate input on
// file. // file.
......
...@@ -212,7 +212,7 @@ class FeedsSimplePieParser extends FeedsParser { ...@@ -212,7 +212,7 @@ class FeedsSimplePieParser extends FeedsParser {
*/ */
protected function cacheDirectory() { protected function cacheDirectory() {
$directory = file_directory_path() .'/simplepie'; $directory = file_directory_path() .'/simplepie';
file_check_directory($directory, TRUE); file_prepare_directory($dir, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
return $directory; return $directory;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment