Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F67229010
20140323.harbor.1.renames.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jun 21, 00:30
Size
830 B
Mime Type
text/x-php
Expires
Sun, Jun 23, 00:30 (2 d)
Engine
blob
Format
Raw Data
Handle
18316882
Attached To
rPH Phabricator
20140323.harbor.1.renames.php
View Options
<?php
$names
=
array
(
'CommandBuildStepImplementation'
,
'LeaseHostBuildStepImplementation'
,
'PublishFragmentBuildStepImplementation'
,
'SleepBuildStepImplementation'
,
'UploadArtifactBuildStepImplementation'
,
'WaitForPreviousBuildStepImplementation'
,
);
$tables
=
array
(
id
(
new
HarbormasterBuildStep
())->
getTableName
(),
id
(
new
HarbormasterBuildTarget
())->
getTableName
(),
);
echo
pht
(
'Renaming Harbormaster classes...'
).
"
\n
"
;
$conn_w
=
id
(
new
HarbormasterBuildStep
())->
establishConnection
(
'w'
);
foreach
(
$names
as
$name
)
{
$old
=
$name
;
$new
=
'Harbormaster'
.
$name
;
echo
pht
(
'Renaming %s -> %s...'
,
$old
,
$new
).
"
\n
"
;
foreach
(
$tables
as
$table
)
{
queryfx
(
$conn_w
,
'UPDATE %T SET className = %s WHERE className = %s'
,
$table
,
$new
,
$old
);
}
}
echo
pht
(
'Done.'
).
"
\n
"
;
Event Timeline
Log In to Comment