Page MenuHomePhabricator

Support PHP namespaces
Closed, InvalidPublic


We would like to use external PHP libraries that use namespaces, for example, Braintree SDK with our custom phabricator installation. I think PHP libraries with namespace is probably more common in 2017 than it was in 2015 .

Can this be supported? May be using something like make it easier to implement this feature.


Event Timeline

What problem or issue are you currently having with Phabricator that you expect this feature to solve. Please see Contributing Feature Requests and Describing Root Problems for what information we require from feature requests.

Specifically, we don't provide support for custom libraries or writing your own Phabricator applications, this is "at your own risk". I don't know what you're using Braintree for (Phortune?) or what problem using it solves for you. I think questions about Phabricator development are better suited for Ponder/Conpherence to get started. Plenty of other admins with experience there.

epriestley added a subscriber: epriestley.

You can already use third-party externals that use namespaces, and we already bundle some (Twilio, Balanced until it was removed in D12074).

We are using Braintree for our payments. This is the error I get when trying to run arc liberate on Braintree SDK:

Writing '__phutil_library_init__.php' to '/home/user/Source/phabricator/braintree_php'...
[2017-03-17 04:45:36] EXCEPTION: (XHPASTSyntaxErrorException) vendor/symfony/yaml/Dumper.php: `arc liberate` has limited support for features introduced after PHP 5.2.3.
This library uses an unsupported feature (namespaces) on line 12 of
braintree_php/vendor/symfony/yaml/Dumper.php. at [<phutil>/src/moduleutils/PhutilLibraryMapBuilder.php:488]
phutil(head=2016_W40, ref.master=3b428ff32aad, ref.2016_W40=db4fadb59679)
  #0 PhutilLibraryMapBuilder::analyzeLibrary() called at [<phutil>/src/moduleutils/PhutilLibraryMapBuilder.php:77]
  #1 PhutilLibraryMapBuilder::buildMap() called at [<phutil>/src/moduleutils/PhutilLibraryMapBuilder.php:109]
  #2 PhutilLibraryMapBuilder::buildAndWriteMap() called at [<phutil>/scripts/phutil_rebuild_map.php:75

You can use Conpherence or Ponder if you have questions about developing on Phabricator.

Stripe's library is in externals and is not run under arc liberate.