Compare commits

...

375 commits

Author SHA1 Message Date
netkas
b975508d07 Indentation Correction 2025-01-08 15:46:13 -05:00
netkas
1ef96c3c4c Updated CHANGELOG.md 2024-10-29 12:28:41 -04:00
netkas
2dad5133bd Updated .gitignore 2024-10-25 19:59:33 -04:00
netkas
544d4ebdf6 Validate package instance before checking execution policy 2024-10-25 19:59:22 -04:00
netkas
41947069be Bumped version to 2.1.6 2024-10-25 19:56:25 -04:00
netkas
11aaa39eaa Update build script and bump version to 2.1.5 2024-10-14 15:29:32 -04:00
bdcf510089 Finalized CHANGELOG.md 2024-10-13 14:50:32 -04:00
278b3d0e2e Add executable and compressed templates with CI updates 2024-10-13 14:50:16 -04:00
771748636d Executable Compiler will now correctly create a directory if it does not exist when compiling a package using gcc 2024-10-13 12:31:51 -04:00
netkas
3b5a3882f6 Refactor CI templates to support dynamic build targets 2024-10-12 14:54:48 -04:00
netkas
77c668f7b6 Refactor phpmake template to support dynamic build targets 2024-10-11 14:21:10 -04:00
netkas
c40c7ce8fe Added new dynamic constant %BUILD_OUTPUT_PATH% which can be used as %BUILD_OUTPUT_PATH%:release to show the output path of a specific build configuration 2024-10-10 15:31:59 -04:00
netkas
f5433c6bf9 Added new constant '%DEFAULT_BUILD_CONFIGURATION%' which points to the project's default build configuration 2024-10-10 15:17:21 -04:00
netkas
bc86e5a65d Updated CHANGELOG.md 2024-10-10 14:16:25 -04:00
netkas
f8ede74764 Updated Runtime 2024-10-10 14:13:47 -04:00
netkas
c87ebf14dd Bumped version to 2.1.4 2024-09-30 03:13:46 -04:00
netkas
e48e6a55e4 Null-pointer fix 2024-09-27 14:00:15 -04:00
netkas
08c770c9e1 Bumped version 2024-09-27 13:57:56 -04:00
netkas
e2a8dbfe27 Implement pre-install and post-install unit execution 2024-09-27 13:23:46 -04:00
netkas
91fe129bf4 Add getter methods for installation lifecycle steps 2024-09-27 00:42:33 -04:00
netkas
44dc1498f7 Updated CHANGELOG.md 2024-09-27 00:39:47 -04:00
netkas
c659baa9ce Updated DocStrings in PackageManager 2024-09-27 00:39:21 -04:00
netkas
1b33b83926 Fixed incorrect enum usage in RepositoryMenu 2024-09-27 00:35:01 -04:00
netkas
9303158674 Bumped version to version 2.1.2 2024-09-27 00:33:17 -04:00
netkas
d249e99448 Merge remote-tracking branch 'origin/dev' into dev 2024-09-24 12:53:33 -04:00
netkas
3f2f325bcc Updated CHANGELOG.md 2024-09-24 12:52:51 -04:00
netkas
2a20786755 Updated github_ci.yml.tpl 2024-09-24 12:52:51 -04:00
netkas
8ceb6756a4 Updated github_ci.yml.tpl 2024-09-24 12:48:16 -04:00
netkas
51bdb22540 Updated github_ci.yml.tpl 2024-09-24 12:45:09 -04:00
netkas
36d8e6f8c6 Updated github_ci.yml.tpl 2024-09-24 12:42:04 -04:00
netkas
9136396700 Updated github_ci.yml.tpl 2024-09-24 12:39:36 -04:00
netkas
e225add40b Updated github_ci.yml.tpl 2024-09-24 12:37:19 -04:00
netkas
33865d7e48 Updated github_ci.yml.tpl 2024-09-24 12:35:25 -04:00
netkas
cba6942cca Updated github_ci.yml.tpl 2024-09-24 12:32:27 -04:00
netkas
29e0a6e4ae Updated github_ci.yml.tpl 2024-09-24 00:36:31 -04:00
netkas
cba5f7041a Updated github_ci.yml.tpl 2024-09-24 00:34:15 -04:00
netkas
1ddb042175 Updated github_ci.yml.tpl 2024-09-24 00:30:09 -04:00
netkas
093e3341e1 Create class directory if it does not exist 2024-09-24 00:26:31 -04:00
netkas
80a019452f Add GitHub CI template support 2024-09-23 18:56:28 -04:00
netkas
b30ddbdc28 Seperated Makefile template into it's own template, added phpcli_full & phplib_full to combine all Templates together for building a PHP project 2024-09-23 15:17:15 -04:00
netkas
e829a839d1 Updated CHANGELOG.md 2024-09-23 15:05:51 -04:00
netkas
d813ef7b94 Added new template for PHP called "phpunit" to generate PHPUnit bootstrap test 2024-09-23 15:01:56 -04:00
netkas
09fb388ee7 Bumped version to 2.1.1 2024-09-20 20:12:38 -04:00
netkas
87290232f5 Merge branch 'master' into dev
# Conflicts:
#	CHANGELOG.md
#	src/ncc/CLI/Commands/BuildCommand.php
#	src/ncc/Classes/GithubExtension/GithubRepository.php
#	src/ncc/Managers/PackageManager.php
#	src/ncc/VERSION
#	src/ncc/version.json
2024-09-20 20:10:15 -04:00
netkas
adbd1d1751 Updated CHANGELOG.md 2024-09-20 20:07:18 -04:00
netkas
273df6ebb4 Updated ci.yml 2024-09-20 20:01:55 -04:00
netkas
d2baa2d580 Updated ci.yml 2024-09-20 19:57:18 -04:00
netkas
b2ef33d48f Updated ci.yml 2024-09-20 19:49:39 -04:00
netkas
7e79bba762 Updated ci.yml 2024-09-20 19:47:30 -04:00
netkas
45c58c0568 Updated ci.yml 2024-09-20 19:37:53 -04:00
netkas
3b0f1a805c Updated ci.yml 2024-09-20 19:35:47 -04:00
netkas
3640befdcc Updated ci.yml 2024-09-20 19:29:48 -04:00
netkas
798fe9e797 Updated ci.yml 2024-09-20 19:26:18 -04:00
netkas
140b0f2aff Updated ci.yml 2024-09-20 19:21:55 -04:00
netkas
64fdc3b5bd Updated ci.yml 2024-09-20 19:19:33 -04:00
netkas
23bd2c6636 Updated ci.yml 2024-09-20 19:16:45 -04:00
netkas
b29c83f276 Updated ci.yml 2024-09-20 19:14:04 -04:00
netkas
5eeb0d270d Updated ci.yml 2024-09-20 19:13:55 -04:00
netkas
2c5733c5c0 Updated ci.yml 2024-09-20 19:13:44 -04:00
netkas
e041ca2c20 Updated ci.yml 2024-09-20 19:11:23 -04:00
netkas
c9e4a6741a Updated ci.yml 2024-09-20 19:05:39 -04:00
netkas
634f50e317 Updated ci.yml 2024-09-20 19:02:49 -04:00
netkas
6d2d827de2 Updated ci.yml 2024-09-20 19:00:38 -04:00
netkas
1bb6189e57 Updated ci.yml 2024-09-20 18:59:02 -04:00
netkas
4db07af9bb Updated ci.yml 2024-09-20 18:58:40 -04:00
netkas
b93e07bc3d Fix argument passing in ExecCommand runner 2024-09-20 18:43:59 -04:00
netkas
9418125722 Add CLI support for passing and splitting execution arguments 2024-09-20 18:39:46 -04:00
netkas
7494ead7b3 Refactor ProjectManager and Runtime handling 2024-09-20 17:47:30 -04:00
netkas
170cb4bf6d Ensure required files exist before evaluation 2024-09-20 17:13:44 -04:00
netkas
dda710119c Add option to force package build from source 2024-09-20 17:04:30 -04:00
netkas
be70823a79 Bug fixes with Php-Parser 2024-09-20 16:00:53 -04:00
netkas
923117999b Updated nikic/PhpParser to version 5.2.0 2024-09-19 15:44:14 -04:00
netkas
a1404490bb Updated Symfony/polyfill-uuid to version 1.31.0 2024-09-19 15:24:32 -04:00
netkas
e556282f61 Updated Symfony/polyfill-mbstring to version 1.31.0 2024-09-19 15:23:08 -04:00
netkas
cdd3516766 Corrected ctype 2024-09-19 15:21:32 -04:00
netkas
9831b9dca1 Updated Symfony/polyfill-ctype to version 1.31.0 2024-09-19 15:19:41 -04:00
netkas
dd48100f06 Updated Symfony/Process to version 7.1.3 2024-09-19 15:14:53 -04:00
netkas
910477df8e Updated Symfony/Uid to version 7.1.4 2024-09-19 15:10:40 -04:00
netkas
d59f5fb6e0 Updated Symfony/Yaml to version 7.1.4 2024-09-19 15:06:13 -04:00
netkas
4e174821fc Updated CHANGELOG.md 2024-09-19 14:23:00 -04:00
netkas
c7b007c704 Refactor project constants handling in NccCompiler 2024-09-19 14:17:16 -04:00
netkas
272fc8524e Fixed version filtering and sorting in PackagistRepository 2024-09-19 13:52:20 -04:00
netkas
5e173b7cc0 Fix case sensitivity for "Semver" in paths and package name 2024-09-19 13:45:33 -04:00
netkas
91a25390fa Rename 'semver' directory to 'Semver' in composer package 2024-09-19 13:43:08 -04:00
netkas
bcb26d1eec Updated Composer/Semver to 3.4.3 2024-09-19 13:29:02 -04:00
netkas
1389b61fa2 Add support for runtime constants 2024-09-19 13:16:58 -04:00
netkas
16ad69b9f2 Remove RuntimeInterface.php 2024-09-19 01:02:08 -04:00
netkas
3aedd2d94d Remove ComponentFileExtensions enum 2024-09-19 00:57:52 -04:00
netkas
b2d2a1ea15 Simplify optional type value retrieval 2024-09-19 00:50:00 -04:00
netkas
604e1fd3e7 Update PHP language level to 8.3 2024-09-19 00:41:39 -04:00
netkas
3950655024 Remove PACKAGE_LOCK_VERSION constant from Versions enum 2024-09-19 00:41:31 -04:00
netkas
da8a6fac01 Update repository type handling in verbose output 2024-09-19 00:31:57 -04:00
netkas
943048785d Refactor Console color formatting 2024-09-19 00:19:06 -04:00
netkas
bdcf5160de Update Console color formatting method 2024-09-19 00:17:49 -04:00
netkas
46fd39c51c Improve error messages in Repository configuration 2024-09-18 15:30:44 -04:00
netkas
8e6acbbc70 Handle missing 'file' in stack trace 2024-09-18 15:28:53 -04:00
netkas
3adc1b81fb Improve error handling for compiler extensions 2024-09-18 15:20:04 -04:00
netkas
3160ddfa27 Refactor type handling for CompilerExtensions and RepositoryType 2024-09-18 15:18:07 -04:00
netkas
ae8021bb3a Fix misplacement of accessor in PackageReader declarations 2024-09-18 15:17:53 -04:00
netkas
b6cdb2a78c Add ResolverTest for parseArguments method 2024-09-18 14:07:08 -04:00
netkas
3e8af9c43c Remove max_arguments from parseArguments 2024-09-18 14:05:26 -04:00
netkas
e5ceb9bbf7 Add unit tests for Security class filename sanitization 2024-09-18 14:01:57 -04:00
netkas
bcefb6c56a Add unit tests for Validate utility methods 2024-09-18 13:54:36 -04:00
netkas
3c1286d9c2 Refactor regex pattern for CONSTANT_NAME 2024-09-18 13:54:26 -04:00
netkas
d8247b0760 Remove unused import and redundant scope validation method 2024-09-18 13:54:17 -04:00
netkas
68cfed8a05 Refactor authentication type handling 2024-09-18 13:36:08 -04:00
netkas
04a85900fd Removed unused methods from Validate.php 2024-09-18 13:10:24 -04:00
netkas
836d0f33eb Validate and enforce repository type enum usage 2024-09-18 00:54:12 -04:00
netkas
ffc6588ff9 Refactor component data type handling in setData method. 2024-09-18 00:50:27 -04:00
netkas
0afc45f300 Added ComponentTest.php 2024-09-17 22:17:43 -04:00
netkas
61158ff802 Added PhpUnit configuration 2024-09-17 22:17:41 -04:00
netkas
ad9e406657 Updated .gitignore 2024-09-17 22:17:04 -04:00
netkas
27c79b1170 Refactor Component class to use ComponentDataType enum 2024-09-17 22:16:48 -04:00
netkas
7e224d91b2 Removed todos (for now) 2024-09-17 22:08:55 -04:00
netkas
d0e484631f Refactor ProjectType handling 2024-09-17 22:08:23 -04:00
netkas
1bcfe90bea Updated Symfony/Filesystem from version 6.3.1 to 7.1.2 2024-09-17 19:26:23 -04:00
netkas
e624663f62 Refactor log level checking to enum method 2024-09-17 19:20:18 -04:00
netkas
8b64a48a5f Refactor log level parsing with enum method 2024-09-17 19:14:49 -04:00
netkas
24e67061f1 Added TODO 2024-09-17 15:38:16 -04:00
netkas
6398b2958b Refactor logging level checks to use LogLevel enum directly 2024-09-17 15:35:20 -04:00
netkas
5ea0235515 Update PHP include paths in project configuration 2024-09-17 15:29:54 -04:00
netkas
b291604145 Fix incorrect color formatting in installer output 2024-09-17 15:29:44 -04:00
netkas
714228ad2e Refactor code to improve readability in Resolver.php 2024-09-17 15:29:30 -04:00
netkas
aa65dd73cf Refactor checkLogLevel to correctly utilize LogLevel cases 2024-09-17 15:29:03 -04:00
netkas
dfa6b50299 Bumped version 2024-09-17 15:28:15 -04:00
netkas
8f87541a64 Refactor flag handling to use PackageFlags enum directly
Updated the NccCompiler and PackageWriter classes to utilize the PackageFlags enum directly rather than its values. This improves type safety and code readability, reducing the chances of runtime errors associated with invalid flag values.
2024-09-17 15:10:19 -04:00
6482d06ba2 Fixed Division by zero in PackageManager 2024-09-14 09:08:21 -04:00
9fe2dc48fe Updated CHANGELOG.md 2024-09-14 09:03:15 -04:00
039147c8a8 Convert ComponentFlags constants to enum cases 2024-09-14 08:58:26 -04:00
863dffafe7 Convert NccBuildFlags constants to enum cases 2024-09-14 08:57:21 -04:00
0c4ef17bbf Convert PackageFlags constants to enum cases 2024-09-14 08:56:40 -04:00
ac81f2f26d Convert CompressionOptions constants to enum cases 2024-09-14 08:54:14 -04:00
66e6e1528d Convert BuildConfigurationOptions constants to enum cases 2024-09-14 08:53:30 -04:00
c24fce2ee5 Convert BuildConfigurationValues constants to enum cases 2024-09-14 08:49:53 -04:00
ae21d98290 Minor corrections for illegal array key type 2024-09-14 08:45:42 -04:00
d379956437 Convert ComponentDecodeOptions constants to enum cases 2024-09-14 08:44:06 -04:00
2bd2d757fd Convert InitializeProjectOptions constants to enum cases 2024-09-14 08:43:07 -04:00
87844ab00a Convert InstallPackageOptions constants to enum cases 2024-09-14 08:41:25 -04:00
ec6b368a82 Convert ProjectOptions constants to enum cases 2024-09-14 08:39:05 -04:00
2efa6654e6 Removed RuntimeImportOptions 2024-09-14 08:38:10 -04:00
21c2405a27 Convert AssemblyConstants constants to enum cases 2024-09-14 08:37:53 -04:00
87a8ca24a1 Convert BuildConstants constants to enum cases 2024-09-14 08:35:16 -04:00
492548d81f Convert DateTimeConstants constants to enum cases 2024-09-14 08:34:34 -04:00
9c06378258 Convert InstallConstants constants to enum cases 2024-09-14 08:33:13 -04:00
0d9f3d37a3 Convert RuntimeConstants constants to enum cases 2024-09-14 08:32:13 -04:00
e02f1f56dc Convert AuthenticationType constants to enum cases 2024-09-14 08:30:41 -04:00
12f0ff2ffa Convert BuildOutputType constants to enum cases 2024-09-14 08:28:04 -04:00
e11f95a22a Removed BuiltinRemoteSourceType 2024-09-14 08:26:30 -04:00
fd928ffc99 Convert ComponentDataType constants to enum cases 2024-09-14 08:26:16 -04:00
3db33006b7 Convert ComposerPackageTypes constants to enum cases 2024-09-14 08:24:19 -04:00
b5d35ed20e Convert ComposerStabilityTypes constants to enum cases 2024-09-14 08:23:29 -04:00
a2149cdb66 Removed DependencySourceType 2024-09-14 08:22:40 -04:00
28ff80dd41 Convert HttpRequestType constants to enum cases 2024-09-14 08:22:25 -04:00
86cf7467af Convert ProjectType constants to enum cases 2024-09-14 08:19:50 -04:00
3d44562241 Removed RemoteSourceType 2024-09-14 08:18:34 -04:00
5b24fe267d Convert RepositoryResultType constants to enum cases 2024-09-14 08:17:45 -04:00
14ec2e06b2 Added TODO 2024-09-14 00:41:27 -04:00
71ffed1a3f Convert RepositoryType constants to enum cases 2024-09-14 00:40:59 -04:00
d884d0fbda Convert CompilerExtensions constants to enum cases 2024-09-14 00:39:18 -04:00
baf11f5cb9 Convert ConsoleColors constants to enum cases 2024-09-14 00:37:03 -04:00
e1013f6c15 Convert ExceptionCodes constants to enum cases 2024-09-14 00:34:12 -04:00
718c6ff8d8 Convert FileDescriptor constants to enum cases 2024-09-14 00:31:43 -04:00
5dd98083d6 Convert LogLevel constants to enum cases 2024-09-14 00:30:05 -04:00
d612c67cb0 Convert PackageDirectory constants to enum cases 2024-09-14 00:24:49 -04:00
42473390e8 Removed CompilerExtensionDefaultVersions.php 2024-09-14 00:20:59 -04:00
cfc93aa066 Removed HttpStatusCodes.php 2024-09-14 00:20:46 -04:00
91103c1470 Removed ConstantReferences.php 2024-09-14 00:20:28 -04:00
9885d98b55 Removed PackageStandardVersions.php 2024-09-14 00:20:10 -04:00
321fef4228 Convert PackageStructure constants to enum cases 2024-09-14 00:19:53 -04:00
c687d0394d Convert PackageStructureVersions constants to enum cases 2024-09-14 00:13:43 -04:00
2a16b2de6b Convert ProjectTemplates constants to enum cases 2024-09-14 00:12:55 -04:00
e98b949b7d Convert RegexPatterns constants to enum cases 2024-09-13 13:38:48 -04:00
7e5cdf4d64 Removed EncoderType enum file, unused. 2024-09-13 13:34:40 -04:00
90535a3a35 Updated CHANGELOG.md 2024-09-13 13:31:37 -04:00
69de79ccf4 Convert Runners class to enum with string cases 2024-09-13 13:29:40 -04:00
7c9f63955a Update Scopes to enum and adjust scope checks 2024-09-13 13:26:54 -04:00
1ba50cc7ee Convert Versions constants to enum cases 2024-09-13 13:20:12 -04:00
f9047dd0d0 Bumped version to 2.1.0 2024-09-13 13:12:14 -04:00
a65b76b6bf
Updated CHANGELOG.md 2023-10-25 22:02:26 -04:00
957d9a9510
Added the ability to use 'all' as a build configuration when running ncc build, to build all build configurations
in the project.

The build command in ncc has been updated to accept 'all' as a build configuration which prompts the build of all configurations in the project. Previously, builds had to be triggered for each individual configurations. This change simplifies the build process especially for projects with multiple configurations, making the process more efficient and less prone to human error.
2023-10-25 22:00:37 -04:00
d2635b19fd
Fixed issue when creating a shadow copy of a package, if the universe aligns together and the cosmos unit together to
produce a package length exactly to where the end-of-package byte sequence is cut in half, the shadow copy will fail
   to be created due to the end-of-package byte sequence being cut in half, this issue was fixed by reading the package
   in chunks to determine the end-of-package byte sequence.

The PackageReader class has been updated to use a more efficient buffer management when reading data from a file. Previously, buffer size was growing uncontrollably and can eventually lead to out-of-memory errors for large files.

Now, the data is read in chunks and the buffer is cleared when it exceeds approximately 1MB size, maintaining only the last 512KB. This change ensures a more memory-efficient package reading and effectively prevents erroneous deadlocks for large package files.

Additionally, detection for end-of-data byte sequence has been modified to rectify an issue where package length could cut off the end-of-package byte sequence. This results in an improved reliability for package validation.
2023-10-25 21:40:42 -04:00
76f12bb0a3
Fixed issue where all development dependencies were not correctly being added to debug builds in composer projects,
instead these dependencies were added globally to the build configuration. This issue was fixed by adding all the
   development dependencies to the debug build configurations only.

This commit revises the handling of composer dependencies in 'ProjectManager.php'. A problem was encountered where software development dependencies were added globally to the build configuration, rather than exclusively to debug builds. By reassigning these dependencies to the debug configuration, this issue has been remedied.

Additionally, a bug-fix in 'PackageReader.php' has been implemented to validate the package file by checking the data length. If the file is discovered to be invalid (data length is null or zero), an IOException is triggered.

These changes enhance the accuracy of dependency management and improve the robustness of package validation.
2023-10-25 17:57:51 -04:00
7befd995e7
Added host resolving in network calls to improve the handling of invalid or unreachable URLs
The 'Resolver' utility was utilized to resolve the host and cache the result, enhancing the robustness and efficiency of the network calling mechanism across different modules including PackageManager, GiteaRepository, GithubRepository, and others.
2023-10-25 15:08:58 -04:00
b2234d5040
Updated the Download function to attempt to retry the download upon an error for at least 3 times.
Updated the downloadFile function in PackageManager.php to retry the download upon an error for at least 3 times. This improvement on error handling will enhance the resilience of the download process, reducing the likelihood of a single network hiccup resulting in a failed download. This change has also been reflected in the CHANGELOG.md file.
2023-10-25 14:33:42 -04:00
27d1609b23
Added Project.xml 2023-10-25 14:00:46 -04:00
de1e199dff
Fixed issue where a newline is sometimes added to the end of a download output due to how short the download process was, mitigated the issue by enforcing a "done" update at the end of the download process
A fix has been implemented for an issue where a newline was unintentionally added to the end of download output, mostly when the download process was too short. This has been mitigated by ensuring a "done" update whenever a download finishes.

