Replace leading double underscore in function names by single underscore
Summary: > PHP reserves all symbols starting with __ as magical. http://php.net/userlandnaming.rules I didn't touch third-party S3 library. Test Plan: / Reviewers: epriestley Reviewed By: epriestley CC: aran Differential Revision: https://secure.phabricator.com/D2077
This commit is contained in:
@@ -929,8 +929,7 @@ phutil_register_library_map(array(
|
|||||||
),
|
),
|
||||||
'function' =>
|
'function' =>
|
||||||
array(
|
array(
|
||||||
'__phabricator_date_format' => 'view/utils',
|
'_phabricator_date_format' => 'view/utils',
|
||||||
'__phabricator_format_local_time' => 'view/utils',
|
|
||||||
'_qsprintf_check_scalar_type' => 'storage/qsprintf',
|
'_qsprintf_check_scalar_type' => 'storage/qsprintf',
|
||||||
'_qsprintf_check_type' => 'storage/qsprintf',
|
'_qsprintf_check_type' => 'storage/qsprintf',
|
||||||
'celerity_generate_unique_node_id' => 'infrastructure/celerity/api',
|
'celerity_generate_unique_node_id' => 'infrastructure/celerity/api',
|
||||||
@@ -938,6 +937,7 @@ phutil_register_library_map(array(
|
|||||||
'javelin_render_tag' => 'infrastructure/javelin/markup',
|
'javelin_render_tag' => 'infrastructure/javelin/markup',
|
||||||
'phabricator_date' => 'view/utils',
|
'phabricator_date' => 'view/utils',
|
||||||
'phabricator_datetime' => 'view/utils',
|
'phabricator_datetime' => 'view/utils',
|
||||||
|
'phabricator_format_local_time' => 'view/utils',
|
||||||
'phabricator_format_relative_time' => 'view/utils',
|
'phabricator_format_relative_time' => 'view/utils',
|
||||||
'phabricator_format_units_generic' => 'view/utils',
|
'phabricator_format_units_generic' => 'view/utils',
|
||||||
'phabricator_on_relative_date' => 'view/utils',
|
'phabricator_on_relative_date' => 'view/utils',
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ final class ManiphestReportController extends ManiphestController {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$day_bucket = __phabricator_format_local_time(
|
$day_bucket = phabricator_format_local_time(
|
||||||
$row['dateCreated'],
|
$row['dateCreated'],
|
||||||
$user,
|
$user,
|
||||||
'z');
|
'z');
|
||||||
@@ -179,7 +179,7 @@ final class ManiphestReportController extends ManiphestController {
|
|||||||
foreach ($stats as $bucket => $info) {
|
foreach ($stats as $bucket => $info) {
|
||||||
$epoch = $day_buckets[$bucket];
|
$epoch = $day_buckets[$bucket];
|
||||||
|
|
||||||
$week_bucket = __phabricator_format_local_time(
|
$week_bucket = phabricator_format_local_time(
|
||||||
$epoch,
|
$epoch,
|
||||||
$user,
|
$user,
|
||||||
'W');
|
'W');
|
||||||
@@ -195,14 +195,14 @@ final class ManiphestReportController extends ManiphestController {
|
|||||||
$last_week_epoch = $epoch;
|
$last_week_epoch = $epoch;
|
||||||
}
|
}
|
||||||
|
|
||||||
$month_bucket = __phabricator_format_local_time(
|
$month_bucket = phabricator_format_local_time(
|
||||||
$epoch,
|
$epoch,
|
||||||
$user,
|
$user,
|
||||||
'm');
|
'm');
|
||||||
if ($month_bucket != $last_month) {
|
if ($month_bucket != $last_month) {
|
||||||
if ($month) {
|
if ($month) {
|
||||||
$rows[] = $this->formatBurnRow(
|
$rows[] = $this->formatBurnRow(
|
||||||
__phabricator_format_local_time($last_month_epoch, $user, 'F, Y'),
|
phabricator_format_local_time($last_month_epoch, $user, 'F, Y'),
|
||||||
$month);
|
$month);
|
||||||
$rowc[] = 'month';
|
$rowc[] = 'month';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ final class PhabricatorIRCBot extends PhabricatorDaemon {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __destroy() {
|
public function __destruct() {
|
||||||
$this->write("QUIT Goodbye.\r\n");
|
$this->write("QUIT Goodbye.\r\n");
|
||||||
fclose($this->socket);
|
fclose($this->socket);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,10 +17,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function phabricator_date($epoch, $user) {
|
function phabricator_date($epoch, $user) {
|
||||||
return __phabricator_format_local_time(
|
return phabricator_format_local_time(
|
||||||
$epoch,
|
$epoch,
|
||||||
$user,
|
$user,
|
||||||
__phabricator_date_format($epoch));
|
_phabricator_date_format($epoch));
|
||||||
}
|
}
|
||||||
|
|
||||||
function phabricator_on_relative_date($epoch, $user) {
|
function phabricator_on_relative_date($epoch, $user) {
|
||||||
@@ -51,20 +51,20 @@ function phabricator_relative_date($epoch, $user, $on = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function phabricator_time($epoch, $user) {
|
function phabricator_time($epoch, $user) {
|
||||||
return __phabricator_format_local_time(
|
return phabricator_format_local_time(
|
||||||
$epoch,
|
$epoch,
|
||||||
$user,
|
$user,
|
||||||
'g:i A');
|
'g:i A');
|
||||||
}
|
}
|
||||||
|
|
||||||
function phabricator_datetime($epoch, $user) {
|
function phabricator_datetime($epoch, $user) {
|
||||||
return __phabricator_format_local_time(
|
return phabricator_format_local_time(
|
||||||
$epoch,
|
$epoch,
|
||||||
$user,
|
$user,
|
||||||
__phabricator_date_format($epoch).', g:i A');
|
_phabricator_date_format($epoch).', g:i A');
|
||||||
}
|
}
|
||||||
|
|
||||||
function __phabricator_date_format($epoch) {
|
function _phabricator_date_format($epoch) {
|
||||||
$format = 'M j Y';
|
$format = 'M j Y';
|
||||||
$now = time();
|
$now = time();
|
||||||
if ($epoch <= $now && $epoch > $now - 30 * 24 * 60 * 60) {
|
if ($epoch <= $now && $epoch > $now - 30 * 24 * 60 * 60) {
|
||||||
@@ -74,7 +74,7 @@ function __phabricator_date_format($epoch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal date rendering method. Do not call this directly; instead, call
|
* This function does not usually need to be called directly. Instead, call
|
||||||
* @{function:phabricator_date}, @{function:phabricator_time}, or
|
* @{function:phabricator_date}, @{function:phabricator_time}, or
|
||||||
* @{function:phabricator_datetime}.
|
* @{function:phabricator_datetime}.
|
||||||
*
|
*
|
||||||
@@ -83,7 +83,7 @@ function __phabricator_date_format($epoch) {
|
|||||||
* @param string Date format, as per DateTime class.
|
* @param string Date format, as per DateTime class.
|
||||||
* @return string Formatted, local date/time.
|
* @return string Formatted, local date/time.
|
||||||
*/
|
*/
|
||||||
function __phabricator_format_local_time($epoch, $user, $format) {
|
function phabricator_format_local_time($epoch, $user, $format) {
|
||||||
if (!$epoch) {
|
if (!$epoch) {
|
||||||
// If we're missing date information for something, the DateTime class will
|
// If we're missing date information for something, the DateTime class will
|
||||||
// throw an exception when we try to construct an object. Since this is a
|
// throw an exception when we try to construct an object. Since this is a
|
||||||
|
|||||||
Reference in New Issue
Block a user