ncc/src/installer/generate_build_files.php

69 lines
1.7 KiB
PHP
Raw Normal View History

2022-08-11 14:04:33 -04:00
<?php
// Check for NCC
if(!file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'autoload.php'))
{
print('Could not find \'autoload.php\', this script is intended to be executed during the redistribution process');
exit(1);
}
- Cleaned up imports - Various bug fixes and improved performance on package reading/writing - Corrected CHANGELOG.md - Updated dependency `Symfony/polyfill-mbstring` to 1.28.0 - Updated dependency `Symfony/polyfill-uuid` to 1.28.0 - Updated dependency `Symfony/Process` to 6.3.4 - Updated dependency `Symfony/Uid` to 6.3.0 - Updated dependency `Symfony/Yaml` to 6.3.3 - Added support for Gitea repositories - Added support for Packagist repositories - Added a new default Gitea repository nocturn9x at git.nocturn9x.space - Added a new default Gitea repository martinvlba at git.martinvlba.eu - Added a new default Gitea repository kuny at git.it-kuny.ch - Added dependency composer/semver version 3.4.0 for composer version comparison compatibility - Added a new class \ncc\Classes\ArchiveExtractor to extract multiple archive types - Refactored \ncc\Objects\RemoteRepository - Refactored the repository system - Refactored Github's repository interface - Refactored Gitlab's repository interface - Refactored SourcesMenu in the CLI to use the new repository system - Updated dependency nikic/php-parser to version 4.17.1 - Added a simple security measure in \ncc\Objects\Value\Entry to delay returns randomly when the password is incorrect - Refactored the CLI menu system to use a return exit code system - Updated the installer to remove unused components and installation steps - Updated dependency Symfony/Filesystem to 6.3.1 - Updated dependency Symfony/polyfill-ctype to 1.28.0 - Enforced credential storage security by applying 600 permissions to the storage file so that only the owner can read/write to the file; this will require root access to perform any operations on the credential file. A password will still be needed to decrypt entries in the file if any entries are encrypted. - Removed \ncc\Classes\NccExtension\Runner in favor of the new Execution Unit system - Removed \ncc\Managers\ExecutionPointerManager in favor of the new Execution Unit system
2023-09-21 17:24:12 -04:00
/** @noinspection PhpIncludeInspection */
2022-08-11 14:04:33 -04:00
require(__DIR__ . DIRECTORY_SEPARATOR . 'autoload.php');
// Start script
- Cleaned up imports - Various bug fixes and improved performance on package reading/writing - Corrected CHANGELOG.md - Updated dependency `Symfony/polyfill-mbstring` to 1.28.0 - Updated dependency `Symfony/polyfill-uuid` to 1.28.0 - Updated dependency `Symfony/Process` to 6.3.4 - Updated dependency `Symfony/Uid` to 6.3.0 - Updated dependency `Symfony/Yaml` to 6.3.3 - Added support for Gitea repositories - Added support for Packagist repositories - Added a new default Gitea repository nocturn9x at git.nocturn9x.space - Added a new default Gitea repository martinvlba at git.martinvlba.eu - Added a new default Gitea repository kuny at git.it-kuny.ch - Added dependency composer/semver version 3.4.0 for composer version comparison compatibility - Added a new class \ncc\Classes\ArchiveExtractor to extract multiple archive types - Refactored \ncc\Objects\RemoteRepository - Refactored the repository system - Refactored Github's repository interface - Refactored Gitlab's repository interface - Refactored SourcesMenu in the CLI to use the new repository system - Updated dependency nikic/php-parser to version 4.17.1 - Added a simple security measure in \ncc\Objects\Value\Entry to delay returns randomly when the password is incorrect - Refactored the CLI menu system to use a return exit code system - Updated the installer to remove unused components and installation steps - Updated dependency Symfony/Filesystem to 6.3.1 - Updated dependency Symfony/polyfill-ctype to 1.28.0 - Enforced credential storage security by applying 600 permissions to the storage file so that only the owner can read/write to the file; this will require root access to perform any operations on the credential file. A password will still be needed to decrypt entries in the file if any entries are encrypted. - Removed \ncc\Classes\NccExtension\Runner in favor of the new Execution Unit system - Removed \ncc\Managers\ExecutionPointerManager in favor of the new Execution Unit system
2023-09-21 17:24:12 -04:00
function scanContents($dir)
2022-08-11 14:04:33 -04:00
{
- Cleaned up imports - Various bug fixes and improved performance on package reading/writing - Corrected CHANGELOG.md - Updated dependency `Symfony/polyfill-mbstring` to 1.28.0 - Updated dependency `Symfony/polyfill-uuid` to 1.28.0 - Updated dependency `Symfony/Process` to 6.3.4 - Updated dependency `Symfony/Uid` to 6.3.0 - Updated dependency `Symfony/Yaml` to 6.3.3 - Added support for Gitea repositories - Added support for Packagist repositories - Added a new default Gitea repository nocturn9x at git.nocturn9x.space - Added a new default Gitea repository martinvlba at git.martinvlba.eu - Added a new default Gitea repository kuny at git.it-kuny.ch - Added dependency composer/semver version 3.4.0 for composer version comparison compatibility - Added a new class \ncc\Classes\ArchiveExtractor to extract multiple archive types - Refactored \ncc\Objects\RemoteRepository - Refactored the repository system - Refactored Github's repository interface - Refactored Gitlab's repository interface - Refactored SourcesMenu in the CLI to use the new repository system - Updated dependency nikic/php-parser to version 4.17.1 - Added a simple security measure in \ncc\Objects\Value\Entry to delay returns randomly when the password is incorrect - Refactored the CLI menu system to use a return exit code system - Updated the installer to remove unused components and installation steps - Updated dependency Symfony/Filesystem to 6.3.1 - Updated dependency Symfony/polyfill-ctype to 1.28.0 - Enforced credential storage security by applying 600 permissions to the storage file so that only the owner can read/write to the file; this will require root access to perform any operations on the credential file. A password will still be needed to decrypt entries in the file if any entries are encrypted. - Removed \ncc\Classes\NccExtension\Runner in favor of the new Execution Unit system - Removed \ncc\Managers\ExecutionPointerManager in favor of the new Execution Unit system
2023-09-21 17:24:12 -04:00
$results = [];
2022-08-11 14:04:33 -04:00
- Cleaned up imports - Various bug fixes and improved performance on package reading/writing - Corrected CHANGELOG.md - Updated dependency `Symfony/polyfill-mbstring` to 1.28.0 - Updated dependency `Symfony/polyfill-uuid` to 1.28.0 - Updated dependency `Symfony/Process` to 6.3.4 - Updated dependency `Symfony/Uid` to 6.3.0 - Updated dependency `Symfony/Yaml` to 6.3.3 - Added support for Gitea repositories - Added support for Packagist repositories - Added a new default Gitea repository nocturn9x at git.nocturn9x.space - Added a new default Gitea repository martinvlba at git.martinvlba.eu - Added a new default Gitea repository kuny at git.it-kuny.ch - Added dependency composer/semver version 3.4.0 for composer version comparison compatibility - Added a new class \ncc\Classes\ArchiveExtractor to extract multiple archive types - Refactored \ncc\Objects\RemoteRepository - Refactored the repository system - Refactored Github's repository interface - Refactored Gitlab's repository interface - Refactored SourcesMenu in the CLI to use the new repository system - Updated dependency nikic/php-parser to version 4.17.1 - Added a simple security measure in \ncc\Objects\Value\Entry to delay returns randomly when the password is incorrect - Refactored the CLI menu system to use a return exit code system - Updated the installer to remove unused components and installation steps - Updated dependency Symfony/Filesystem to 6.3.1 - Updated dependency Symfony/polyfill-ctype to 1.28.0 - Enforced credential storage security by applying 600 permissions to the storage file so that only the owner can read/write to the file; this will require root access to perform any operations on the credential file. A password will still be needed to decrypt entries in the file if any entries are encrypted. - Removed \ncc\Classes\NccExtension\Runner in favor of the new Execution Unit system - Removed \ncc\Managers\ExecutionPointerManager in favor of the new Execution Unit system
2023-09-21 17:24:12 -04:00
foreach (scandir($dir, SCANDIR_SORT_NONE) as $key => $value)
2022-08-11 14:04:33 -04:00
{
$path = realpath($dir . DIRECTORY_SEPARATOR . $value);
- Cleaned up imports - Various bug fixes and improved performance on package reading/writing - Corrected CHANGELOG.md - Updated dependency `Symfony/polyfill-mbstring` to 1.28.0 - Updated dependency `Symfony/polyfill-uuid` to 1.28.0 - Updated dependency `Symfony/Process` to 6.3.4 - Updated dependency `Symfony/Uid` to 6.3.0 - Updated dependency `Symfony/Yaml` to 6.3.3 - Added support for Gitea repositories - Added support for Packagist repositories - Added a new default Gitea repository nocturn9x at git.nocturn9x.space - Added a new default Gitea repository martinvlba at git.martinvlba.eu - Added a new default Gitea repository kuny at git.it-kuny.ch - Added dependency composer/semver version 3.4.0 for composer version comparison compatibility - Added a new class \ncc\Classes\ArchiveExtractor to extract multiple archive types - Refactored \ncc\Objects\RemoteRepository - Refactored the repository system - Refactored Github's repository interface - Refactored Gitlab's repository interface - Refactored SourcesMenu in the CLI to use the new repository system - Updated dependency nikic/php-parser to version 4.17.1 - Added a simple security measure in \ncc\Objects\Value\Entry to delay returns randomly when the password is incorrect - Refactored the CLI menu system to use a return exit code system - Updated the installer to remove unused components and installation steps - Updated dependency Symfony/Filesystem to 6.3.1 - Updated dependency Symfony/polyfill-ctype to 1.28.0 - Enforced credential storage security by applying 600 permissions to the storage file so that only the owner can read/write to the file; this will require root access to perform any operations on the credential file. A password will still be needed to decrypt entries in the file if any entries are encrypted. - Removed \ncc\Classes\NccExtension\Runner in favor of the new Execution Unit system - Removed \ncc\Managers\ExecutionPointerManager in favor of the new Execution Unit system
2023-09-21 17:24:12 -04:00
2022-08-11 14:04:33 -04:00
if (!is_dir($path))
{
- Cleaned up imports - Various bug fixes and improved performance on package reading/writing - Corrected CHANGELOG.md - Updated dependency `Symfony/polyfill-mbstring` to 1.28.0 - Updated dependency `Symfony/polyfill-uuid` to 1.28.0 - Updated dependency `Symfony/Process` to 6.3.4 - Updated dependency `Symfony/Uid` to 6.3.0 - Updated dependency `Symfony/Yaml` to 6.3.3 - Added support for Gitea repositories - Added support for Packagist repositories - Added a new default Gitea repository nocturn9x at git.nocturn9x.space - Added a new default Gitea repository martinvlba at git.martinvlba.eu - Added a new default Gitea repository kuny at git.it-kuny.ch - Added dependency composer/semver version 3.4.0 for composer version comparison compatibility - Added a new class \ncc\Classes\ArchiveExtractor to extract multiple archive types - Refactored \ncc\Objects\RemoteRepository - Refactored the repository system - Refactored Github's repository interface - Refactored Gitlab's repository interface - Refactored SourcesMenu in the CLI to use the new repository system - Updated dependency nikic/php-parser to version 4.17.1 - Added a simple security measure in \ncc\Objects\Value\Entry to delay returns randomly when the password is incorrect - Refactored the CLI menu system to use a return exit code system - Updated the installer to remove unused components and installation steps - Updated dependency Symfony/Filesystem to 6.3.1 - Updated dependency Symfony/polyfill-ctype to 1.28.0 - Enforced credential storage security by applying 600 permissions to the storage file so that only the owner can read/write to the file; this will require root access to perform any operations on the credential file. A password will still be needed to decrypt entries in the file if any entries are encrypted. - Removed \ncc\Classes\NccExtension\Runner in favor of the new Execution Unit system - Removed \ncc\Managers\ExecutionPointerManager in favor of the new Execution Unit system
2023-09-21 17:24:12 -04:00
$results[] = str_ireplace(__DIR__ . DIRECTORY_SEPARATOR, '', $path);
2022-08-11 14:04:33 -04:00
}
- Cleaned up imports - Various bug fixes and improved performance on package reading/writing - Corrected CHANGELOG.md - Updated dependency `Symfony/polyfill-mbstring` to 1.28.0 - Updated dependency `Symfony/polyfill-uuid` to 1.28.0 - Updated dependency `Symfony/Process` to 6.3.4 - Updated dependency `Symfony/Uid` to 6.3.0 - Updated dependency `Symfony/Yaml` to 6.3.3 - Added support for Gitea repositories - Added support for Packagist repositories - Added a new default Gitea repository nocturn9x at git.nocturn9x.space - Added a new default Gitea repository martinvlba at git.martinvlba.eu - Added a new default Gitea repository kuny at git.it-kuny.ch - Added dependency composer/semver version 3.4.0 for composer version comparison compatibility - Added a new class \ncc\Classes\ArchiveExtractor to extract multiple archive types - Refactored \ncc\Objects\RemoteRepository - Refactored the repository system - Refactored Github's repository interface - Refactored Gitlab's repository interface - Refactored SourcesMenu in the CLI to use the new repository system - Updated dependency nikic/php-parser to version 4.17.1 - Added a simple security measure in \ncc\Objects\Value\Entry to delay returns randomly when the password is incorrect - Refactored the CLI menu system to use a return exit code system - Updated the installer to remove unused components and installation steps - Updated dependency Symfony/Filesystem to 6.3.1 - Updated dependency Symfony/polyfill-ctype to 1.28.0 - Enforced credential storage security by applying 600 permissions to the storage file so that only the owner can read/write to the file; this will require root access to perform any operations on the credential file. A password will still be needed to decrypt entries in the file if any entries are encrypted. - Removed \ncc\Classes\NccExtension\Runner in favor of the new Execution Unit system - Removed \ncc\Managers\ExecutionPointerManager in favor of the new Execution Unit system
2023-09-21 17:24:12 -04:00
elseif ($value !== '.' && $value !== '..')
2022-08-11 14:04:33 -04:00
{
- Cleaned up imports - Various bug fixes and improved performance on package reading/writing - Corrected CHANGELOG.md - Updated dependency `Symfony/polyfill-mbstring` to 1.28.0 - Updated dependency `Symfony/polyfill-uuid` to 1.28.0 - Updated dependency `Symfony/Process` to 6.3.4 - Updated dependency `Symfony/Uid` to 6.3.0 - Updated dependency `Symfony/Yaml` to 6.3.3 - Added support for Gitea repositories - Added support for Packagist repositories - Added a new default Gitea repository nocturn9x at git.nocturn9x.space - Added a new default Gitea repository martinvlba at git.martinvlba.eu - Added a new default Gitea repository kuny at git.it-kuny.ch - Added dependency composer/semver version 3.4.0 for composer version comparison compatibility - Added a new class \ncc\Classes\ArchiveExtractor to extract multiple archive types - Refactored \ncc\Objects\RemoteRepository - Refactored the repository system - Refactored Github's repository interface - Refactored Gitlab's repository interface - Refactored SourcesMenu in the CLI to use the new repository system - Updated dependency nikic/php-parser to version 4.17.1 - Added a simple security measure in \ncc\Objects\Value\Entry to delay returns randomly when the password is incorrect - Refactored the CLI menu system to use a return exit code system - Updated the installer to remove unused components and installation steps - Updated dependency Symfony/Filesystem to 6.3.1 - Updated dependency Symfony/polyfill-ctype to 1.28.0 - Enforced credential storage security by applying 600 permissions to the storage file so that only the owner can read/write to the file; this will require root access to perform any operations on the credential file. A password will still be needed to decrypt entries in the file if any entries are encrypted. - Removed \ncc\Classes\NccExtension\Runner in favor of the new Execution Unit system - Removed \ncc\Managers\ExecutionPointerManager in favor of the new Execution Unit system
2023-09-21 17:24:12 -04:00
/** @noinspection SlowArrayOperationsInLoopInspection */
$results = array_merge($results, scanContents($path));
2022-08-11 14:04:33 -04:00
}
}
return $results;
}
- Cleaned up imports - Various bug fixes and improved performance on package reading/writing - Corrected CHANGELOG.md - Updated dependency `Symfony/polyfill-mbstring` to 1.28.0 - Updated dependency `Symfony/polyfill-uuid` to 1.28.0 - Updated dependency `Symfony/Process` to 6.3.4 - Updated dependency `Symfony/Uid` to 6.3.0 - Updated dependency `Symfony/Yaml` to 6.3.3 - Added support for Gitea repositories - Added support for Packagist repositories - Added a new default Gitea repository nocturn9x at git.nocturn9x.space - Added a new default Gitea repository martinvlba at git.martinvlba.eu - Added a new default Gitea repository kuny at git.it-kuny.ch - Added dependency composer/semver version 3.4.0 for composer version comparison compatibility - Added a new class \ncc\Classes\ArchiveExtractor to extract multiple archive types - Refactored \ncc\Objects\RemoteRepository - Refactored the repository system - Refactored Github's repository interface - Refactored Gitlab's repository interface - Refactored SourcesMenu in the CLI to use the new repository system - Updated dependency nikic/php-parser to version 4.17.1 - Added a simple security measure in \ncc\Objects\Value\Entry to delay returns randomly when the password is incorrect - Refactored the CLI menu system to use a return exit code system - Updated the installer to remove unused components and installation steps - Updated dependency Symfony/Filesystem to 6.3.1 - Updated dependency Symfony/polyfill-ctype to 1.28.0 - Enforced credential storage security by applying 600 permissions to the storage file so that only the owner can read/write to the file; this will require root access to perform any operations on the credential file. A password will still be needed to decrypt entries in the file if any entries are encrypted. - Removed \ncc\Classes\NccExtension\Runner in favor of the new Execution Unit system - Removed \ncc\Managers\ExecutionPointerManager in favor of the new Execution Unit system
2023-09-21 17:24:12 -04:00
2022-08-11 14:04:33 -04:00
$excluded_files = [
'hash_check.php',
'generate_build_files.php',
'default_config.yaml',
2022-08-11 14:04:33 -04:00
'installer',
'checksum.bin',
2022-08-12 20:32:59 -04:00
'build_files',
'ncc.sh',
'extension'
2022-08-11 14:04:33 -04:00
];
ncc\Utilities\Console::out('Creating build_files ...');
if(file_exists('build_files'))
{
unlink('build_files');
}
$build_files_content = [];
foreach(scanContents(__DIR__) as $path)
{
if(!in_array($path, $excluded_files, true))
2022-08-11 14:04:33 -04:00
{
$build_files_content[] = $path;
}
}
- Cleaned up imports - Various bug fixes and improved performance on package reading/writing - Corrected CHANGELOG.md - Updated dependency `Symfony/polyfill-mbstring` to 1.28.0 - Updated dependency `Symfony/polyfill-uuid` to 1.28.0 - Updated dependency `Symfony/Process` to 6.3.4 - Updated dependency `Symfony/Uid` to 6.3.0 - Updated dependency `Symfony/Yaml` to 6.3.3 - Added support for Gitea repositories - Added support for Packagist repositories - Added a new default Gitea repository nocturn9x at git.nocturn9x.space - Added a new default Gitea repository martinvlba at git.martinvlba.eu - Added a new default Gitea repository kuny at git.it-kuny.ch - Added dependency composer/semver version 3.4.0 for composer version comparison compatibility - Added a new class \ncc\Classes\ArchiveExtractor to extract multiple archive types - Refactored \ncc\Objects\RemoteRepository - Refactored the repository system - Refactored Github's repository interface - Refactored Gitlab's repository interface - Refactored SourcesMenu in the CLI to use the new repository system - Updated dependency nikic/php-parser to version 4.17.1 - Added a simple security measure in \ncc\Objects\Value\Entry to delay returns randomly when the password is incorrect - Refactored the CLI menu system to use a return exit code system - Updated the installer to remove unused components and installation steps - Updated dependency Symfony/Filesystem to 6.3.1 - Updated dependency Symfony/polyfill-ctype to 1.28.0 - Enforced credential storage security by applying 600 permissions to the storage file so that only the owner can read/write to the file; this will require root access to perform any operations on the credential file. A password will still be needed to decrypt entries in the file if any entries are encrypted. - Removed \ncc\Classes\NccExtension\Runner in favor of the new Execution Unit system - Removed \ncc\Managers\ExecutionPointerManager in favor of the new Execution Unit system
2023-09-21 17:24:12 -04:00
$build_files = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'build_files', 'ab+');
2022-08-11 14:04:33 -04:00
fwrite($build_files, implode("\n", $build_files_content));
fclose($build_files);
- Cleaned up imports - Various bug fixes and improved performance on package reading/writing - Corrected CHANGELOG.md - Updated dependency `Symfony/polyfill-mbstring` to 1.28.0 - Updated dependency `Symfony/polyfill-uuid` to 1.28.0 - Updated dependency `Symfony/Process` to 6.3.4 - Updated dependency `Symfony/Uid` to 6.3.0 - Updated dependency `Symfony/Yaml` to 6.3.3 - Added support for Gitea repositories - Added support for Packagist repositories - Added a new default Gitea repository nocturn9x at git.nocturn9x.space - Added a new default Gitea repository martinvlba at git.martinvlba.eu - Added a new default Gitea repository kuny at git.it-kuny.ch - Added dependency composer/semver version 3.4.0 for composer version comparison compatibility - Added a new class \ncc\Classes\ArchiveExtractor to extract multiple archive types - Refactored \ncc\Objects\RemoteRepository - Refactored the repository system - Refactored Github's repository interface - Refactored Gitlab's repository interface - Refactored SourcesMenu in the CLI to use the new repository system - Updated dependency nikic/php-parser to version 4.17.1 - Added a simple security measure in \ncc\Objects\Value\Entry to delay returns randomly when the password is incorrect - Refactored the CLI menu system to use a return exit code system - Updated the installer to remove unused components and installation steps - Updated dependency Symfony/Filesystem to 6.3.1 - Updated dependency Symfony/polyfill-ctype to 1.28.0 - Enforced credential storage security by applying 600 permissions to the storage file so that only the owner can read/write to the file; this will require root access to perform any operations on the credential file. A password will still be needed to decrypt entries in the file if any entries are encrypted. - Removed \ncc\Classes\NccExtension\Runner in favor of the new Execution Unit system - Removed \ncc\Managers\ExecutionPointerManager in favor of the new Execution Unit system
2023-09-21 17:24:12 -04:00
2022-08-11 14:04:33 -04:00
exit(0);