Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12944197
autoload_vendor.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
autoload_vendor.php
View Options
<?php
/* -------------------------------------------------------------
Obsidian Workspaces :: Autoloader from vendor/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Project: Nasqueron
Product: Obsidian Workspaces
License: Trivial work, not eligible to copyright
------------------------------------------------------------- */
/* -------------------------------------------------------------
Search relevant vendor/ directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
const
VENDOR_DIR_CANDIDATES
=
[
# Composer packages have been installed directly in workspaces/
__DIR__
.
"/../../vendor"
,
# Composer packages have been installed at monorepo root level
__DIR__
.
"/../../../vendor"
,
];
function
search_vendor_autoload
()
:
string
|
null
{
foreach
(
VENDOR_DIR_CANDIDATES
as
$dir
)
{
$autoload_path
=
$dir
.
"/autoload.php"
;
if
(
file_exists
(
$autoload_path
))
{
return
$autoload_path
;
}
}
return
null
;
}
/* -------------------------------------------------------------
Loader
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
function
require_vendor_autoload
()
:
void
{
$vendor_autoload
=
search_vendor_autoload
();
if
(
$vendor_autoload
===
null
)
{
fwrite
(
STDERR
,
"You first need to install dependencies. Run `composer install`."
);
die
;
}
require
(
$vendor_autoload
);
}
require_vendor_autoload
();
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Nov 18, 17:05 (1 d, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3147594
Default Alt Text
autoload_vendor.php (1 KB)
Attached To
Mode
rOBSIDIAN Obsidian Workspaces
Attached
Detach File
Event Timeline
Log In to Comment