At the same time, improvements have been made to the download progress output. Specifically, the downloaded size now won't exceed the total download size, and a definitive "100%" progress indication is enforced when the download ends.
2023-10-25 14:00:24 -04:00
aa6800e96a
Correction 2023-10-24 16:41:41 -04:00
a2cd98ba98
Updated exception handling in PackageReader
Optimized exception handling in PackageReader class by replacing NotSupportedException with IntegrityException. The update aligns with the objective of more accurate error handling and reporting during ZiProto decoding. The new IntegrityException provides a detailed error message, facilitating easier debugging.
2023-10-24 16:28:10 -04:00
27baeca112
Set default process timeouts to null
This commit sets the default timeout and idleTimeout for the execution process in ExecutionUnitRunner to null when there are no specific timeouts provided by the execution policy. This change was made to avoid unexpected timeouts when no specific values are set in the execution policy.
2023-10-24 16:07:48 -04:00
4f7aa7a859
Update progress bar text to display basename only
Modified the progress bar text display in PackageManager.php and NccCompiler.php classes. Changed 'setMiscText' function to now display only the basename of the component name, execution policy name, and resource name. This change improves readability and clarity of the progress bar by reducing clutter from long file paths.
2023-10-24 16:05:40 -04:00
3ebdeb0cba
Fixed issue where progress bar is displayed in VERBOSE mode
Added checks in the update method of the ConsoleProgressBar class to prevent it from displaying when log level is set to VERBOSE. This is to prevent cluttering the command-line interface with unnecessary information when running in VERBOSE mode. The changes also are reflected in the changelog.
2023-10-22 22:16:33 -04:00
bcc6f45eb4
Fix division by zero in ConsoleProgressBar
The rendering of the progress bar was causing a division by zero error when the maximum value was set to 0. This change adds a condition to check if the maximum value is not 0 before calculating the number of hashes and the percentage done in the progress bar. This avoids the division by zero error and makes the progress bar rendering more robust. The CHANGELOG.md file has also been updated to reflect this bug fix.
2023-10-22 19:26:16 -04:00
698d2e7a1f
Updated file tracking in Runtime class
Implemented changes in Runtime.php to better handle file tracking and to prevent unnecessary inclusion of duplicate files during Runtime. Instead of directly checking if a file is already included, we now create a unique identifier for each file using a crc32 hash function. This identifier (instead of the file path) is checked and stored in the inclusion list, allowing for better handling of dynamic or virtual files.
2023-10-18 16:03:40 -04:00
89d3af8680
Improve build efficiency by preventing duplicate merges
Introduced a private property to the `NccCompiler` class, `$merged_dependencies`, to keep track of the dependencies that have already been merged. This prevents unnecessary re-merging during the build operation, potentially enhancing the efficiency of the process. The implementation involves a check for a preexisting merge before a new merge is performed. If a merge already exists, the process is skipped, thereby avoiding redundancies.
2023-10-18 15:56:24 -04:00
12d7744e1e
Bumped version to 2.0.4 2023-10-18 15:49:16 -04:00
a76a8a4ae6
Updated CHANGELOG.md 2023-10-17 21:44:22 -04:00
7293519ba3
Add error handling for unspecified package in PackageManagerMenu 2023-10-17 21:27:40 -04:00
2605b8d218
- Added new ConsoleProgressBar class for UI improvement, imrpoved the CLI Progress Bar inspired by
[pacman](https://wiki.archlinux.org/title/pacman)
2023-10-17 21:23:05 -04:00
173032df72
- 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.
2023-10-17 17:01:40 -04:00
c736a896fb
When finding package versions in the package lock, ncc will try to find a satisfying version rather than the exact version, this is to prevent errors when the package lock contains a version that is not available in the repository. 2023-10-13 09:41:39 -04:00
930c206fa9
Bumped version to 2.0.3 2023-10-13 02:33:12 -04:00
4c6f2ddcfe
Updated CHANGELOG.md 2023-10-13 01:32:34 -04:00
d434345c59
Minor corrections 2023-10-13 01:32:21 -04:00
e3ac3cf7a3
Updated CHANGELOG.md 2023-10-12 16:34:21 -04:00
81ea985b68
Updated CHANGELOG.md 2023-10-12 16:27:07 -04:00
71214e769e
Refactor ncc extension registration logic, this also allows for debian packages to install the ncc extension automatically.
The logic related to the registration of the ncc extension has been refactored. Previously, the code that registered the ncc extension was contained in the installer. However, this change moves the code that registers the ncc extension from the installer to the Utilities/Functions class. This change was made because the extension registration is not only applicable to the installer, but is also required for several other components. This fact justified the need for the logic to be located in a more generic and accessible class. The Makefile, installer, generate_build_files.php files have been updated to reflect this change. Components using these should now work properly with the changes.
2023-10-12 16:24:36 -04:00
89b0c931b9
Fixed incorrect mime type in ncc-package.xml
This update addresses a mistake in the `ncc-package.xml` file, where the wrong mime type was specified. The mime type has been corrected from `application/ncc-package` to `application/ncc` and the glob pattern from `*.ncc_pkg` to `*.ncc`. This change will ensure proper recognition and handling of the file type.
2023-10-12 15:59:58 -04:00
4ef923b83c
- Fixed issue where some build artifacts are being bundled with package builds such as output_path and static
where they should not be included in the package.
 - Added the ability to pull static versions of packages from repositories where package names ending with `-static.ncc`
   or `_static.ncc` can be pulled if you use the `--prefer-static` or `--static` option when using the `package install`
   command. Otherwise, the normal package will be installed, avoiding static versions.
 - Added support for importing static packages from the system, allowing you to install static packages onto your
   system and import them without importing additional dependencies that isn't already included in the package.
2023-10-12 15:55:10 -04:00
e4a3dc2f99
Updated CHANGELOG.md 2023-10-11 20:23:45 -04:00
d9b30a755d
Update dependencies import in \ncc\Classes > Runtime > importFromPackage()
Moved the recursive import of dependencies inside an else statement to provide a condition for fake importing dependencies. This change offers an effective way to handle static dependencies. It enhances the robustness of the package reading and dependency import process.
2023-10-11 20:22:07 -04:00
ff5a6c7f7a
Updated CHANGELOG.md 2023-10-11 19:06:46 -04:00
21753364dc
Updated fetchPackage method to include authentication 2023-10-11 19:04:36 -04:00
345a215a56
Bumped version to 2.0.2 2023-10-11 18:59:09 -04:00
08592e4cb6
Bumpde version in control 2023-10-11 00:34:35 -04:00
e1907911bf
Updated CHANGELOG.md 2023-10-11 00:29:41 -04:00
94e599e372
Updated CHANGELOG.md 2023-10-11 00:27:13 -04:00
35981115eb
Add functionality to install project dependencies
Added a new feature in `ProjectManager.php` that allows automatic installation of a project's dependencies. The `installDependencies` function eases the task of separately installing each dependency. Now, both public and private dependencies can be installed collectively using the 'install' command added in `ProjectMenu.php`. This functionality is further documented in `DOCUMENTATION.md`.
2023-10-11 00:25:39 -04:00
c82bc7195a
Updated CHANGELOG.md 2023-10-10 23:01:01 -04:00
e69ae7aba9
Bumped version to 2.0.1 2023-10-10 23:00:56 -04:00
87dc682ef2
Correct exception message for configuration property in \ncc\Objects\ProjectConfiguration\Build > BuildConfiguration > fromArray() 2023-10-10 23:00:46 -04:00
71787cd7fe
Updated CHANGELOG.md 2023-10-10 22:57:56 -04:00
68ea83c103
Updated README.md 2023-10-10 19:08:25 -04:00
af9f3fba22
Update Docker run commands in Makefile 2023-10-10 18:37:11 -04:00
7e1072fdf6
Added content on constructing executable binary files in DOCUMENTATION.md 2023-10-10 18:09:38 -04:00
d32592e393
Completed ProjectConfiguration documentation 2023-10-10 17:24:13 -04:00
72a429ecce
Add 'Build', 'Dependency', 'BuildConfiguration' documentation 2023-10-10 16:33:55 -04:00
5dd3472f2a
Revert "Add Build section to documentation"
This reverts commit 9e1f55acb7.
2023-10-10 16:00:38 -04:00
9e1f55acb7
Add Build section to documentation
A "Build" section was added to the existing DOCUMENTATION.md to provide instructions on how to define the build configuration for a project.
2023-10-10 15:59:01 -04:00
1b8079f96b
Correct the data type of uuid property in docs 2023-10-10 14:18:49 -04:00
a1f1541854
Added documentation for package structures 2023-10-09 21:26:49 -04:00
a8e74a0877
Removed unused assets 2023-10-09 21:08:30 -04:00
83329c6076
Added project configuration documentation (incomplete) 2023-10-09 20:42:40 -04:00
79b5bafd3e
Added phplib section 2023-10-09 18:55:46 -04:00
de9ee13aa1
Directory paths corrected in \ncc\Classes\PhpExtension\Templates > LibraryTemplate 2023-10-09 18:25:00 -04:00
97f31399e3
Minor correction 2023-10-09 16:56:20 -04:00
a69a705451
Added phpcli section 2023-10-09 16:53:06 -04:00
6d39f1da13
Various changes and corrections 2023-10-09 16:29:44 -04:00
f24caf0799
Added package inspection command to DOCUMENTATION.md 2023-10-08 21:52:14 -04:00
d65f1955d6
Added build & exec sections to DOCUMENTATION.md 2023-10-08 21:35:28 -04:00
437b3f8b78
Added repository management section to DOCUMENTATION.md 2023-10-08 20:45:34 -04:00
42f9a39131
Added credential management section to DOCUMENTATION.md 2023-10-08 20:07:03 -04:00
bcc550ede6
Updated DOCUMENTATION.md 2023-10-08 19:16:03 -04:00
f94794bfb3
Updated Makefile 2023-10-08 18:35:57 -04:00
a63d148f30
Updated bootstrap_main.c to no longer hard-code "ncc" but find it's execution point instead 2023-10-08 15:40:37 -04:00
09debf85c6
Improved template system 2023-10-08 15:35:20 -04:00
aeccdaea68
\ncc\CLI\Management > ProjectMenu > initializeProject() merged --path|-p option with --name|-n if path is not provided, the Name will be used instead. 2023-10-08 15:24:18 -04:00
43cbe801d8
Merge branch 'dev' of https://git.n64.cc/nosial/ncc into dev 2023-10-08 15:13:31 -04:00
0a2cee2a02
Added functionality to remove symlink registrations during the uninstallation process & upgraded fix-broken to also detect broken packages that are installed on the system 2023-10-08 15:13:19 -04:00
6388b27b7a
Removed unused \ncc\Utilities > Functions > convertToSemver() 2023-10-08 12:23:47 -04:00
3f67344a60
Removed unused \ncc\Utilities > Functions > isTtyMode() 2023-10-08 12:23:17 -04:00
32b455576d
Implemented "symlink" registration for system-level packages 2023-10-08 12:20:24 -04:00
badPointer
1880ab6fa8 chore: oops 2023-10-07 12:49:25 +00:00
badPointer
5ec56ac0ab chore: hot 2023-10-07 12:43:00 +00:00
badPointer
248d420881 chore: Dockerfiles are cool 2023-10-07 12:36:59 +00:00
badPointer
f88a9b4802 chore: make Docker great again 2023-10-07 12:30:22 +00:00
2d3c1f3ab0
Added docker-debian, docker-debian-run, docker-alpine & docker-alpine-run to the Makefile 2023-10-07 04:51:45 -04:00
fb366f3aca
Correction 2023-10-07 04:36:48 -04:00
fe8f178b6f
Updated dockerfiles & gitlab ci 2023-10-07 04:35:46 -04:00
bf980be6e7
Updated .gitlab-ci.yml 2023-10-06 23:36:25 -04:00
b102089d80
Additional improvements to the debian build + a setup command built into ncc 2023-10-06 05:18:24 -04:00
5b57f12365
Added debian build (WIP) 2023-10-06 02:48:32 -04:00
d3659cb51a Merge branch 'dev' into 'dev'
Added ncc deb package build support

See merge request nosial/ncc!8
2023-10-06 03:37:26 +00:00
Cybersecbyte [UFOLINUX]
5a38586ff2 Merge branch ncc:master into dev 2023-10-05 17:33:43 +00:00
Cybersecbyte [UFOLINUX]
41ec00d136 Remove repo downloading and use local files 2023-10-05 17:33:09 +00:00
Cybersecbyte [UFOLINUX]
bb09222f46 deb support 2023-10-05 16:47:17 +00:00
a96830942a Merge branch 'revert-2d638540' into 'master'
Revert "Merge branch 'readme-upd' into 'master'"

See merge request nosial/ncc!7
2023-10-05 02:00:58 +00:00
8de8f29bd6
Updated README.md 2023-10-04 21:53:10 -04:00
0e486e0a64 Revert "Merge branch 'readme-upd' into 'master'"
This reverts merge request !6
2023-10-05 01:50:13 +00:00
2d638540a0 Merge branch 'readme-upd' into 'master'
Update README

See merge request nosial/ncc!6
2023-10-05 01:49:58 +00:00
3a52815213
Added debian stuff & changed the build path to produce ncc-<version> in Makefile 2023-10-04 21:32:34 -04:00
8ce6c68d77
Implemented retry logic for HTTP requests in Repositories 2023-10-04 15:12:56 -04:00
cf7e1aa107
Minor correction in curl handling 2023-10-04 14:41:23 -04:00
d5e28d1f45
Updated PackagistRepository.php to use RuntimeCache for http requests 2023-10-03 19:25:13 -04:00
63411d7d65
Updated GitlabRepository.php to use RuntimeCache for http requests 2023-10-03 19:22:35 -04:00
b689be3bd5
Updated GithubRepository.php to use RuntimeCache for http requests 2023-10-03 19:08:37 -04:00
09977f9f11
Updated GiteaRepository.php to use RuntimeCache for http requests 2023-10-03 18:03:48 -04:00
8549cff119
Refactored RuntimeCache.php 2023-10-03 17:34:09 -04:00
021d5ec750
Corrected argument pass through in \ncc\Manager > PackageManager > downloadFile() where $file_handle is passed to ShutdownHandler::declareTemporaryPath() rather than $file_path 2023-10-03 17:22:12 -04:00
1e0ea848b8
Added check for empty package input 2023-10-03 17:15:01 -04:00
161ef357a2
Added beta flag 2023-10-03 17:12:27 -04:00
0b4dbf6cc1
Minor optimization 2023-10-01 17:47:58 -04:00
4673c74d16
Updated CHANGELOG.md 2023-10-01 16:39:25 -04:00
01589e509f
Minor correction 2023-10-01 16:35:48 -04:00
c73465e965
Changed output initialization 2023-10-01 16:33:31 -04:00
44a12b66cf
Added check for importing a package from the system 2023-10-01 16:28:57 -04:00
4d317d61ab
Removed unused Constants.php 2023-10-01 16:26:10 -04:00
234c6e955b
Added check for installing dependencies 2023-10-01 16:25:20 -04:00
9bc339d1cb
Merged output_path & output_name build configuration options to output 2023-10-01 14:44:05 -04:00
107ebfa68c
Implemented require files handler & implemented proper exception handling for the import function 2023-10-01 14:34:58 -04:00
c86b4b7465
Added '-y' argument to \ncc\CLI\Management > PackageManagerMenu > uninstallAllPackages() 2023-10-01 14:17:59 -04:00
67956d3641
Removed redundant call 2023-10-01 14:03:06 -04:00
f2b69253ae
Reduced function calls :D 2023-10-01 12:12:44 -04:00
05c6483edc
Added todo tasks 2023-10-01 11:55:13 -04:00
5d9168f664
Implemented static dependencies & corrected output argument 2023-09-30 21:27:12 -04:00
770dde9ed2
Corrected shadow copy logic to not use stream_copy_to_stream() as it causes unexpected results. 2023-09-30 02:20:01 -04:00
9ded98c3e1
Added the ability to reinstall & skip dependencies for installation procedures 2023-09-30 00:07:56 -04:00
976518439f
Added checksum 2023-09-29 23:42:56 -04:00
e1f813ab60
Oops 2023-09-29 17:01:59 -04:00
38ab509630
Added shadow copy command to the Package Inspector Command 2023-09-29 16:43:48 -04:00
2cb5659de9
Update project files 2023-09-29 06:37:07 -04:00
29cf2ac00b
Update project files 2023-09-29 06:36:50 -04:00
67a1a29f8a
- Removed .gitlab-ci.yml.old
- Added logic for dependency importing
 - Enforced security
 - Added "." handler for GitlabRepository.php
 - Minor bug fixes
2023-09-29 01:57:41 -04:00
9cfca3281a
Touch-up & Implemented authentication system 2023-09-28 21:56:15 -04:00
09c89c16a0
Merge remote-tracking branch 'n64/dev' into dev 2023-09-28 21:30:29 -04:00
ba2e968676
Touchup 2023-09-28 21:30:00 -04:00
d5c0ebf9c7
Moved Component.php to InternalComponent.php 2023-09-26 17:35:52 -04:00
9aba1cbf38
Removed ExecutionPointer.php & Implemented ValidatableObjectInterface into BuildConfiguration.php 2023-09-26 17:33:14 -04:00
f62856b530
- 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-26 17:06:43 -04:00
badPointer
23e2673eed feat: update readme 2023-09-22 16:37:06 +00:00
5da97e4b3d
Updated PhpRunner.php 2023-09-10 22:47:37 -04:00
de88a4fb9e
- Added the ability to compile executable binaries for php using gcc
- Refactored execution unit system to use a new execution pointer system
 - Refactored `PhpRunner` to use the new execution pointer system
 - Refactored `BashRunner` to use the new execution pointer system
 - Refactored `LuaRunner` to use the new execution pointer system
 - Refactored `PerlRunner` to use the new execution pointer system
 - Refactored `PythonRunner` to use the new execution pointer system
 - Removed dependency `theseer\Autoload` in favor of ncc's own autoloader (screw you Arne Blankerts)
 - Refactored ZiProto
 - Removed runners `Python2` & `Python3` in favor of `Python`
2023-09-10 22:47:24 -04:00
ab32a3bba3
Minor change 2023-09-04 22:45:31 -04:00
4682b613a4
Minor change 2023-09-04 22:45:09 -04:00
5ce1c8cfa1
Bumped version to 2.0.0 2023-09-04 21:56:36 -04:00
d41ae8114f
- Refactored the entire package structure to ncc package structure 2.0 for memory efficiency and performance 2023-09-04 21:56:07 -04:00
d4f69522fc
Cleanup 2023-09-01 04:31:24 -04:00
e7eecd354a
Cleanup 2023-09-01 04:23:01 -04:00
d4e710d9d9
Cleanup 2023-09-01 04:19:09 -04:00
00e9bf1dd9
Fixed multiple ExecutionPolicies from populating the configuration file 2023-09-01 04:17:19 -04:00
84e4158fb8
Fixed return type in \ncc\Objects\ProjectConfiguration\ExecutionPolicy > Execute > toArray() 2023-09-01 04:11:33 -04:00
45c53981ef
- Added the ability to clean arrays in \ncc\Utilities > Functions > cleanArray() 2023-09-01 04:06:52 -04:00
0e8397ec1f
- Added new template PhpCliTemplate phpcli
- Added new template PhpLibraryTemplate `phplib`
 - Implemented a template engine and refactored the CLI menu for the Project Manager and added a new `template` command
2023-09-01 03:47:01 -04:00
8ea203a0f1
Fixed @Throw statements 2023-08-31 18:27:21 -04:00
01cda99139
- \ncc\Objects\ProjectConfiguration > Dependency > __construct() now requires the parameters $name, $source_type,
`$source` and `$version`
 - `\ncc\Objects\ProjectConfiguration > Dependency > fromArray()` Throws an `ConfigurationException` if the property
   `name` is missing in the dependency configuration
 - Also updated a bunch of objects in a similar fashion to the ones above, (BuildConfiguration, Execute, ExitHandle,
   ExitHandler, Repository, Assembly, Build, Dependency, ExecutionPolicy, Installer, Project, UpdateSource) I'm not
   going to list them all here, but you can find them in the commit history.
 - Added a new interface class `ValidatableObjectInterface` to implement validatable objects, this method will throw a
   `ConfigurationException` if the object is not valid or a `NotSupportedException` if the object contains methods that
   are not supported by the current version of ncc or project.
2023-08-31 18:26:18 -04:00
230675c586
- \ncc\Objects\ProjectConfiguration > Compiler: Added Public Constructor to automatically determine the minimum and
maximum supported compiler version for the selected extension
 - `\ncc\Objects\ProjectConfiguration > Compiler > fromArray()` throws an ConfigurationException if the property `extension` is null
 - `\ncc\Objects\ProjectConfiguration > Compiler > fromArray()` throws an NotSupportedException if the `extension` uses an
   unsupported compiler extension
 - `\ncc\Objects\ProjectConfiguration > Compiler > validate()` No longer accepts `$throw_exception` and throws an
   `ConfigurationException` or `NotSupportedException` if the validation fails, otherwise it returns `True`.
 - `\ncc\Objects\ProjectConfiguration > Project > fromArray()` Throws an `ConfigurationException` if the property `compiler`
   is missing in the project configuration
 - `\ncc\Objects > ProjectConfiguration > fromArray()` Throws an `ConfigurationException` if the property 'project' is
   missing in the root configuration
 - `\ncc\Objects\ProjectConfiguration > Project > __construct()` now requires the parameter `$compiler`
 - Removed parameter `$throw_exception` from `\ncc\Objects\ProjectConfiguration > Project > validate()`
2023-08-30 20:38:52 -04:00
99bdd933cd
Created autoload.php in test 2023-08-30 20:06:13 -04:00
dd3c659fe1
Created autoload.php in test 2023-08-30 20:06:08 -04:00
b751b39548
Moved old tests 2023-08-30 20:04:51 -04:00
e93fd81002
Added project.json 2023-08-30 20:03:29 -04:00
2ad6dfabab
Moved all old tests to another folder 2023-08-30 20:03:19 -04:00
960770d73f
Removed exceptions_plan.txt 2023-08-30 19:58:50 -04:00
05c890f0d1
- Corrected code-smell and code style issues in \ncc\Objects > HttpResponseCache
- Corrected code-smell and code style issues in `\ncc\Objects > InstallationPaths`
 - Updated class `\ncc\Objects > NccVersionInformation` to use method calls rather than direct property access and implemented
   `SerializableObjectInterface`
 - Updated class `\ncc\Objects > Package` to use method calls rather than direct property access and implemented
   `SerializableObjectInterface`
 - Updated class `\ncc\Objects > PackageLock` to use method calls rather than direct property access and implemented
   `BytecodeObjectInterface`
 - Updated class `\ncc\Objects > ProjectConfiguration` to use method calls rather than direct property access
 - Updated class `\ncc\Objects > ProjectDetectionResults` to use method calls rather than direct property access
 - Updated class `\ncc\Objects > RemotePackageInput` to use method calls rather than direct property access
 - Updated class `\ncc\Objects > RepositoryQueryResults` to use method calls rather than direct property access
 - Updated class `\ncc\Objects > Vault` to use method calls rather than direct property access
 - Removed unused `\ncc\Objects > NccUpdateInformation`
 - Removed unused `\ncc\Objects > PhpConfiguration`
2023-08-30 19:58:31 -04:00
42c26c92a0
- Updated class \ncc\Objects > CliHelpSection to use method calls rather than direct property access
- Updated class `\ncc\Objects > ComposerJson` to use method calls rather than direct property access
 - Updated class `\ncc\Objects > ComposerLock` to use method calls rather than direct property access
 - Updated class `\ncc\Objects > DefinedRemoteSource` to use method calls rather than direct property access
 - Updated class `\ncc\Objects > HttpRequest` to use method calls rather than direct property access and implemented
   `SerializableObjectInterface`
 - Updated class `\ncc\Objects > HttpResponse` to use method calls rather than direct property access and implemented
   `SerializableObjectInterface`
 - Fixed hash comparisons to use `hash_equals` implementations to combat against Timing Attacks
2023-08-28 22:54:54 -04:00
eeffb15eb7
- Updated class \ncc\Objects\Vault\Password > AccessToken to use method calls rather than direct property access 2023-08-28 18:34:19 -04:00
424b503f42
- Updated class \ncc\Objects\SymlinkDictionary > SymlinkEntry to use method calls rather than direct property access 2023-08-28 18:31:59 -04:00
cda454a9c1
Update project file 2023-08-28 18:27:43 -04:00
729c9cb217
- Added a new interface class SerializableObjectInterface to implement serializable objects, BytecodeObjectInterface
extends this interface to allow for serialization of compiled assets
 - Updated class `\ncc\Objects\ComposerJson > Author` to use method calls rather than direct property access and
   implemented `SerializableObjectInterface`
 - Updated class `\ncc\Objects\ComposerJson > Autoloader` to use method calls rather than direct property access and
   implemented `SerializableObjectInterface`
 - Updated class `\ncc\Objects\ComposerJson > Funding` to use method calls rather than direct property access and
   implemented `SerializableObjectInterface`
 - Updated class `\ncc\Objects\ComposerJson > NamespacePointer` to use method calls rather than direct property access
   and implemented `SerializableObjectInterface`
 - Updated class `\ncc\Objects\ComposerJson > PackageLink` to use method calls rather than direct property access and
   implemented `SerializableObjectInterface`
 - Updated class `\ncc\Objects\ComposerJson > Suggestion` to use method calls rather than direct property access and
   implemented `SerializableObjectInterface`
 - Updated class `\ncc\Objects\ComposerJson > Support` to use method calls rather than direct property access and
   implemented `SerializableObjectInterface`
 - Updated class `\ncc\Objects\ExecutionPointers > ExecutionPointer` to use method calls rather than direct property
   access and implemented `BytecodeObjectInterface`
 - Updated class `\ncc\Objects\NccVersionInformation > Component` to use method calls rather than direct property access
   and implemented `SerializableObjectInterface`
 - Updated class `\ncc\Objects\Package > Component` to use method calls rather than direct property access and
   implemented `BytecodeObjectInterface`
 - Updated class `\ncc\Objects\Package > ExecutionUnit` to use method calls rather than direct property access and
   implemented `BytecodeObjectInterface`
 - Updated class `\ncc\Objects\Package > Header` to use method calls rather than direct property access and implemented
   `BytecodeObjectInterface`
 - Updated class `\ncc\Objects\Package > Installer` to use method calls rather than direct property access and implemented
   `BytecodeObjectInterface`
 - Updated class `\ncc\Objects\Package > MagicBytes` to use method calls rather than direct property access and implemented
   `SerializableObjectInterface`
 - Updated class `\ncc\Objects\Package > Resource` to use method calls rather than direct property access and implemented
   `BytecodeObjectInterface`
 -  Updated class `\ncc\Objects\PackageLock > DependencyEntry` to use method calls rather than direct property access
    and implemented `BytecodeObjectInterface`
 - Updated class `\ncc\Objects\PackageLock > PackageEntry` to use method calls rather than direct property access
   and implemented `BytecodeObjectInterface`
 - Updated class `\ncc\Objects\PackageLock > VersionEntry` to use method calls rather than direct property access
   and implemented `BytecodeObjectInterface`
2023-08-28 18:27:09 -04:00
2ea1dfc27a
- Updated class \ncc\Objects\ProjectConfiguration > Project to use method calls rather than direct property access
- Updated class `\ncc\Objects\ProjectConfiguration > UpdateSource` to use method calls rather than direct property access
2023-08-27 11:41:11 -04:00
dc7fcfc757
- Updated class \ncc\Objects\ProjectConfiguration\Build > BuildConfiguration to use method calls rather than direct
property access
 - Updated class `\ncc\Objects\ProjectConfiguration\ExecutionPolicy > Execute` to use method calls rather than direct
   property access
 - Changed all uppercase occurrences of `NCC` to `ncc` in the entire project
 - Corrected code-smell and code style issues in `\ncc\Utilities > Base64`
 - Corrected code-smell and code style issues in `\ncc\Utilities > Console`
 - Updated class `\ncc\Objects\ProjectConfiguration\ExecutionPolicy > ExitHandle` to use method calls rather than direct
   property access
 - Updated class `\ncc\Objects\ProjectConfiguration\ExecutionPolicy > ExitHandlers` to use method calls rather than
   direct property access
 - Updated class `\ncc\Objects\ProjectConfiguration\UpdateSource > Repository` to use method calls rather than direct
   property access
 - Updated class `\ncc\Objects\ProjectConfiguration > Assembly` to use method calls rather than direct property access
 - Updated class `\ncc\Objects\ProjectConfiguration > Build` to use method calls rather than direct property access
 - Updated class `\ncc\Objects\ProjectConfiguration > Compiler` to use method calls rather than direct property access
 - Updated class `\ncc\Objects\ProjectConfiguration > ExecutionPolicy` to use method calls rather than direct property access
 - Updated class `\ncc\Objects\ProjectConfiguration > Installer` to use method calls rather than direct property access
 - Fixed all @throw tags in the project to use the correct exception class
 - Removed unused `scope` property from `\ncc\Objects\ProjectConfiguration > Build`
2023-08-27 01:04:35 -04:00
9c76d31de9
- Updated class \ncc\Objects\ProjectConfiguration > Dependency to use method calls rather than direct property access 2023-08-23 14:23:21 -04:00
628d126baf
Updated exception message in \ncc\Objects > RemotePackageInput > __construct() 2023-08-23 12:50:10 -04:00
eef360a8f7
- Added new exception OperationException in \ncc\Exceptions to replace all generic related exceptions
- Removed unused exception `UnitsNotFoundException` in `\ncc\Exceptions` (not used)
 - Removed unused exception `NoAvailableUnitsException` in `\ncc\Exceptions` in favor for `OperationException`
 - Removed unused exception `InstallationException` in `\ncc\Exceptions` in favor for `OperationException`
 - Removed all unused exceptions from the project, reduced the number of exceptions in total.
2023-08-23 11:44:32 -04:00
69d7b86534
- Removed unused exception PackageNotFoundException in \ncc\Exceptions in favor of PackageException
- Removed unused exception `ConstantReadonlyException` in `\ncc\Exceptions` in favor of `IntegrityException` & `\InvalidArgumentException`
 - Removed unused exception `InvalidConstantName` in `\ncc\Exceptions` in favor for `IntegrityException`
 - Removed unused exception `ComponentDecodeException` in `\ncc\Exceptions` in favor for `IntegrityException`
 - Removed unused exception `ResourceChecksumException` in `\ncc\Exceptions` in favor for `IntegrityException`
 - Removed unused exception `AutoloadGeneratorException` in `\ncc\Exceptions` in favor for `IOException`
 - Removed unused exception `SymlinkException` in `\ncc\Exceptions` in favor for `IOException`
 - Removed unused exception `PackageLockException` in `\ncc\Exceptions` in favor for `IOException`
2023-08-21 23:14:13 -04:00
cdbc87e4bc
- Added new exception PackageException in \ncc\Exceptions to replace all package related exceptions
- Removed unused exception `HttpException` in `\ncc\Exceptions` in favor of `NetworkException`
 - Removed unused exception `ComposerDisabledException` in `\ncc\Exceptions` in favor of `ComposerException`
 - Removed unused exception `ComposerNotAvailable` in `\ncc\Exceptions` in favor of `ComposerException`
 - Removed unused exception `InternalComposerNotAvailable` in `\ncc\Exceptions` in favor of `ComposerException`
 - Removed unused exception `PackagePreperationFailedException` in `\ncc\Exceptions` in favor of `PackageException`
 - Removed unused exception `PackageParsingException` in `\ncc\Exceptions` in favor of `PackageException`
 - Removed unused exception `MissingDependencyException` in `\ncc\Exceptions` (not used)
 - Removed unused exception `PackageAlreadyInstalledException` in `\ncc\Exceptions` in favor of `PackageException`
 - Removed unused exception `PackageFetchException` in `\ncc\Exceptions` in favor of `PackageException`
2023-08-21 21:35:24 -04:00
623da68d29
Updated exceptions_plan.txt 2023-08-21 20:47:45 -04:00
7ad8518114
- Removed unused exception AccessDeniedException in \ncc\Exceptions in favor of AuthenticationException 2023-08-21 20:46:00 -04:00
b685d66b77
- Removed unused exception InvalidBuildConfigurationException in \ncc\Exceptions (not used)
- Removed unused exception `InvalidPropertyValue` in `\ncc\Exceptions` in favor of `ConfigurationException`
 - Removed unused exception `InvalidVersionConfiguration` in `\ncc\Exceptions` (not used)
 - Removed unused exception `InvalidDependencyConfiguraiton` in `\ncc\Exceptions` (not used)
 - Removed unused exception `ProjectConfigurationNotFoundException` in `\ncc\Exceptions` in favor of `ConfigurationException`
 - Removed unused exception `UndefinedExecutionPolicyExpection` in `\ncc\Exceptions` in favor of `ConfigurationException`
 - Removed unused exception `InvalidExecutionPolicyName` in `\ncc\Exceptions` (not used)
2023-08-21 20:30:48 -04:00
59dc4bb9cb
Updated ExceptionCodes.php 2023-08-21 18:53:48 -04:00
0f08bd54d4
- Corrected code-smell and code style issues in \ncc\Objects > PackageLock
- Removed unused exception `InvalidProjectConfigurationException` in `\ncc\Exceptions` in favor of `ConfigurationException`
 - Removed unused exception `InvalidScopeException` in `\ncc\Exceptions` in favor of `InvalidArgumentException` (standard php)
 - Removed unused exception `InvalidCredentialsEntryException` in `\ncc\Exceptions` (not used)
 - Removed unused exception `ComponentNotFoundException` in `\ncc\Exceptions` in favor of `ConfigurationException`
 - Removed unused exception `InvalidPackageNameException` in `\ncc\Exceptions` (not used)
 - Removed unused exception `InvalidVersionNumberException` in `\ncc\Exceptions` (not used)
 - Removed unused exception `InvalidProjectException` in `\ncc\Exceptions` in favor of `ConfigurationException`
 - Removed unused exception `InvalidProjectNameException` in `\ncc\Exceptions` in favor of `ConfigurationException`
 - Removed unused exception `BuildConfigurationNotFoundException` in `\ncc\Exceptions` in favor of `ConfigurationException`
2023-08-21 18:49:09 -04:00
c151d29b46
- Removed unused exception UnsupportedComponentTypeException in \ncc\Exceptions in favor of NotSupportedException
- Removed unused exception `UnsupportedPackageException` in `\ncc\Exceptions` (not used)
 - Removed unused exception `UnsupportedRemoteTypeSource` in `\ncc\Exceptions` (not used)
 - Removed unused exception `UnsupportedProjectTypeException` in `\ncc\Exceptions` (not used)
2023-08-20 21:20:13 -04:00
14541123c0
self::UNSUPPORTED_EXTENSION_VERSION, 2023-08-20 17:38:36 -04:00
57305c8b52
Removed GithubServiceException.php 2023-08-19 12:57:15 -04:00
85d4a63248
- Removed unused exception GitTagsException in \ncc\Exceptions in favor of GitException 2023-08-19 12:56:31 -04:00
00dcc7e004
- Removed unused exception GitCloneException in \ncc\Exceptions in favor of GitException
- Removed unused exception `GitCheckoutException` in `\ncc\Exceptions` in favor of `GitException`
 - Removed unused exception `GithubServiceException` in `\ncc\Exceptions` in favor of `GitException`
 - Updated `\ncc\Classes > GitClient > cloneRepository()` to throw `GitException` instead of `GitCloneException`
 - Updated `\ncc\Classes > GitClient > checkout()` to throw `GitException` instead of `GitCheckoutException`
 - Added new exception `GitException` in `\ncc\Exceptions` to replace all git related exceptions
2023-08-19 12:52:55 -04:00
c3406ca13f
Updated CHANGELOG.md 2023-08-19 12:37:14 -04:00
79c02e5132
Refactored Runtime to an extent, added plan (exceptions_plans.txt) 2023-08-19 12:34:22 -04:00
348ca2d4a1
- Implemented interface BytecodeObjectInterface into \ncc\Objects\ProjectConfiguration > Assembly
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration\UpdateSource > Repository`
 - Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration\ExecutionPolicy > Execute`
 - Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration\ExecutionPolicy > ExitHandle`
 - Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration\ExecutionPolicy > ExitHandlers`
 - Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration\Build > BuildConfiguration`
2023-08-19 12:24:42 -04:00
15fd06d2d0
- Implemented Bytecode compiling properly into \ncc\Objects > ProjectConfiguration
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration > Installer`
 - Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration > ExecutionPolicy`
 - Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration > Dependecy`
 - Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration > Compiler`
 - Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration > Build`
 - Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration > UpdateSource`
 - Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration > Project`
2023-08-19 11:33:51 -04:00
352faa0b23
Updated CHANGELOG.md 2023-08-19 08:44:24 -04:00
7138913ef3
- Implemented interface BytecodeObjectInterface into \ncc\Objects > ExecutionPointers
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects > DefinedRemoteSource`
 - Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\Vault > Entry`
 - Corrected code-smell and code style issues in `\ncc\Objects\Vault\Password > AccessToken`
 - Corrected code-smell and code style issues in `\ncc\Objects\Vault\Password > UsernamePassword`
 - Extended `PasswordInterface` with `BytecodeObjectInterface`
 - Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\SymlinkDictionary > SymlinkEntry`
2023-08-19 08:38:13 -04:00
8df38191c6
Fixes 2023-08-19 05:15:06 -04:00
2e11e32611
Updated Makefile 2023-08-19 05:02:22 -04:00
b4ae29d0b3
- Implemented interface BytecodeObjectInterface into \ncc\Objects > Package
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects > Vault`
 - Corrected code-smell and code style issues in `\ncc\Objects > Vault`
 - Implemented interface `BytecodeObjectInterface` into `\ncc\Objects > ProjectConfiguration`
 - Removed unused class `\ncc\Objects > SymlinkDictionary`
2023-08-19 04:48:23 -04:00
57009c115f
- Corrected code-smell and code style issues in \ncc\Objects > Package
- Corrected code-smell and code style issues in `\ncc\Classes\NccExtension > PackageCompiler`
 - Corrected code-smell and code style issues in `\ncc\CLI > PackageManagerMenu`
 - Corrected code-smell and code style issues in `\ncc\Classes\PhpExtension > PhpCompiler`
 - Corrected code-smell and code style issues in `\ncc\Classes\PhpExtension > PhpInstaller`
 - Corrected code-smell and code style issues in `\ncc\Classes\PhpExtension > PhpRunner`
 - Corrected code-smell and code style issues in `\ncc\Objects > ProjectConfiguraiton`
 - Corrected code-smell and code style issues in `\ncc\Managers > ProjectManager`
 - Corrected code-smell and code style issues in `\ncc\Classes\Extensions\PythonExtension > Python2Runner`
 - Corrected code-smell and code style issues in `\ncc\Classes\Extensions\PythonExtension > Python3Runner`
 - Corrected code-smell and code style issues in `\ncc\Classes\Extensions\PythonExtension > PythonRunner`
 - Corrected code-smell and code style issues in `\ncc\Interfaces > RunnerInterface`
2023-08-19 04:39:39 -04:00
0820cd3c32
- Corrected code-smell and code style issues in \ncc\Utilities > IO
- Corrected code-smell and code style issues in `\ncc > ncc`
 - Corrected code-smell and code style issues in `\ncc\CLI > Main`
 - Removed unused exception `FileNotFoundException` in `\ncc\CLI > HelpMenu`
 - Corrected code-smell and code style issues in `\ncc\Managers > ProjectManager`
 - Corrected code-smell and code style issues in `\ncc\Objects\NccVersionInformation > Component`
 - Corrected code-smell and code style issues in `\ncc\Objects\Package > Component`
 - Corrected code-smell and code style issues in `\ncc\Managers > ConfigurationManager`
 - Corrected code-smell and code style issues in `\ncc\Managers > CredentialManager`
 - Refactored `\ncc\Utilities > PathFinder` to remove all Win32 references
 - Corrected code-smell and code style issues in `\ncc\Objects > ExecutionPointers`
 - Corrected code-smell and code style issues in `\ncc\Managers > ExecutionPointerManager`
 - Corrected code-smell and code style issues in `\ncc\Utilities > Functions`
 - Corrected code-smell and code style issues in `\ncc\Managers > PackageManager`
 - Removed `FileNotFoundException` and `DirectoryNotFoundException` from `\ncc\Exceptions`
 - Removed the use of `InvalidScopeException` across the project
 - Removed references of Win32 from the project as Windows is not going supported
 - Added new exception `PathNotFoundException` and implemented it in replacement for `DirectoryNotFoundException` and
   `FileNotFoundException` in `\ncc\Exceptions`
 - Corrected code-smell and code style issues in `src/installer/hash_check.php`
 - Renamed `Abstracts` namespace to `Enums`
 - Updated class type to "final class" in `\ncc\Enums\Options > BuildConfigurationValues`
 - Updated class type to "final class" in `\ncc\Enums\Options > InitializeProjectOptions`
 - Updated class type to "final class" in `\ncc\Enums\Options > InstallPackageOptions`
 - Updated class type to "final class" in `\ncc\Enums\SpecialConstants > AssemblyConstants`
 - Updated class type to "final class" in `\ncc\Enums\SpecialConstants > BuildConstants`
 - Updated class type to "final class" in `\ncc\Enums\SpecialConstants > DateTimeConstants`
 - Updated class type to "final class" in `\ncc\Enums\SpecialConstants > InstallConstants`
 - Updated class type to "final class" in `\ncc\Enums\SpecialConstants > RuntimeConstants`
 - Updated class type to "final class" in `\ncc\Enums > AuthenticationType`
 - Updated class type to "final class" in `\ncc\Enums > CompilerExtensionDefaultVersions`
 - Updated class type to "final class" in `\ncc\Enums > CompilerExtensions`
 - Updated class type to "final class" in `\ncc\Enums > CompilerExtensionSupportedVersions`
 - Updated class type to "final class" in `\ncc\Enums > ComponentDataType`
 - Updated class type to "final class" in `\ncc\Enums > ComponentFileExtensions`
 - Updated class type to "final class" in `\ncc\Enums > ComposerPackageTypes`
 - Updated class type to "final class" in `\ncc\Enums > ComposerStabilityTypes`
 - Updated class type to "final class" in `\ncc\Enums > EncoderType`
 - Updated class type to "final class" in `\ncc\Enums > ExceptionCodes`
 - Updated class type to "final class" in `\ncc\Enums > HttpRequestType`
 - Updated class type to "final class" in `\ncc\Enums > HttpStatusCodes`
 - Updated class type to "final class" in `\ncc\Enums > LogLevel`
 - Updated class type to "final class" in `\ncc\Enums > NccBuildFlags`
 - Updated class type to "final class" in `\ncc\Enums > PackageStandardVersions`
 - Updated class type to "final class" in `\ncc\Enums > PackageStructureVersions`
 - Updated class type to "final class" in `\ncc\Enums > ProjectType`
 - Updated class type to "final class" in `\ncc\Enums > RegexPattern`
 - Updated class type to "final class" in `\ncc\Enums > RemoteSourceType`
 - Updated class type to "final class" in `\ncc\Enums > Runners`
 - Updated class type to "final class" in `\ncc\Enums > Scopes`
 - Updated class type to "final class" in `\ncc\Enums > Versions`
 - Corrected code-smell and code style issues in `\ncc\Classes > NccExtension > ConstantCompiler`
 - Corrected code-smell and code style issues in `\ncc\Classes > GitlabExtension > GitlabService`
 - Corrected code-smell and code style issues in `\ncc\Classes > GithubExtension > GithubService`
2023-08-19 02:42:22 -04:00
983e34f58e
- Corrected code-smell and code style issues in src/installer/hash_check.php 2023-08-18 00:37:08 -04:00
8e44a8c7c9
- Renamed Abstracts namespace to Enums
- Updated class type to "final class" in `\ncc\Enums\Options > BuildConfigurationValues`
 - Updated class type to "final class" in `\ncc\Enums\Options > InitializeProjectOptions`
 - Updated class type to "final class" in `\ncc\Enums\Options > InstallPackageOptions`
 - Updated class type to "final class" in `\ncc\Enums\SpecialConstants > AssemblyConstants`
 - Updated class type to "final class" in `\ncc\Enums\SpecialConstants > BuildConstants`
 - Updated class type to "final class" in `\ncc\Enums\SpecialConstants > DateTimeConstants`
 - Updated class type to "final class" in `\ncc\Enums\SpecialConstants > InstallConstants`
 - Updated class type to "final class" in `\ncc\Enums\SpecialConstants > RuntimeConstants`
 - Updated class type to "final class" in `\ncc\Enums > AuthenticationType`
 - Updated class type to "final class" in `\ncc\Enums > CompilerExtensionDefaultVersions`
 - Updated class type to "final class" in `\ncc\Enums > CompilerExtensions`
 - Updated class type to "final class" in `\ncc\Enums > CompilerExtensionSupportedVersions`
 - Updated class type to "final class" in `\ncc\Enums > ComponentDataType`
 - Updated class type to "final class" in `\ncc\Enums > ComponentFileExtensions`
 - Updated class type to "final class" in `\ncc\Enums > ComposerPackageTypes`
 - Updated class type to "final class" in `\ncc\Enums > ComposerStabilityTypes`
 - Updated class type to "final class" in `\ncc\Enums > EncoderType`
 - Updated class type to "final class" in `\ncc\Enums > ExceptionCodes`
 - Updated class type to "final class" in `\ncc\Enums > HttpRequestType`
 - Updated class type to "final class" in `\ncc\Enums > HttpStatusCodes`
 - Updated class type to "final class" in `\ncc\Enums > LogLevel`
 - Updated class type to "final class" in `\ncc\Enums > NccBuildFlags`
 - Updated class type to "final class" in `\ncc\Enums > PackageStandardVersions`
 - Updated class type to "final class" in `\ncc\Enums > PackageStructureVersions`
 - Updated class type to "final class" in `\ncc\Enums > ProjectType`
 - Updated class type to "final class" in `\ncc\Enums > RegexPattern`
 - Updated class type to "final class" in `\ncc\Enums > RemoteSourceType`
 - Updated class type to "final class" in `\ncc\Enums > Runners`
 - Updated class type to "final class" in `\ncc\Enums > Scopes`
 - Updated class type to "final class" in `\ncc\Enums > Versions`
2023-08-18 00:22:15 -04:00
3afcb731fe
- Corrected code-smell and code style issues in \ncc\Classes > NccExtension > ConstantCompiler 2023-08-17 16:09:42 -04:00
309d37fe7d
- Corrected code-smell and code style issues in \ncc\Classes > GitlabExtension > GitlabService 2023-08-17 15:44:56 -04:00
ae373c6f70
- Corrected code-smell and code style issues in \ncc\Classes > GithubExtension > GithubService 2023-08-17 14:40:49 -04:00
bc1156278e
Bumped version to 1.0.4 2023-08-17 14:35:20 -04:00
4dc1463d26
- Corrected code-smell and code style issues in \ncc\Classes > ComposerExtension > ComposerSourceBuiltin
- `LICENSE.md` & `license.md` are now detected as license files in  `\ncc\Classes\ComposerExtension > ComposerSourceBuiltin > convertProject()`
2023-08-17 14:32:47 -04:00
84e5e5a346
- Corrected code-smell and code style issues in \ncc\Classes > BashExtension > BashRunner 2023-08-17 14:08:22 -04:00
d4709443f7
Corrected code-smell and code style issues in \ncc\Classes > GitClient 2023-08-17 14:05:14 -04:00
393078cd9e
- Corrected code-smell and code style issues in \ncc\Classes > HttpClient
- Fixed MITM attack vector in `\ncc\Classes > HttpClient > prepareCurl()`
2023-08-17 14:02:41 -04:00
839 changed files with 43172 additions and 133630 deletions

136
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,136 @@
name: CI Pipeline
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
release:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring, ctype, common, zip
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y git libpq-dev libzip-dev zip make wget gnupg
- name: Install Phive
run: |
wget -O phive.phar https://phar.io/releases/phive.phar
wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc
gpg --keyserver hkps://keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79
gpg --verify phive.phar.asc phive.phar
chmod +x phive.phar
sudo mv phive.phar /usr/local/bin/phive
- name: Install PHPAB
run: sudo phive install phpab --global --trust-gpg-keys 0x2A8299CE842DD38C
- name: Build project
run: make redist
- name: Find NCC build directory
id: find-ncc-dir
run: echo "NCC_DIR=$(find build/ -type d -name 'ncc_*' | head -n 1)" >> $GITHUB_ENV
- name: Upload NCC build directory
uses: actions/upload-artifact@v3
with:
name: ncc-build
path: ${{ env.NCC_DIR }}
- name: Create redist.zip
run: zip -r redist.zip ${{ env.NCC_DIR }}
- name: Upload redist.zip
uses: actions/upload-artifact@v3
with:
name: redist-zip
path: redist.zip
- name: Build Debian package
run: make deb
- name: Find Debian package
id: find-deb
run: echo "DEB_FILE=$(find build/ -type f -name '*.deb' | head -n 1)" >> $GITHUB_ENV
- name: Upload Debian package
uses: actions/upload-artifact@v3
with:
name: ncc-deb
path: ${{ env.DEB_FILE }}
test-install:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download NCC build directory
uses: actions/download-artifact@v3
with:
name: ncc-build
path: build
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring, ctype, common, zip
- name: Test NCC installation
run: |
ls -l build
sudo php build/INSTALL --auto
upload-release:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'release' && github.event.action == 'created'
permissions: write-all
steps:
- name: Download redist.zip
uses: actions/download-artifact@v3
with:
name: redist-zip
path: .
- name: Download Debian package
uses: actions/download-artifact@v3
with:
name: ncc-deb
path: .
- name: Set DEB_FILE environment variable
run: echo "DEB_FILE=$(find . -type f -name '*.deb' | head -n 1)" >> $GITHUB_ENV
- name: Upload redist.zip to release
uses: softprops/action-gh-release@v1
with:
files: redist.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload ncc.deb to release
uses: softprops/action-gh-release@v1
with:
files: ${{ env.DEB_FILE }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

12
.gitignore vendored
View file

@ -8,13 +8,14 @@
build
# Autoload files
src/ncc/ThirdParty/composer/Semver/autoload_spl.php
src/ncc/ThirdParty/defuse/php-encryption/autoload_spl.php
src/ncc/ThirdParty/jelix/version/autoload_spl.php
src/ncc/ThirdParty/nikic/PhpParser/autoload_spl.php
src/ncc/ThirdParty/php_parallel_lint/php_console_color/autoload_spl.php
src/ncc/ThirdParty/Symfony/polyfill-ctype/autoload_spl.php
src/ncc/ThirdParty/Symfony/polyfill-mbstring/autoload_spl.php
src/ncc/ThirdParty/Symfony/polyfill-uuid/autoload_spl.php
src/ncc/ThirdParty/Symfony/polyfill_ctype/autoload_spl.php
src/ncc/ThirdParty/Symfony/polyfill_mbstring/autoload_spl.php
src/ncc/ThirdParty/Symfony/polyfill_uuid/autoload_spl.php
src/ncc/ThirdParty/Symfony/Process/autoload_spl.php
src/ncc/ThirdParty/Symfony/Uid/autoload_spl.php
src/ncc/ThirdParty/Symfony/Filesystem/autoload_spl.php
@ -27,4 +28,7 @@ src/ncc/autoload.php
# Test files
tests/example_project/project.json
tests/example_project/ncc
tests/example_project/build
tests/example_project/build
/.phpunit.result.cache
/.idea/php-test-framework.xml
/.idea/gbrowser_project.xml

View file

@ -3,9 +3,8 @@ image: php:8.2
stages:
- setup
- build
- build-docker
- docker
- publish
- publish-docker
before_script:
- apt update -yqq
@ -34,40 +33,58 @@ build:
paths:
- build/*.tar.gz
# Build the debian package using the Makefile
build-debian:
stage: build
script:
- wget -O phive.phar https://phar.io/releases/phive.phar
- wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc
- chmod +x phive.phar
- mv phive.phar /usr/local/bin/phive
- phive install phpab --global --trust-gpg-keys 0x2A8299CE842DD38C
- make autoload
- make redist
- make deb
artifacts:
paths:
- build/*.deb
# Build the Alpine Docker image
ncc-docker-build:
docker-alpine:
image: docker:latest
stage: build-docker
stage: docker
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- |
if [[ ! -z "$CI_COMMIT_TAG" ]]; then
DOCKER_TAG="$CI_COMMIT_TAG-alpine"
if [[ "$CI_COMMIT_BRANCH" == "master" ]]; then
DOCKER_TAG="latest"
elif [[ ! -z "$CI_COMMIT_TAG" ]]; then
DOCKER_TAG="$CI_COMMIT_TAG"
else
DOCKER_TAG="$CI_COMMIT_REF_SLUG-alpine"
DOCKER_TAG="$CI_COMMIT_REF_SLUG"
fi
- docker build -f Dockerfile -t $CI_REGISTRY_IMAGE:$DOCKER_TAG .
- docker push $CI_REGISTRY_IMAGE:$DOCKER_TAG
rules:
- if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_BRANCH == 'dev'
exists:
- exists:
- Dockerfile
# Build the Debian Docker image
ncc-docker-build-debian:
docker-debian:
image: docker:latest
stage: build-docker
stage: docker
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- |
if [[ ! -z "$CI_COMMIT_TAG" ]]; then
if [[ "$CI_COMMIT_BRANCH" == "master" ]]; then
DOCKER_TAG="debian"
elif [[ ! -z "$CI_COMMIT_TAG" ]]; then
DOCKER_TAG="$CI_COMMIT_TAG-debian"
else
DOCKER_TAG="$CI_COMMIT_REF_SLUG-debian"
@ -75,33 +92,41 @@ ncc-docker-build-debian:
- docker build -f Dockerfile.debian -t $CI_REGISTRY_IMAGE:$DOCKER_TAG .
- docker push $CI_REGISTRY_IMAGE:$DOCKER_TAG
rules:
- if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_BRANCH == 'dev'
exists:
- exists:
- Dockerfile.debian
# Publish the package
# Publish the tarball and Debian package to the GitLab Package Registry
publish:
stage: publish
script:
- |
if [[ ! -z "$CI_COMMIT_TAG" ]]; then
PACKAGE_NAME=$CI_COMMIT_TAG
FILE_NAME="ncc-$CI_COMMIT_TAG.tar.gz"
FILE_NAME_TAR="ncc-$CI_COMMIT_TAG.tar.gz"
FILE_NAME_DEB="ncc-$CI_COMMIT_TAG.deb"
else
BRANCH_NAME=$(echo $CI_COMMIT_REF_NAME | sed 's/\//-/g')
COMMIT_ID=${CI_COMMIT_SHORT_SHA}
PACKAGE_NAME="$BRANCH_NAME-$COMMIT_ID"
FILE_NAME="ncc-$PACKAGE_NAME.tar.gz"
FILE_NAME_TAR="ncc-$PACKAGE_NAME.tar.gz"
FILE_NAME_DEB="ncc-$PACKAGE_NAME.deb"
fi
mv build/*.tar.gz build/$FILE_NAME
mv build/*.tar.gz build/$FILE_NAME_TAR
mv build/*.deb build/$FILE_NAME_DEB
echo "Package Name: $PACKAGE_NAME"
echo "File Name: $FILE_NAME"
echo "Tarball File Name: $FILE_NAME_TAR"
echo "Debian Package File Name: $FILE_NAME_DEB"
# Upload the tarball
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" \
--upload-file build/$FILE_NAME \
"https://$CI_SERVER_HOST/api/v4/projects/$CI_PROJECT_ID/packages/generic/$PACKAGE_NAME/$CI_PIPELINE_ID/$FILE_NAME"
--upload-file build/$FILE_NAME_TAR \
"https://$CI_SERVER_HOST/api/v4/projects/$CI_PROJECT_ID/packages/generic/$PACKAGE_NAME/$CI_PIPELINE_ID/$FILE_NAME_TAR"
# Upload the Debian package
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" \
--upload-file build/$FILE_NAME_DEB \
"https://$CI_SERVER_HOST/api/v4/projects/$CI_PROJECT_ID/packages/generic/$PACKAGE_NAME/$CI_PIPELINE_ID/$FILE_NAME_DEB"
only:
- branches
- tags
- tags

View file

@ -1,72 +0,0 @@
build:
image: php:8.1
before_script:
# Install some stuff that the image doesn't come with
- apt update -yqq
- apt install git libpq-dev libzip-dev zip make wget gnupg -yqq
# Install phive
- wget -O phive.phar https://phar.io/releases/phive.phar
- wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc
- gpg --keyserver hkps://keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79
- gpg --verify phive.phar.asc phive.phar
- chmod +x phive.phar
- mv phive.phar /usr/local/bin/phive
# install phpab
- phive install phpab --global --trust-gpg-keys 0x2A8299CE842DD38C
script:
- make tar
rules:
- if: $CI_COMMIT_BRANCH
release:
image: php:8.1
before_script:
# Install some stuff that the image doesn't come with
- apt update -yqq
- apt install git libpq-dev libzip-dev zip make wget gnupg -yqq
# Install phive
- wget -O phive.phar https://phar.io/releases/phive.phar
- wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc
- gpg --keyserver hkps://keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79
- gpg --verify phive.phar.asc phive.phar
- chmod +x phive.phar
- mv phive.phar /usr/local/bin/phive
# install phpab
- phive install phpab --global --trust-gpg-keys 0x2A8299CE842DD38C
script:
- make redist
- mkdir ncc_$CI_COMMIT_TAG
- cp -r build/src/* ncc_$CI_COMMIT_TAG/
artifacts:
paths:
- ncc_$CI_COMMIT_TAG/
rules:
- if: $CI_COMMIT_TAG
ncc-docker-build:
image: docker:latest
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag=""
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag=":$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
- docker build --no-cache --pull -t "$CI_REGISTRY_IMAGE${tag}" .
- docker push "$CI_REGISTRY_IMAGE${tag}"
rules:
- if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_BRANCH == 'dev'
exists:
- Dockerfile

1
.idea/.name generated Normal file
View file

@ -0,0 +1 @@
Nosial Code Compiler

View file

@ -5,6 +5,7 @@
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/tests/example_project/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/tests/projects/lib/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/docs" />
<excludeFolder url="file://$MODULE_DIR$/tests/example_project/ncc" />

7
.idea/codeStyles/Project.xml generated Normal file
View file

@ -0,0 +1,7 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<ScalaCodeStyleSettings>
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
</ScalaCodeStyleSettings>
</code_scheme>
</component>

4
.idea/icon.svg generated Executable file
View file

@ -0,0 +1,4 @@
<svg width="160" height="160" viewBox="0 0 160 160" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M80 0C76.001 0 72.002 1.51978 68.7229 4.71944L4.73883 68.7113C-1.57961 74.9506 -1.57961 85.0293 4.73883 91.2685L68.7229 155.261C74.9613 161.58 85.0388 161.58 91.2772 155.261L155.261 91.2685C161.58 85.0293 161.58 74.9506 155.261 68.7113L91.2772 4.71944C87.998 1.51978 83.999 0 80 0Z" fill="#111111"/>
<path d="M55.2178 55C53.9929 55 53 55.949 53 57.1197V80.9658C53 82.1365 53.9929 83.0855 55.2178 83.0855H72.1287V108.622L81 117L89.8713 108.622V83.0855H106.782C108.007 83.0855 109 82.1365 109 80.9658V57.1197C109 55.949 108.007 55 106.782 55H55.2178Z" fill="#EEEEEE"/>
</svg>

After

Width:  |  Height:  |  Size: 683 B

View file

@ -1,6 +1,79 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="ContractViolationInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<Languages>
<language minSize="133" name="PHP" />
</Languages>
</inspection_tool>
<inspection_tool class="ForgottenDebugOutputInspection" enabled="true" level="ERROR" enabled_by_default="true">
<option name="configuration">
<list>
<option value="\Codeception\Util\Debug::debug" />
<option value="\Codeception\Util\Debug::pause" />
<option value="\Doctrine\Common\Util\Debug::dump" />
<option value="\Doctrine\Common\Util\Debug::export" />
<option value="\Illuminate\Support\Debug\Dumper::dump" />
<option value="\Symfony\Component\Debug\Debug::enable" />
<option value="\Symfony\Component\Debug\DebugClassLoader::enable" />
<option value="\Symfony\Component\Debug\ErrorHandler::register" />
<option value="\Symfony\Component\Debug\ExceptionHandler::register" />
<option value="\TYPO3\CMS\Core\Utility\DebugUtility::debug" />
<option value="\Zend\Debug\Debug::dump" />
<option value="\Zend\Di\Display\Console::export" />
<option value="dd" />
<option value="debug_print_backtrace" />
<option value="debug_zval_dump" />
<option value="dpm" />
<option value="dpq" />
<option value="dsm" />
<option value="dump" />
<option value="dvm" />
<option value="error_log" />
<option value="kpr" />
<option value="phpinfo" />
<option value="print_r" />
<option value="var_dump" />
<option value="var_export" />
<option value="wp_die" />
<option value="xdebug_break" />
<option value="xdebug_call_class" />
<option value="xdebug_call_file" />
<option value="xdebug_call_function" />
<option value="xdebug_call_line" />
<option value="xdebug_code_coverage_started" />
<option value="xdebug_debug_zval" />
<option value="xdebug_debug_zval_stdout" />
<option value="xdebug_dump_superglobals" />
<option value="xdebug_enable" />
<option value="xdebug_get_code_coverage" />
<option value="xdebug_get_collected_errors" />
<option value="xdebug_get_declared_vars" />
<option value="xdebug_get_function_stack" />
<option value="xdebug_get_headers" />
<option value="xdebug_get_monitored_functions" />
<option value="xdebug_get_profiler_filename" />
<option value="xdebug_get_stack_depth" />
<option value="xdebug_get_tracefile_name" />
<option value="xdebug_is_enabled" />
<option value="xdebug_memory_usage" />
<option value="xdebug_peak_memory_usage" />
<option value="xdebug_print_function_stack" />
<option value="xdebug_start_code_coverage" />
<option value="xdebug_start_error_collection" />
<option value="xdebug_start_function_monitor" />
<option value="xdebug_start_trace" />
<option value="xdebug_stop_code_coverage" />
<option value="xdebug_stop_error_collection" />
<option value="xdebug_stop_function_monitor" />
<option value="xdebug_stop_trace" />
<option value="xdebug_time_index" />
<option value="xdebug_var_dump" />
</list>
</option>
<option name="migratedIntoUserSpace" value="true" />
</inspection_tool>
<inspection_tool class="IncorrectHttpHeaderInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="customHeaders">
<set>
@ -25,5 +98,61 @@
</set>
</option>
</inspection_tool>
<inspection_tool class="SecurityAdvisoriesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="optionConfiguration">
<list>
<option value="barryvdh/laravel-debugbar" />
<option value="behat/behat" />
<option value="brianium/paratest" />
<option value="codeception/codeception" />
<option value="codedungeon/phpunit-result-printer" />
<option value="composer/composer" />
<option value="doctrine/coding-standard" />
<option value="filp/whoops" />
<option value="friendsofphp/php-cs-fixer" />
<option value="humbug/humbug" />
<option value="infection/infection" />
<option value="jakub-onderka/php-parallel-lint" />
<option value="johnkary/phpunit-speedtrap" />
<option value="kalessil/production-dependencies-guard" />
<option value="mikey179/vfsStream" />
<option value="mockery/mockery" />
<option value="mybuilder/phpunit-accelerator" />
<option value="orchestra/testbench" />
<option value="pdepend/pdepend" />
<option value="phan/phan" />
<option value="phing/phing" />
<option value="phpcompatibility/php-compatibility" />
<option value="phpmd/phpmd" />
<option value="phpro/grumphp" />
<option value="phpspec/phpspec" />
<option value="phpspec/prophecy" />
<option value="phpstan/phpstan" />
<option value="phpunit/phpunit" />
<option value="povils/phpmnd" />
<option value="roave/security-advisories" />
<option value="satooshi/php-coveralls" />
<option value="sebastian/phpcpd" />
<option value="slevomat/coding-standard" />
<option value="spatie/phpunit-watcher" />
<option value="squizlabs/php_codesniffer" />
<option value="sstalle/php7cc" />
<option value="symfony/debug" />
<option value="symfony/maker-bundle" />
<option value="symfony/phpunit-bridge" />
<option value="symfony/var-dumper" />
<option value="vimeo/psalm" />
<option value="wimg/php-compatibility" />
<option value="wp-coding-standards/wpcs" />
<option value="yiisoft/yii2-coding-standards" />
<option value="yiisoft/yii2-debug" />
<option value="yiisoft/yii2-gii" />
<option value="zendframework/zend-coding-standard" />
<option value="zendframework/zend-debug" />
<option value="zendframework/zend-test" />
</list>
</option>
</inspection_tool>
<inspection_tool class="UnknownInspectionInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
</profile>
</component>

2
.idea/modules.xml generated
View file

@ -2,7 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/ncc.iml" filepath="$PROJECT_DIR$/.idea/ncc.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/Nosial Code Compiler.iml" filepath="$PROJECT_DIR$/.idea/Nosial Code Compiler.iml" />
</modules>
</component>
</project>

20
.idea/php-inspections-ea-ultimate.xml generated Normal file
View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EAUltimateProjectSettings">
<categories>
<STRICTNESS_CATEGORY_SECURITY enabled="yes" />
<STRICTNESS_CATEGORY_PROBABLE_BUGS enabled="yes" />
<STRICTNESS_CATEGORY_PERFORMANCE enabled="yes" />
<STRICTNESS_CATEGORY_ARCHITECTURE enabled="yes" />
<STRICTNESS_CATEGORY_CONTROL_FLOW enabled="yes" />
<STRICTNESS_CATEGORY_LANGUAGE_LEVEL_MIGRATION enabled="yes" />
<STRICTNESS_CATEGORY_CODE_STYLE enabled="yes" />
<STRICTNESS_CATEGORY_UNUSED enabled="yes" />
<STRICTNESS_CATEGORY_PHPUNIT enabled="yes" />
</categories>
<settings>
<ANALYZE_ONLY_MODIFIED_FILES value="no" />
<PREFER_YODA_COMPARISON_STYLE value="no" />
</settings>
</component>
</project>

12
.idea/php.xml generated
View file

@ -14,12 +14,22 @@
<path value="/usr/share/php" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="8.2">
<component name="PhpProjectSharedConfiguration" php_language_level="8.3">
<option name="suggestChangeDefaultLanguageLevel" value="false" />
</component>
<component name="PhpRuntimeConfiguration">
<extensions>
<extension name="msgpack" enabled="true" />
</extensions>
</component>
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PhpUnit">
<phpunit_settings>
<PhpUnitSettings load_method="PHPUNIT_PHAR" custom_loader_path="" phpunit_phar_path="$USER_HOME$/phpunit.phar" />
</phpunit_settings>
</component>
<component name="PsalmOptionsConfiguration">
<option name="transferred" value="true" />
</component>

View file

@ -1,10 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build Tarball" type="MAKEFILE_TARGET_RUN_CONFIGURATION" factoryName="Makefile">
<makefile filename="$PROJECT_DIR$/Makefile" target="tar" workingDirectory="" arguments="">
<envs />
</makefile>
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Clean" run_configuration_type="MAKEFILE_TARGET_RUN_CONFIGURATION" />
</method>
</configuration>
</component>

View file

@ -1,8 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Clean" type="MAKEFILE_TARGET_RUN_CONFIGURATION" factoryName="Makefile" activateToolWindowBeforeRun="false">
<makefile filename="$PROJECT_DIR$/Makefile" target="clean" workingDirectory="" arguments="">
<envs />
</makefile>
<method v="2" />
</configuration>
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="NCC Source files" pattern="file[ncc]:src/ncc/Managers//*||file[ncc]:src/ncc/Abstracts//*||file[ncc]:src/ncc/Exceptions//*||file[ncc]:src/ncc/Runtime//*||file[ncc]:src/ncc/Extensions//*||file[ncc]:src/ncc/CLI//*||file[ncc]:src/ncc/Classes//*||file[ncc]:src/ncc/Objects//*||file[ncc]:src/ncc/Interfaces//*||file[ncc]:src/ncc/Utilities//*||file:src/ncc/ncc.php||file:src/ncc/ncc||file:src/ncc/banner_basic||file:src/ncc/autoload_spl.php||file:src/ncc/autoload.php||file:src/ncc/Runtime.php" />
<scope name="NCC Source files" pattern="file[Nosial Code Compiler]:src/ncc/Managers//*||file[Nosial Code Compiler]:src/ncc/Enums//*||file[Nosial Code Compiler]:src/ncc/Exceptions//*||file[Nosial Code Compiler]:src/ncc/Runtime//*||file[Nosial Code Compiler]:src/ncc/Extensions//*||file[Nosial Code Compiler]:src/ncc/CLI//*||file[Nosial Code Compiler]:src/ncc/Classes//*||file[Nosial Code Compiler]:src/ncc/Objects//*||file[Nosial Code Compiler]:src/ncc/Interfaces//*||file[Nosial Code Compiler]:src/ncc/Utilities//*||file:src/ncc/ncc.php||file:src/ncc/ncc||file:src/ncc/banner_basic||file:src/ncc/autoload_spl.php||file:src/ncc/autoload.php||file:src/ncc/Runtime.php" />
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="Symfony\Filesystem" pattern="file[ncc]:src/ncc/ThirdParty/Symfony/Filesystem//*" />
<scope name="Symfony\Filesystem" pattern="file[Nosial Code Compiler]:src/ncc/ThirdParty/Symfony/Filesystem//*" />
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="Symfony\Process" pattern="file[ncc]:src/ncc/ThirdParty/Symfony/Process//*" />
<scope name="Symfony\Process" pattern="file[Nosial Code Compiler]:src/ncc/ThirdParty/Symfony/Process//*" />
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="Symfony\Uid" pattern="file[ncc]:src/ncc/ThirdParty/Symfony/Uid//*" />
<scope name="Symfony\Uid" pattern="file[Nosial Code Compiler]:src/ncc/ThirdParty/Symfony/Uid//*" />
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="Symfony\Yaml" pattern="file[ncc]:src/ncc/ThirdParty/Symfony/Yaml//*" />
<scope name="Symfony\Yaml" pattern="file[Nosial Code Compiler]:src/ncc/ThirdParty/Symfony/Yaml//*" />
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="Symfony\polyfill-ctype" pattern="file[ncc]:src/ncc/ThirdParty/Symfony/polyfill-ctype//*" />
<scope name="Symfony\polyfill-ctype" pattern="file[Nosial Code Compiler]:src/ncc/ThirdParty/Symfony/polyfill_ctype//*" />
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="Symfony\polyfill-mbstring" pattern="file[ncc]:src/ncc/ThirdParty/Symfony/polyfill-mbstring//*" />
<scope name="Symfony\polyfill-mbstring" pattern="file[Nosial Code Compiler]:src/ncc/ThirdParty/Symfony/polyfill_mbstring//*" />
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="Symfony\polyfill-uuid" pattern="file[ncc]:src/ncc/ThirdParty/Symfony/polyfill-uuid//*" />
<scope name="Symfony\polyfill-uuid" pattern="file[Nosial Code Compiler]:src/ncc/ThirdParty/Symfony/polyfill_uuid//*" />
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="Third Party Source Files" pattern="file[ncc]:src/ncc/ThirdParty//*" />
<scope name="Third Party Source Files" pattern="file[Nosial Code Compiler]:src/ncc/ThirdParty//*" />
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="defuse" pattern="file[ncc]:src/ncc/ThirdParty/defuse//*" />
<scope name="defuse" pattern="file[Nosial Code Compiler]:src/ncc/ThirdParty/defuse//*" />
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="defuse\php-encryption" pattern="file[ncc]:src/ncc/ThirdParty/defuse/php-encryption//*" />
<scope name="defuse\php-encryption" pattern="file[Nosial Code Compiler]:src/ncc/ThirdParty/defuse/php-encryption//*" />
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="jelix" pattern="file[ncc]:src/ncc/ThirdParty/jelix//*" />
<scope name="jelix" pattern="file[Nosial Code Compiler]:src/ncc/ThirdParty/jelix//*" />
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="jelix\version" pattern="file[ncc]:src/ncc/ThirdParty/jelix/version//*" />
<scope name="jelix\version" pattern="file[Nosial Code Compiler]:src/ncc/ThirdParty/jelix/version//*" />
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="nikic" pattern="file[ncc]:src/ncc/ThirdParty/nikic//*" />
<scope name="nikic" pattern="file[Nosial Code Compiler]:src/ncc/ThirdParty/nikic//*" />
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="nikic\PhpParser" pattern="file[ncc]:src/ncc/ThirdParty/nikic/PhpParser//*" />
<scope name="nikic\PhpParser" pattern="file[Nosial Code Compiler]:src/ncc/ThirdParty/nikic/PhpParser//*" />
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="theseer" pattern="file[ncc]:src/ncc/ThirdParty/theseer//*" />
<scope name="theseer" pattern="file[Nosial Code Compiler]:src/ncc/ThirdParty/theseer//*" />
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="theseer\Autoload" pattern="file[ncc]:src/ncc/ThirdParty/theseer/Autoload//*" />
<scope name="theseer\Autoload" pattern="file[Nosial Code Compiler]:src/ncc/ThirdParty/theseer/Autoload//*" />
</component>

View file

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="theseer\DirectoryScanner" pattern="file[ncc]:src/ncc/ThirdParty/theseer/DirectoryScanner//*" />
<scope name="theseer\DirectoryScanner" pattern="file[Nosial Code Compiler]:src/ncc/ThirdParty/theseer/DirectoryScanner//*" />
</component>

View file

@ -7,6 +7,7 @@
<resourceRoots>
<path value="file://$PROJECT_DIR$/templates" />
<path value="file://$PROJECT_DIR$/assets" />
<path value="file://$PROJECT_DIR$/scratch" />
</resourceRoots>
</entryData>
</entry>

View file

@ -5,6 +5,566 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.1.6] - 2024-10-29
This update introduces critical bug fixes
### Fixed
- Validate package instance before checking execution policy
## [2.1.5] - 2024-10-14
This update introduces a critical bug fix
## [2.1.4] - 2024-10-13
This update introduces minor bug fixes & improvements
### Added
- Added new constant `%DEFAULT_BUILD_CONFIGURATION%` which points to the project's default build configuration
- Added new dynamic constant `%BUILD_OUTPUT_PATH%` which can be used as `%BUILD_OUTPUT_PATH%:release` to show the
output path of a specific build configuration
- Refactor CI templates to support dynamic build targets
- Added template `phpexe` & `phpgz` for generating executable binaries and compressed executables for the project
### Changed
- Refactor phpmake template to support dynamic build targets
### Fixed
- ncc will now correctly handle package execution where the main unit is not defined in the package instead of
throwing an exception.
- Executable Compiler will now correctly create a directory if it does not exist when compiling a package using gcc
## [2.1.3] - 2024-09-27
This update introduces bug fixes
### Fixed
- Null-pointer fix
## [2.1.2] - 2024-09-27
This update introduces bug fixes
### Added
- Add getter methods for installation lifecycle steps
- Added pre-install & post-install execution unit handling
### Changed
- Updated DocStrings in PackageManager
### Fixed
- Fixed incorrect enum usage in RepositoryMenu
## [2.1.1] - 2024-09-24
This update introduces a couple of new features and quality of life improvements
### Added
- Added new PHP template `phpunit` for generating PhpUnit tests for the project
- Added new PHP template `phpmake` for generating a Makefile for the project
- Added new PHP template `phplib_full` That combines `phplib`, `phpmake` and `phpunit` templates
- Added new PHP template `phpcli_full` That combines `phpcli`, `phplib`, `phpmake` and `phpunit` templates
- Added new PHP template `phpci_github` that generates a Github CI workflow for the project
### Changed
- The template `phpcli` no longer includes a Makefile, instead use `phpmake` to generate a Makefile for the project
### Fixed
- Fixed incorrect enum usage with a logging method call.
## [2.1.0] - 2024-09-20
This update introduces a refactored code-base, code quality improvements, and better exception handling.
### Added
- Added Test unit tests/ncc/Objects/Package/ComponentTest.php
- Added Test unit tests/ncc/Utilities/ResolverTest.php
- Added Test unit tests/ncc/Utilities/SecurityTest.php
- Added Test unit tests/ncc/Utilities/ValidateTest.php
- Add support for runtime constants
### Changed
- Convert Versions constants to enum cases
- Update Scopes to enum and adjust scope checks
- Convert Runners class to enum with string cases
- Convert RegexPatterns constants to enum cases
- Convert ProjectTemplates constants to enum cases
- Convert PackageStructureVersions constants to enum cases
- Convert PackageStructure constants to enum cases
- Convert PackageDirectory constants to enum cases
- Convert LogLevel constants to enum cases
- Convert FileDescriptor constants to enum cases
- Convert ExceptionCodes constants to enum cases
- Convert ConsoleColors constants to enum cases
- Convert CompilerExtensions constants to enum cases
- Convert RepositoryType constants to enum cases
- Convert RepositoryResultType constants to enum cases
- Convert ProjectType constants to enum cases
- Convert HttpRequestType constants to enum cases
- Convert ComposerStabilityTypes constants to enum cases
- Convert ComposerPackageTypes constants to enum cases
- Convert ComponentDataType constants to enum cases
- Convert BuildOutputType constants to enum cases
- Convert AuthenticationType constants to enum cases
- Convert RuntimeConstants constants to enum cases
- Convert InstallConstants constants to enum cases
- Convert DateTimeConstants constants to enum cases
- Convert BuildConstants constants to enum cases
- Convert AssemblyConstants constants to enum cases
- Convert ProjectOptions constants to enum cases
- Convert InstallPackageOptions constants to enum cases
- Convert InitializeProjectOptions constants to enum cases
- Convert ComponentDecodeOptions constants to enum cases
- Convert BuildConfigurationValues constants to enum cases
- Convert BuildConfigurationOptions constants to enum cases
- Convert CompressionOptions constants to enum cases
- Convert PackageFlags constants to enum cases
- Convert NccBuildFlags constants to enum cases
- Convert ComponentFlags constants to enum cases
- Refactor flag handling to use PackageFlags enum directly
- Refactor checkLogLevel to correctly utilize LogLevel cases
- Refactor code to improve readability in Resolver.php
- Update PHP include paths in project configuration
- Refactor logging level checks to use LogLevel enum directly
- Refactor log level parsing with enum method
- Refactor log level checking to enum method
- Updated Symfony/Filesystem from version 6.3.1 to 7.1.2
- Refactor ProjectType handling
- Validate and enforce repository type enum usage
- Updated Composer/Semver to 3.4.3
- Rename 'semver' directory to 'Semver' in composer package
- Refactor project constants handling in NccCompiler
- Updated Symfony/Yaml to version 7.1.4
- Updated Symfony/Uid to version 7.1.4
- Updated Symfony/Process to version 7.1.3
- Updated Symfony/polyfill-ctype to version 1.31.0
- Updated Symfony/polyfill-mbstring to version 1.31.0
- Updated Symfony/polyfill-uuid to version 1.31.0
- Updated nikic/PhpParser to version 5.2.0
### Fixed
- Fixed Division by zero in PackageManager
- Fixed runner argument passing for ExecCommand
### Removed
- Removed EncoderType enum file, unused.
- Removed PackageStandardVersions.php
- Removed ConstantReferences.php
- Removed HttpStatusCodes.php
- Removed CompilerExtensionDefaultVersions.php
- Removed RemoteSourceType
- Removed DependencySourceType
- Removed BuiltinRemoteSourceType
- Removed RuntimeImportOptions
- Remove ComponentFileExtensions enum
- Remove unused import and redundant scope validation method
## [2.0.3] - 2023-10-17
This update includes enhanced support for PHP statements in AST traversal, a friendly CLI Progress Bar, and fixes
related to package version searching, ncc's extension registration, and error handling in PackageManagerMenu.
The changes improve the system's efficiency, error resilience, and user experience.
### Added
- 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.
- Added new `ConsoleProgressBar` class for UI improvement, imrpoved the CLI Progress Bar inspired by
[pacman](https://wiki.archlinux.org/title/pacman)
### Fixed
- When finding package versions in the package lock, ncc will try to find a satisfying version rather than the exact
version, this is to prevent[CHANGELOG.md](CHANGELOG.md) errors when the package lock contains a version that is not available in the repository.
- 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.
- Add error handling for unspecified package in PackageManagerMenu
## [2.0.2] - 2023-10-13
In this new update, the software introduces a feature for importing static packages without extra dependencies and
supports pulling static versions of packages from repositories. Changes include enhanced security through an updated
fetchPackage method along with improvements in dependency imports and extension registration logic for Debian packages.
Finally, bugs related to unnecessary bundling of some build artifacts and mime type errors in ncc-package.xml have
been fixed.
### Added
- Added support for importing static packages from the system, allowing you to install static packages onto your
system and import them without importing additional dependencies that isn't already included in the package.
- Added the ability to pull static versions of packages from repositories where package names ending with `-static.ncc`
or `_static.ncc` can be pulled if you use the `--prefer-static` or `--static` option when using the `package install`
command. Otherwise, the normal package will be installed, avoiding static versions.
### Changed
- Updated fetchPackage method to include authentication
- Update dependencies import in \ncc\Classes > Runtime > importFromPackage()
- Refactor ncc extension registration logic, this also allows for debian packages to install the ncc extension
automatically.
### Fixed
- Fixed issue where some build artifacts are being bundled with package builds such as `output_path` and `static`
where they should not be included in the package.
- Corrected mistakes in `ncc-package.xml` mime type
## [2.0.1] - 2023-10-11
Added a new feature in `ProjectManager.php` that allows automatic installation of a project's dependencies. The
`installDependencies` function eases the task of separately installing each dependency. Now, both public and private
dependencies can be installed collectively using the 'install' command added in `ProjectMenu.php`. This functionality
is further documented in `DOCUMENTATION.md`
### Added
- Add functionality to install project dependencies with the new `project install` command in `ProjectMenu.php`
### Fixed
- Correct exception message for configuration property in `\ncc\Objects\ProjectConfiguration\Build > BuildConfiguration > fromArray()`
## [2.0.0] - 2023-10-10
This update introduces major changes in the codebase, including the removal of Win32 support, and the addition of new
features. This is the Mk II of ncc, and it is a major update, so please read the changelog carefully.
### Known issues
- `require` and `include` statements are not supported; when running a program directly, this feature will be added in
a future update. Using these statements will result in files not being found.
### Added
- `LICENSE.md` & `license.md` are now detected as license files in `\ncc\Classes\ComposerExtension > ComposerSourceBuiltin > convertProject()`
- Added new exception `PathNotFoundException` and implemented it in replacement for `DirectoryNotFoundException` and
`FileNotFoundException` in `\ncc\Exceptions`
- Added a new interface class `BytecodeObjectInterface` which will be used to implement object types for compiled assets
- Added new exception `GitException` in `\ncc\Exceptions` to replace all git related exceptions
- Added new exception `PackageException` in `\ncc\Exceptions` to replace all package related exceptions
- Added new exception `OperationException` in `\ncc\Exceptions` to replace all generic related exceptions
- Added a new interface class `SerializableObjectInterface` to implement serializable objects, `BytecodeObjectInterface`
extends this interface to allow for serialization of compiled assets
- Added a new interface class `ValidatableObjectInterface` to implement validatable objects, this method will throw a
`ConfigurationException` if the object is not valid or a `NotSupportedException` if the object contains methods that
are not supported by the current version of ncc or project.
- Added a new interface class `TemplateInterface` to implement template classes
- Added new template PhpCliTemplate `phpcli`
- Added new template PhpLibraryTemplate `phplib`
- Added the ability to clean arrays in `\ncc\Utilities > Functions > cleanArray()`
- Added the ability to compile executable binaries for php using `gcc`
- Added support for Gitea repositories
- Added support for Packagist repositories
- Added a new default gitea repository `nocturn9x` git.nocturn9x.space
- Added a new default gitea repository `martinvlba` git.martinvlba.eu
- Added a new default gitea repository `kuny` git.it-kuny.ch
- Added dependency `composer/semver` version 3.4.0 for composer version comparison compatibility
- Added new class `\ncc\Classes > ArchiveExtractor` to extract multiple archive types
### Fixed
- Fixed MITM attack vector in `\ncc\Classes > HttpClient > prepareCurl()`
- Fixed all @throw tags in the project to use the correct exception class
- Fixed hash comparisons to use `hash_equals` implementations to combat against Timing Attacks
### Changed
- Corrected code-smell and code style issues in `\ncc\Classes > HttpClient`
- Corrected code-smell and code style issues in `\ncc\Classes > BashExtension > BashRunner`
- Corrected code-smell and code style issues in `\ncc\Classes > ComposerExtension > ComposerSourceBuiltin`
- Corrected code-smell and code style issues in `\ncc\Classes > GithubExtension > GithubService`
- Corrected code-smell and code style issues in `\ncc\Classes > GitlabExtension > GitlabService`
- Corrected code-smell and code style issues in `\ncc\Classes > NccExtension > ConstantCompiler`
- Renamed `Abstracts` namespace to `Enums`
- Updated class type to "final class" in `\ncc\Enums\Options > BuildConfigurationValues`
- Updated class type to "final class" in `\ncc\Enums\Options > InitializeProjectOptions`
- Updated class type to "final class" in `\ncc\Enums\Options > InstallPackageOptions`
- Updated class type to "final class" in `\ncc\Enums\SpecialConstants > AssemblyConstants`
- Updated class type to "final class" in `\ncc\Enums\SpecialConstants > BuildConstants`
- Updated class type to "final class" in `\ncc\Enums\SpecialConstants > DateTimeConstants`
- Updated class type to "final class" in `\ncc\Enums\SpecialConstants > InstallConstants`
- Updated class type to "final class" in `\ncc\Enums\SpecialConstants > RuntimeConstants`
- Updated class type to "final class" in `\ncc\Enums > AuthenticationType`
- Updated class type to "final class" in `\ncc\Enums > CompilerExtensionDefaultVersions`
- Updated class type to "final class" in `\ncc\Enums > CompilerExtensions`
- Updated class type to "final class" in `\ncc\Enums > CompilerExtensionSupportedVersions`
- Updated class type to "final class" in `\ncc\Enums > ComponentDataType`
- Updated class type to "final class" in `\ncc\Enums > ComponentFileExtensions`
- Updated class type to "final class" in `\ncc\Enums > ComposerPackageTypes`
- Updated class type to "final class" in `\ncc\Enums > ComposerStabilityTypes`
- Updated class type to "final class" in `\ncc\Enums > EncoderType`
- Updated class type to "final class" in `\ncc\Enums > ExceptionCodes`
- Updated class type to "final class" in `\ncc\Enums > HttpRequestType`
- Updated class type to "final class" in `\ncc\Enums > HttpStatusCodes`
- Updated class type to "final class" in `\ncc\Enums > LogLevel`
- Updated class type to "final class" in `\ncc\Enums > NccBuildFlags`
- Updated class type to "final class" in `\ncc\Enums > PackageStandardVersions`
- Updated class type to "final class" in `\ncc\Enums > PackageStructureVersions`
- Updated class type to "final class" in `\ncc\Enums > ProjectType`
- Updated class type to "final class" in `\ncc\Enums > RegexPattern`
- Updated class type to "final class" in `\ncc\Enums > RemoteSourceType`
- Updated class type to "final class" in `\ncc\Enums > Runners`
- Updated class type to "final class" in `\ncc\Enums > Scopes`
- Updated class type to "final class" in `\ncc\Enums > Versions`
- Corrected code-smell and code style issues in `src/installer/hash_check.php`
- Corrected code-smell and code style issues in `\ncc\Managers > ProjectManager`
- Corrected code-smell and code style issues in `\ncc\Objects\NccVersionInformation > Component`
- Corrected code-smell and code style issues in `\ncc\Objects\Package > Component`
- Corrected code-smell and code style issues in `\ncc\Managers > ConfigurationManager`
- Corrected code-smell and code style issues in `\ncc\Managers > CredentialManager`
- Refactored `\ncc\Utilities > PathFinder` to remove all Win32 references
- Corrected code-smell and code style issues in `\ncc\Objects > ExecutionPointers`
- Corrected code-smell and code style issues in `\ncc\Managers > ExecutionPointerManager`
- Corrected code-smell and code style issues in `\ncc\Utilities > Functions`
- Corrected code-smell and code style issues in `\ncc\Managers > PackageManager`
- Corrected code-smell and code style issues in `\ncc\Utilities > IO`
- Corrected code-smell and code style issues in `\ncc > ncc`
- Corrected code-smell and code style issues in `\ncc\CLI > Main`
- Corrected code-smell and code style issues in `\ncc\Objects > Package`
- Corrected code-smell and code style issues in `\ncc\Classes\NccExtension > PackageCompiler`
- Corrected code-smell and code style issues in `\ncc\CLI > PackageManagerMenu`
- Corrected code-smell and code style issues in `\ncc\Classes\PhpExtension > PhpCompiler`
- Corrected code-smell and code style issues in `\ncc\Classes\PhpExtension > PhpInstaller`
- Corrected code-smell and code style issues in `\ncc\Classes\PhpExtension > PhpRunner`
- Corrected code-smell and code style issues in `\ncc\Objects > ProjectConfiguraiton`
- Corrected code-smell and code style issues in `\ncc\Managers > ProjectManager`
- Corrected code-smell and code style issues in `\ncc\Classes\Extensions\PythonExtension > Python2Runner`
- Corrected code-smell and code style issues in `\ncc\Classes\Extensions\PythonExtension > Python3Runner`
- Corrected code-smell and code style issues in `\ncc\Classes\Extensions\PythonExtension > PythonRunner`
- Corrected code-smell and code style issues in `\ncc\Interfaces > RunnerInterface`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects > Package`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects > Vault`
- Corrected code-smell and code style issues in `\ncc\Objects > Vault`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects > ProjectConfiguration`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects > ExecutionPointers`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects > DefinedRemoteSource`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\Vault > Entry`
- Corrected code-smell and code style issues in `\ncc\Objects\Vault\Password > AccessToken`
- Corrected code-smell and code style issues in `\ncc\Objects\Vault\Password > UsernamePassword`
- Extended `PasswordInterface` with `BytecodeObjectInterface`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\SymlinkDictionary > SymlinkEntry`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration > UpdateSource`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration > Project`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration > Installer`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration > ExecutionPolicy`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration > Dependecy`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration > Compiler`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration > Build`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration > Assembly`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration\UpdateSource > Repository`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration\ExecutionPolicy > Execute`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration\ExecutionPolicy > ExitHandle`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration\ExecutionPolicy > ExitHandlers`
- Implemented interface `BytecodeObjectInterface` into `\ncc\Objects\ProjectConfiguration\Build > BuildConfiguration`
- Updated `\ncc\Classes > GitClient > cloneRepository()` to throw `GitException` instead of `GitCloneException`
- Updated `\ncc\Classes > GitClient > checkout()` to throw `GitException` instead of `GitCheckoutException`
- Corrected code-smell and code style issues in `\ncc\Objects > PackageLock`
- Corrected code-smell and code style issues in `\ncc\Classes\PhpExtension > PhpRuntime`
- Updated class `\ncc\Objects\ProjectConfiguration > Dependency` to use method calls rather than direct property access
- Updated class `\ncc\Objects\ProjectConfiguration\Build > BuildConfiguration` to use method calls rather than direct
property access
- Updated class `\ncc\Objects\ProjectConfiguration\ExecutionPolicy > Execute` to use method calls rather than direct
property access
- Changed all uppercase occurrences of `NCC` to `ncc` in the entire project
- Corrected code-smell and code style issues in `\ncc\Utilities > Base64`
- Corrected code-smell and code style issues in `\ncc\Utilities > Console`
- Updated class `\ncc\Objects\ProjectConfiguration\ExecutionPolicy > ExitHandle` to use method calls rather than direct
property access
- Updated class `\ncc\Objects\ProjectConfiguration\ExecutionPolicy > ExitHandlers` to use method calls rather than
direct property access
- Updated class `\ncc\Objects\ProjectConfiguration\UpdateSource > Repository` to use method calls rather than direct
property access
- Updated class `\ncc\Objects\ProjectConfiguration > Assembly` to use method calls rather than direct property access
- Updated class `\ncc\Objects\ProjectConfiguration > Build` to use method calls rather than direct property access
- Updated class `\ncc\Objects\ProjectConfiguration > Compiler` to use method calls rather than direct property access
- Updated class `\ncc\Objects\ProjectConfiguration > ExecutionPolicy` to use method calls rather than direct property access
- Updated class `\ncc\Objects\ProjectConfiguration > Installer` to use method calls rather than direct property access
- Updated class `\ncc\Objects\ProjectConfiguration > Project` to use method calls rather than direct property access
- Updated class `\ncc\Objects\ProjectConfiguration > UpdateSource` to use method calls rather than direct property access
- Updated class `\ncc\Objects\ComposerJson > Author` to use method calls rather than direct property access and
implemented `SerializableObjectInterface`
- Updated class `\ncc\Objects\ComposerJson > Autoloader` to use method calls rather than direct property access and
implemented `SerializableObjectInterface`
- Updated class `\ncc\Objects\ComposerJson > Funding` to use method calls rather than direct property access and
implemented `SerializableObjectInterface`
- Updated class `\ncc\Objects\ComposerJson > NamespacePointer` to use method calls rather than direct property access
and implemented `SerializableObjectInterface`
- Updated class `\ncc\Objects\ComposerJson > PackageLink` to use method calls rather than direct property access and
implemented `SerializableObjectInterface`
- Updated class `\ncc\Objects\ComposerJson > Suggestion` to use method calls rather than direct property access and
implemented `SerializableObjectInterface`
- Updated class `\ncc\Objects\ComposerJson > Support` to use method calls rather than direct property access and
implemented `SerializableObjectInterface`
- Updated class `\ncc\Objects\ExecutionPointers > ExecutionPointer` to use method calls rather than direct property
access and implemented `BytecodeObjectInterface`
- Updated class `\ncc\Objects\NccVersionInformation > Component` to use method calls rather than direct property access
and implemented `SerializableObjectInterface`
- Updated class `\ncc\Objects\Package > Component` to use method calls rather than direct property access and
implemented `BytecodeObjectInterface`
- Updated class `\ncc\Objects\Package > ExecutionUnit` to use method calls rather than direct property access and
implemented `BytecodeObjectInterface`
- Updated class `\ncc\Objects\Package > Header` to use method calls rather than direct property access and implemented
`BytecodeObjectInterface`
- Updated class `\ncc\Objects\Package > Installer` to use method calls rather than direct property access and implemented
`BytecodeObjectInterface`
- Updated class `\ncc\Objects\Package > MagicBytes` to use method calls rather than direct property access and implemented
`SerializableObjectInterface`
- Updated class `\ncc\Objects\Package > Resource` to use method calls rather than direct property access and implemented
`BytecodeObjectInterface`
- Updated class `\ncc\Objects\PackageLock > DependencyEntry` to use method calls rather than direct property access
and implemented `BytecodeObjectInterface`
- Updated class `\ncc\Objects\PackageLock > PackageEntry` to use method calls rather than direct property access
and implemented `BytecodeObjectInterface`
- Updated class `\ncc\Objects\PackageLock > VersionEntry` to use method calls rather than direct property access
and implemented `BytecodeObjectInterface`
- Updated class `\ncc\Objects\SymlinkDictionary > SymlinkEntry` to use method calls rather than direct property access
- Updated class `\ncc\Objects\Vault\Password > AccessToken` to use method calls rather than direct property access
- Updated class `\ncc\Objects > CliHelpSection` to use method calls rather than direct property access
- Updated class `\ncc\Objects > ComposerJson` to use method calls rather than direct property access
- Updated class `\ncc\Objects > ComposerLock` to use method calls rather than direct property access
- Updated class `\ncc\Objects > DefinedRemoteSource` to use method calls rather than direct property access
- Updated class `\ncc\Objects > HttpRequest` to use method calls rather than direct property access and implemented
`SerializableObjectInterface`
- Updated class `\ncc\Objects > HttpResponse` to use method calls rather than direct property access and implemented
`SerializableObjectInterface`
- Corrected code-smell and code style issues in `\ncc\Objects > HttpResponseCache`
- Corrected code-smell and code style issues in `\ncc\Objects > InstallationPaths`
- Updated class `\ncc\Objects > NccVersionInformation` to use method calls rather than direct property access and implemented
`SerializableObjectInterface`
- Updated class `\ncc\Objects > Package` to use method calls rather than direct property access and implemented
`SerializableObjectInterface`
- Updated class `\ncc\Objects > PackageLock` to use method calls rather than direct property access and implemented
`BytecodeObjectInterface`
- Updated class `\ncc\Objects > ProjectConfiguration` to use method calls rather than direct property access
- Updated class `\ncc\Objects > ProjectDetectionResults` to use method calls rather than direct property access
- Updated class `\ncc\Objects > RemotePackageInput` to use method calls rather than direct property access
- Updated class `\ncc\Objects > RepositoryQueryResults` to use method calls rather than direct property access
- Updated class `\ncc\Objects > Vault` to use method calls rather than direct property access
- `\ncc\Objects\ProjectConfiguration > Compiler`: Added Public Constructor to automatically determine the minimum and
maximum supported compiler version for the selected extension
- `\ncc\Objects\ProjectConfiguration > Compiler > fromArray()` throws an ConfigurationException if the property `extension` is null
- `\ncc\Objects\ProjectConfiguration > Compiler > fromArray()` throws an NotSupportedException if the `extension` uses an
unsupported compiler extension
- `\ncc\Objects\ProjectConfiguration > Compiler > validate()` No longer accepts `$throw_exception` and throws an
`ConfigurationException` or `NotSupportedException` if the validation fails, otherwise it returns `True`.
- `\ncc\Objects\ProjectConfiguration > Project > fromArray()` Throws an `ConfigurationException` if the property `compiler`
is missing in the project configuration
- `\ncc\Objects > ProjectConfiguration > fromArray()` Throws an `ConfigurationException` if the property 'project' is
missing in the root configuration
- `\ncc\Objects\ProjectConfiguration > Project > __construct()` now requires the parameter `$compiler`
- `\ncc\Objects\ProjectConfiguration > Dependency > __construct()` now requires the parameters `$name`, `$source_type`,
`$source` and `$version`
- `\ncc\Objects\ProjectConfiguration > Dependency > fromArray()` Throws an `ConfigurationException` if the property
`name` is missing in the dependency configuration
- Also updated a bunch of objects in a similar fashion to the ones above, (BuildConfiguration, Execute, ExitHandle,
ExitHandler, Repository, Assembly, Build, Dependency, ExecutionPolicy, Installer, Project, UpdateSource) I'm not
going to list them all here, but you can find them in the commit history.
- Implemented a template engine and refactored the CLI menu for the Project Manager and added a new `template` command
- Refactored the entire package structure to ncc package structure 2.0 for memory efficiency and performance
- Refactored execution unit system to use a new execution pointer system
- Refactored `PhpRunner` to use the new execution pointer system
- Refactored `BashRunner` to use the new execution pointer system
- Refactored `LuaRunner` to use the new execution pointer system
- Refactored `PerlRunner` to use the new execution pointer system
- Refactored `PythonRunner` to use the new execution pointer system
- 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 > unlock()` 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 to do anything with the credential file. A password will still be
needed to decrypt entries in the file if any entries are encrypted.
- 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
- Refactored ZiProto
### Removed
- Removed `FileNotFoundException` and `DirectoryNotFoundException` from `\ncc\Exceptions`
- Removed the use of `InvalidScopeException` across the project
- Removed references of Win32 from the project as Windows is not going supported
- Removed unused exception `FileNotFoundException` in `\ncc\CLI > HelpMenu`
- Removed unused class `\ncc\Objects > SymlinkDictionary`
- Removed unused exception `GitCloneException` in `\ncc\Exceptions` in favor of `GitException`
- Removed unused exception `GitCheckoutException` in `\ncc\Exceptions` in favor of `GitException`
- Removed unused exception `GithubServiceException` in `\ncc\Exceptions` in favor of `GitException`
- Removed unused exception `GitTagsException` in `\ncc\Exceptions` in favor of `GitException`
- Removed unused exception `GitlabServiceException` in `\ncc\Exceptions` in favor of `GitException`
- Removed unused exception `UnsupportedArchiveException` in `\ncc\Exceptions` in favor of `ArchiveException`
- Removed unused exception `NotImplementedException` in `\ncc\Exceptions` in favor of `NotSupportedException`
- Removed unused exception `UnsupportedCompilerExtensionException` in `\ncc\Exceptions` in favor of `NotSupportedException`
- Removed unused exception `UnsupportedExtensionVersionException` in `\ncc\Exceptions` (not used)
- Removed unused exception `UnsupportedComponentTypeException` in `\ncc\Exceptions` in favor of `NotSupportedException`
- Removed unused exception `UnsupportedPackageException` in `\ncc\Exceptions` (not used)
- Removed unused exception `UnsupportedRemoteTypeSource` in `\ncc\Exceptions` (not used)
- Removed unused exception `UnsupportedProjectTypeException` in `\ncc\Exceptions` (not used)
- Removed unused exception `InvalidProjectConfigurationException` in `\ncc\Exceptions` in favor of `ConfigurationException`
- Removed unused exception `InvalidScopeException` in `\ncc\Exceptions` in favor of `InvalidArgumentException` (standard php)
- Removed unused exception `InvalidCredentialsEntryException` in `\ncc\Exceptions` (not used)
- Removed unused exception `ComponentNotFoundException` in `\ncc\Exceptions` in favor of `ConfigurationException`
- Removed unused exception `InvalidPackageNameException` in `\ncc\Exceptions` (not used)
- Removed unused exception `InvalidVersionNumberException` in `\ncc\Exceptions` (not used)
- Removed unused exception `InvalidProjectException` in `\ncc\Exceptions` in favor of `ConfigurationException`
- Removed unused exception `InvalidProjectNameException` in `\ncc\Exceptions` in favor of `ConfigurationException`
- Removed unused exception `BuildConfigurationNotFoundException` in `\ncc\Exceptions` in favor of `ConfigurationException`
- Removed unused exception `InvalidBuildConfigurationException` in `\ncc\Exceptions` (not used)
- Removed unused exception `InvalidPropertyValue` in `\ncc\Exceptions` in favor of `ConfigurationException`
- Removed unused exception `InvalidVersionConfiguration` in `\ncc\Exceptions` (not used)
- Removed unused exception `InvalidDependencyConfiguraiton` in `\ncc\Exceptions` (not used)
- Removed unused exception `ProjectConfigurationNotFoundException` in `\ncc\Exceptions` in favor of `ConfigurationException`
- Removed unused exception `UndefinedExecutionPolicyExpection` in `\ncc\Exceptions` in favor of `ConfigurationException`
- Removed unused exception `InvalidExecutionPolicyName` in `\ncc\Exceptions` (not used)
- Removed unused exception `AccessDeniedException` in `\ncc\Exceptions` in favor of `AuthenticationException`
- Removed unused exception `HttpException` in `\ncc\Exceptions` in favor of `NetworkException`
- Removed unused exception `ComposerDisabledException` in `\ncc\Exceptions` in favor of `ComposerException`
- Removed unused exception `ComposerNotAvailable` in `\ncc\Exceptions` in favor of `ComposerException`
- Removed unused exception `InternalComposerNotAvailable` in `\ncc\Exceptions` in favor of `ComposerException`
- Removed unused exception `PackagePreperationFailedException` in `\ncc\Exceptions` in favor of `PackageException`
- Removed unused exception `PackageParsingException` in `\ncc\Exceptions` in favor of `PackageException`
- Removed unused exception `MissingDependencyException` in `\ncc\Exceptions` (not used)
- Removed unused exception `PackageAlreadyInstalledException` in `\ncc\Exceptions` in favor of `PackageException`
- Removed unused exception `PackageFetchException` in `\ncc\Exceptions` in favor of `PackageException`
- Removed unused exception `PackageNotFoundException` in `\ncc\Exceptions` in favor of `PackageException`
- Removed unused exception `ConstantReadonlyException` in `\ncc\Exceptions` in favor of `IntegrityException` & `\InvalidArgumentException`
- Removed unused exception `InvalidConstantName` in `\ncc\Exceptions` in favor for `IntegrityException`
- Removed unused exception `ComponentDecodeException` in `\ncc\Exceptions` in favor for `IntegrityException`
- Removed unused exception `ResourceChecksumException` in `\ncc\Exceptions` in favor for `IntegrityException`
- Removed unused exception `AutoloadGeneratorException` in `\ncc\Exceptions` in favor for `IOException`
- Removed unused exception `SymlinkException` in `\ncc\Exceptions` in favor for `IOException`
- Removed unused exception `PackageLockException` in `\ncc\Exceptions` in favor for `IOException`
- Removed unused exception `UnitsNotFoundException` in `\ncc\Exceptions` (not used)
- Removed unused exception `NoAvailableUnitsException` in `\ncc\Exceptions` in favor for `OperationException`
- Removed unused exception `InstallationException` in `\ncc\Exceptions` in favor for `OperationException`
- Removed all unused exceptions from the project, reduced the number of exceptions in total.
- Removed unused `scope` property from `\ncc\Objects\ProjectConfiguration > Build`
- Removed unused `\ncc\Objects > NccUpdateInformation`
- Removed unused `\ncc\Objects > PhpConfiguration`
- Removed parameter `$throw_exception` from `\ncc\Objects\ProjectConfiguration > Project > validate()`
- Removed dependency `theseer\Autoload` in favor of ncc's own autoloader (screw you Arne Blankerts)
- Removed runners `Python2` & `Python3` in favor of `Python`
- 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
- Removed checksum properties from Component & Resource since they are unused
## [1.0.3] - 2023-08-16
### Changed
@ -21,6 +581,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
ncc will display a warning if TTY mode cannot be enabled
## [1.0.2] - 2023-06-29
### Fixed
@ -38,7 +599,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated `\ncc\Managers > PackageManager` to display more logging messages
### Added
- Dockerfile for building a docker image of NCC
- Dockerfile for building a docker image of ncc
## [1.0.1] - 2023-02-07
@ -56,7 +619,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- File downloads now cache the URL as a pointer to the file reducing the number of times the same file is downloaded
## [1.0.0] - 2022-01-29
### Added
- Initial release of NCC
- Initial release of ncc

View file

@ -1,4 +1,4 @@
# Contributing to NCC
# Contributing to ncc
We welcome contributions to NCC! If you have an idea for how to improve the project, please don't hesitate to reach out.
There are many ways to contribute, and we appreciate all forms of support.

File diff suppressed because it is too large Load diff

View file

@ -18,54 +18,55 @@
# This image is intended to be used as a base for projects using ncc.
#
#
# Builder stage: downloads necessary files and serves them on a silver platter.
#
# Build-time args
ARG PHP_VERSION=8.2
FROM php:8.2-fpm AS builder
# Builder stage: downloads necessary files and serves them on a silver platter.
FROM php:${PHP_VERSION}-fpm AS builder
ENV GENERIC_BUILD_PATH=/tmp/ncc_build
WORKDIR /tmp
# Install some stuff the default image doesn't come with
RUN apt update -yqq; \
apt install git libpq-dev libzip-dev zip make wget gnupg -yqq
RUN apt-get update -yqq && \
apt-get install git libpq-dev libzip-dev zip make wget gnupg -yqq
# Download phive and install phab
RUN wget -O phive.phar https://phar.io/releases/phive.phar; \
wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc; \
gpg --keyserver hkps://keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79; \
gpg --verify phive.phar.asc phive.phar; \
rm phive.phar.asc; chmod +x phive.phar; ./phive.phar install phpab --global --trust-gpg-keys 0x2A8299CE842DD38C
RUN wget -O phive.phar https://phar.io/releases/phive.phar && \
wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc && \
gpg --keyserver hkps://keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79 && \
gpg --verify phive.phar.asc phive.phar && \
rm phive.phar.asc && chmod +x phive.phar && \
./phive.phar install phpab --global --trust-gpg-keys 0x2A8299CE842DD38C
# Copy the local repository to the image
COPY . /tmp/ncc
# Download the latest version of ncc (Nosial Code Compiler)
# Build ncc
RUN cd /tmp/ncc && make redist
#
# Main stage: Copies downloaded files and installs all
#
# Main stage: Copies build files and installs all dependencies
FROM php:${PHP_VERSION}-fpm-alpine AS production
FROM php:8.2-fpm-alpine
# OSI labels
LABEL maintainer="Netkas <netkas@nosial.net>"
LABEL description="ncc's official Docker image"
# Add extensions
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
# Copy downloaded files
COPY --from=builder /tmp/. .
COPY --from=builder /tmp/ncc_build/. .
# Install extensions required to run ncc
RUN install-php-extensions mbstring \
ctype \
common; \
# Add git and tar
apk add git tar; \
# Install phive, phab and ncc; create workdir
chmod +x phive.phar; \
mv phive.phar /usr/local/bin/phive; \
phive install phpab --global --trust-gpg-keys 0x2A8299CE842DD38C; \
cd ncc; php build/src/INSTALL --auto --install-composer; cd ..; rm -rf ncc; \
mkdir /app
# Install some stuff the default image doesn't come with
RUN apk update && \
apk add --no-cache git libpq libzip zip make wget gnupg gcc
WORKDIR /app
RUN chmod +x /usr/local/bin/install-php-extensions && sync && \
install-php-extensions zip xsl
# Install ncc
RUN php INSTALL --auto
# Finalize image
RUN mkdir /app
WORKDIR /app

View file

@ -18,58 +18,55 @@
# This image is intended to be used as a base for projects using ncc.
#
#
# Builder stage: downloads necessary files and serves them on a silver platter.
#
# Build-time args
ARG PHP_VERSION=8.2
FROM php:8.2-fpm AS builder
# Builder stage: downloads necessary files and serves them on a silver platter.
FROM php:${PHP_VERSION}-fpm AS builder
ENV GENERIC_BUILD_PATH=/tmp/ncc_build
WORKDIR /tmp
# Install some stuff the default image doesn't come with
RUN apt update -yqq; \
apt install git libpq-dev libzip-dev zip make wget gnupg -yqq
RUN apt-get update -yqq && \
apt-get install git libpq-dev libzip-dev zip make wget gnupg -yqq
# Download phive and install phab
RUN wget -O phive.phar https://phar.io/releases/phive.phar; \
wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc; \
gpg --keyserver hkps://keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79; \
gpg --verify phive.phar.asc phive.phar; \
rm phive.phar.asc; chmod +x phive.phar; ./phive.phar install phpab --global --trust-gpg-keys 0x2A8299CE842DD38C
RUN wget -O phive.phar https://phar.io/releases/phive.phar && \
wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc && \
gpg --keyserver hkps://keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79 && \
gpg --verify phive.phar.asc phive.phar && \
rm phive.phar.asc && chmod +x phive.phar && \
./phive.phar install phpab --global --trust-gpg-keys 0x2A8299CE842DD38C
# Copy the local repository to the image
COPY . /tmp/ncc
# Download the latest version of ncc (Nosial Code Compiler)
# Build ncc
RUN cd /tmp/ncc && make redist
#
# Main stage: Copies downloaded files and installs all
#
# Main stage: Copies build files and installs all dependencies
FROM php:${PHP_VERSION}-fpm AS production
FROM php:8.2-fpm
# OSI labels
LABEL maintainer="Netkas <netkas@nosial.net>"
LABEL description="ncc's official Docker image"
# Add extensions
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
# Copy downloaded files
COPY --from=builder /tmp/. .
COPY --from=builder /tmp/ncc_build/. .
# Install some stuff the default image doesn't come with
RUN apt update -yqq; \
apt install git libpq-dev libzip-dev zip make wget gnupg -yqq
RUN apt-get update -yqq && \
apt-get install -yqq git libpq-dev libzip-dev zip make wget gnupg gcc -yqq
# Install extensions required to run ncc
RUN install-php-extensions mbstring \
ctype \
common; \
# Add git
apt install -y git; \
# Install phive, phab and ncc; create workdir
chmod +x phive.phar; \
mv phive.phar /usr/local/bin/phive; \
phive install phpab --global --trust-gpg-keys 0x2A8299CE842DD38C; \
cd ncc; php build/src/INSTALL --auto --install-composer; cd ..; rm -rf ncc; \
mkdir /app
RUN chmod +x /usr/local/bin/install-php-extensions && sync && \
install-php-extensions zip xsl
WORKDIR /app
# Install ncc
RUN php INSTALL --auto
# Finalize image
RUN mkdir /app
WORKDIR /app

157
Makefile
View file

@ -1,34 +1,45 @@
# Variables
PHPCC := $(shell which php)
PHPAB := $(shell which phpab)
BUILD_PATH := build
DEBPKG := $(shell which dpkg-deb)
SRC_PATH := src
INSTALLER_PATH := $(SRC_PATH)/installer
ASSETS_PATH := assets
INSTALLER_SRC_PATH := $(SRC_PATH)/installer
CONFIG_PATH := $(SRC_PATH)/config
TIMESTAMP := $(shell date +%Y%m%d%H%M%S)
BUILD_VERSION := $(shell cat $(SRC_PATH)/ncc/VERSION)
BUILD_PATH := build
ifndef GENERIC_BUILD_PATH
GENERIC_BUILD_PATH := $(BUILD_PATH)/ncc_$(BUILD_VERSION)
endif
TAR_BUILD:= ncc_$(BUILD_VERSION).tar.gz
DEBIAN_SRC_PATH := $(SRC_PATH)/debian
DEBIAN_BUILD_PATH := $(BUILD_PATH)/debian/ncc_$(BUILD_VERSION)_all
DEBIAN_PACKAGE_BUILD_PATH := $(BUILD_PATH)/ncc_$(BUILD_VERSION)_all.deb
# List of paths for autoloading
AUTOLOAD_PATHS := $(addprefix $(SRC_PATH)/ncc/ThirdParty/, \
defuse/php-encryption \
jelix/version \
nikic/PhpParser \
Symfony/polyfill-ctype \
Symfony/polyfill-mbstring \
Symfony/polyfill-uuid \
Symfony/Process \
Symfony/Uid \
Symfony/Filesystem \
Symfony/Yaml \
theseer/Autoload \
theseer/DirectoryScanner \
composer/Semver \
defuse/php-encryption \
jelix/version \
nikic/PhpParser \
Symfony/polyfill_ctype \
Symfony/polyfill_mbstring \
Symfony/polyfill_uuid \
Symfony/Process \
Symfony/Uid \
Symfony/Filesystem \
Symfony/Yaml \
theseer/DirectoryScanner \
)
# Check for necessary binaries
ifndef PHPCC
$(error "PHP binary not found. Please install PHP or check your PATH")
$(error "PHP binary not found. Please install PHP or check your PATH")
endif
# Check if phpab is installed
ifndef PHPAB
$(error "phpab (PHP Autoload Builder) binary not found. Please install phpab or check your PATH")
$(error "phpab (PHP Autoload Builder) not found. Please install phpab or check your PATH")
endif
# Build rules
@ -37,7 +48,7 @@ $(SRC_PATH)/%/autoload_spl.php:
$(SRC_PATH)/ncc/autoload_spl.php:
$(PHPCC) $(PHPAB) --output $@ \
$(SRC_PATH)/ncc/Abstracts \
$(SRC_PATH)/ncc/Enums \
$(SRC_PATH)/ncc/Classes \
$(SRC_PATH)/ncc/CLI \
$(SRC_PATH)/ncc/Exceptions \
@ -45,7 +56,6 @@ $(SRC_PATH)/ncc/autoload_spl.php:
$(SRC_PATH)/ncc/Interfaces \
$(SRC_PATH)/ncc/Managers \
$(SRC_PATH)/ncc/Objects \
$(SRC_PATH)/ncc/Runtime \
$(SRC_PATH)/ncc/Utilities \
$(SRC_PATH)/ncc/ncc.php \
$(SRC_PATH)/ncc/Runtime.php
@ -57,31 +67,82 @@ autoload: $(addsuffix /autoload_spl.php, $(AUTOLOAD_PATHS)) $(SRC_PATH)/ncc/auto
.PHONY: redist
redist: autoload
rm -rf $(BUILD_PATH)/src
mkdir -p $(BUILD_PATH)/src
cp -rf $(SRC_PATH)/ncc/* $(BUILD_PATH)/src
cp -f $(INSTALLER_PATH)/installer $(BUILD_PATH)/src/INSTALL
cp -f $(INSTALLER_PATH)/ncc.sh $(BUILD_PATH)/src/ncc.sh
cp -f $(CONFIG_PATH)/ncc.yaml $(BUILD_PATH)/src/default_config.yaml
cp -f $(CONFIG_PATH)/ncc.yaml $(BUILD_PATH)/src/CLI/template_config.yaml
cp -f $(INSTALLER_PATH)/extension $(BUILD_PATH)/src/extension
chmod +x $(BUILD_PATH)/src/INSTALL
cp -f LICENSE $(BUILD_PATH)/src/LICENSE
cp -f README.md $(BUILD_PATH)/src/README.md
cp -f $(INSTALLER_PATH)/hash_check.php $(BUILD_PATH)/src/hash_check.php
$(PHPCC) $(BUILD_PATH)/src/hash_check.php
rm $(BUILD_PATH)/src/hash_check.php
cp -f $(INSTALLER_PATH)/generate_build_files.php $(BUILD_PATH)/src/generate_build_files.php
$(PHPCC) $(BUILD_PATH)/src/generate_build_files.php
rm $(BUILD_PATH)/src/generate_build_files.php
mkdir -p $(BUILD_PATH)/src/repositories
cp -rf $(SRC_PATH)/default_repositories/*.json $(BUILD_PATH)/src/repositories
rm -rf $(GENERIC_BUILD_PATH)
mkdir -p $(GENERIC_BUILD_PATH)
cp -rf $(SRC_PATH)/ncc/* $(GENERIC_BUILD_PATH)
cp -f $(INSTALLER_SRC_PATH)/installer $(GENERIC_BUILD_PATH)/INSTALL
cp -f $(INSTALLER_SRC_PATH)/ncc.sh $(GENERIC_BUILD_PATH)/ncc.sh
cp -f $(CONFIG_PATH)/ncc.yaml $(GENERIC_BUILD_PATH)/default_config.yaml
cp -f $(CONFIG_PATH)/ncc.yaml $(GENERIC_BUILD_PATH)/CLI/template_config.yaml
cp -f $(CONFIG_PATH)/default_repositories.json $(GENERIC_BUILD_PATH)/default_repositories.json
cp -f $(INSTALLER_SRC_PATH)/ncc-package.xml $(GENERIC_BUILD_PATH)/ncc-package.xml
chmod +x $(GENERIC_BUILD_PATH)/INSTALL
cp -f LICENSE $(GENERIC_BUILD_PATH)/LICENSE
cp -f README.md $(GENERIC_BUILD_PATH)/README.md
cp -f $(INSTALLER_SRC_PATH)/hash_check.php $(GENERIC_BUILD_PATH)/hash_check.php
$(PHPCC) $(GENERIC_BUILD_PATH)/hash_check.php
rm $(GENERIC_BUILD_PATH)/hash_check.php
cp -f $(INSTALLER_SRC_PATH)/generate_build_files.php $(GENERIC_BUILD_PATH)/generate_build_files.php
$(PHPCC) $(GENERIC_BUILD_PATH)/generate_build_files.php
rm $(GENERIC_BUILD_PATH)/generate_build_files.php
$(BUILD_PATH)/build_$(TIMESTAMP).tar.gz: redist
cd $(BUILD_PATH)/src; tar -czvf ../build_$(TIMESTAMP).tar.gz *
.PHONY: debian_prepare
debian_prepare: autoload
rm -rf $(DEBIAN_BUILD_PATH)
mkdir -p $(DEBIAN_BUILD_PATH)
mkdir -p $(DEBIAN_BUILD_PATH)/DEBIAN
mkdir -p $(DEBIAN_BUILD_PATH)/usr/share/ncc
cp -rf $(SRC_PATH)/ncc/* $(DEBIAN_BUILD_PATH)/usr/share/ncc
cp -rf $(CONFIG_PATH)/ncc.yaml $(DEBIAN_BUILD_PATH)/usr/share/ncc/default_config.yaml
cp -rf $(CONFIG_PATH)/ncc.yaml $(DEBIAN_BUILD_PATH)/usr/share/ncc/CLI/template_config.yaml
cp -rf $(CONFIG_PATH)/default_repositories.json $(DEBIAN_BUILD_PATH)/usr/share/ncc/default_repositories.json
cp -f LICENSE $(DEBIAN_BUILD_PATH)/usr/share/ncc/LICENSE
mkdir -p $(DEBIAN_BUILD_PATH)/usr/share/mime/packages
cp -rf $(INSTALLER_SRC_PATH)/ncc-package.xml $(DEBIAN_BUILD_PATH)/usr/share/mime/packages/ncc-package.xml
mkdir -p $(DEBIAN_BUILD_PATH)/usr/share/applications
cp -rf $(INSTALLER_SRC_PATH)/ncc.desktop $(DEBIAN_BUILD_PATH)/usr/share/applications/ncc.desktop
mkdir -p $(DEBIAN_BUILD_PATH)/usr/share/icons
cp -rf $(ASSETS_PATH)/icon/ncc@256px.png $(DEBIAN_BUILD_PATH)/usr/share/icons/ncc.png
cp -rf $(INSTALLER_SRC_PATH)/hash_check.php $(DEBIAN_BUILD_PATH)/usr/share/ncc/hash_check.php
cp -rf $(DEBIAN_SRC_PATH)/control $(DEBIAN_BUILD_PATH)/DEBIAN/control
cp -rf $(DEBIAN_SRC_PATH)/postinst $(DEBIAN_BUILD_PATH)/DEBIAN/postinst
chmod +x $(DEBIAN_BUILD_PATH)/DEBIAN/postinst
cp -rf $(DEBIAN_SRC_PATH)/postrm $(DEBIAN_BUILD_PATH)/DEBIAN/postrm
chmod +x $(DEBIAN_BUILD_PATH)/DEBIAN/postrm
cp -rf $(DEBIAN_SRC_PATH)/copyright $(DEBIAN_BUILD_PATH)/DEBIAN/copyright
$(BUILD_PATH)/$(TAR_BUILD): redist
cd $(GENERIC_BUILD_PATH) && tar -czf ../$(TAR_BUILD) *
.PHONY: tar
tar: $(BUILD_PATH)/build_$(TIMESTAMP).tar.gz
tar: $(BUILD_PATH)/$(TAR_BUILD)
$(DEBIAN_PACKAGE_BUILD_PATH): debian_prepare
$(DEBPKG) --build $(DEBIAN_BUILD_PATH) $(DEBIAN_PACKAGE_BUILD_PATH)
.PHONY: deb
deb: $(DEBIAN_PACKAGE_BUILD_PATH)
.PHONY: install
install: redist
$(GENERIC_BUILD_PATH)/INSTALL --auto
.PHONY: docker-debian
docker-debian:
docker build -t ncc-debian -f Dockerfile.debian .
.PHONY: docker-debian-run
docker-debian-run:
docker run -it --rm ncc-debian /bin/bash
.PHONY: docker-alpine
docker-alpine:
docker build -t ncc-alpine -f Dockerfile .
.PHONY: docker-alpine-run
docker-alpine-run:
docker run -it --rm ncc-alpine /bin/sh
.PHONY: clean
clean:
@ -92,7 +153,13 @@ clean:
.PHONY: help
help:
@echo "Available commands:"
@echo " make autoload - Generate autoload files"
@echo " make redist - Prepare the project for redistribution"
@echo " make tar - Package the project into a tarball with timestamp"
@echo " make clean - Clean the build artifacts"
@echo " make autoload - Generate autoload files"
@echo " make redist - Prepare the project for redistribution"
@echo " make install - Installs ncc on the system (requires root privileges & php)"
@echo " make tar - Package the project into a tarball (Generic installer, requires php)"
@echo " make deb - Package the project into a Debian package"
@echo " make docker-debian - Build a Debian Docker image"
@echo " make docker-debian-run - Run the Debian Docker image"
@echo " make docker-alpine - Build an Alpine Docker image"
@echo " make docker-alpine-run - Run the Alpine Docker image"
@echo " make clean - Clean the build artifacts"

View file

@ -1,26 +1,53 @@
# ![NCC](assets/icon/ncc@32px.png "NCC") NCC
# ![NCC](assets/icon/ncc@32px.png "NCC") Nosial Code Compiler
Nosial Code Compiler is a program written in PHP designed to be a multi-purpose compiler, package manager and toolkit.
This program is a complete re-write of the now defunct [PHP Package Manager (PPM)](https://git.n64.cc/intellivoid/ppm)
toolkit offering more features, security and proper code licensing and copyrighting for the components used for the project.
[![wakatime](https://wakatime.com/badge/user/bc15cc8e-c9b9-4c11-bad9-3e3cfacf01e4/project/273bc06f-12e7-43d7-824d-40a78b02aada.svg)](https://wakatime.com/badge/user/bc15cc8e-c9b9-4c11-bad9-3e3cfacf01e4/project/273bc06f-12e7-43d7-824d-40a78b02aada)
## Alpha Stage
Nosial Code Compiler is a package compiler, manager & installer for PHP. Allowing you to install and manage multiple
versions of php packages on your system that your PHP programs/projects can share and use. Additionally, ncc also allows
you to create a redistributable package of your PHP program/project in the form of a `.ncc` binary package file.
NCC is currently in alpha stage, meaning that it's not fully functional and may not work on your system. If you find any bugs
or issues please report them to the [GitHub Issue Tracker](https://git.n64.cc/nosial/ncc/issues).
At the moment NCC is currently being used while developing other software, this serves as a test run to
improve on changes for the next version.
## Features
- [x] Package Manager
- [x] Support for repositories such as GitHub, GitLab, GitTea and Packagist
- [x] Package compiler
- [x] Execution Handler
- [x] Import System (*No need for autoloaders!*)
## Dependencies
- PHP 8.0 or higher
- php-mbstring extension
- php-zip extension
- php-mbcrypt extension
- php-ctype extension
- php-curl extension
## Documentation
Extensive documentation for ncc can be found on at [DOCUMENTATION.md](DOCUMENTATION.md), explaining how from how to
build and install ncc to how to use it, it is highly recommended that you read the documentation before using ncc.
## Bugs and issues
If you encounter any bugs or issues with ncc, please report them on the [issue tracker](https://git.n64.cc/nosial/ncc/-/issues).
## Changelog
The changelog for NCC can be found in the [CHANGELOG.md](CHANGELOG.md) file.
The changelog for ncc can be found in the [CHANGELOG.md](CHANGELOG.md) file.
## Repository Mirrors
The official repository for NCC is hosted on [GitLab](https://git.n64.cc/nosial/ncc), however, you can also find
The official repository for ncc is hosted on [n64](https://git.n64.cc/nosial/ncc); however, you can also find
mirrors of the repository mirrored on different platforms, including
community powered mirrors. (more to come)
community-powered mirrors. (more to come)
- [git.it-kuny.ch](https://git.it-kuny.ch)
- [git.martinvlba.eu](https://git.martinvlba.eu/Nosial/ncc)
@ -29,17 +56,19 @@ community powered mirrors. (more to come)
# Contributing
We welcome contributions to NCC! If you have an idea for how to improve the project, please don't hesitate to reach out.
We welcome contributions to ncc! If you have an idea for how to improve the project, please don't hesitate to reach out.
There are many ways to contribute, and we appreciate all forms of support.
For more information on how to contribute, please read the [CONTRIBUTING.md](CONTRIBUTING.md) file.
# Code of Conduct
We are committed to maintaining a welcoming and inclusive environment for all contributors. Please read and follow our
[Code of Conduct](CODE_OF_CONDUCT.md).
# Authors
- Zi Xing Narrakas (netkas) <[netkas@n64.cc](mailto:netkas@64.cc)>
@ -49,16 +78,16 @@ We are committed to maintaining a welcoming and inclusive environment for all co
- Marc Gutt (mgutt) <[marc@gutt.it](mailto:marc@gutt.it)>
- Debusschère Alexandre ([debuss](https://github.com/debuss))
- badPointer <[https://git.n64.cc/badPointer](https://git.n64.cc/badPointer)>
- Cybersecbyte <[https://git.n64.cc/Cybersecbyte](https://git.n64.cc/Cybersecbyte)>
# Copyright
- Copyright (c) 2022-2023, Nosial - All Rights Reserved
- Copyright (c) 2022-2023, NosialAll Rights Reserved
# Licenses
NCC is licensed under the MIT License, see [LICENSE](LICENSE) for more information.
Multiple licenses for the open source components used in this
project can be found at [LICENSE](LICENSES)
ncc is licensed under the MIT License, see [LICENSE](LICENSE) for more information.
Multiple licenses for the open-source components used in this project can be found at [LICENSE](LICENSES)

BIN
assets/compiler_process.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
assets/data_structure.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
assets/header_structure.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

9
bootstrap.php Normal file
View file

@ -0,0 +1,9 @@
<?php
$autoload_path = __DIR__ . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'ncc' . DIRECTORY_SEPARATOR . 'autoload.php';
if(!file_exists($autoload_path))
{
throw new Exception("Autoload file not found");
}
require $autoload_path;

71
old_docker/Dockerfile Normal file
View file

@ -0,0 +1,71 @@
# Copyright 2022-2023 Nosial - All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# ncc in Docker
#
# This image is intended to be used as a base for projects using ncc.
#
#
# Builder stage: downloads necessary files and serves them on a silver platter.
#
FROM php:8.2-fpm AS builder
WORKDIR /tmp
# Install some stuff the default image doesn't come with
RUN apt update -yqq; \
apt install git libpq-dev libzip-dev zip make wget gnupg -yqq
# Download phive and install phab
RUN wget -O phive.phar https://phar.io/releases/phive.phar; \
wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc; \
gpg --keyserver hkps://keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79; \
gpg --verify phive.phar.asc phive.phar; \
rm phive.phar.asc; chmod +x phive.phar; ./phive.phar install phpab --global --trust-gpg-keys 0x2A8299CE842DD38C
# Copy the local repository to the image
COPY . /tmp/ncc
# Download the latest version of ncc (Nosial Code Compiler)
RUN cd /tmp/ncc && make redist
#
# Main stage: Copies downloaded files and installs all
#
FROM php:8.2-fpm-alpine
# Add extensions
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
# Copy downloaded files
COPY --from=builder /tmp/. .
# Install extensions required to run ncc
RUN install-php-extensions mbstring \
ctype \
common; \
# Add git and tar
apk add git tar; \
# Install phive, phab and ncc; create workdir
chmod +x phive.phar; \
mv phive.phar /usr/local/bin/phive; \
phive install phpab --global --trust-gpg-keys 0x2A8299CE842DD38C; \
cd ncc; php build/src/INSTALL --auto; cd ..; rm -rf ncc; \
mkdir /app
WORKDIR /app

View file

@ -0,0 +1,74 @@
# Copyright 2022-2023 Nosial - All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# ncc in Docker
#
# This image is intended to be used as a base for projects using ncc.
#
#
# Builder stage: downloads necessary files and serves them on a silver platter.
#
FROM php:8.2-fpm AS builder
WORKDIR /tmp
# Install some stuff the default image doesn't come with
RUN apt update -yqq; \
apt install git libpq-dev libzip-dev zip make wget gnupg -yqq
# Download phive and install phab
RUN wget -O phive.phar https://phar.io/releases/phive.phar; \
wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc; \
gpg --keyserver hkps://keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79; \
gpg --verify phive.phar.asc phive.phar; \
rm phive.phar.asc; chmod +x phive.phar; ./phive.phar install phpab --global --trust-gpg-keys 0x2A8299CE842DD38C
# Copy the local repository to the image
COPY . /tmp/ncc
# Download the latest version of ncc (Nosial Code Compiler)
RUN cd /tmp/ncc && make redist
#
# Main stage: Copies downloaded files and installs all
#
FROM php:8.2-fpm
# Add extensions
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
# Copy downloaded files
COPY --from=builder /tmp/. .
# Install some stuff the default image doesn't come with
RUN apt update -yqq; \
apt install git libpq-dev libzip-dev zip make wget gnupg -yqq
# Install extensions required to run ncc
RUN install-php-extensions mbstring \
ctype \
common; \
# Add git
apt install -y git; \
# Install phive, phab and ncc; create workdir
chmod +x phive.phar; \
mv phive.phar /usr/local/bin/phive; \
phive install phpab --global --trust-gpg-keys 0x2A8299CE842DD38C; \
cd ncc; php build/src/INSTALL --auto; cd ..; rm -rf ncc; \
mkdir /app
WORKDIR /app

2
old_docker/note.txt Normal file
View file

@ -0,0 +1,2 @@
These are the old dockerfiles for ncc, they are no longer used. The new dockerfiles are in the root of the repository.
These files are kept for reference and may be removed in the future.

11
phpunit.xml Normal file
View file

@ -0,0 +1,11 @@
<phpunit bootstrap="bootstrap.php">
<testsuites>
<testsuite name="ncc Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<php>
<ini name="error_reporting" value="-1"/>
<server name="KERNEL_DIR" value="app/"/>
</php>
</phpunit>

View file

@ -13,20 +13,20 @@
$third_party_path = __DIR__ . DIRECTORY_SEPARATOR . 'ThirdParty' . DIRECTORY_SEPARATOR;
$target_files = [
__DIR__ . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'composer' . DIRECTORY_SEPARATOR . 'Semver' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'defuse' . DIRECTORY_SEPARATOR . 'php-encryption' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'jelix' . DIRECTORY_SEPARATOR . 'version' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'nikic' . DIRECTORY_SEPARATOR . 'PhpParser' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'polyfill-ctype' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'polyfill-ctype' . DIRECTORY_SEPARATOR . 'bootstrap.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'polyfill-mbstring' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'polyfill-mbstring' . DIRECTORY_SEPARATOR . 'bootstrap.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'polyfill-uuid' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'polyfill-uuid' . DIRECTORY_SEPARATOR . 'bootstrap.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'polyfill_ctype' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'polyfill_ctype' . DIRECTORY_SEPARATOR . 'bootstrap.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'polyfill_mbstring' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'polyfill_mbstring' . DIRECTORY_SEPARATOR . 'bootstrap.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'polyfill_uuid' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'polyfill_uuid' . DIRECTORY_SEPARATOR . 'bootstrap.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'Process' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'Uid' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'Filesystem' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'Yaml' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'theseer' . DIRECTORY_SEPARATOR . 'Autoload' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
$third_party_path . 'theseer' . DIRECTORY_SEPARATOR . 'DirectoryScanner' . DIRECTORY_SEPARATOR . 'autoload_spl.php',
];

View file

@ -0,0 +1,50 @@
[
{
"name": "n64",
"type": "gitlab",
"host": "git.n64.cc",
"ssl": true
},
{
"name": "packagist",
"type": "packagist",
"host": "packagist.org",
"ssl": true
},
{
"name": "github",
"type": "github",
"host": "api.github.com",
"ssl": true
},
{
"name": "gitlab",
"type": "gitlab",
"host": "gitlab.com",
"ssl": true
},
{
"name": "gitgud",
"type": "gitlab",
"host": "gitgud.io",
"ssl": true
},
{
"name": "nocturn9x",
"type": "gitea",
"host": "git.nocturn9x.space",
"ssl": true
},
{
"name": "martinvlba",
"type": "gitea",
"host": "git.martinvlba.eu",
"ssl": true
},
{
"name": "kuny",
"type": "gitea",
"host": "git.it-kuny.ch",
"ssl": true
}
]

View file

@ -13,75 +13,4 @@ ncc:
# The default logging level to use in the CLI
# Values can be (silent, verbose, debug, info, warn, error or fatal)
logging: "info"
# Configuration section for the PHP configuration that NCC will use to run
php:
# The main executable path for PHP that NCC should use
executable_path: "/usr/bin/php"
git:
# if git is enabled or not
enabled: true
# The executable path of git
executable_path: "/usr/bin/git"
# When enabled, NCC will use it's builtin version of composer
# to execute composer tasks, if disabled it will fall back to
# the `executable_path` option and attempt to use that specified
# location of composer
composer:
# if composer is enabled or not
enabled: true
# If internal composer is enabled (install must be executed with --install-composer)
enable_internal_composer: true
# The executable path to the system's installed composer executable
executable_path: "/home/user/composer.phar"
# Composer options
options:
# Do not output any message
quiet: false
# Disable ANSI output
no_ansi: true
# Do not ask any interactive question
no_interaction: true
# Display timing and memory usage information
profile: false
# Skips the execution of all scripts defined in composer.json file.
no_scripts: true
# Prevent use of the cache
no_cache: false
# 1 normal output, 2 for more verbose output and 3 for debug output, 4 to match NCC's logging level
logging: 1
# NCC Composer Extension options
extension:
# If licenses should be displayed in the conversion process of a composer package
display_licenses: true
# If authors should be displayed in the conversion process of a composer package
display_authors: true
# If NCC should try to install suggested packages
try_install_suggested: true
# Supported runners executable paths
runners:
php: "/usr/bin/php"
bash: "/usr/bin/bash"
sh: "/usr/bin/sh"
python: "/usr/bin/python"
python3: "/usr/bin/python3"
python2: "/usr/bin/python2"
logging: "info"

18
src/debian/control Normal file
View file

@ -0,0 +1,18 @@
Package: ncc
Source: ncc
Section: devel
Priority: optional
Version: 2.0.4
Maintainer: netkas <netkas@nosial.net>
Build-Depends: debhelper-compat (= 13)
Standards-Version: 4.5.1
Homepage: https://git.n64.cc/nosial/ncc
Vcs-Git: https://git.n64.cc/nosial/ncc.git
Vcs-Browser: https://git.n64.cc/nosial/ncc
Name: Nosial Code Compiler
Architecture: all
Depends: shared-mime-info, php (>= 8.0), php-mbstring, php-common, php-ctype, php-curl, zlib1g, php-zip
Description: Nosial Code Compiler is a multi-purpose compiler, package manager, and toolkit written in PHP.
NCC (Nosial Code Compiler) is a versatile tool designed for various tasks related to PHP development.
It allows you to compile PHP code, manage packages, and perform various tasks in a PHP-centric environment.

8
src/debian/copyright Normal file
View file

@ -0,0 +1,8 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ncc
Upstream-Contact: netkas <netkas@nosial.net>
Source: https://git.n64.cc/nosial/ncc
Files: *
Copyright: 2022-2023 Nosial - All Rights Reserved.
License: MIT

33
src/debian/postinst Normal file
View file

@ -0,0 +1,33 @@
#!/bin/bash
set -e
# Update MIME database
if ! update-mime-database /usr/share/mime; then
echo "Error: Failed to update MIME database"
exit 1
fi
# Ensure PHP is installed
PHP_BIN=$(command -v php)
if [ -z "$PHP_BIN" ]; then
echo "Error: PHP binary not found"
exit 1
fi
# Create symlink for ncc-cli
ENTRY_POINT="/usr/bin/ncc"
if ! cat <<EOF > "$ENTRY_POINT"
#!/bin/bash
$PHP_BIN /usr/share/ncc/ncc --ncc-cli "\$@"
EOF
then
echo "Error: Failed to create entry point script at $ENTRY_POINT"
exit 1
fi
chmod +x "$ENTRY_POINT"
# Initialize ncc
if ! ncc setup --default-repositories=/usr/share/ncc/default_repositories.json; then
echo "Error: Failed to setup ncc"
exit 1
fi

21
src/debian/postrm Normal file
View file

@ -0,0 +1,21 @@
#!/bin/bash
set -e
case "$1" in
remove|purge)
# Remove the entry point script
ENTRY_POINT="/usr/bin/ncc"
if [ -f "$ENTRY_POINT" ]; then
rm -f "$ENTRY_POINT"
echo "Removed $ENTRY_POINT"
else
echo "$ENTRY_POINT not found. Skipping removal."
fi
;;
*)
esac
# End of the script
exit 0

View file

@ -1,6 +0,0 @@
[
"gitgud.json",
"github.json",
"gitlab.json",
"n64.json"
]

View file

@ -1,6 +0,0 @@
{
"name": "gitgud",
"type": "gitlab",
"host": "gitgud.io",
"ssl": true
}

View file

@ -1,6 +0,0 @@
{
"name": "github",
"type": "github",
"host": "api.github.com",
"ssl": true
}

View file

@ -1,6 +0,0 @@
{
"name": "gitlab",
"type": "gitlab",
"host": "gitlab.com",
"ssl": true
}

View file

@ -1,6 +0,0 @@
{
"name": "n64",
"type": "gitlab",
"host": "git.n64.cc",
"ssl": true
}

View file

@ -1,170 +0,0 @@
<?php
use ncc\Abstracts\Versions;
use ncc\Exceptions\ConstantReadonlyException;
use ncc\Exceptions\ImportException;
use ncc\Exceptions\InvalidConstantNameException;
use ncc\Exceptions\InvalidPackageNameException;
use ncc\Exceptions\InvalidScopeException;
use ncc\Exceptions\PackageLockException;
use ncc\Exceptions\PackageNotFoundException;
use ncc\ncc;
use ncc\Runtime;
if(!defined('NCC_INIT'))
{
if(!file_exists('%ncc_install' . DIRECTORY_SEPARATOR . 'autoload.php'))
{
throw new RuntimeException('Cannot locate file \'%ncc_install' . DIRECTORY_SEPARATOR . 'autoload.php\'');
}
else
{
require('%ncc_install' . DIRECTORY_SEPARATOR . 'autoload.php');
}
if(!function_exists('import'))
{
/**
* Attempts to import a package into the current runtime
*
* @param string $package
* @param string $version
* @param array $options
* @return void
* @throws ImportException
*/
function import(string $package, string $version= Versions::Latest, array $options=[]): void
{
Runtime::import($package, $version, $options);
}
}
if(!function_exists('get_imported'))
{
/**
* Returns an array of all imported packages
*
* @return array
*/
function get_imported(): array
{
return Runtime::getImportedPackages();
}
}
if(!function_exists('ncc_constants'))
{
/**
* Returns an array of constants defined by NCC
*
* @return array
* @throws \ncc\Exceptions\RuntimeException
*/
function ncc_constants(): array
{
return ncc::getConstants();
}
}
if(!function_exists('consts_get'))
{
/**
* Returns the value of a constant defined in NCC's runtime environment
*
* @param string $package
* @param string $name
* @return string|null
*/
function consts_get(string $package, string $name): ?string
{
return Runtime\Constants::get($package, $name);
}
}
if(!function_exists('consts_set'))
{
/**
* Sets the value of a constant defined in NCC's runtime environment
*
* @param string $package
* @param string $name
* @param string $value
* @param bool $readonly
* @return void
* @throws ConstantReadonlyException
* @throws InvalidConstantNameException
*/
function consts_set(string $package, string $name, string $value, bool $readonly=false): void
{
Runtime\Constants::register($package, $name, $value, $readonly);
}
}
if(!function_exists('consts_delete'))
{
/**
* Deletes a constant defined in NCC's runtime environment
*
* @param string $package
* @param string $name
* @return void
* @throws ConstantReadonlyException
*/
function consts_delete(string $package, string $name): void
{
Runtime\Constants::delete($package, $name);
}
}
if(!function_exists('get_data_path'))
{
/**
* Returns the data path of the package
*
* @param string $package
* @return string
* @throws InvalidPackageNameException
* @throws InvalidScopeException
* @throws PackageLockException
* @throws PackageNotFoundException
*/
function get_data_path(string $package): string
{
return Runtime::getDataPath($package);
}
}
if(!function_exists('get_constant'))
{
/**
* Returns the value of a constant defined in NCC's runtime environment
*
* @param string $package
* @param string $name
* @return string|null
*/
function get_constant(string $package, string $name): ?string
{
return Runtime::getConstant($package, $name);
}
}
if(!function_exists('set_constant'))
{
/**
* Sets the value of a constant defined in NCC's runtime environment
*
* @param string $package
* @param string $name
* @param string $value
* @return void
* @throws ConstantReadonlyException
* @throws InvalidConstantNameException
*/
function set_constant(string $package, string $name, string $value): void
{
Runtime::setConstant($package, $name, $value);
}
}
}

