Merge pull request #2162 from totten/4.4-wp-active
[civicrm-core.git] / api / v3 / File.php
index 54e18d902f27941df900e5fe1a4cc5de976722a3..1e2a76c1e8034227808889b9238beef05308e612 100644 (file)
@@ -1,9 +1,8 @@
 <?php
-// $Id$
 
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
  *
  */
 
-/**
- * Files required for this package
- */
-require_once 'CRM/Core/DAO/File.php';
-require_once 'CRM/Core/BAO/File.php';
-
 /**
  * Create a file
  *
@@ -65,8 +58,6 @@ function civicrm_api3_file_create($params) {
     $params['upload_date'] = date("Ymd");
   }
 
-  require_once 'CRM/Core/DAO/File.php';
-
   $fileDAO = new CRM_Core_DAO_File();
   $properties = array('id', 'file_type_id', 'mime_type', 'uri', 'document', 'description', 'upload_date');
 
@@ -117,7 +108,6 @@ function &civicrm_api3_file_update($params) {
     return civicrm_api3_create_error('Required parameter missing');
   }
 
-  require_once 'CRM/Core/DAO/File.php';
   $fileDAO = new CRM_Core_DAO_File();
   $fileDAO->id = $params['id'];
   if ($fileDAO->find(TRUE)) {
@@ -150,14 +140,12 @@ function civicrm_api3_file_delete($params) {
 
   $check = FALSE;
 
-  require_once 'CRM/Core/DAO/EntityFile.php';
   $entityFileDAO = new CRM_Core_DAO_EntityFile();
   $entityFileDAO->file_id = $params['id'];
   if ($entityFileDAO->find()) {
     $check = $entityFileDAO->delete();
   }
 
-  require_once 'CRM/Core/DAO/File.php';
   $fileDAO = new CRM_Core_DAO_File();
   $fileDAO->id = $params['id'];
   if ($fileDAO->find(TRUE)) {
@@ -165,4 +153,4 @@ function civicrm_api3_file_delete($params) {
   }
 
   return $check ? NULL : civicrm_api3_create_error('Error while deleting a file.');
-}
\ No newline at end of file
+}