Home GnuPG

Fall back to from utf8_decode to phutil_utf8v for codepoint counting
6cd38ce75feaUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Fall back to from utf8_decode to phutil_utf8v for codepoint counting

Summary:
The php7.0 package in Ubuntu 16.04 splits out the php7.0-xml package, which
provides the utf8_decode function. As such, parts of Arcanist throw
exceptions -- most notably PhutilArgumentSpellingCorrector:

$ arc dieff
[2017-01-12 14:57:25] EXCEPTION: (Error) Call to undefined function utf8_decode() at [<phutil>/src/utils/utf8.php:259]
arcanist(head=master, ref.master=d6e112aecf93), phutil(head=master, ref.master=ab80dcf99c6b)
  #0 phutil_utf8_strlen(string) called at [<phutil>/src/parser/argument/PhutilArgumentSpellingCorrector.php:120]
  #1 PhutilArgumentSpellingCorrector::correctSpelling(string, array) called at [<arcanist>/src/configuration/ArcanistConfiguration.php:148]
  #2 ArcanistConfiguration::selectWorkflow(string, array, ArcanistConfigurationManager, PhutilConsole) called at [<arcanist>/scripts/arcanist.php:193]

Since spelling correction is a core feature, and working out-of-the-box is
desirable, fall back to implementing phutil_utf8_strlen in terms of
phutil_utf8v if decode_utf8 is not present.

Fixes: T11713.

Test Plan:
Ran arc dieff on an Ubuntu 16.04 machine after `apt-get
install php7.0-cli`, as well as on PHP 5.5.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D17188

Details

Provenance
Alex Vandiver <alexmv@dropbox.com>Authored on Jan 12 2017, 3:51 PM
Parents
rPHUTILe4b06e06ee78: Stop hardcoding the YACC error message
Branches
Unknown
Tags
Unknown

Event Timeline

Alex Vandiver <alexmv@dropbox.com> committed rPHUTIL6cd38ce75fea: Fall back to from utf8_decode to phutil_utf8v for codepoint counting (authored by Alex Vandiver <alexmv@dropbox.com>).Jan 12 2017, 4:32 PM