View file

@ -6,30 +6,34 @@
print('Could not find \'autoload.php\', this script is intended to be executed during the redistribution process');
exit(1);
}
/** @noinspection PhpIncludeInspection */
require(__DIR__ . DIRECTORY_SEPARATOR . 'autoload.php');
// Start script
function scanContents($dir, &$results = array())
function scanContents($dir)
{
$files = scandir($dir);
$results = [];
foreach ($files as $key => $value)
foreach (scandir($dir, SCANDIR_SORT_NONE) as $key => $value)
{
$path = realpath($dir . DIRECTORY_SEPARATOR . $value);
if (!is_dir($path))
{
$results[] = str_ireplace(__DIR__ . DIRECTORY_SEPARATOR, (string)null, $path);
$results[] = str_ireplace(__DIR__ . DIRECTORY_SEPARATOR, '', $path);
}
else if ($value != '.' && $value != '..')
elseif ($value !== '.' && $value !== '..')
{
$results[] = str_ireplace(__DIR__ . DIRECTORY_SEPARATOR, (string)null, $path);
scanContents($path, $results);
/** @noinspection SlowArrayOperationsInLoopInspection */
$results = array_merge($results, scanContents($path));
}
}
return $results;
}
$excluded_files = [
'hash_check.php',
'generate_build_files.php',
@ -37,8 +41,7 @@
'installer',
'checksum.bin',
'build_files',
'ncc.sh',
'extension'
'ncc.sh'
];
ncc\Utilities\Console::out('Creating build_files ...');
@ -56,8 +59,10 @@
$build_files_content[] = $path;
}
}
$build_files = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'build_files', 'a+');
$build_files = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'build_files', 'ab+');
fwrite($build_files, implode("\n", $build_files_content));
fclose($build_files);
ncc\Utilities\Console::out('Created build_files');
exit(0);

