示例#1
0
 /**
  * @{inheritDoc}
  */
 public function fix_package_name(\titania_contribution $contrib, \titania_revision $revision, attachment $attachment, $root_dir = null)
 {
     // If we managed to find a single parent directory, then we use that in the zip name, otherwise we fall back to using contrib_name_clean
     if ($root_dir !== null) {
         $new_real_filename = $root_dir . '_' . strtolower($revision->revision_version) . '.' . $attachment->extension;
     } else {
         $new_real_filename = $contrib->contrib_name_clean . '_' . strtolower($revision->revision_version) . '.' . $attachment->extension;
     }
     $attachment->change_real_filename($new_real_filename);
     return $root_dir;
 }
示例#2
0
 /**
  * @{inheritDoc}
  */
 public function fix_package_name(\titania_contribution $contrib, \titania_revision $revision, attachment $attachment, $root_dir = null)
 {
     $new_real_filename = url::generate_slug($contrib->contrib_name_clean) . '_' . preg_replace('#[^0-9a-z]#', '_', strtolower($revision->revision_version));
     $attachment->change_real_filename($new_real_filename . '.' . $attachment->extension);
     return $new_real_filename;
 }