Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96186393
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
Mon, Dec 23, 14:20
Size
830 B
Mime Type
text/x-php
Expires
Wed, Dec 25, 14:20 (2 d)
Engine
blob
Format
Raw Data
Handle
23140720
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