Hi guys,

I am starting two issues on both uuid and deploy module. In deploy module i want to be able to send only realpath for some files which then should be pulled with file_get_contents in uuid.

The case which brought me to this solution is that on one of our sites we have many files. Most of them are cloudinary images that should not be transfered at all. And the other part are really big videos that after base64_encode are breaking the mysql as they reach extremely high levels of packet_size. So i want to be able to send only the realpath and then to be able to download them on the endpoint site.

Deploy issue

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ShaxA created an issue. See original summary.

ShaxA’s picture

ShaxA’s picture

ShaxA’s picture

Status: Needs work » Needs review
sylus’s picture

I think you need to use the "===" operator or else the first line is always called:

+      if (stripos($entity->file_contents, 'http') === 0) {
+        $entity->uri = file_unmanaged_save_data(file_get_contents($entity->file_contents), $uri, $replace);
+      }
+      else {
+        $entity->uri = file_unmanaged_save_data(base64_decode($entity->file_contents), $uri, $replace);
+      }