Projet

Général

Profil

Révision 1aa883a3

Ajouté par Assos Assos il y a presque 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/print/print_epub/lib_handlers/print_epub_phpepub/print_epub_phpepub.module
20 20
  if (file_exists(DRUPAL_ROOT . '/' . $epub_tool)) {
21 21
    include_once DRUPAL_ROOT . '/' . $epub_tool;
22 22

  
23
    if (class_exists('EPub')) {
24
      return EPub::VERSION;
23
    $phpepub_version_4_plus = strpos($epub_tool, 'autoload.php') !== FALSE;
24
    if ($phpepub_version_4_plus) {
25
      return \PHPePub\Core\EPub::VERSION;
26
    }
27
    else {
28
      if (class_exists('EPub')) {
29
        return EPub::VERSION;
30
      }
25 31
    }
26 32
  }
33

  
34
  return 'unknown';
27 35
}
28 36

  
29 37
/**
......
36 44
  foreach ($tools as $tool) {
37 45
    $epub_tools['print_epub_phpepub|' . $tool] = 'PHPePub (' . dirname($tool) . ')';
38 46
  }
47

  
48
  // PHPePub >= 4.0 uses a composer autoloader.
49
  $tools = _print_scan_libs('phpepub', '!^autoload.php$!');
50
  foreach ($tools as $tool) {
51
    if (preg_match('!PHPePub.*?/vendor/autoload.php$!i', $tool)) {
52
      $epub_tools['print_epub_phpepub|' . $tool] = 'PHPePub (' . dirname(dirname($tool)) . ')';
53
    }
54
  }
39 55
}

Formats disponibles : Unified diff