Skip to content

Commit

Permalink
Updating linker.php (#847)
Browse files Browse the repository at this point in the history
- Removed the `auto_loaders` section from `linker.json`. This was replaced by
  `require_once("$baseDir/vendor/autoload.php")` in `linker.php`.
- Moved all entries in `linker.json::include_dirs` but `classes` to
  `composer.json::autoload::classmap`.
- Updated composer.lock because composer.json was updated.
- All of the XSEDE entries in `linker.json::include_dirs` was moved to the XSEDE
  modules `linker.d/xsede.json`.
  • Loading branch information
ryanrath authored Mar 11, 2019
1 parent aaf96fd commit 4f490c1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 52 deletions.
10 changes: 9 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,15 @@
},
"autoload": {
"classmap": [
"composer.scripts.php"
"composer.scripts.php",
"classes",
"classes/DB",
"classes/DB/DBModel",
"classes/DB/TimePeriodGenerators",
"classes/ExtJS",
"classes/Rest",
"classes/User",
"classes/ReportTemplates"
]
}
}
1 change: 1 addition & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 1 addition & 18 deletions configuration/linker.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
{
"autoloaders": [
"vendor/autoload.php"
],
"include_dirs": [
"classes",
"classes/DB",
"classes/DB/TACCStatsIngestors",
"classes/DB/TGcDBIngestors",
"classes/DB/POPSIngestors",
"classes/DB/XRASIngestors",
"classes/DB/Aggregators",
"classes/DB/DBModel",
"classes/DB/TimePeriodGenerators",
"classes/ExtJS",
"classes/REST",
"classes/User",
"classes/ReportTemplates",
"classes/AppKernel",
"libraries/HighRoller_1.0.5"
"classes"
]
}
36 changes: 3 additions & 33 deletions configuration/linker.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,10 @@
$baseDir = dirname($dir);

require_once($dir . '/constants.php');
require_once($baseDir . '/libraries/utilities.php');
require_once($baseDir . "/vendor/autoload.php");

// ---------------------------

// If present, load linker configuration from linker.json and linker.d.
require_once("$baseDir/classes/CCR/Json.php");

try {
$linkerConfigFilePath = implode(
DIRECTORY_SEPARATOR,
array(
CONFIG_DIR,
'linker.json'
)
);
$linkerConfig = CCR\Json::loadFile(
$linkerConfigFilePath
);
} catch (Exception $e) {
$configDir = $config->getConfigDirPath();
echo "Could not find valid \"linker.json\" or \"linker.d\" files in \"$configDir\".\n";
echo "Please set up valid linker configuration files and try again.\n";
exit(1);
}

// Load configured autoloaders.
if (isset($linkerConfig['autoloaders'])) {
foreach ($linkerConfig['autoloaders'] as $autoloaderPath) {
require_once("$baseDir/$autoloaderPath");
}
}
$linkerConfig = \Configuration\XdmodConfiguration::assocArrayFactory('linker.json', CONFIG_DIR);

// Update PHP's include path to include certain XDMoD directories.
if (isset($linkerConfig['include_dirs'])) {
Expand Down Expand Up @@ -71,10 +45,6 @@ function xdmodAutoload($className)

spl_autoload_register('xdmodAutoload');

// Libraries ---------------------------

require_once($baseDir . '/libraries/utilities.php');

$libraries = scandir($baseDir . '/libraries');

foreach ($libraries as $library) {
Expand Down

0 comments on commit 4f490c1

Please sign in to comment.