Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2890434
ArcanistUserConfigurationSource.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
ArcanistUserConfigurationSource.php
View Options
<?php
final
class
ArcanistUserConfigurationSource
extends
ArcanistFilesystemConfigurationSource
{
public
function
getFileKindDisplayName
(
)
{
return
pht
(
'User Config File'
)
;
}
public
function
isWritableConfigurationSource
(
)
{
return
true
;
}
public
function
getConfigurationSourceScope
(
)
{
return
ArcanistConfigurationSource
::
SCOPE_USER
;
}
protected
function
didReadFilesystemValues
(
array
$values
)
{
// Before toolsets, the "~/.arcrc" file had separate top-level keys for
// "config", "hosts", and "aliases". Transform this older file format into
// a more modern format.
if
(
!
isset
(
$values
[
'config'
]
)
)
{
// This isn't an older file, so just return the values unmodified.
return
$values
;
}
// Make the keys in "config" top-level keys. Then add in whatever other
// top level keys exist, other than "config", preferring keys that already
// exist in the "config" dictionary.
// For example, this older configuration file:
//
// {
// "hosts": ...,
// "config": {x: ..., y: ...},
// "aliases": ...
// }
//
// ...becomes this modern file:
//
// {
// "x": ...,
// "y": ...,
// "hosts": ...,
// "aliases": ...
// }
$result
=
$values
[
'config'
]
;
unset
(
$values
[
'config'
]
)
;
$result
+=
$values
;
return
$result
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 13:35 (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1116364
Default Alt Text
ArcanistUserConfigurationSource.php (1 KB)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment