Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F109796585
moduleutils.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
Wed, Apr 23, 10:41
Size
994 B
Mime Type
text/x-php
Expires
Fri, Apr 25, 10:41 (2 d)
Engine
blob
Format
Raw Data
Handle
25758692
Attached To
rPHU libphutil
moduleutils.php
View Options
<?php
function
phutil_get_library_root
(
$library
)
{
$bootloader
=
PhutilBootloader
::
getInstance
();
return
$bootloader
->
getLibraryRoot
(
$library
);
}
function
phutil_get_library_root_for_path
(
$path
)
{
foreach
(
Filesystem
::
walkToRoot
(
$path
)
as
$dir
)
{
if
(@
file_exists
(
$dir
.
'/__phutil_library_init__.php'
))
{
return
$dir
;
}
}
return
null
;
}
function
phutil_get_library_name_for_root
(
$path
)
{
$path
=
rtrim
(
Filesystem
::
resolvePath
(
$path
),
'/'
);
$bootloader
=
PhutilBootloader
::
getInstance
();
$libraries
=
$bootloader
->
getAllLibraries
();
foreach
(
$libraries
as
$library
)
{
$root
=
$bootloader
->
getLibraryRoot
(
$library
);
if
(
rtrim
(
Filesystem
::
resolvePath
(
$root
),
'/'
)
==
$path
)
{
return
$library
;
}
}
return
null
;
}
/**
* Warns about use of deprecated behavior.
*/
function
phutil_deprecated
(
$what
,
$why
)
{
PhutilErrorHandler
::
dispatchErrorMessage
(
PhutilErrorHandler
::
DEPRECATED
,
$what
,
array
(
'why'
=>
$why
,
));
}
Event Timeline
Log In to Comment