Something went wrong. Try again.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
Something went wrong. Try again.
3.3 kB · 112 lines
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113@title Developer Setup@group developerHow to configure a Phorge development environment.Overview========There are some options and workflows that may be useful if you are developingor debugging Phorge.Configuration=============To adjust Phorge for development: - Enable `phabricator.developer-mode` to enable some options and show more debugging information. - Enable `phabricator.show-prototypes` to show all the incomplete applications. - See @{article: Using DarkConsole} for instructions on enabling the debugging console.Error Handling==============Errors normally go to DarkConsole (if enabled) and the webserver error log,which is often located somewhere like `/var/log/apache/error_log`. This fileoften contains relevant information after you encounter an error.When debugging, you can print information to the error log with `phlog(...)`.You can `phlog(new Exception(...))` to get a stack trace.You can print information to the UI with `throw new Exception(...)`,`print_r(...)`, or `var_dump(...)`.You can abort execution with `die(...)` if you want to make sure executiondoes not make it past some point. Normally `throw` does this too, but callerscan `catch` exceptions; they can not catch `die(...)`.Utilities=========After adding, renaming, or moving classes, run `arc liberate` to rebuildthe class map:```phorge/ $ arc liberate```Until you do this, Phorge won't recognize your new, moved, or renamedclasses. You do not need to run this after modifying an existing class.After any modifications to static resources (CSS / JS) but before sendingchanges for review or pushing them to the remote, run `bin/celerity map`:```phorge/ $ ./bin/celerity map```This rebuilds the static resource map.If you forget to run these commands you'll normally be warned by unit tests,but knowing about them may prevent confusion before you hit the warnings.Command Line============Almost every script supports a `--trace` flag, which prints out servicecalls and more detailed error information. This is often the best way to getstarted with debugging command-line scripts.Performance===========Although it is more user-focused than developer-focused, the@{article:Troubleshooting Performance Problems} guide has useful informationon the tools available for diagnosing and understanding performance problems.Custom Domains==============If you're working with applications that support custom domains (like Phurl orPhame) you can normally test them by adding more entries to your webserverconfiguration that look exactly like the primary entry (or expanding theprimary entry to match more domains).Phorge routes all requests based on host headers, so alternate domainsdo not normally need any kind of special configuration.You may also need to add `/etc/hosts` entries for the domains themselves.Creating Test Data==================You can create test objects with the "Lipsum" utility:```phorge/ $ ./bin/lipsum help generatephorge/ $ ./bin/lipsum generate ...```Test data can make your local install feel a little more realistic. With`--quickly`, you can generate a large amount of test data to help test issueswith performance or scale.