docker
docker-compose
- Firefox, or some other way to connect your browser to a SOCKS proxy.
- Pull the repository into a separate (e.g.
phabricator
) directory. - For Phabricator only, from within the
phabricator
directory rundocker-compose up --build
.
You can either configure the existing Firefox to use our proxy, or run a preconfigured Firefox.
To configure your current browser:
- Open
Preferences -> Net Proxy -> Settings
- Choose the
Manual Proxy Configuration
radio button - Set the
Proxy HTTP Server
tolocalhost
, and thePort
to1090
.
To run Firefox with an empty profile:
- Please set the environment variable
FIREFOX_CMD
to/path/to/firefox
if your system does not recognize thefirefox
command. - In a new terminal, run
firefox-proxy
, orfirefox-proxy $(docker-machine ip)
if you are usingdocker-machine
. - A new browser with an empty profile will open.
- Phabricator - http://phabricator.test
For performing administration tasks in Phabricator, first log out of
Phabricator and then go to the login page with the Login using BMO
button
and add ?admin=1
to the URL. You can also navigate directly to
http://phabricator.test/auth/login/password:self/
user:admin
, password:password123456789!
Install Python dependencies:
$ pip install -r requirements.txt
After adding, renaming, or moving classes, run arc liberate
to rebuild the
class map:
$ invoke liberate
To test changes in code:
$ invoke test
Our development container is outfitted with Xdebug, but you have to do some local setup to take advantage of it. Note that the following directions use PHPStorm as the example IDE, though any Xdebug-compatible app should work.
- Start the development environment from the
suite
repository. - Configure your IDE/debugger's Xdebug settings:
- Port 9000 should be included in the list of XDebug ports.
- It should accept at least 10 simultaneous connections
- Uncheck the "Notify if debug session was finished without being paused" option so that PhpStorm doesn't
continually pop up a notification if web requests succeed without hitting a breakpoint. This allows background
requests (fetching resources,
bmo.feed
requests, etc) to function without triggering warnings.
- Configure your source mappings from your host's directories to your server's (docker container's) directories
- It's recommended to have the
arcanist
andphabricator
source code in your PHP's includes so that you can step into (debug) and Intellisense the vendor code- This can be set up by cloning phabricator and
arcanist, then checking out the appropriate commits as defined in
this repository's
Dockerfile
.
- This can be set up by cloning phabricator and
arcanist, then checking out the appropriate commits as defined in
this repository's
- Create a new "server" configuration with the host as
phabricator.test
and the path mappings as shown below:
- It's recommended to have the
- Test your mappings
- Enable the debugger in PhpStorm
- Set a breakpoint in
LandoLinkEventListener
- Go to
phabricator.test/D1
- Your IDE should have stopped the control flow on your breakpoint and be showing you debugger details
Due to the phd
daemon, there's four PHP processes that will attach to your debugger, but mostly sit in the
background and be pretty quiet. If you don't bump your "Max. simultaneous connections" in your IDE, you'll find that
the daemon processes hog these connections while Phabricator page loads will wait for one of these connections to become
free (which won't, since the daemon processes won't stop unless Phabricator is turned off).
TL;DR: increase your "Max. simultaneous connections" to at least 10 (4 for the daemons, plus 6 as a buffer for all the concurrent http requests).
docker-compose -f docker-compose.yml -f docker-compose.bmo.yml exec phabricator vi <filename>
docker-compose -f docker-compose.yml -f docker-compose.bmo.yml exec phabricator /app/phabricator/bin/differential extract <commit-sha>
docker-compose -f docker-compose.yml -f docker-compose.bmo.yml exec phabdb mysql --user=root --password=password
To talk to the Mozilla phabricator
developers, you can join them on Matrix.