Compare commits
471 commits
1.0.1-alph
...
master
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b975508d07 | ||
![]() |
1ef96c3c4c | ||
![]() |
2dad5133bd | ||
![]() |
544d4ebdf6 | ||
![]() |
41947069be | ||
![]() |
11aaa39eaa | ||
bdcf510089 | |||
278b3d0e2e | |||
771748636d | |||
![]() |
3b5a3882f6 | ||
![]() |
77c668f7b6 | ||
![]() |
c40c7ce8fe | ||
![]() |
f5433c6bf9 | ||
![]() |
bc86e5a65d | ||
![]() |
f8ede74764 | ||
![]() |
c87ebf14dd | ||
![]() |
e48e6a55e4 | ||
![]() |
08c770c9e1 | ||
![]() |
e2a8dbfe27 | ||
![]() |
91fe129bf4 | ||
![]() |
44dc1498f7 | ||
![]() |
c659baa9ce | ||
![]() |
1b33b83926 | ||
![]() |
9303158674 | ||
![]() |
d249e99448 | ||
![]() |
3f2f325bcc | ||
![]() |
2a20786755 | ||
![]() |
8ceb6756a4 | ||
![]() |
51bdb22540 | ||
![]() |
36d8e6f8c6 | ||
![]() |
9136396700 | ||
![]() |
e225add40b | ||
![]() |
33865d7e48 | ||
![]() |
cba6942cca | ||
![]() |
29e0a6e4ae | ||
![]() |
cba5f7041a | ||
![]() |
1ddb042175 | ||
![]() |
093e3341e1 | ||
![]() |
80a019452f | ||
![]() |
b30ddbdc28 | ||
![]() |
e829a839d1 | ||
![]() |
d813ef7b94 | ||
![]() |
09fb388ee7 | ||
![]() |
87290232f5 | ||
![]() |
adbd1d1751 | ||
![]() |
273df6ebb4 | ||
![]() |
d2baa2d580 | ||
![]() |
b2ef33d48f | ||
![]() |
7e79bba762 | ||
![]() |
45c58c0568 | ||
![]() |
3b0f1a805c | ||
![]() |
3640befdcc | ||
![]() |
798fe9e797 | ||
![]() |
140b0f2aff | ||
![]() |
64fdc3b5bd | ||
![]() |
23bd2c6636 | ||
![]() |
b29c83f276 | ||
![]() |
5eeb0d270d | ||
![]() |
2c5733c5c0 | ||
![]() |
e041ca2c20 | ||
![]() |
c9e4a6741a | ||
![]() |
634f50e317 | ||
![]() |
6d2d827de2 | ||
![]() |
1bb6189e57 | ||
![]() |
4db07af9bb | ||
![]() |
b93e07bc3d | ||
![]() |
9418125722 | ||
![]() |
7494ead7b3 | ||
![]() |
170cb4bf6d | ||
![]() |
dda710119c | ||
![]() |
be70823a79 | ||
![]() |
923117999b | ||
![]() |
a1404490bb | ||
![]() |
e556282f61 | ||
![]() |
cdd3516766 | ||
![]() |
9831b9dca1 | ||
![]() |
dd48100f06 | ||
![]() |
910477df8e | ||
![]() |
d59f5fb6e0 | ||
![]() |
4e174821fc | ||
![]() |
c7b007c704 | ||
![]() |
272fc8524e | ||
![]() |
5e173b7cc0 | ||
![]() |
91a25390fa | ||
![]() |
bcb26d1eec | ||
![]() |
1389b61fa2 | ||
![]() |
16ad69b9f2 | ||
![]() |
3aedd2d94d | ||
![]() |
b2d2a1ea15 | ||
![]() |
604e1fd3e7 | ||
![]() |
3950655024 | ||
![]() |
da8a6fac01 | ||
![]() |
943048785d | ||
![]() |
bdcf5160de | ||
![]() |
46fd39c51c | ||
![]() |
8e6acbbc70 | ||
![]() |
3adc1b81fb | ||
![]() |
3160ddfa27 | ||
![]() |
ae8021bb3a | ||
![]() |
b6cdb2a78c | ||
![]() |
3e8af9c43c | ||
![]() |
e5ceb9bbf7 | ||
![]() |
bcefb6c56a | ||
![]() |
3c1286d9c2 | ||
![]() |
d8247b0760 | ||
![]() |
68cfed8a05 | ||
![]() |
04a85900fd | ||
![]() |
836d0f33eb | ||
![]() |
ffc6588ff9 | ||
![]() |
0afc45f300 | ||
![]() |
61158ff802 | ||
![]() |
ad9e406657 | ||
![]() |
27c79b1170 | ||
![]() |
7e224d91b2 | ||
![]() |
d0e484631f | ||
![]() |
1bcfe90bea | ||
![]() |
e624663f62 | ||
![]() |
8b64a48a5f | ||
![]() |
24e67061f1 | ||
![]() |
6398b2958b | ||
![]() |
5ea0235515 | ||
![]() |
b291604145 | ||
![]() |
714228ad2e | ||
![]() |
aa65dd73cf | ||
![]() |
dfa6b50299 | ||
![]() |
8f87541a64 | ||
6482d06ba2 | |||
9fe2dc48fe | |||
039147c8a8 | |||
863dffafe7 | |||
0c4ef17bbf | |||
ac81f2f26d | |||
66e6e1528d | |||
c24fce2ee5 | |||
ae21d98290 | |||
d379956437 | |||
2bd2d757fd | |||
87844ab00a | |||
ec6b368a82 | |||
2efa6654e6 | |||
21c2405a27 | |||
87a8ca24a1 | |||
492548d81f | |||
9c06378258 | |||
0d9f3d37a3 | |||
e02f1f56dc | |||
12f0ff2ffa | |||
e11f95a22a | |||
fd928ffc99 | |||
3db33006b7 | |||
b5d35ed20e | |||
a2149cdb66 | |||
28ff80dd41 | |||
86cf7467af | |||
3d44562241 | |||
5b24fe267d | |||
14ec2e06b2 | |||
71ffed1a3f | |||
d884d0fbda | |||
baf11f5cb9 | |||
e1013f6c15 | |||
718c6ff8d8 | |||
5dd98083d6 | |||
d612c67cb0 | |||
42473390e8 | |||
cfc93aa066 | |||
91103c1470 | |||
9885d98b55 | |||
321fef4228 | |||
c687d0394d | |||
2a16b2de6b | |||
e98b949b7d | |||
7e5cdf4d64 | |||
90535a3a35 | |||
69de79ccf4 | |||
7c9f63955a | |||
1ba50cc7ee | |||
f9047dd0d0 | |||
a65b76b6bf | |||
957d9a9510 | |||
d2635b19fd | |||
76f12bb0a3 | |||
7befd995e7 | |||
b2234d5040 | |||
27d1609b23 | |||
de1e199dff | |||
aa6800e96a | |||
a2cd98ba98 | |||
27baeca112 | |||
4f7aa7a859 | |||
3ebdeb0cba | |||
bcc6f45eb4 | |||
698d2e7a1f | |||
89d3af8680 | |||
12d7744e1e | |||
a76a8a4ae6 | |||
7293519ba3 | |||
2605b8d218 | |||
173032df72 | |||
c736a896fb | |||
930c206fa9 | |||
4c6f2ddcfe | |||
d434345c59 | |||
e3ac3cf7a3 | |||
81ea985b68 | |||
71214e769e | |||
89b0c931b9 | |||
4ef923b83c | |||
e4a3dc2f99 | |||
d9b30a755d | |||
ff5a6c7f7a | |||
21753364dc | |||
345a215a56 | |||
08592e4cb6 | |||
e1907911bf | |||
94e599e372 | |||
35981115eb | |||
c82bc7195a | |||
e69ae7aba9 | |||
87dc682ef2 | |||
71787cd7fe | |||
68ea83c103 | |||
af9f3fba22 | |||
7e1072fdf6 | |||
d32592e393 | |||
72a429ecce | |||
5dd3472f2a | |||
9e1f55acb7 | |||
1b8079f96b | |||
a1f1541854 | |||
a8e74a0877 | |||
83329c6076 | |||
79b5bafd3e | |||
de9ee13aa1 | |||
97f31399e3 | |||
a69a705451 | |||
6d39f1da13 | |||
f24caf0799 | |||
d65f1955d6 | |||
437b3f8b78 | |||
42f9a39131 | |||
bcc550ede6 | |||
f94794bfb3 | |||
a63d148f30 | |||
09debf85c6 | |||
aeccdaea68 | |||
43cbe801d8 | |||
0a2cee2a02 | |||
6388b27b7a | |||
3f67344a60 | |||
32b455576d | |||
![]() |
1880ab6fa8 | ||
![]() |
5ec56ac0ab | ||
![]() |
248d420881 | ||
![]() |
f88a9b4802 | ||
2d3c1f3ab0 | |||
fb366f3aca | |||
fe8f178b6f | |||
bf980be6e7 | |||
b102089d80 | |||
5b57f12365 | |||
d3659cb51a | |||
![]() |
5a38586ff2 | ||
![]() |
41ec00d136 | ||
![]() |
bb09222f46 | ||
a96830942a | |||
8de8f29bd6 | |||
0e486e0a64 | |||
2d638540a0 | |||
3a52815213 | |||
8ce6c68d77 | |||
cf7e1aa107 | |||
d5e28d1f45 | |||
63411d7d65 | |||
b689be3bd5 | |||
09977f9f11 | |||
8549cff119 | |||
021d5ec750 | |||
1e0ea848b8 | |||
161ef357a2 | |||
0b4dbf6cc1 | |||
4673c74d16 | |||
01589e509f | |||
c73465e965 | |||
44a12b66cf | |||
4d317d61ab | |||
234c6e955b | |||
9bc339d1cb | |||
107ebfa68c | |||
c86b4b7465 | |||
67956d3641 | |||
f2b69253ae | |||
05c6483edc | |||
5d9168f664 | |||
770dde9ed2 | |||
9ded98c3e1 | |||
976518439f | |||
e1f813ab60 | |||
38ab509630 | |||
2cb5659de9 | |||
29cf2ac00b | |||
67a1a29f8a | |||
9cfca3281a | |||
09c89c16a0 | |||
ba2e968676 | |||
d5c0ebf9c7 | |||
9aba1cbf38 | |||
f62856b530 | |||
![]() |
23e2673eed | ||
5da97e4b3d | |||
de88a4fb9e | |||
ab32a3bba3 | |||
4682b613a4 | |||
5ce1c8cfa1 | |||
d41ae8114f | |||
d4f69522fc | |||
e7eecd354a | |||
d4e710d9d9 | |||
00e9bf1dd9 | |||
84e4158fb8 | |||
45c53981ef | |||
0e8397ec1f | |||
8ea203a0f1 | |||
01cda99139 | |||
230675c586 | |||
99bdd933cd | |||
dd3c659fe1 | |||
b751b39548 | |||
e93fd81002 | |||
2ad6dfabab | |||
960770d73f | |||
05c890f0d1 | |||
42c26c92a0 | |||
eeffb15eb7 | |||
424b503f42 | |||
cda454a9c1 | |||
729c9cb217 | |||
2ea1dfc27a | |||
dc7fcfc757 | |||
9c76d31de9 | |||
628d126baf | |||
eef360a8f7 | |||
69d7b86534 | |||
cdbc87e4bc | |||
623da68d29 | |||
7ad8518114 | |||
b685d66b77 | |||
59dc4bb9cb | |||
0f08bd54d4 | |||
c151d29b46 | |||
14541123c0 | |||
57305c8b52 | |||
85d4a63248 | |||
00dcc7e004 | |||
c3406ca13f | |||
79c02e5132 | |||
348ca2d4a1 | |||
15fd06d2d0 | |||
352faa0b23 | |||
7138913ef3 | |||
8df38191c6 | |||
2e11e32611 | |||
b4ae29d0b3 | |||
57009c115f | |||
0820cd3c32 | |||
983e34f58e | |||
8e44a8c7c9 | |||
3afcb731fe | |||
309d37fe7d | |||
ae373c6f70 | |||
bc1156278e | |||
4dc1463d26 | |||
84e5e5a346 | |||
d4709443f7 | |||
393078cd9e | |||
8019d8c378 | |||
5e7e82598d | |||
3269100ef5 | |||
01252aa7bb | |||
43f5e32c87 | |||
a64161e648 | |||
99e5961f9b | |||
7a1b337800 | |||
56bfad6818 | |||
5aeabb0d4e | |||
a51d6f74f7 | |||
da3354965f | |||
6a3200c35d | |||
48e986e26c | |||
c0bde40fea | |||
7279212387 | |||
5c3945a96c | |||
afeccba803 | |||
57cd97e75b | |||
b649f36467 | |||
eb0ae32b71 | |||
5ef3e8a08d | |||
5992a2bb6c | |||
1fad26d0b6 | |||
22997fc072 | |||
6567f5900a | |||
60365861ab | |||
5fe91c7d14 | |||
6eef188389 | |||
ac8fba7958 | |||
6ce327c527 | |||
770a99d8c5 | |||
eb061171a5 | |||
e576b3b4c0 | |||
b3e456a088 | |||
4d9316cd72 | |||
628c84b968 | |||
07d5487126 | |||
618f49dec6 | |||
![]() |
289e1f4897 | ||
![]() |
4460cad692 | ||
![]() |
7ef3bd0e8b | ||
![]() |
eb7c0815bb | ||
b775e435c7 | |||
566c70ded7 | |||
bce47a62c3 | |||
b2c3974d76 | |||
![]() |
0e388bbbda | ||
![]() |
e8ee078a2f | ||
d75a2124dd | |||
56c59ba4f4 | |||
c2d0e6e23c | |||
716203856c | |||
![]() |
b9be303876 | ||
![]() |
319f7b65d0 | ||
05b46296d7 | |||
277a09529e | |||
05d05e33b1 | |||
2fb56d3543 | |||
ffa48ca0aa | |||
56a220f704 | |||
b287ba5457 | |||
8fca981d85 | |||
78be09cd20 | |||
03cd0d4d16 | |||
34e3b13dfe | |||
6e0613650a | |||
![]() |
f955c6c2cd | ||
![]() |
3485a66bc2 | ||
![]() |
e77b806724 | ||
![]() |
10538b22b1 | ||
![]() |
ac8101c7f3 | ||
![]() |
ae62bae9a0 | ||
![]() |
02a5e24b86 | ||
![]() |
1873b9c1db | ||
![]() |
b56a0c3131 | ||
![]() |
3579d7bf83 | ||
![]() |
f5cc3f46b8 | ||
![]() |
62a66fb4c4 | ||
![]() |
aeeffa8abf | ||
![]() |
9d7942746c | ||
![]() |
edbe1937e1 | ||
![]() |
7f34b7ce9e | ||
![]() |
12afa07e28 | ||
![]() |
efc3257a41 | ||
![]() |
3a7738140f | ||
![]() |
712020b129 | ||
![]() |
32a4a8c2cf | ||
![]() |
40497db58c | ||
![]() |
d272fe74a9 | ||
![]() |
0f26bdc960 | ||
![]() |
28e673d5a4 | ||
![]() |
5f7440166e | ||
![]() |
16aad8eb38 | ||
![]() |
177b6b5238 | ||
![]() |
7f73c45920 |
136
.github/workflows/ci.yml
vendored
Normal 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
|
@ -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
|
||||
|
|
148
.gitlab-ci.yml
|
@ -1,34 +1,132 @@
|
|||
image: php:8.1
|
||||
image: php:8.2
|
||||
|
||||
stages:
|
||||
- setup
|
||||
- build
|
||||
- docker
|
||||
- publish
|
||||
|
||||
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
|
||||
- apt update -yqq
|
||||
- apt install -yqq git libzip-dev zip make wget gnupg2 libonig-dev libcurl4-openssl-dev
|
||||
- apt-get clean
|
||||
|
||||
# Install phive
|
||||
# Prepare the environment
|
||||
setup:
|
||||
stage: setup
|
||||
script:
|
||||
- docker-php-ext-install mbstring ctype posix zip curl fileinfo
|
||||
|
||||
# Build the project using the Makefile
|
||||
build:
|
||||
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
|
||||
- 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
|
||||
|
||||
build:
|
||||
script:
|
||||
- make tar
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
|
||||
release:
|
||||
script:
|
||||
- make autoload
|
||||
- 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
|
||||
- make tar
|
||||
artifacts:
|
||||
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
|
||||
docker-alpine:
|
||||
image: docker:latest
|
||||
stage: docker
|
||||
services:
|
||||
- docker:dind
|
||||
before_script:
|
||||
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||
script:
|
||||
- |
|
||||
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"
|
||||
fi
|
||||
- docker build -f Dockerfile -t $CI_REGISTRY_IMAGE:$DOCKER_TAG .
|
||||
- docker push $CI_REGISTRY_IMAGE:$DOCKER_TAG
|
||||
rules:
|
||||
- exists:
|
||||
- Dockerfile
|
||||
|
||||
# Build the Debian Docker image
|
||||
docker-debian:
|
||||
image: docker:latest
|
||||
stage: docker
|
||||
services:
|
||||
- docker:dind
|
||||
before_script:
|
||||
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||
script:
|
||||
- |
|
||||
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"
|
||||
fi
|
||||
- docker build -f Dockerfile.debian -t $CI_REGISTRY_IMAGE:$DOCKER_TAG .
|
||||
- docker push $CI_REGISTRY_IMAGE:$DOCKER_TAG
|
||||
rules:
|
||||
- exists:
|
||||
- Dockerfile.debian
|
||||
|
||||
# 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_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_TAR="ncc-$PACKAGE_NAME.tar.gz"
|
||||
FILE_NAME_DEB="ncc-$PACKAGE_NAME.deb"
|
||||
fi
|
||||
|
||||
mv build/*.tar.gz build/$FILE_NAME_TAR
|
||||
mv build/*.deb build/$FILE_NAME_DEB
|
||||
echo "Package Name: $PACKAGE_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_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
|
1
.idea/.name
generated
Normal file
|
@ -0,0 +1 @@
|
|||
Nosial Code Compiler
|
1
.idea/ncc.iml → .idea/Nosial Code Compiler.iml
generated
|
@ -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
|
@ -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
|
@ -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 |
132
.idea/inspectionProfiles/Project_Default.xml
generated
|
@ -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>
|
||||
|
@ -19,8 +92,67 @@
|
|||
<option value="X-Args-3" />
|
||||
<option value="X-Args-4" />
|
||||
<option value="X-Args-5" />
|
||||
<option value="X-Temperature" />
|
||||
<option value="X-Model" />
|
||||
<option value="X-OPENAI-API-KEY" />
|
||||
</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
|
@ -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
|
@ -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
|
@ -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>
|
||||
|
|
10
.idea/runConfigurations/Build_Redist.xml
generated
Normal file
|
@ -0,0 +1,10 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Build Redist" type="MAKEFILE_TARGET_RUN_CONFIGURATION" factoryName="Makefile">
|
||||
<makefile filename="$PROJECT_DIR$/Makefile" target="redist" 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>
|
10
.idea/runConfigurations/Rebuild_Autoloaders.xml
generated
Normal file
|
@ -0,0 +1,10 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Rebuild Autoloaders" type="MAKEFILE_TARGET_RUN_CONFIGURATION" factoryName="Makefile">
|
||||
<makefile filename="$PROJECT_DIR$/Makefile" target="autoload" 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>
|
2
.idea/scopes/NCC_Source_files.xml
generated
|
@ -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>
|
2
.idea/scopes/Symfony_Filesystem.xml
generated
|
@ -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>
|
2
.idea/scopes/Symfony_Process.xml
generated
|
@ -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>
|
2
.idea/scopes/Symfony_Uid.xml
generated
|
@ -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>
|
2
.idea/scopes/Symfony_Yaml.xml
generated
|
@ -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>
|
2
.idea/scopes/Symfony_polyfill_ctype.xml
generated
|
@ -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>
|
2
.idea/scopes/Symfony_polyfill_mbstring.xml
generated
|
@ -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>
|
2
.idea/scopes/Symfony_polyfill_uuid.xml
generated
|
@ -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>
|
2
.idea/scopes/Third_Party_Source_Files.xml
generated
|
@ -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>
|
2
.idea/scopes/defuse.xml
generated
|
@ -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>
|
2
.idea/scopes/defuse_php_encryption.xml
generated
|
@ -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>
|
2
.idea/scopes/jelix.xml
generated
|
@ -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>
|
2
.idea/scopes/jelix_version.xml
generated
|
@ -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>
|
2
.idea/scopes/nikic.xml
generated
|
@ -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>
|
2
.idea/scopes/nikic_PhpParser.xml
generated
|
@ -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>
|
2
.idea/scopes/theseer.xml
generated
|
@ -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>
|
2
.idea/scopes/theseer_Autoload.xml
generated
|
@ -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>
|
2
.idea/scopes/theseer_DirectoryScanner.xml
generated
|
@ -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>
|
1
.idea/webResources.xml
generated
|
@ -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>
|
||||
|
|
619
CHANGELOG.md
|
@ -5,26 +5,623 @@ 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
|
||||
- Refactored `\ncc\Objects > PackageLock`
|
||||
- Updated `defuse\php-encryption` to version 2.4.0
|
||||
- Updated `\ncc\Classes > GitClient > cloneRepositor()` to clone submodules recursively by default
|
||||
- Updated `\ncc\Classes > GitClient > checkout()` to update submoudles.
|
||||
- Updated build system for Gitlab
|
||||
|
||||
### Fixed
|
||||
- Fixed issue in `\ncc\Managers > ExecutionPointerManager > executeUnit()` where if ttyMode is enabled in a non-tty
|
||||
environment, the process will throw an exception
|
||||
"/etc/ncc/ThirdParty/Symfony/Process/Process.php:1019 Error: TTY mode requires /dev/tty to be read/writable.", now
|
||||
ncc will display a warning if TTY mode cannot be enabled
|
||||
|
||||
|
||||
|
||||
## [1.0.2] - 2023-06-29
|
||||
|
||||
### Fixed
|
||||
- Fixed issue where error states are not properly handled in `ExecutionPointerManager` issue [#44](https://git.n64.cc/nosial/ncc/-/issues/44)
|
||||
- Updated \ncc\Managers > ExecutionPointerManager > executeUnit to set processes to run forever if a timeout is not set/null
|
||||
|
||||
### Changed
|
||||
- Updated `Symfony\Filesystem` to version 6.2.5
|
||||
- Updated `Symfony\polyfill-ctype` to version 1.27.0
|
||||
- Updated `Symfony\polyfill-mbstring` to version 1.27.0
|
||||
- Updated `Symfony\polyfill-uuid` to version 1.27.0
|
||||
- Updated `Symfony\Process` to version 6.2.5
|
||||
- Updated `Symfony\Uid` to version 6.2.5
|
||||
- Updated `Symfony\Yaml` to version 6.2.5
|
||||
- Updated `\ncc\Managers > PackageManager` to display more logging messages
|
||||
|
||||
### Added
|
||||
- Dockerfile for building a docker image of ncc
|
||||
|
||||
|
||||
|
||||
## [1.0.1] - 2023-02-07
|
||||
|
||||
### Added
|
||||
- Added file downloads progress
|
||||
- Added pass-through arguments to `composer` command, all arguments beginning with `--composer-` will be passed to the
|
||||
`composer` command, for example `--composer-dev` will be passed as `--dev` to the `composer` command
|
||||
- Added file downloads progress
|
||||
- Added pass-through arguments to `composer` command, all arguments beginning with `--composer-` will be passed to the
|
||||
`composer` command, for example `--composer-dev` will be passed as `--dev` to the `composer` command
|
||||
|
||||
### Fixed
|
||||
|
||||
- Bug fix where resources are not decoded correctly when installing packages [#31](https://git.n64.cc/nosial/ncc/-/issues/42)
|
||||
- Fixed issue where dependency conflicts are thrown even when `--reinstall` is used
|
||||
- Properly implemented `composer.enable_internal_composer` so that warnings regarding improper configuration values are not thrown
|
||||
- Minor improvements to the CLI interface including fixing `--version`
|
||||
- Bug fix where resources are not decoded correctly when installing packages [#31](https://git.n64.cc/nosial/ncc/-/issues/42)
|
||||
- Fixed issue where dependency conflicts are thrown even when `--reinstall` is used
|
||||
- Properly implemented `composer.enable_internal_composer` so that warnings regarding improper configuration values are not thrown
|
||||
- Minor improvements to the CLI interface including fixing `--version`
|
||||
|
||||
### Changed
|
||||
- File downloads now cache the URL as a pointer to the file reducing the number of times the same file is downloaded
|
||||
|
||||
|
||||
- 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
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Code of Conduct
|
||||
|
||||
We are committed to maintaining a welcoming and inclusive environment for all contributors. In order to ensure that
|
||||
|
|
|
@ -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.
|
||||
|
|
2155
DOCUMENTATION.md
72
Dockerfile
Normal file
|
@ -0,0 +1,72 @@
|
|||
# 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.
|
||||
#
|
||||
|
||||
# Build-time args
|
||||
ARG PHP_VERSION=8.2
|
||||
|
||||
# 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-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
|
||||
|
||||
# Copy the local repository to the image
|
||||
COPY . /tmp/ncc
|
||||
|
||||
# Build ncc
|
||||
RUN cd /tmp/ncc && make redist
|
||||
|
||||
|
||||
# Main stage: Copies build files and installs all dependencies
|
||||
FROM php:${PHP_VERSION}-fpm-alpine AS production
|
||||
|
||||
# OSI labels
|
||||
LABEL maintainer="Netkas <netkas@nosial.net>"
|
||||
LABEL description="ncc's official Docker image"
|
||||
|
||||
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/ncc_build/. .
|
||||
|
||||
# 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
|
||||
|
||||
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
|
72
Dockerfile.debian
Normal file
|
@ -0,0 +1,72 @@
|
|||
# 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.
|
||||
#
|
||||
|
||||
# Build-time args
|
||||
ARG PHP_VERSION=8.2
|
||||
|
||||
# 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-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
|
||||
|
||||
# Copy the local repository to the image
|
||||
COPY . /tmp/ncc
|
||||
|
||||
# Build ncc
|
||||
RUN cd /tmp/ncc && make redist
|
||||
|
||||
|
||||
# Main stage: Copies build files and installs all dependencies
|
||||
FROM php:${PHP_VERSION}-fpm AS production
|
||||
|
||||
# OSI labels
|
||||
LABEL maintainer="Netkas <netkas@nosial.net>"
|
||||
LABEL description="ncc's official Docker image"
|
||||
|
||||
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/ncc_build/. .
|
||||
|
||||
# Install some stuff the default image doesn't come with
|
||||
RUN apt-get update -yqq && \
|
||||
apt-get install -yqq git libpq-dev libzip-dev zip make wget gnupg gcc -yqq
|
||||
|
||||
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
|
239
Makefile
|
@ -1,76 +1,54 @@
|
|||
PHPCC:=$(shell which php)
|
||||
PHPAB:=$(shell which phpab)
|
||||
BUILD_PATH=build
|
||||
SRC_PATH=src
|
||||
# Variables
|
||||
PHPCC := $(shell which php)
|
||||
PHPAB := $(shell which phpab)
|
||||
DEBPKG := $(shell which dpkg-deb)
|
||||
SRC_PATH := src
|
||||
ASSETS_PATH := assets
|
||||
INSTALLER_SRC_PATH := $(SRC_PATH)/installer
|
||||
CONFIG_PATH := $(SRC_PATH)/config
|
||||
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
|
||||
|
||||
autoload:
|
||||
# Generates/creates all the autoloader files
|
||||
make $(SRC_PATH)/ncc/ThirdParty/defuse/php-encryption/autoload_spl.php
|
||||
make $(SRC_PATH)/ncc/ThirdParty/jelix/version/autoload_spl.php
|
||||
make $(SRC_PATH)/ncc/ThirdParty/nikic/php-parser/autoload_spl.php
|
||||
make $(SRC_PATH)/ncc/ThirdParty/Symfony/polyfill-ctype/autoload_spl.php
|
||||
make $(SRC_PATH)/ncc/ThirdParty/Symfony/polyfill-mbstring/autoload_spl.php
|
||||
make $(SRC_PATH)/ncc/ThirdParty/Symfony/polyfill-uuid/autoload_spl.php
|
||||
make $(SRC_PATH)/ncc/ThirdParty/Symfony/Process/autoload_spl.php
|
||||
make $(SRC_PATH)/ncc/ThirdParty/Symfony/Uid/autoload_spl.php
|
||||
make $(SRC_PATH)/ncc/ThirdParty/Symfony/Filesystem/autoload_spl.php
|
||||
make $(SRC_PATH)/ncc/ThirdParty/Symfony/Yaml/autoload_spl.php
|
||||
make $(SRC_PATH)/ncc/ThirdParty/theseer/Autoload/autoload_spl.php
|
||||
make $(SRC_PATH)/ncc/ThirdParty/theseer/DirectoryScanner/autoload_spl.php
|
||||
make $(SRC_PATH)/ncc/autoload_spl.php
|
||||
cp $(SRC_PATH)/autoload/autoload.php $(SRC_PATH)/ncc/autoload.php
|
||||
# List of paths for autoloading
|
||||
AUTOLOAD_PATHS := $(addprefix $(SRC_PATH)/ncc/ThirdParty/, \
|
||||
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 \
|
||||
)
|
||||
|
||||
$(SRC_PATH)/ncc/ThirdParty/defuse/php-encryption/autoload_spl.php:
|
||||
$(PHPCC) $(PHPAB) --output $(SRC_PATH)/ncc/ThirdParty/defuse/php-encryption/autoload_spl.php \
|
||||
$(SRC_PATH)/ncc/ThirdParty/defuse/php-encryption
|
||||
# Check for necessary binaries
|
||||
ifndef PHPCC
|
||||
$(error "PHP binary not found. Please install PHP or check your PATH")
|
||||
endif
|
||||
|
||||
$(SRC_PATH)/ncc/ThirdParty/jelix/version/autoload_spl.php:
|
||||
$(PHPCC) $(PHPAB) --output $(SRC_PATH)/ncc/ThirdParty/jelix/version/autoload_spl.php \
|
||||
$(SRC_PATH)/ncc/ThirdParty/jelix/version
|
||||
# Check if phpab is installed
|
||||
ifndef PHPAB
|
||||
$(error "phpab (PHP Autoload Builder) not found. Please install phpab or check your PATH")
|
||||
endif
|
||||
|
||||
$(SRC_PATH)/ncc/ThirdParty/nikic/php-parser/autoload_spl.php:
|
||||
$(PHPCC) $(PHPAB) --output $(SRC_PATH)/ncc/ThirdParty/nikic/PhpParser/autoload_spl.php \
|
||||
$(SRC_PATH)/ncc/ThirdParty/nikic/PhpParser
|
||||
|
||||
$(SRC_PATH)/ncc/ThirdParty/Symfony/polyfill-ctype/autoload_spl.php:
|
||||
$(PHPCC) $(PHPAB) --output $(SRC_PATH)/ncc/ThirdParty/Symfony/polyfill-ctype/autoload_spl.php \
|
||||
$(SRC_PATH)/ncc/ThirdParty/Symfony/polyfill-ctype
|
||||
|
||||
$(SRC_PATH)/ncc/ThirdParty/Symfony/polyfill-mbstring/autoload_spl.php:
|
||||
$(PHPCC) $(PHPAB) --output $(SRC_PATH)/ncc/ThirdParty/Symfony/polyfill-mbstring/autoload_spl.php \
|
||||
$(SRC_PATH)/ncc/ThirdParty/Symfony/polyfill-mbstring
|
||||
|
||||
$(SRC_PATH)/ncc/ThirdParty/Symfony/polyfill-uuid/autoload_spl.php:
|
||||
$(PHPCC) $(PHPAB) --output $(SRC_PATH)/ncc/ThirdParty/Symfony/polyfill-uuid/autoload_spl.php \
|
||||
$(SRC_PATH)/ncc/ThirdParty/Symfony/polyfill-uuid
|
||||
|
||||
$(SRC_PATH)/ncc/ThirdParty/Symfony/Process/autoload_spl.php:
|
||||
$(PHPCC) $(PHPAB) --output $(SRC_PATH)/ncc/ThirdParty/Symfony/Process/autoload_spl.php \
|
||||
$(SRC_PATH)/ncc/ThirdParty/Symfony/Process
|
||||
|
||||
$(SRC_PATH)/ncc/ThirdParty/Symfony/Uid/autoload_spl.php:
|
||||
$(PHPAB) --output $(SRC_PATH)/ncc/ThirdParty/Symfony/Uid/autoload_spl.php \
|
||||
$(SRC_PATH)/ncc/ThirdParty/Symfony/Uid
|
||||
|
||||
$(SRC_PATH)/ncc/ThirdParty/Symfony/Filesystem/autoload_spl.php:
|
||||
$(PHPCC) $(PHPAB) --output $(SRC_PATH)/ncc/ThirdParty/Symfony/Filesystem/autoload_spl.php \
|
||||
$(SRC_PATH)/ncc/ThirdParty/Symfony/Filesystem
|
||||
|
||||
$(SRC_PATH)/ncc/ThirdParty/Symfony/Yaml/autoload_spl.php:
|
||||
$(PHPCC) $(PHPAB) --output $(SRC_PATH)/ncc/ThirdParty/Symfony/Yaml/autoload_spl.php \
|
||||
$(SRC_PATH)/ncc/ThirdParty/Symfony/Yaml
|
||||
|
||||
$(SRC_PATH)/ncc/ThirdParty/theseer/Autoload/autoload_spl.php:
|
||||
$(PHPCC) $(PHPAB) --output $(SRC_PATH)/ncc/ThirdParty/theseer/Autoload/autoload_spl.php \
|
||||
$(SRC_PATH)/ncc/ThirdParty/theseer/Autoload
|
||||
|
||||
$(SRC_PATH)/ncc/ThirdParty/theseer/DirectoryScanner/autoload_spl.php:
|
||||
$(PHPCC) $(PHPAB) --output $(SRC_PATH)/ncc/ThirdParty/theseer/DirectoryScanner/autoload_spl.php \
|
||||
$(SRC_PATH)/ncc/ThirdParty/theseer/DirectoryScanner
|
||||
# Build rules
|
||||
$(SRC_PATH)/%/autoload_spl.php:
|
||||
$(PHPCC) $(PHPAB) --output $@ $(SRC_PATH)/$*
|
||||
|
||||
$(SRC_PATH)/ncc/autoload_spl.php:
|
||||
$(PHPCC) $(PHPAB) --output $(SRC_PATH)/ncc/autoload_spl.php \
|
||||
$(SRC_PATH)/ncc/Abstracts \
|
||||
$(PHPCC) $(PHPAB) --output $@ \
|
||||
$(SRC_PATH)/ncc/Enums \
|
||||
$(SRC_PATH)/ncc/Classes \
|
||||
$(SRC_PATH)/ncc/CLI \
|
||||
$(SRC_PATH)/ncc/Exceptions \
|
||||
|
@ -78,43 +56,110 @@ $(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
|
||||
|
||||
# Phony targets
|
||||
.PHONY: autoload
|
||||
autoload: $(addsuffix /autoload_spl.php, $(AUTOLOAD_PATHS)) $(SRC_PATH)/ncc/autoload_spl.php
|
||||
cp -f $(SRC_PATH)/autoload/autoload.php $(SRC_PATH)/ncc/autoload.php
|
||||
|
||||
.PHONY: redist
|
||||
redist: autoload
|
||||
rm -rf $(BUILD_PATH)/src
|
||||
mkdir -p $(BUILD_PATH)/src
|
||||
cp -rf $(SRC_PATH)/ncc/* $(BUILD_PATH)/src
|
||||
cp $(SRC_PATH)/installer/installer $(BUILD_PATH)/src/INSTALL
|
||||
cp $(SRC_PATH)/installer/ncc.sh $(BUILD_PATH)/src/ncc.sh
|
||||
cp $(SRC_PATH)/config/ncc.yaml $(BUILD_PATH)/src/default_config.yaml;
|
||||
cp $(SRC_PATH)/config/ncc.yaml $(BUILD_PATH)/src/CLI/template_config.yaml;
|
||||
cp $(SRC_PATH)/installer/extension $(BUILD_PATH)/src/extension
|
||||
chmod +x $(BUILD_PATH)/src/INSTALL
|
||||
cp LICENSE $(BUILD_PATH)/src/LICENSE
|
||||
cp README.md $(BUILD_PATH)/src/README.md
|
||||
cp $(SRC_PATH)/installer/hash_check.php $(BUILD_PATH)/src/hash_check.php; $(PHPCC) $(BUILD_PATH)/src/hash_check.php; rm $(BUILD_PATH)/src/hash_check.php
|
||||
cp $(SRC_PATH)/installer/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
|
||||
|
||||
tar: redist
|
||||
cd $(BUILD_PATH)/src; tar -czvf ../build.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)/$(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:
|
||||
rm -rf $(BUILD_PATH)
|
||||
rm -f $(SRC_PATH)/ncc/autoload_spl.php
|
||||
rm -f $(SRC_PATH)/ncc/ThirdParty/defuse/php-encryption/autoload_spl.php
|
||||
rm -f $(SRC_PATH)/ncc/ThirdParty/jelix/version/autoload_spl.php
|
||||
rm -f $(SRC_PATH)/ncc/ThirdParty/nikic/PhpParser/autoload_spl.php
|
||||
rm -f $(SRC_PATH)/ncc/ThirdParty/Symfony/polyfill-ctype/autoload_spl.php
|
||||
rm -f $(SRC_PATH)/ncc/ThirdParty/Symfony/polyfill-mbstring/autoload_spl.php
|
||||
rm -f $(SRC_PATH)/ncc/ThirdParty/Symfony/polyfill-uuid/autoload_spl.php
|
||||
rm -f $(SRC_PATH)/ncc/ThirdParty/Symfony/Process/autoload_spl.php
|
||||
rm -f $(SRC_PATH)/ncc/ThirdParty/Symfony/Uid/autoload_spl.php
|
||||
rm -f $(SRC_PATH)/ncc/ThirdParty/Symfony/Filesystem/autoload_spl.php
|
||||
rm -f $(SRC_PATH)/ncc/ThirdParty/Symfony/Yaml/autoload_spl.php
|
||||
rm -f $(SRC_PATH)/ncc/ThirdParty/theseer/Autoload/autoload_spl.php
|
||||
rm -f $(SRC_PATH)/ncc/ThirdParty/theseer/DirectoryScanner/autoload_spl.php
|
||||
rm -f $(addsuffix /autoload_spl.php, $(AUTOLOAD_PATHS))
|
||||
|
||||
.PHONY: help
|
||||
help:
|
||||
@echo "Available commands:"
|
||||
@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"
|
66
README.md
|
@ -1,44 +1,74 @@
|
|||
#  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.
|
||||
[](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/intellivoid/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/intellivoid/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)
|
||||
- [github.com](https://github.com/Nosial/ncc)
|
||||
|
||||
|
||||
# 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)>
|
||||
|
@ -48,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, Nosial—All 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
After Width: | Height: | Size: 57 KiB |
BIN
assets/data_structure.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
assets/execution_process.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
assets/header_structure.png
Normal file
After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 3.5 KiB |
|
@ -1 +1,4 @@
|
|||
<?xml version="1.0" ?><svg fill="none" height="48" viewBox="0 0 48 48" width="48" xmlns="http://www.w3.org/2000/svg"><path d="M6 14C6 4 14 4 14 4V24H6C6 24 6 24 6 14Z" fill="#2F88FF" stroke="black" stroke-linejoin="round" stroke-width="4"/><rect fill="#2F88FF" height="6" stroke="black" stroke-linejoin="round" stroke-width="4" width="28" x="14" y="10"/><path d="M6 30H42C42 30 42 38 36 38C30 38 29 38 29 38L31 44H13L15 38H6V30Z" fill="#2F88FF" stroke="black" stroke-linejoin="round" stroke-width="4"/></svg>
|
||||
<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>
|
||||
|
|
Before Width: | Height: | Size: 508 B After Width: | Height: | Size: 683 B |
BIN
assets/icon/ncc@1024px.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
assets/icon/ncc@128px.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
assets/icon/ncc@16px.png
Normal file
After Width: | Height: | Size: 351 B |
BIN
assets/icon/ncc@256px.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
assets/icon/ncc@32px.png
Normal file
After Width: | Height: | Size: 504 B |
BIN
assets/icon/ncc@512px.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
assets/icon/ncc@64px.png
Normal file
After Width: | Height: | Size: 820 B |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 327 B |
Before Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 393 B |
Before Width: | Height: | Size: 324 B |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 522 B |
Before Width: | Height: | Size: 132 KiB |
Before Width: | Height: | Size: 568 B |
Before Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 910 B |
Before Width: | Height: | Size: 90 KiB |
BIN
assets/package_structure.png
Normal file
After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 49 KiB |
9
bootstrap.php
Normal 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
|
@ -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
|
74
old_docker/Dockerfile.debian
Normal 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
|
@ -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
|
@ -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>
|
|
@ -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',
|
||||
];
|
||||
|
||||
|
|
50
src/config/default_repositories.json
Normal 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
|
||||
}
|
||||
]
|
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
|
@ -1,6 +0,0 @@
|
|||
[
|
||||
"gitgud.json",
|
||||
"github.json",
|
||||
"gitlab.json",
|
||||
"n64.json"
|
||||
]
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"name": "gitgud",
|
||||
"type": "gitlab",
|
||||
"host": "gitgud.io",
|
||||
"ssl": true
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"name": "github",
|
||||
"type": "github",
|
||||
"host": "api.github.com",
|
||||
"ssl": true
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"name": "gitlab",
|
||||
"type": "gitlab",
|
||||
"host": "gitlab.com",
|
||||
"ssl": true
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"name": "n64",
|
||||
"type": "gitlab",
|
||||
"host": "git.n64.cc",
|
||||
"ssl": true
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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);
|
|
@ -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);
|
|
@ -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\'');
|
||||
|
||||
|
|
31
src/installer/ncc-package.xml
Normal 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
|
@ -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
|
|
@ -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;
|
||||
}
|
|
@ -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
|
||||
];
|
||||
}
|
|
@ -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'];
|
||||
}
|
|
@ -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'];
|
||||
}
|
|
@ -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
|
||||
];
|
||||
}
|
|
@ -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';
|
||||
}
|
|
@ -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'];
|
||||
}
|