Further modules included.
[yaffs-website] / web / modules / contrib / libraries / src / ExternalLibrary / Local / LocalLibraryInterface.php
1 <?php
2
3 namespace Drupal\libraries\ExternalLibrary\Local;
4
5 use Drupal\Component\Plugin\Factory\FactoryInterface;
6 use Drupal\libraries\ExternalLibrary\LibraryInterface;
7
8 /**
9  * Provides an interface for local libraries.
10  *
11  * Local libraries are libraries that can be found on the filesystem. If the
12  * library files can be found in the filesystem a library is considered
13  * installed and its library path can be retrieved.
14  *
15  * Because determining whether or not the library is available locally is not
16  * the responsibility of the library itself, but of a designated locator, this
17  * interface declares setter methods, as well.
18  *
19  * @see \Drupal\libraries\ExternalLibrary\Local\LocatorInterface
20  */
21 interface LocalLibraryInterface extends LibraryInterface {
22
23   /**
24    * Checks whether the library is installed.
25    *
26    * @return bool
27    *   TRUE if the library is installed; FALSE otherwise;
28    */
29   public function isInstalled();
30
31   /**
32    * Marks the library as uninstalled.
33    *
34    * A corresponding method to mark the library as installed is not provided as
35    * an installed library should have a library path, so that
36    * LocalLibraryInterface::setLibraryPath() can be used instead.
37    *
38    * @return $this
39    *
40    * @see \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface::isInstalled()
41    * @see \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface::setLocalPath()
42    */
43   public function setUninstalled();
44
45   /**
46    * Gets the local path to the library.
47    *
48    * @return string
49    *   The absolute path to the library on the filesystem.
50    *
51    * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryNotInstalledException
52    *
53    * @see \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface::setLocalPath()
54    */
55   public function getLocalPath();
56
57   /**
58    * Sets the local path of the library.
59    *
60    * @param string $path
61    *   The path to the library.
62    *
63    * @see \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface::getLocalPath()
64    */
65   public function setLocalPath($path);
66
67   /**
68    * Gets the locator of this library using the locator factory.
69    *
70    * Because determining the installation status and library path of a library
71    * is not specific to any library or even any library type, this logic is
72    * offloaded to separate locator objects.
73    *
74    * @param \Drupal\Component\Plugin\Factory\FactoryInterface $locator_factory
75    *
76    * @return \Drupal\libraries\ExternalLibrary\Local\LocatorInterface
77    *
78    * @see \Drupal\libraries\ExternalLibrary\Local\LocatorInterface
79    */
80   public function getLocator(FactoryInterface $locator_factory);
81
82 }