- Fixed issue when registering ncc's extension, when using the INSTALLER, the installation path used in the process
appears to be incorrect, added a optional parameter to the `registerExtension` method to allow the installer to pass the correct installation path. - Implemented support in the AST traversal for the PHP statements `include`, `include_once`, `require`, and `require_once`. These statements are transformed into function calls. With this change, ncc can correctly handle and import files from system packages or direct binary package files.
This commit is contained in:
parent
c736a896fb
commit
173032df72
12 changed files with 557 additions and 74 deletions
|
@ -242,23 +242,6 @@
|
|||
|
||||
$NCC_FILESYSTEM->mkdir($NCC_INSTALL_PATH, 0755);
|
||||
|
||||
try
|
||||
{
|
||||
if(is_file(__DIR__ . DIRECTORY_SEPARATOR . 'default_repositories.json'))
|
||||
{
|
||||
Functions::initializeFiles(Functions::loadJsonFile(__DIR__ . DIRECTORY_SEPARATOR . 'default_repositories.json', Functions::FORCE_ARRAY));
|
||||
}
|
||||
else
|
||||
{
|
||||
Functions::initializeFiles();
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
Console::outException('Cannot initialize NCC files, ' . $e->getMessage(), $e, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
// Copy files to the installation path
|
||||
try
|
||||
{
|
||||
|
@ -302,6 +285,24 @@
|
|||
Console::inlineProgressBar($processed_items, $total_items);
|
||||
}
|
||||
|
||||
// Initialize ncc's files
|
||||
try
|
||||
{
|
||||
if(is_file(__DIR__ . DIRECTORY_SEPARATOR . 'default_repositories.json'))
|
||||
{
|
||||
Functions::initializeFiles($NCC_INSTALL_PATH, Functions::loadJsonFile(__DIR__ . DIRECTORY_SEPARATOR . 'default_repositories.json', Functions::FORCE_ARRAY));
|
||||
}
|
||||
else
|
||||
{
|
||||
Functions::initializeFiles($NCC_INSTALL_PATH);
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
Console::outException('Cannot initialize NCC files, ' . $e->getMessage(), $e, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Generate executable shortcut
|
||||
try
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue