Skip to content

Commit

Permalink
Only register API dir if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed Mar 29, 2019
1 parent b76093f commit fc25a4d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libraries/namespacemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,13 @@ private function getNamespaces(string $dir): array
if (strpos($extension, 'com_') === 0)
{
$extensions[$namespace . 'Site\\\\'] = str_replace('administrator/', '', $namespacePath) . $namespaceNode->attributes()->path;
$extensions[$namespace . 'Api\\\\'] = str_replace('administrator/', 'api/', $namespacePath) . $namespaceNode->attributes()->path;

$apiPath = str_replace('administrator/', 'api/', $namespacePath);

if (is_dir(JPATH_ROOT . $apiPath))
{
$extensions[$namespace . 'Api\\\\'] = str_replace('administrator/', 'api/', $namespacePath) . $namespaceNode->attributes()->path;
}
}

// Add the application specific segment when not a plugin
Expand Down

0 comments on commit fc25a4d

Please sign in to comment.