Browse files

mark remote hooks

  • Loading branch information...
1 parent 1e4b233 commit 4e16e8eff162f99abc0dbe79b3e2b9b0be7c5384 @epriestley epriestley committed May 6, 2011
Showing with 19 additions and 3 deletions.
  1. +1 −0 .arcconfig
  2. +4 −2 src/error/PhutilErrorHandler.php
  3. +14 −1 src/filesystem/filefinder/FileFinder.php
View
1 .arcconfig
@@ -3,5 +3,6 @@
"conduit_uri" : "https://secure.phabricator.com/api/",
"lint_engine" : "PhutilLintEngine",
"unit_engine" : "PhutilUnitTestEngine",
+ "remote_hooks_installed" : true,
"copyright_holder" : "Facebook, Inc."
}
View
6 src/error/PhutilErrorHandler.php
@@ -119,7 +119,7 @@ public static function dispatchErrorMessage($event, $value, $metadata) {
error_log(sprintf(
"[%s] EXCEPTION: %s at [%s:%d]",
$timestamp,
- $value->getMessage(),
+ '('.get_class($value).') '.$value->getMessage(),
$value->getFile(),
$value->getLine()));
break;
@@ -165,7 +165,9 @@ function phlog($value) {
$line = $trace[0]['line'];
PhutilErrorHandler::dispatchErrorMessage(
- PhutilErrorHandler::PHLOG,
+ $value instanceof Exception
+ ? PhutilErrorHandler::EXCEPTION
+ : PhutilErrorHandler::PHLOG,
$value,
array('file' => $file,
'line' => $line,
View
15 src/filesystem/filefinder/FileFinder.php
@@ -40,6 +40,7 @@
private $suffix = array();
private $type;
private $generateChecksums = false;
+ private $followSymlinks;
/**
* Create a new FileFinder.
@@ -87,6 +88,14 @@ public function withType($type) {
/**
* @task config
*/
+ public function withFollowSymlinks($follow) {
+ $this->followSymlinks = $follow;
+ return $this;
+ }
+
+ /**
+ * @task config
+ */
public function setGenerateChecksums($generate) {
$this->generateChecksums = $generate;
return $this;
@@ -102,7 +111,11 @@ public function find() {
$command[] = '(cd %s; ';
$args[] = $this->root;
- $command[] = 'find .';
+ $command[] = 'find';
+ if ($this->followSymlinks) {
+ $command[] = '-L';
+ }
+ $command[] = '.';
if ($this->exclude) {
$command[] = $this->generateList('path', $this->exclude).' -prune';

0 comments on commit 4e16e8e

Please sign in to comment.