]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14589 improved method names
authorskodak <skodak>
Wed, 6 Aug 2008 20:51:14 +0000 (20:51 +0000)
committerskodak <skodak>
Wed, 6 Aug 2008 20:51:14 +0000 (20:51 +0000)
lib/file/file_storage.php

index 948408c05fb29458fc0345881f66e0cd820b7411..42a34b84492273afaaacc33acd53343ae01c0dd3 100644 (file)
@@ -306,7 +306,7 @@ class file_storage {
 
         static $contenthash = null;
         if (!$contenthash) {
-            $this->add_to_pool_string('');
+            $this->add_string_to_pool('');
             $contenthash = sha1('');
         }
 
@@ -473,7 +473,7 @@ class file_storage {
         $newrecord->mimetype     = empty($file_record->mimetype) ? mimeinfo('type', $file_record->filename) : $file_record->mimetype;
         $newrecord->userid       = empty($file_record->userid) ? null : $file_record->userid;
 
-        list($newrecord->contenthash, $newrecord->filesize, $newfile) = $this->add_to_pool_pathname($pathname);
+        list($newrecord->contenthash, $newrecord->filesize, $newfile) = $this->add_file_to_pool($pathname);
 
         $newrecord->pathnamehash = $this->get_pathname_hash($newrecord->contextid, $newrecord->filearea, $newrecord->itemid, $newrecord->filepath, $newrecord->filename);
 
@@ -548,7 +548,7 @@ class file_storage {
         $newrecord->mimetype     = empty($file_record->mimetype) ? mimeinfo('type', $file_record->filename) : $file_record->mimetype;
         $newrecord->userid       = empty($file_record->userid) ? null : $file_record->userid;
 
-        list($newrecord->contenthash, $newrecord->filesize, $newfile) = $this->add_to_pool_string($content);
+        list($newrecord->contenthash, $newrecord->filesize, $newfile) = $this->add_string_to_pool($content);
 
         $newrecord->pathnamehash = $this->get_pathname_hash($newrecord->contextid, $newrecord->filearea, $newrecord->itemid, $newrecord->filepath, $newrecord->filename);
 
@@ -577,7 +577,7 @@ class file_storage {
      * @param string sha1 hash of content if known (performance only)
      * @return array(contenthash, filesize, newfile)
      */
-    public function add_to_pool_pathname($pathname, $contenthash=null) {
+    public function add_file_to_pool($pathname, $contenthash=null) {
         if (!is_readable($pathname)) {
             throw new file_exception('localfilecannotread');
         }
@@ -622,7 +622,7 @@ class file_storage {
      * @param string $content file content - binary string
      * @return array(contenthash, filesize, newfile)
      */
-    public function add_to_pool_string($content) {
+    public function add_string_to_pool($content) {
         $contenthash = sha1($content);
         $filesize = strlen($content); // binary length