View file

@ -6,21 +6,20 @@
print('Could not find \'autoload.php\', this script is intended to be executed during the redistribution process');
exit(1);
}
require(__DIR__ . DIRECTORY_SEPARATOR . 'autoload.php');
// Start script
function scanContents($dir, &$results = array())
{
$files = scandir($dir);
foreach ($files as $key => $value)
foreach (scandir($dir, SCANDIR_SORT_NONE) as $key => $value)
{
$path = realpath($dir . DIRECTORY_SEPARATOR . $value);
if (!is_dir($path))
{
$results[] = str_ireplace(__DIR__ . DIRECTORY_SEPARATOR, (string)null, $path);
}
else if ($value != '.' && $value != '..')
else if ($value !== '.' && $value !== '..')
{
scanContents($path, $results);
}
@ -42,12 +41,12 @@
foreach(scanContents(__DIR__) as $file)
{
if(!in_array($file, $excluded_files))
if(!in_array($file, $excluded_files, true))
{
$hash_values[$file] = hash_file('sha256', __DIR__ . DIRECTORY_SEPARATOR . $file);
}
}
file_put_contents(__DIR__ . DIRECTORY_SEPARATOR . 'checksum.bin', \ncc\ZiProto\ZiProto::encode($hash_values));
file_put_contents(__DIR__ . DIRECTORY_SEPARATOR . 'checksum.bin', \ncc\Extensions\ZiProto\ZiProto::encode($hash_values));
ncc\Utilities\Console::out('Created checksum.bin');
exit(0);

View file

@ -3,8 +3,8 @@
# ------------------------------------------------------------------
# Nosial Code Compiler (NCC) Installation Script
#
# Nosial Code Compiler is a program written in PHP designed
# to be a multipurpose compiler, package manager and toolkit.
# Nosial Code Compiler is a program written in PHP designed
# to be a multipurpose compiler, package manager and toolkit.
#
# Dependency:
# PHP 8.0+
@ -12,18 +12,12 @@
<?PHP
use ncc\Abstracts\ConsoleColors;
use ncc\Exceptions\FileNotFoundException;
use ncc\Managers\RemoteSourcesManager;
use ncc\Enums\ConsoleColors;
use ncc\ncc;
use ncc\Objects\CliHelpSection;
use ncc\Objects\DefinedRemoteSource;
use ncc\ThirdParty\Symfony\Filesystem\Exception\IOException;
use ncc\ThirdParty\Symfony\Filesystem\Filesystem;
use ncc\ThirdParty\Symfony\Process\Exception\ProcessFailedException;
use ncc\ThirdParty\Symfony\Process\ExecutableFinder;
use ncc\ThirdParty\Symfony\process\PhpExecutableFinder;
use ncc\ThirdParty\Symfony\Process\Process;
use ncc\ThirdParty\Symfony\Yaml\Yaml;
use ncc\Utilities\Console;
use ncc\Utilities\Functions;
@ -31,63 +25,34 @@
use ncc\Utilities\PathFinder;
use ncc\Utilities\Resolver;
use ncc\Utilities\Validate;
use ncc\ZiProto\ZiProto;
use ncc\Extensions\ZiProto\ZiProto;
# Global Variables
$NCC_INSTALL_PATH=DIRECTORY_SEPARATOR . 'etc' . DIRECTORY_SEPARATOR . 'ncc';
$NCC_DATA_PATH=DIRECTORY_SEPARATOR . 'var' . DIRECTORY_SEPARATOR . 'ncc';
$NCC_COMPOSER_UPDATE_SOURCE='https://getcomposer.org/installer';
$NCC_CHECKSUM=__DIR__ . DIRECTORY_SEPARATOR . 'checksum.bin';
$NCC_AUTOLOAD=__DIR__ . DIRECTORY_SEPARATOR . 'autoload.php';
$NCC_PHP_EXECUTABLE=null;
$NCC_FILESYSTEM=null;
/**
* A getParameter function to avoid code redundancy (Type-Safe)
*
* @param array|null $args
* @param string $option
* @param bool $require_content
* @return string|null
*/
function getParameter(?array $args, string $option, bool $require_content=true): ?string
{
if($args == null)
{
return null;
}
if(!isset($args[$option]))
{
return null;
}
if($require_content && ($args[$option] == null || strlen((string)$args[$option] == 0)))
{
return null;
}
return $args[$option];
}
$NCC_INSTALL_PATH = DIRECTORY_SEPARATOR . 'usr' . DIRECTORY_SEPARATOR . 'share' . DIRECTORY_SEPARATOR . 'ncc';
$NCC_DATA_PATH = DIRECTORY_SEPARATOR . 'var' . DIRECTORY_SEPARATOR . 'ncc';
$NCC_CHECKSUM = __DIR__ . DIRECTORY_SEPARATOR . 'checksum.bin';
$NCC_AUTOLOAD = __DIR__ . DIRECTORY_SEPARATOR . 'autoload.php';
$NCC_PHP_EXECUTABLE = null;
// Require NCC
if(!file_exists($NCC_AUTOLOAD))
{
print('The file \'autoload.php\' was not found, installation cannot proceed.' . PHP_EOL);
print(sprintf('Cannot find autoload file \'%s\', installation failed successfully.', $NCC_AUTOLOAD) . PHP_EOL);
exit(1);
}
require($NCC_AUTOLOAD);
// Initialize NCC
try
{
// Initialize NCC
define('NCC_CLI_MODE', 1);
ncc::initialize();
}
catch (FileNotFoundException|\ncc\Exceptions\RuntimeException $e)
catch (Exception $e)
{
Console::outError('Cannot initialize NCC, ' . $e->getMessage() . ' (Error Code: ' . $e->getCode() . ')');
exit(1);
Console::outException('Cannot initialize NCC, ' . $e->getMessage() . ' (Error Code: ' . $e->getCode() . ')', $e, 1);
return;
}
$NCC_ARGS = null;
@ -100,17 +65,14 @@
}
$NCC_AUTO_MODE = ($NCC_ARGS !== null && isset($NCC_ARGS['auto']));
$NCC_BYPASS_CLI_CHECK = ($NCC_ARGS !== null && isset($NCC_ARGS['bypass-cli-check']));
$NCC_BYPASS_OS_CHECK = ($NCC_ARGS !== null && isset($NCC_ARGS['bypass-os-check']));
$NCC_BYPASS_CHECKSUM = ($NCC_ARGS !== null && isset($NCC_ARGS['bypass-checksum']));
if(isset($NCC_ARGS['help']))
{
$options = [
new CliHelpSection(['--help'], 'Displays this help menu about the installer'),
new CliHelpSection(['--auto'], 'Automates the installation process'),
new CliHelpSection(['--install-composer'], 'Require composer to be installed alongside NCC'),
new CliHelpSection(['--install-dir'], 'Specifies the installation directory for NCC'),
new CliHelpSection(['--bypass-cli-check'], 'Bypasses the check for a CLI environment'),
new CliHelpSection(['--bypass-os-check'], 'Bypasses the check for the current operating system'),
new CliHelpSection(['--bypass-checksum'], 'Bypasses the checksum for the installation files'),
];
@ -126,55 +88,31 @@
}
// Detect if running in Windows
if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
if(!$NCC_BYPASS_OS_CHECK && strtolower(PHP_OS_FAMILY) === 'windows')
{
print('This installer can only run on Linux based machines' . PHP_EOL);
Console::outError(sprintf('This installer is not compatible with Windows, detected OS: %s (This check can be bypassed with --bypass-os-check)', PHP_OS), true, 1);
return;
}
// Detect the server API
if(!$NCC_BYPASS_CLI_CHECK)
{
if(defined('PHP_SAPI'))
{
if(strtolower(PHP_SAPI) !== 'cli')
{
print('This installation script is meant to be running in your terminal' . PHP_EOL);
}
}
elseif(function_exists('php_sapi_name') && strtolower(php_sapi_name()) !== 'cli')
{
print('This installation script is meant to be running in your terminal' . PHP_EOL);
}
else
{
Console::outWarning(
'The installer cannot determine the Server API (SAPI), the installer will continue but it is ' .
'recommended to be running this installer in a terminal'
);
}
}
// Check if running as root
if(!function_exists('posix_getuid'))
{
Console::outError('The function posix_getuid() is not available on your system, please make sure the extension `php-common` is installed');
exit(1);
Console::outError('The function posix_getuid() is not available on your system, please make sure the extension `php-common` is installed', true, 1);
return;
}
if (posix_getuid() !== 0)
{
Console::outError('You must be running as root');
exit(1);
Console::outError('You must be running as root', true, 1);
return;
}
// Find the PHP executable
$executable_finder = new PhpExecutableFinder();
$NCC_PHP_EXECUTABLE = $executable_finder->find();
$NCC_EXECUTABLE_FINDER = new ExecutableFinder();
$NCC_PHP_EXECUTABLE = (new PhpExecutableFinder())->find();
if(!$NCC_PHP_EXECUTABLE)
{
Console::outError('Cannot find PHP executable path');
exit(1);
Console::outError('Cannot find PHP executable path', true ,1);
return;
}
// Check for the required files
@ -198,47 +136,41 @@
{
if(!$NCC_FILESYSTEM->exists($NCC_CHECKSUM))
{
Console::outWarning('The file \'checksum.bin\' was not found, the contents of the program cannot be verified to be safe');
Console::outError(sprintf('The checksum file \'%s\' was not found, the checksum cannot be validated', $NCC_CHECKSUM), 1, true);
return;
}
else
try
{
Console::out('Running checksum');
Console::out('Testing checksum...');
$checksum = ZiProto::decode(IO::fread($NCC_CHECKSUM));
}
catch(Exception $e)
{
Console::outError($e->getMessage(), true, 1);
return;
}
try
{
$checksum = ZiProto::decode(IO::fread(__DIR__ . DIRECTORY_SEPARATOR . 'checksum.bin'));
}
catch(Exception $e)
{
Console::outError($e->getMessage(), true, 1);
return;
}
$checksum_failed = false;
$checksum_failed = false;
foreach($checksum as $path => $hash)
{
if(!file_exists(__DIR__ . DIRECTORY_SEPARATOR . $path))
{
Console::outError('Cannot check file, \'' . $path . '\' not found.');
$checksum_failed = true;
}
elseif(hash_file('sha256', __DIR__ . DIRECTORY_SEPARATOR . $path) !== $hash)
{
Console::outWarning('The file \'' . $path . '\' does not match the original checksum');
$checksum_failed = true;
}
}
foreach($checksum as $path => $hash)
{
if(!file_exists(__DIR__ . DIRECTORY_SEPARATOR . $path))
{
Console::outError('Cannot check file, \'' . $path . '\' not found.');
$checksum_failed = true;
}
elseif(hash_file('sha256', __DIR__ . DIRECTORY_SEPARATOR . $path) !== $hash)
{
Console::outWarning('The file \'' . $path . '\' does not match the original checksum');
$checksum_failed = true;
}
}
if($checksum_failed)
{
Console::outError('Checksum failed, the contents of the program cannot be verified to be safe');
exit(1);
}
else
{
Console::out('Checksum passed');
}
if($checksum_failed)
{
Console::outError('Checksum failed, the contents of the program cannot be verified to be safe', true, 1);
return;
}
}
@ -249,207 +181,51 @@
{
if($installed)
{
Console::out("$ext ... " . Console::formatColor("installed", ConsoleColors::LightGreen));
Console::out("$ext ... " . Console::formatColor("installed", ConsoleColors::LIGHT_GREEN));
}
else
{
Console::out("$ext ... " . Console::formatColor("missing", ConsoleColors::LightRed));
Console::out("$ext ... " . Console::formatColor("missing", ConsoleColors::LIGHT_RED));
}
}
// Check for curl if the installer requires it
$curl_available = true;
if(!$extensions['curl'])
{
if(getParameter($NCC_ARGS, 'install-composer') !== null)
{
Console::outError('This installer requires the \'curl\' extension to install composer', true, 1);
return;
}
$curl_available = false;
Console::outWarning('The extension \'curl\' is not installed, the installer will not be able to install composer');
}
// Attempt to load version information
try
{
$VersionInformation = ncc::getVersionInformation();
// Attempt to load version information
$version_information = ncc::getVersionInformation();
}
catch (FileNotFoundException|\ncc\Exceptions\RuntimeException $e)
catch (Exception $e)
{
Console::outError('Cannot get version information, ' . $e->getMessage() . ' (Error Code: ' . $e->getCode() . ')');
exit(1);
Console::outException('Cannot get version information, ' . $e->getMessage() . ' (Error Code: ' . $e->getCode() . ')', $e, 1);
return;
}
// Start of installer
Console::out('Started NCC installer');
// Display version information
Console::out('NCC Version: ' . NCC_VERSION_NUMBER . ' (' . NCC_VERSION_BRANCH . ')');
Console::out('Build Flags: ' . implode(',', NCC_VERSION_FLAGS));
foreach($VersionInformation->Components as $component)
foreach($version_information->getComponents() as $component)
{
$full_name = $component->Vendor . '/' . $component->PackageName;
$full_name = $component->getVendor() . '/' . $component->getPackageName();
try
{
Console::out(Console::formatColor($full_name, ConsoleColors::Green) . ' Version: ' . Console::formatColor($component->getVersion(), ConsoleColors::LightMagenta));
Console::out(Console::formatColor($full_name, ConsoleColors::GREEN) . ' Version: ' . Console::formatColor($component->getVersion(), ConsoleColors::LIGHT_MAGENTA));
}
catch (Exception $e)
{
Console::outWarning('Cannot determine component version of ' . Console::formatColor($full_name, ConsoleColors::Green));
Console::outWarning('Cannot determine component version of ' . Console::formatColor($full_name, ConsoleColors::GREEN));
}
}
if(!$NCC_AUTO_MODE && !Console::getBooleanInput('Do you want install NCC?'))
{
Console::outError('Installation cancelled by user', true, 1);
return;
}
Console::out('Starting installation');
// Determine the installation path
$skip_prompt = false;
$install_dir_arg = getParameter($NCC_ARGS, 'install-dir');
// Check the arguments
if($install_dir_arg !== null)
{
if(!Validate::unixFilepath($install_dir_arg))
{
Console::outError('The given file path is not valid');
exit(1);
}
if($NCC_FILESYSTEM->exists($install_dir_arg . DIRECTORY_SEPARATOR . 'ncc'))
{
Console::out('NCC Seems to already be installed, the installer will repair/upgrade your current install');
$NCC_INSTALL_PATH = $install_dir_arg;
$skip_prompt = true;
}
else
{
Console::outError('The given directory already exists, it must be deleted before proceeding');
exit(1);
}
}
if(!$NCC_AUTO_MODE && !$skip_prompt)
{
while(true)
{
$user_input = null;
$user_input = Console::getInput("Installation Path (Default: $NCC_INSTALL_PATH): ");
if(strlen($user_input) > 0 && $NCC_FILESYSTEM->exists($user_input) && Validate::unixFilepath($user_input))
{
if($NCC_FILESYSTEM->exists($user_input . DIRECTORY_SEPARATOR . 'ncc'))
{
$NCC_INSTALL_PATH = $user_input;
break;
}
else
{
Console::outError('The given directory already exists, it must be deleted before proceeding');
}
}
elseif(strlen($user_input) > 0)
{
Console::outError('The given file path is not valid');
}
else
{
break;
}
}
}
// Determine the data path
$skip_prompt = false;
$data_dir_arg = getParameter($NCC_ARGS, 'data-dir');
// Check the arguments
if($data_dir_arg !== null)
{
if(!Validate::unixFilepath($data_dir_arg))
{
Console::outError('The given file path \''. $data_dir_arg . '\' is not valid');
exit(1);
}
if($NCC_FILESYSTEM->exists($data_dir_arg . DIRECTORY_SEPARATOR . 'package.lck'))
{
$NCC_DATA_PATH = $data_dir_arg;
$skip_prompt = true;
}
else
{
Console::outError('The given directory \'' . $data_dir_arg . '\' already exists, it must be deleted before proceeding');
exit(1);
}
}
// Proceed with prompt if not in auto mode and argument was met
if(!$NCC_AUTO_MODE && !$skip_prompt)
{
while(true)
{
$user_input = null;
$user_input = Console::getInput("Data Path (Default: $NCC_DATA_PATH): ");
if(strlen($user_input) > 0 && $NCC_FILESYSTEM->exists($user_input) && Validate::unixFilepath($user_input))
{
if($NCC_FILESYSTEM->exists($user_input . DIRECTORY_SEPARATOR . 'package.lck'))
{
$NCC_DATA_PATH = $user_input;
break;
}
else
{
Console::outError('The given directory already exists, it must be deleted before proceeding');
}
}
elseif(strlen($user_input) > 0)
{
Console::outError('The given file path is not valid');
}
else
{
break;
}
}
}
// Ask to install composer if curl is available
if($curl_available)
{
if(getParameter($NCC_ARGS, 'install-composer') !== null)
{
$update_composer = true;
}
else
{
if(!$NCC_AUTO_MODE)
{
Console::out("Note: This doesn't affect your current install of composer (if you have composer installed)");
$update_composer = Console::getBooleanInput('Do you want to install composer for NCC? (Recommended)');
}
else
{
$update_composer = false;
}
}
}
else
{
$update_composer = false;
}
if(!$NCC_AUTO_MODE)
{
if(!Console::getBooleanInput('Do you want install NCC?'))
{
Console::outError('Installation cancelled by user');
exit(1);
}
}
// Prepare installation
if($NCC_FILESYSTEM->exists($NCC_INSTALL_PATH))
{
@ -459,97 +235,17 @@
}
catch(IOException $e)
{
Console::outError('Cannot delete directory \'' . $NCC_INSTALL_PATH . '\', ' . $e->getMessage());
exit(1);
Console::outException('Cannot delete directory \'' . $NCC_INSTALL_PATH . '\', ' . $e->getMessage(), $e, 1);
return;
}
}
$NCC_FILESYSTEM->mkdir($NCC_INSTALL_PATH, 0755);
// Copy files to the installation path
try
{
Functions::initializeFiles();
}
catch(Exception $e)
{
Console::outError('Cannot initialize NCC files, ' . $e->getMessage());
exit(1);
}
// Install composer
if($update_composer)
{
Console::out('Installing composer for NCC');
$fp = fopen($NCC_INSTALL_PATH . DIRECTORY_SEPARATOR . 'composer-setup.php', 'w+');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $NCC_COMPOSER_UPDATE_SOURCE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 600);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, 'ncc/' . NCC_VERSION_NUMBER . ' (' . NCC_VERSION_BRANCH . ')');
curl_exec($ch);
curl_close($ch);
fclose($fp);
Console::out('Running composer installer');
$Process = Process::fromShellCommandline(implode(' ', [
$NCC_PHP_EXECUTABLE,
escapeshellcmd($NCC_INSTALL_PATH . DIRECTORY_SEPARATOR . 'composer-setup.php'),
'--install-dir=' . escapeshellcmd($NCC_INSTALL_PATH),
'--filename=composer.phar'
]));
$Process->setWorkingDirectory($NCC_INSTALL_PATH);
$Process->setTty(Functions::isTtyMode());
try
{
if($Process->isTty())
{
$Process->run();
}
else
{
Console::outWarning('Composer is running in non-interactive mode, this may cause issues');
$Process->run(function ($type, $buffer)
{
if (Process::ERR === $type)
{
Console::outError($buffer);
}
else
{
Console::out($buffer);
}
});
}
}
catch(ProcessFailedException $e)
{
Console::outError('Cannot install composer, ' . $e->getMessage());
exit(1);
}
// Verify install
if(!$NCC_FILESYSTEM->exists([$NCC_INSTALL_PATH . DIRECTORY_SEPARATOR . 'composer.phar']))
{
Console::outError("Installation failed, the installation exited without any issues but composer doesn't seem to be installed correctly");
exit(1);
}
$NCC_FILESYSTEM->remove([$NCC_INSTALL_PATH . DIRECTORY_SEPARATOR . 'composer-setup.php']);
$NCC_FILESYSTEM->chmod([$NCC_INSTALL_PATH . DIRECTORY_SEPARATOR . 'composer.phar'], 0755);
Console::out('Installed composer successfully');
}
// Install NCC
Console::out('Copying files to \'' . $NCC_INSTALL_PATH . '\'');
try
{
Console::out('Copying files to \'' . $NCC_INSTALL_PATH . '\'');
$build_files = explode("\n", IO::fread(__DIR__ . DIRECTORY_SEPARATOR . 'build_files'));
}
catch(Exception $e)
@ -557,184 +253,102 @@
Console::outError($e->getMessage(), true, 1);
return;
}
$total_items = count($build_files);
$processed_items = 1;
//$processed_items = 1;
$progress_bar = new \ncc\Utilities\ConsoleProgressBar('Installing ncc', $total_items);
// Create all the directories first
foreach($build_files as $path)
foreach ($build_files as $item)
{
if(is_dir(__DIR__ . DIRECTORY_SEPARATOR . $path))
$progress_bar->setMiscText($item, true);
$source = __DIR__ . DIRECTORY_SEPARATOR . $item;
$destination = $NCC_INSTALL_PATH . DIRECTORY_SEPARATOR . $item;
if (is_file($source))
{
$NCC_FILESYSTEM->mkdir([$NCC_INSTALL_PATH . DIRECTORY_SEPARATOR . $path]);
$NCC_FILESYSTEM->chmod([$NCC_INSTALL_PATH . DIRECTORY_SEPARATOR . $path], 0755);
$processed_items += 1;
}
$parent_directory = dirname($destination);
Console::inlineProgressBar($processed_items, $total_items);
}
// Copy over all the files
foreach($build_files as $file)
{
if(is_file(__DIR__ . DIRECTORY_SEPARATOR . $file))
{
$NCC_FILESYSTEM->copy(__DIR__ . DIRECTORY_SEPARATOR . $file, $NCC_INSTALL_PATH . DIRECTORY_SEPARATOR . $file);
$NCC_FILESYSTEM->chmod([$NCC_INSTALL_PATH . DIRECTORY_SEPARATOR . $file], 0755);
if(!$NCC_FILESYSTEM->exists($NCC_INSTALL_PATH . DIRECTORY_SEPARATOR . $file))
if(!is_dir($parent_directory))
{
Console::outError('Cannot create file \'' . $NCC_INSTALL_PATH . DIRECTORY_SEPARATOR . $file . '\', installation failed.');
exit(1);
$NCC_FILESYSTEM->mkdir($parent_directory, 0755);
}
$processed_items += 1;
$NCC_FILESYSTEM->copy($source, $destination);
$NCC_FILESYSTEM->chmod([$destination], 0755);
if (!$NCC_FILESYSTEM->exists($destination))
{
Console::outError(sprintf('Failed to copy file \'%s\' to \'%s\'', $source, $destination), true, 1);
return;
}
}
Console::inlineProgressBar($processed_items, $total_items);
//++$processed_items;
//Console::inlineProgressBar($processed_items, $total_items);
$progress_bar->increaseValue(1, true);
}
// Generate executable shortcut
Console::out('Creating shortcut');
$progress_bar->setMiscText('done', true);
unset($progress_bar);
// 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
{
$executable_shortcut = IO::fread(__DIR__ . DIRECTORY_SEPARATOR . 'ncc.sh');
}
catch(Exception $e)
{
Console::outError($e->getMessage(), true, 1);
Console::outException(sprintf('Failed to read file \'%s\', %s', __DIR__ . DIRECTORY_SEPARATOR . 'ncc.sh', $e->getMessage()), $e, 1);
return;
}
$executable_shortcut = str_ireplace('%php_exec', $NCC_PHP_EXECUTABLE, $executable_shortcut);
$executable_shortcut = str_ireplace('%ncc_exec', $NCC_INSTALL_PATH . DIRECTORY_SEPARATOR . 'ncc', $executable_shortcut);
$executable_shortcut = str_ireplace(['%php_exec', '%ncc_exec'], [$NCC_PHP_EXECUTABLE, $NCC_INSTALL_PATH . DIRECTORY_SEPARATOR . 'ncc'],
$executable_shortcut
);
$bin_paths = [
DIRECTORY_SEPARATOR . 'usr' . DIRECTORY_SEPARATOR . 'local' . DIRECTORY_SEPARATOR . 'bin',
DIRECTORY_SEPARATOR . 'usr' . DIRECTORY_SEPARATOR . 'bin',
DIRECTORY_SEPARATOR . 'bin'
];
foreach($bin_paths as $path)
{
// Delete old versions of the executable shortcuts.
if($NCC_FILESYSTEM->exists($path . DIRECTORY_SEPARATOR . 'ncc'))
{
$NCC_FILESYSTEM->remove($path . DIRECTORY_SEPARATOR . 'ncc');
}
$path .= DIRECTORY_SEPARATOR . 'ncc';
// Delete old versions of the executable shortcuts.
if($NCC_FILESYSTEM->exists($path))
{
try
{
IO::fwrite($path . DIRECTORY_SEPARATOR . 'ncc', $executable_shortcut);
$NCC_FILESYSTEM->chmod([$path . DIRECTORY_SEPARATOR . 'ncc'], 0755);
}
catch (Exception $e)
{
Console::outException($e->getMessage(), $e, 1);
return;
}
}
}
// Register the ncc extension
Console::out('Registering extension');
try
{
$extension_shortcut = IO::fread(__DIR__ . DIRECTORY_SEPARATOR . 'extension');
}
catch(Exception $e)
{
Console::outError($e->getMessage(), true, 1);
return;
}
$extension_shortcut = str_ireplace('%ncc_install', $NCC_INSTALL_PATH, $extension_shortcut);
// Remove all the old extensions first.
/**
* @param string $path
* @param Filesystem $filesystem
* @param string $extension_shortcut
* @return bool
*/
function install_extension(string $path, Filesystem $filesystem, string $extension_shortcut): bool
{
if ($filesystem->exists($path . DIRECTORY_SEPARATOR . 'ncc'))
{
$filesystem->remove($path . DIRECTORY_SEPARATOR . 'ncc');
$NCC_FILESYSTEM->remove($path);
}
try
{
IO::fwrite($path . DIRECTORY_SEPARATOR . 'ncc', $extension_shortcut);
IO::fwrite($path, $executable_shortcut);
$NCC_FILESYSTEM->chmod([$path], 0755);
}
catch (\ncc\Exceptions\IOException $e)
catch (Exception $e)
{
Console::outException($e->getMessage(), $e, 1);
return false;
}
if ($filesystem->exists($path . DIRECTORY_SEPARATOR . 'ncc'))
{
return true;
}
return false;
}
if(function_exists('get_include_path'))
{
$default_share = DIRECTORY_SEPARATOR . 'usr' . DIRECTORY_SEPARATOR . 'share' . DIRECTORY_SEPARATOR . 'php';
$include_paths = explode(':', get_include_path());
$extension_registered = false;
if(!in_array($default_share, $include_paths))
{
foreach($include_paths as $path)
{
if($extension_registered)
break;
switch($path)
{
// Ignore local files
case '.':
case '..':
break;
// First real include path is /usr/share/php
default:
// Install the extension
$extension_registered = install_extension($path, $NCC_FILESYSTEM, $extension_shortcut);
break;
}
}
}
else
{
// Remove the old extension
install_extension($default_share, $NCC_FILESYSTEM, $extension_shortcut);
}
}
// Overwrite automatic values created by the installer
$config_obj['ncc']['data_directory'] = $NCC_DATA_PATH;
$config_obj['php']['executable_path'] = $NCC_PHP_EXECUTABLE;
$config_obj['git']['executable_path'] = $NCC_EXECUTABLE_FINDER->find('git');
$config_obj['composer']['executable_path'] = $NCC_EXECUTABLE_FINDER->find('composer');
if($config_obj['git']['executable_path'] == null)
{
Console::outWarning('Cannot locate the executable path for \'git\', run \'ncc config -p git.executable_path -v "GIT_PATH_HERE"\' as root to update the path');
}
if(!$update_composer)
{
Console::outWarning('Since composer is not installed alongside NCC, the installer will attempt to locate a install of composer on your system and configure NCC to use that');
$config_obj['composer']['enable_internal_composer'] = false;
if($config_obj['composer']['executable_path'] == null)
{
Console::outWarning('Cannot locate the executable path for \'composer\', run \'ncc config --composer.executable_path="composer.phar"\' as root to update the path');
Console::outException(sprintf('Failed to write file \'%s\', %s', $path, $e->getMessage()), $e, 1);
return;
}
}
@ -770,18 +384,20 @@
{
// handle the arguments, merge one by one
$args = func_get_args();
$array = $args[0];
if (!is_array($array))
if (!is_array($args[0]))
{
return $array;
return $args[0];
}
for ($i = 1; $i < count($args); $i++)
for ($i = 1, $i_max = count($args); $i < $i_max; $i++)
{
if (is_array($args[$i]))
{
$array = recurse($array, $args[$i]);
}
}
return $array;
}
}
@ -799,7 +415,7 @@
{
foreach ($array1 as $key => $value)
{
// create new key in $array, if it is empty or not an array
// create new key in $array if it is empty or not an array
/** @noinspection PhpConditionAlreadyCheckedInspection */
if (!isset($array[$key]) || (isset($array[$key]) && !is_array($array[$key])))
{
@ -811,6 +427,7 @@
{
$value = recurse($array[$key], $value);
}
$array[$key] = $value;
}
return $array;
@ -819,9 +436,11 @@
if($config_backup !== null)
{
$config_obj = array_replace_recursive($config_obj, $config_backup);
}
if($config_backup == null)
if($config_backup === null)
{
Console::out('Generating ncc.yaml');
}
@ -840,57 +459,6 @@
return;
}
if($NCC_FILESYSTEM->exists(__DIR__ . DIRECTORY_SEPARATOR . 'repositories'))
{
if(!$NCC_FILESYSTEM->exists(__DIR__ . DIRECTORY_SEPARATOR . 'repositories' . DIRECTORY_SEPARATOR . 'custom_repositories.json'))
return;
try
{
$custom_repositories = Functions::loadJsonFile(__DIR__ . DIRECTORY_SEPARATOR . 'repositories' . DIRECTORY_SEPARATOR . 'custom_repositories.json', Functions::FORCE_ARRAY);
}
catch(Exception $e)
{
$custom_repositories = null;
Console::outWarning(sprintf('Failed to load custom repositories: %s', $e->getMessage()));
}
if($custom_repositories !== null)
{
$source_manager = new RemoteSourcesManager();
foreach($custom_repositories as $repository)
{
$repo_path = __DIR__ . DIRECTORY_SEPARATOR . 'repositories' . DIRECTORY_SEPARATOR . $repository;
if($NCC_FILESYSTEM->exists($repo_path))
{
try
{
$definedEntry = DefinedRemoteSource::fromArray(Functions::loadJsonFile($repo_path, Functions::FORCE_ARRAY));
if(!$source_manager->getRemoteSource($definedEntry->Name))
$source_manager->addRemoteSource($definedEntry);
}
catch(Exception $e)
{
Console::outWarning(sprintf('Failed to load custom repository %s: %s', $repository, $e->getMessage()));
}
}
else
{
Console::outWarning(sprintf('Failed to load custom repository %s, file does not exist', $repository));
}
}
try
{
$source_manager->save();
}
catch (\ncc\Exceptions\IOException $e)
{
Console::outWarning(sprintf('Failed to save sources: %s', $e->getMessage()));
}
}
}
Console::out('NCC version: ' . NCC_VERSION_NUMBER . ' has been successfully installed');
Console::out('For licensing information see \'' . $NCC_INSTALL_PATH . DIRECTORY_SEPARATOR . 'LICENSE\' or run \'ncc help --license\'');

View file

@ -0,0 +1,31 @@
<?xml version="1.0"?>
<!--
~ Copyright (c) Nosial 2022-2023, all rights reserved.
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
~ associated documentation files (the "Software"), to deal in the Software without restriction, including without
~ limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
~ Software, and to permit persons to whom the Software is furnished to do so, subject to the following
~ conditions:
~
~ The above copyright notice and this permission notice shall be included in all copies or substantial portions
~ of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
~ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
~ PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
~ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
~ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
~ DEALINGS IN THE SOFTWARE.
~
-->
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/ncc">
<comment>ncc package binary</comment>
<magic priority="50">
<match type="string" value="ncc_pkg" offset="0"/>
</magic>
<glob pattern="*.ncc"/>
</mime-type>
</mime-info>

12
src/installer/ncc.desktop Normal file
View file

@ -0,0 +1,12 @@
[Desktop Entry]
Version=1.0
Name=ncc
GenericName=Nosial Code Compiler
Comment=Nosial Code Compiler
Exec=/usr/bin/ncc
TryExec=/usr/bin/ncc
Icon=/usr/share/icons/ncc.png
Terminal=true
Type=Application
Categories=Development;
Keywords=compiler;code

View file

@ -1,36 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class AuthenticationType
{
/**
* A combination of a username and password is used for authentication
*/
const UsernamePassword = 1;
/**
* A single private access token is used for authentication
*/
const AccessToken = 2;
}

View file

@ -1,37 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
class BuiltinRemoteSourceType
{
/**
* The remote source indicates the package is to be
* fetched using the composer utility.
*/
const Composer = 'composer';
const All = [
self::Composer
];
}

View file

@ -1,33 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class CompilerExtensionDefaultVersions
{
// ----------------------------------------------------------------
// [0] = MinimumVersion
// [1] = MaximumVersion
// ----------------------------------------------------------------
const PHP = ['8.0', '8.2'];
}

View file

@ -1,28 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class CompilerExtensionSupportedVersions
{
const PHP = ['8.0', '8.1', '8.2'];
}

View file

@ -1,32 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class CompilerExtensions
{
const PHP = 'php';
const All = [
CompilerExtensions::PHP
];
}

View file

@ -1,51 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class ComponentDataType
{
/**
* Indicates whether the component is represented as an AST representation
*/
const AST = 'ast';
/**
* Indicates whether the component is represented as plaintext
*/
const Plain = 'plain';
/**
* Indicates whether the component is represented as bytecode
*/
const Bytecode = 'bytecode';
/**
* Indicates whether the component is represented as binary or executable
*/
const Binary = 'binary';
/**
* Indicates whether the component is represented as as a base64 encoded string (Raw bytes' representation)
*/
const b64encoded = 'b64enc';
}

View file

@ -1,33 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class ComponentFileExtensions
{
/**
* The file extensions that the PHP compiler extension will accept as components.
*
* @var array
*/
const Php = ['*.php', '*.php3', '*.php4', '*.php5', '*.phtml'];
}

View file

@ -1,55 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class ComposerPackageTypes
{
/**
* This is the default. It will copy the files to `vendor`
*/
const Library = 'library';
/**
* This denotes a project rather than a library. For example
* application shells like the Symfony standard edition, CMSs
* like the SilverStripe installer or full-fledged applications
* distributed as packages. This can for example be used by IDEs
* to provide listings of projects to initialize when creating
* a new workspace.
*/
const Project = 'project';
/**
* An empty package that contains requirements and will trigger
* their installation, but contains no files and will not write
* anything to the filesystem. As such, it does not require a
* a dist or source key to be installable
*/
const MetaPackage = 'metapackage';
/**
* A package of type `composer-plugin` may provide an installer
* for other packages that have a custom type.
*/
const ComposerPlugin = 'composer-plugin';
}

View file

@ -1,36 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class ComposerStabilityTypes
{
const Dev = 'dev';
const Alpha = 'alpha';
const Beta = 'beta';
const RC = 'rc';
const Stable ='stable';
}

View file

@ -1,60 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class ConsoleColors
{
const Default = "\e[39m";
const Black = "\e[30m";
const Red = "\e[31m";
const Green = "\e[32m";
const Yellow = "\e[33m";
const Blue = "\e[34m";
const Magenta = "\e[35m";
const Cyan = "\e[36m";
const LightGray = "\e[37m";
const DarkGrey = "\e[90m";
const LightRed = "\e[91m";
const LightGreen = "\e[92m";
const LightYellow = "\e[93m";
const LightBlue = "\e[94m";
const LightMagenta = "\e[95m";
const LightCyan = "\e[96m";
const White = "\e[97m";
}

View file

@ -1,36 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class ConstantReferences
{
const Assembly = 'assembly';
const Build = 'build';
const DateTime = 'date_time';
const Install = 'install';
const Runtime = 'runtime';
}

View file

@ -1,53 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class DefinedRemoteSourceType
{
/**
* THe remote source is from gitlab or a custom gitlab instance
*
* Will use an API wrapper to interact with the gitlab instance
* to fetch the package and check for updates without having to
* pull the entire repository
*
* Will still use git to fetch the package from the gitlab instance
*/
const Gitlab = 'gitlab';
/**
* The remote source is from GitHub
*
* Will use an API wrapper to interact with the GitHub instance
* to fetch the package and check for updates without having to
* pull the entire repository
*
* Will still use git to fetch the package from the GitHub instance
*/
const Github = 'github';
const All = [
self::Gitlab,
self::Github
];
}

View file

@ -1,49 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class DependencySourceType
{
/**
* The dependency pointer does not point to a package
*/
const None = 'none';
/**
* Indicates if the dependency is statically linked and the
* reference points to the compiled package of the dependency
*/
const StaticLinking = 'static';
/**
* Indicates if the pointer reference points to a remote source
* to fetch the dependency from
*/
const RemoteSource = 'remote';
/**
* Indicates if the pointer reference points to a relative file with the
* filename format "{package_name}=={version}.ncc" to fetch the dependency from
*/
const Local = 'local';
}

View file

@ -1,28 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class EncoderType
{
const ZiProto = '3';
}

View file

@ -1,449 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
use ncc\Exceptions\SymlinkException;
/**
* @author Zi Xing Narrakas
* @copyright Copyright (C) 2022-2022. Nosial - All Rights Reserved.
*/
abstract class ExceptionCodes
{
/**
* @see InvalidProjectConfigurationException
*/
const InvalidProjectConfigurationException = -1700;
/**
* @see FileNotFoundException;
*/
const FileNotFoundException = -1701;
/**
* @see DirectoryNotFoundException
*/
const DirectoryNotFoundException = -1702;
/**
* @see InvalidScopeException
*/
const InvalidScopeException = -1703;
/**
* @see AccessDeniedException
*/
const AccessDeniedException = -1704;
/**
* @see MalformedJsonException
*/
const MalformedJsonException = -1705;
/**
* @see RuntimeException
*/
const RuntimeException = -1706;
/**
* @see InvalidCredentialsEntryException
*/
const InvalidCredentialsEntryException = -1707;
/**
* @see ComponentVersionNotFoundException
*/
const ComponentVersionNotFoundException = -1708;
/**
* @see ConstantReadonlyException
*/
const ConstantReadonlyException = -1709;
/**
* @see InvalidPackageNameException
*/
const InvalidPackageNameException = -1710;
/**
* @see InvalidVersionNumberException
*/
const InvalidVersionNumberException = -1711;
/**
* @see InvalidProjectNameException
*/
const InvalidProjectNameException = -1712;
/**
* @see ProjectAlreadyExistsException
*/
const ProjectAlreadyExistsException = -1713;
/**
* @see AutoloadGeneratorException
*/
const AutoloadGeneratorException = -1714;
/**
* @see NoUnitsFoundException
*/
const NoUnitsFoundException = -1715;
/**
* @see UnsupportedPackageException
*/
const UnsupportedPackageException = -1716;
/**
* @see NotImplementedException
*/
const NotImplementedException = -1717;
/**
* @see InvalidPackageException
*/
const InvalidPackageException = -1718;
/**
* @see InvalidConstantNameException
*/
const InvalidConstantNameException = -1719;
/**
* @see PackagePreparationFailedException
*/
const PackagePreparationFailedException = -1720;
/**
* @see BuildConfigurationNotFoundException
*/
const BuildConfigurationNotFoundException = -1721;
/**
* @see InvalidProjectBuildConfiguration
*/
const InvalidProjectBuildConfiguration = -1722;
/**
* @see UnsupportedCompilerExtensionException
*/
const UnsupportedCompilerExtensionException = -1723;
/**
* @see InvalidPropertyValueException
*/
const InvalidPropertyValueException = -1724;
/**
* @see InvalidVersionConfigurationException
*/
const InvalidVersionConfigurationException = -1725;
/**
* @see UnsupportedExtensionVersionException
*/
const UnsupportedExtensionVersionException = -1726;
/**
* @see BuildException
*/
const BuildException = -1727;
/**
* @see PackageParsingException
*/
const PackageParsingException = -1728;
/**
* @see PackageLockException
*/
const PackageLockException = -1729;
/**
* @see InstallationException
*/
const InstallationException = -1730;
/**
* @see UnsupportedComponentTypeException
*/
const UnsupportedComponentTypeException = -1731;
/**
* @see ComponentDecodeException
*/
const ComponentDecodeException = -1732;
/**
* @see ComponentChecksumException
*/
const ComponentChecksumException = -1733;
/**
* @see ResourceChecksumException
*/
const ResourceChecksumException = -1734;
/**
* @see IOException
*/
const IOException = -1735;
/**
* @see UnsupportedRunnerException
*/
const UnsupportedRunnerException = -1736;
/**
* @see VersionNotFoundException
*/
const VersionNotFoundException = -1737;
/**
* @see UndefinedExecutionPolicyException
*/
const UndefinedExecutionPolicyException = -1738;
/**
* @see InvalidExecutionPolicyName
*/
const InvalidExecutionPolicyName = -1739;
/**
* @see ProjectConfigurationNotFoundException
*/
const ProjectConfigurationNotFoundException = -1740;
/**
* @see RunnerExecutionException
*/
const RunnerExecutionException = -1741;
/**
* @see NoAvailableUnitsException
*/
const NoAvailableUnitsException = -1742;
/**
* @see ExecutionUnitNotFoundException
*/
const ExecutionUnitNotFoundException = -1743;
/**
* @see PackageAlreadyInstalledException
*/
const PackageAlreadyInstalledException = -1744;
/**
* @see PackageNotFoundException
*/
const PackageNotFoundException = -1745;
/**
* @see ComposerDisabledException
*/
const ComposerDisabledException = -1746;
/**
* @see InternalComposerNotAvailableException
*/
const InternalComposerNotAvailable = -1747;
/**
* @see ComposerNotAvailableException
*/
const ComposerNotAvailableException = -1748;
/**
* @see ComposerException
*/
const ComposerException = -1749;
/**
* @see UserAbortedOperationException
*/
const UserAbortedOperationException = -1750;
/**
* @see MissingDependencyException
*/
const MissingDependencyException = -1751;
/**
* @see HttpException
*/
const HttpException = -1752;
/**
* @see UnsupportedRemoteSourceTypeException
*/
const UnsupportedRemoteSourceTypeException = -1753;
/**
* @see GitCloneException
*/
const GitCloneException = -1754;
/**
* @see GitCheckoutException
*/
const GitCheckoutException = -1755;
/**
* @see GitlabServiceException
*/
const GitlabServiceException = -1756;
/**
* @see ImportException
*/
const ImportException = -1757;
/**
* @see GitTagsException
*/
const GitTagsException = -1758;
/**
* @see GithubServiceException
*/
const GithubServiceException = -1759;
/**
* @see AuthenticationException
*/
const AuthenticationException = -1760;
/**
* @see NotSupportedException
*/
const NotSupportedException = -1761;
/**
* @see UnsupportedProjectTypeException
*/
const UnsupportedProjectTypeException = -1762;
/**
* @see UnsupportedArchiveException
*/
const UnsupportedArchiveException = -1763;
/**
* @see ArchiveException
*/
const ArchiveException = -1764;
/**
* @see PackageFetchException
*/
const PackageFetchException = -1765;
/**
* @see InvalidBuildConfigurationException
*/
const InvalidBuildConfigurationException = -1766;
/**
* @see InvalidBuildConfigurationNameException
*/
const InvalidDependencyConfiguration = -1767;
/**
* @see SymlinkException
*/
const SymlinkException = -1768;
/**
* All the exception codes from NCC
*/
const All = [
self::InvalidProjectConfigurationException,
self::FileNotFoundException,
self::DirectoryNotFoundException,
self::InvalidScopeException,
self::AccessDeniedException,
self::MalformedJsonException,
self::RuntimeException,
self::InvalidCredentialsEntryException,
self::ComponentVersionNotFoundException,
self::ConstantReadonlyException,
self::InvalidPackageNameException,
self::InvalidVersionNumberException,
self::InvalidProjectNameException,
self::ProjectAlreadyExistsException,
self::AutoloadGeneratorException,
self::NoUnitsFoundException,
self::UnsupportedPackageException,
self::NotImplementedException,
self::InvalidPackageException,
self::InvalidConstantNameException,
self::PackagePreparationFailedException,
self::BuildConfigurationNotFoundException,
self::InvalidProjectBuildConfiguration,
self::UnsupportedCompilerExtensionException,
self::InvalidPropertyValueException,
self::InvalidVersionConfigurationException,
self::UnsupportedExtensionVersionException,
self::BuildException,
self::PackageParsingException,
self::PackageLockException,
self::InstallationException,
self::UnsupportedComponentTypeException,
self::ComponentDecodeException,
self::ResourceChecksumException,
self::IOException,
self::UnsupportedRunnerException,
self::VersionNotFoundException,
self::UndefinedExecutionPolicyException,
self::InvalidExecutionPolicyName,
self::ProjectConfigurationNotFoundException,
self::RunnerExecutionException,
self::NoAvailableUnitsException,
self::ExecutionUnitNotFoundException,
self::PackageAlreadyInstalledException,
self::PackageNotFoundException,
self::ComposerDisabledException,
self::InternalComposerNotAvailable,
self::ComposerNotAvailableException,
self::ComposerException,
self::UserAbortedOperationException,
self::MissingDependencyException,
self::HttpException,
self::UnsupportedRemoteSourceTypeException,
self::GitCloneException,
self::GitCheckoutException,
self::GitlabServiceException,
self::GitTagsException,
self::AuthenticationException,
self::NotSupportedException,
self::UnsupportedProjectTypeException,
self::UnsupportedArchiveException,
self::ArchiveException,
self::PackageFetchException,
self::InvalidBuildConfigurationException,
self::InvalidDependencyConfiguration,
self::SymlinkException,
];
}

View file

@ -1,31 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class HttpRequestType
{
const GET = 'GET';
const POST = 'POST';
const PUT = 'PUT';
const DELETE = 'DELETE';
}

View file

@ -1,124 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class HttpStatusCodes
{
const OK = 200;
const CREATED = 201;
const ACCEPTED = 202;
const NO_CONTENT = 204;
const MOVED_PERMANENTLY = 301;
const FOUND = 302;
const SEE_OTHER = 303;
const NOT_MODIFIED = 304;
const TEMPORARY_REDIRECT = 307;
const PERMANENT_REDIRECT = 308;
const BAD_REQUEST = 400;
const UNAUTHORIZED = 401;
const FORBIDDEN = 403;
const NOT_FOUND = 404;
const METHOD_NOT_ALLOWED = 405;
const NOT_ACCEPTABLE = 406;
const REQUEST_TIMEOUT = 408;
const CONFLICT = 409;
const GONE = 410;
const LENGTH_REQUIRED = 411;
const PRECONDITION_FAILED = 412;
const PAYLOAD_TOO_LARGE = 413;
const URI_TOO_LONG = 414;
const UNSUPPORTED_MEDIA_TYPE = 415;
const RANGE_NOT_SATISFIABLE = 416;
const EXPECTATION_FAILED = 417;
const IM_A_TEAPOT = 418;
const MISDIRECTED_REQUEST = 421;
const UNPROCESSABLE_ENTITY = 422;
const LOCKED = 423;
const FAILED_DEPENDENCY = 424;
const UPGRADE_REQUIRED = 426;
const PRECONDITION_REQUIRED = 428;
const TOO_MANY_REQUESTS = 429;
const REQUEST_HEADER_FIELDS_TOO_LARGE = 431;
const UNAVAILABLE_FOR_LEGAL_REASONS = 451;
const INTERNAL_SERVER_ERROR = 500;
const NOT_IMPLEMENTED = 501;
const BAD_GATEWAY = 502;
const SERVICE_UNAVAILABLE = 503;
const GATEWAY_TIMEOUT = 504;
const HTTP_VERSION_NOT_SUPPORTED = 505;
const VARIANT_ALSO_NEGOTIATES = 506;
const INSUFFICIENT_STORAGE = 507;
const LOOP_DETECTED = 508;
const NOT_EXTENDED = 510;
const NETWORK_AUTHENTICATION_REQUIRED = 511;
const All = [
self::OK,
self::CREATED,
self::ACCEPTED,
self::NO_CONTENT,
self::MOVED_PERMANENTLY,
self::FOUND,
self::SEE_OTHER,
self::NOT_MODIFIED,
self::TEMPORARY_REDIRECT,
self::PERMANENT_REDIRECT,
self::BAD_REQUEST,
self::UNAUTHORIZED,
self::FORBIDDEN,
self::NOT_FOUND,
self::METHOD_NOT_ALLOWED,
self::NOT_ACCEPTABLE,
self::REQUEST_TIMEOUT,
self::CONFLICT,
self::GONE,
self::LENGTH_REQUIRED,
self::PRECONDITION_FAILED,
self::PAYLOAD_TOO_LARGE,
self::URI_TOO_LONG,
self::UNSUPPORTED_MEDIA_TYPE,
self::RANGE_NOT_SATISFIABLE,
self::EXPECTATION_FAILED,
self::IM_A_TEAPOT,
self::MISDIRECTED_REQUEST,
self::UNPROCESSABLE_ENTITY,
self::LOCKED,
self::FAILED_DEPENDENCY,
self::UPGRADE_REQUIRED,
self::PRECONDITION_REQUIRED,
self::TOO_MANY_REQUESTS,
self::REQUEST_HEADER_FIELDS_TOO_LARGE,
self::UNAVAILABLE_FOR_LEGAL_REASONS,
self::INTERNAL_SERVER_ERROR,
self::NOT_IMPLEMENTED,
self::BAD_GATEWAY,
self::SERVICE_UNAVAILABLE,
self::GATEWAY_TIMEOUT,
self::HTTP_VERSION_NOT_SUPPORTED,
self::VARIANT_ALSO_NEGOTIATES,
self::INSUFFICIENT_STORAGE,
self::LOOP_DETECTED,
self::NOT_EXTENDED,
self::NETWORK_AUTHENTICATION_REQUIRED
];
}

View file

@ -1,50 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class LogLevel
{
const Silent = 'silent';
const Verbose = 'verbose';
const Debug = 'debug';
const Info = 'info';
const Warning = 'warn';
const Error = 'error';
const Fatal = 'fatal';
const All = [
self::Silent,
self::Verbose,
self::Debug,
self::Info,
self::Warning,
self::Error,
self::Fatal,
];
}

View file

@ -1,32 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class NccBuildFlags
{
/**
* Indicates if the build is currently unstable and some features may not work correctly
* and can cause errors
*/
const Unstable = 'unstable';
}

View file

@ -1,30 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts\Options;
abstract class BuildConfigurationValues
{
const DefaultConfiguration = 'default';
const AllConfigurations = 'all';
}

View file

@ -1,28 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts\Options;
abstract class InitializeProjectOptions
{
const CREATE_SOURCE_DIRECTORY = 1;
}

View file

@ -1,40 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts\Options;
abstract class InstallPackageOptions
{
/**
* Skips the installation of dependencies of the package
*
* @warning This will cause the package to fail to import of
* the dependencies are not met
*/
const SkipDependencies = 'skip_dependencies';
/**
* Reinstall all packages if they are already installed
* Including dependencies if they are being processed.
*/
const Reinstall = 'reinstall';
}

View file

@ -1,38 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts\Options;
abstract class RuntimeImportOptions
{
/**
* Indicates if the import should require PHP's autoload.php file
* for the package (Only applies to PHP packages)
*/
const ImportAutoloader = 'import_autoloader';
/**
* Indicates if the import should require all static files
* for the package (Only applies to PHP packages)
*/
const ImportStaticFiles = 'import_static_files';
}

View file

@ -1,28 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class PackageStandardVersions
{
const VERSION_1 = '1.0';
}

View file

@ -1,32 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class PackageStructureVersions
{
const _1_0 = '1.0';
const ALL = [
self::_1_0
];
}

View file

@ -1,32 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class ProjectType
{
const Composer = 'composer';
const Ncc = 'ncc';
const Unknown = 'unknown';
}

View file

@ -1,54 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
/**
* @author Zi Xing Narrakas
* @copyright Copyright (C) 2022-2022. Nosial - All Rights Reserved.
*/
abstract class RegexPatterns
{
const UUID = '{^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$}Di';
const PackageNameFormat = '/^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+[0-9a-z_]$/';
const ComposerVersionFormat = '/^([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/';
const PythonVersionFormat = '/^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/';
const SemanticVersioning2 = '/^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/m';
const UnixPath = '/^(((?:\.\/|\.\.\/|\/)?(?:\.?\w+\/)*)(\.?\w+\.?\w+))$/m';
const WindowsPath = '/^(([%][^\/:*?<>""|]*[%])|([a-zA-Z][:])|(\\\\))((\\\\{1})|((\\\\{1})[^\\\\]([^\/:*?<>""|]*))+)$/m';
const ConstantName = '/^([^\x00-\x7F]|[\w_\ \.\+\-]){2,64}$/';
const ExecutionPolicyName = '/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/m';
/**
* @author <purplex>
*/
const RemotePackage = '/^(?<vendor>[^\/\n]+)\/(?<package>[^:=\n@]+)(?:=(?<version>[^:@\n]+))?(?::(?<branch>[^@\n]+))?@(?<source>.*)$/m';
}

View file

@ -1,50 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class RemoteSourceType
{
/**
* A builtin source type is not defined by the user but handled by
* an extension built into NCC
*/
const Builtin = 'builtin';
/**
* A defined source type is defined by the user in the remote sources file
* and handled by an extension designed by passing on the information of
* the source to the extension
*/
const Defined = 'defined';
/**
* Unsupported or invalid source type
*/
const Unknown = 'unknown';
const All = [
self::Builtin,
self::Defined,
self::Unknown
];
}

View file

@ -1,51 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class Runners
{
const php = 'php';
const bash = 'bash';
const python = 'python';
const python3 = 'python3';
const python2 = 'python2';
const perl = 'perl';
const lua = 'lua';
const All = [
self::php,
self::bash,
self::python,
self::python3,
self::python2,
self::perl,
self::lua
];
}

View file

@ -1,32 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Abstracts;
abstract class Scopes
{
const Auto = 'AUTO';
const User = 'USER';
const System = 'SYSTEM';
}

Some files were not shown because too many files have changed in this diff Show more