Fix a f()[0] use in rPd45855e33e0b98d521ea3e44a4c1f718821ec6cc

Summary: See D3291.

Test Plan: Ran `phpast.getast` via API.

Reviewers: alanh

Reviewed By: alanh

CC: aran

Differential Revision: https://secure.phabricator.com/D3292
Minor; fix a unit test
Add basic support for editing project policies

Summary:
This case is unusually complicated because there are more rules than most objects will have.

  - Edits are either "joins", "leaves" or "other edits".
  - "Joins" require "can join" or "can edit".
  - "Leaves" don't require any policy.
  - "Other edits" require "can edit".
  - You can't edit away your ability to edit.
  - You //can// leave a project that you wouldn't be able to rejoin.

Things I'm going to add:

  - Global log of policy changes.
  - `bin/policy` script for undoing policy changes.
  - Test coverage for these rules.

Test Plan: Made various project visibility edits with various users, joined / left projects, etc. I'll add more complete coverage in the next diff.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3270
Modernize Paste

Summary:
  - Add a PhabricatorApplication.
  - Make most of the views work well on tablets / phones. The actual "Create" form doesn't, but everything else is good -- need to make device-friendly form layouts before I can do the form.

Test Plan: Will attach screenshots.

Reviewers: btrahan, chad, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1569

Differential Revision: https://secure.phabricator.com/D3293
Fix lint error
Restore "Forks" to Paste

Summary:
I just put them in the property table instead of a list at the foot, they looked weird down there and were too bulky relative to their importance.

This won't scale great if someone forks a paste ten thousand times or whatever, but we can deal with that when we get there.

Also clean up a few things and tweak some styles,

Test Plan: Looked at forked, unforked pastes.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D3295
Link libphutil functions from docs
Minor, resolve a method name conflict between ManiphestController and PhabricatorController.
Minor, fix a name collision between HeraldRuleController and PhabricatorController.

Auditors: btrahan
Make the paste creation form work on phones

Summary:
This is the first time I've ever had CSS actually work like it promises it does (i.e., markup the "right" way and then you don't have to change the markup later).

Since I laboriously laid this whole thing out with <divs> originally, I was able to just override some of the styles and make the layout reasonable for devices.

The only differences for existing forms are:

  - No colon after labels (looks cleaner anyway).
  - Non-error required text is no longer a red star but a the grey word "Required" (this is clearer).

Test Plan:
Viewed paste form on a phone.

Viewed ~20 other forms on the site to verify that I didn't break anything.

Reviewers: btrahan, chad, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1569

Differential Revision: https://secure.phabricator.com/D3298
Fix bug with mousein / mouseout event on comment preview at bottom of page

Summary: these comments aren't associated the same way with the actual changeset ui. ergo, don't update the reticle when mousing over these comments.

Test Plan: moused over comments at bottom - no more JS error. mouse over comments inline - reticle highlighting / de-highlighting still occurred as expected.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1657

Differential Revision: https://secure.phabricator.com/D3299
Fix a tab in the daemon console

Summary:
The "Running Daemons" tab in `/daemon` links to
`/daemon/log?show=running/`, which doesn't work. No other side nav tries
to link to a URL with a query string, and I don't know if this ever
worked. This fixes that in a minimally invasive way.

NOTE: Daemons run when a good man goes to war.

Test Plan: View `/daemon` and click on tabs.

Reviewers: epriestley, nh

Reviewed By: nh

CC: aran, Korvin, nh

Differential Revision: https://secure.phabricator.com/D3301
Fix letter case
Jump to PHP docs from symbol search more often

Summary:
It's kind of nice to type `s explode` in jump nav and have it
just work. This involves weakening a bunch of the request parameter
checks, but the only real extra assumption is that language defaults to
PHP... which is not that big of a stretch, and it's not like we know
about any other languages' documentation.

It'd be better to have builtins be more first-class and less awkward
hack, but that seems hard.

Test Plan: Search for symbols.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3302
Support limiting symbol deletion to certain paths

Summary:
For Nefarious Facebook Internal Purposes, which may or may not
include incremental symbol database updates.

Give the import script an option to not clear all symbols from the
project, and make a new script that clears only symbols from paths given
on stdin.

(I'm not yet sure how much of the NFIPs is going to be ported over
here. So there might be a future diff that uses this. Conversely,
since there's no real use case out here, I'm fine just moving this to
the Facebook configuration if necessary.)

Test Plan: Run scripts in innumerable bizarre and eldritch configurations.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1602

Differential Revision: https://secure.phabricator.com/D3305
Simplify Differential field selector

Summary:
If I use my own selector then it doesn't respect Phabricator config.

Also I hated this method.

Test Plan: Used default selector, displayed revision.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3307
Enable zooming text in Chrome

Test Plan: Zoomed in Chrome.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1664

Differential Revision: https://secure.phabricator.com/D3310
Allow filtering for users with .-_ in the username

Make it possible to filter for users, which have a .-_ in the username.
Add a bunch of policy tests for projects

Summary: Improve test coverage for policy rules in project edits.

Test Plan: Ran uint tests.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran, alanh

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D3294
Fix a fatal if a directory listing contains a non-file called 'readme'

Summary: See T1665. If you have a directory named 'readme', we try to read it as a README.

Test Plan: Created a directory named 'readme', hit a similar fatal to the one in T1665, applied this patch, everything worked great.

Reviewers: btrahan, vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1665

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