/** * attempt to create the uploads directory * * sets an error if it fails * * @param string $dir the name of the new directory */ public static function _make_uploads_dir($dir = '') { $dir = empty($dir) ? Participants_Db::files_location() : $dir; $savedmask = umask(0); $status = true; if (mkdir(Participants_Db::app_base_path() . $dir, 0755, true) === false) { if (is_object(self::$validation_errors)) { self::$validation_errors->add_error('', sprintf(__('The uploads directory (%s) could not be created.', 'participants-database'), $dir)); } $status = false; } umask($savedmask); return $status; }
/** * sets up the root path for the uploaded file * * defaults to the WP root */ function _set_root_path() { $this->root_path = Participants_Db::app_base_path(); }