Page MenuHomePhorge
Diviner libphutil Tech Docs PhutilLibraryConflictException

final class PhutilLibraryConflictException
libphutil Technical Documentation ()

Thrown when you attempt to load two different copies of a library with the same name. Trying to load the second copy of the library will trigger this, and the library will not be loaded.

This means you've either done something silly (like tried to explicitly load two different versions of the same library into the same program -- this won't work because they'll have namespace conflicts), or your configuration might have some problems which caused two parts of your program to try to load the same library but end up loading different copies of it, or there may be some subtle issue like running 'arc' in a different Arcanist working directory. (Some bootstrapping workflows like that which run low-level library components on other copies of themselves are expected to fail.)

To resolve this, you need to make sure your program loads no more than one copy of each libphutil library, but exactly how you approach this depends on why it's happening in the first place.

Tasks

Getting Exception Information

  • public function getLibrary() — Retrieve the name of the library in conflict.
  • public function getOldPath() — Get the path to the library which has already been loaded earlier in the program's execution.
  • public function getNewPath() — Get the path to the library which is causing this conflict.

Creating Library Conflict Exceptions

  • public function __construct($library, $old_path, $new_path) — Create a new library conflict exception.

Methods

public function __construct($library, $old_path, $new_path)

Create a new library conflict exception.

Parameters
string$libraryThe name of the library which conflicts with an existing library.
string$old_pathThe path of the already-loaded library.
string$new_pathThe path of the attempting-to-load library.
Return
this//Implicit.//

public function getLibrary()

Retrieve the name of the library in conflict.

Return
stringThe name of the library which conflicts with an existing library.

public function getOldPath()

Get the path to the library which has already been loaded earlier in the program's execution.

Return
stringThe path of the already-loaded library.

public function getNewPath()

Get the path to the library which is causing this conflict.

Return
stringThe path of the attempting-to-load library.