From 9e1a27c02da16941ded41b305fc3f21b739e0453 Mon Sep 17 00:00:00 2001 From: xy2z Date: Sat, 17 Feb 2024 12:40:00 +0100 Subject: [PATCH] Fix #30 + Minor fixes --- .gitattributes | 1 + CONTRIBUTING.md | 23 -------------- README.md | 65 ++-------------------------------------- capro | 7 ++++- capro-logo.png | Bin 2560 -> 0 bytes src/capro_bootstrap.php | 2 +- 6 files changed, 11 insertions(+), 87 deletions(-) delete mode 100644 CONTRIBUTING.md delete mode 100644 capro-logo.png diff --git a/.gitattributes b/.gitattributes index c0fc819..7c90463 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ +# This file is not really needed as the dev branch is not released as a package /capro-logo.png export-ignore /README.md export-ignore /.gitignore export-ignore diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 8bccf7f..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,23 +0,0 @@ -# Contributing to Capro - -Pull Requests are welcome! - -- If you want to work on a completely new feature please make an issue beforehand to discuss if it fits the projects scope. -- Use `php-cs-fixer` to follow the coding standard. This can be called automatically in modern editors on file save. -- Call `vendor\bin\phpstan` to check for errors. -- Make sure it works with all supported PHP versions (see "Requirements" in the README, or composer.json). -- When you test the code you should run "php capro " to make sure you are running the correct script. - -If you have any questions or notes about contributing, please ask in [Discussions](https://github.com/xy2z/capro/discussions) - - -## Build and Release -1. Check `box validate` command to validate the box.json.dist file. (should be part of "build.sh" script, fails if not valid) -1. Make sure the version is bumped in `src/capro_bootstrap.php` -1. Run `composer build` to build the phar file in the `build` dir. -1. Test the `build/capro.phar` file. -1. Run `composer validate` to check the `build/composer.json` file. -1. Overwrite the `build/capro.phar` file in the master branch, commit and push -1. Make a new release on GitHub (make sure the version matches the one in `src/capro_bootstrap.php`) - -To get back the development composer packages (phpstan, etc.) run `composer install` again. diff --git a/README.md b/README.md index eb740fb..bc6e3a2 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,6 @@ -
+# Capro - Dev Branch -![capro logo](./capro-logo.png) +This is the development branch, where the capro.phar file is build from. -Capro is a static-site generator for PHP 8+ +See [CONTRIBUTION](https://github.com/xy2z/capro/blob/master/CONTRIBUTING.md) (in master branch) ---- - -[Quick Setup](#quick-setup) | [Documentation](https://capro.xy2z.io) | [Community](https://github.com/xy2z/capro/discussions) | [Sponsor](https://github.com/sponsors/xy2z) - -

- - - - - -

- ---- - -
- - -## ⚠ Notice - -Capro is currently in [alpha](https://github.com/xy2z/capro/issues/5), please report bugs via [GitHub Issues](https://github.com/xy2z/capro/issues) - - -## About - -A PHP static-site generator, using Blade template engine. - -Capro is currently in alpha, and is not thoroughly tested for production. Breaking changes might occur during the alpha phase. - - -## Sponsors - -Currently none. Sponsor here: https://github.com/sponsors/xy2z - - -## Requirements -- PHP 8.0+ -- [Composer](https://getcomposer.org/) - - -## Quick Setup -First install the capro global package -```bash -composer global require xy2z/capro:@alpha -``` - -Now, you can create new sites using: -```bash -capro new demo -cd demo/public -php -S localhost:82 -``` -Head over to http://localhost:82 to see your new static Capro site. - -Learn more in the **[full documentation site](https://capro.xy2z.io).** (which was build in capro) - - -## Contributing - -Pull Requests are welcome! See more in the [Contributing Guide](CONTRIBUTING.md). diff --git a/capro b/capro index ad02287..4285311 100644 --- a/capro +++ b/capro @@ -22,12 +22,17 @@ require __DIR__ . '/src/capro_bootstrap.php'; // Autoload.php (for box/phar and development of capro) if (file_exists(__DIR__ . '/vendor/autoload.php')) { - require __DIR__ . '/vendor/autoload.php'; + require_once __DIR__ . '/vendor/autoload.php'; } else { echo 'Error: Composer\'s vendor/autoload.php file was not found. (try `composer install`)' . PHP_EOL; exit(1); } +// Autoload "client's" autoload.php for their project. +if (file_exists(CAPRO_SITE_ROOT_DIR . 'vendor/autoload.php')) { + require_once CAPRO_SITE_ROOT_DIR . 'vendor/autoload.php'; +} + // Load env (before config) if (file_exists(CAPRO_SITE_ROOT_DIR . '.env')) { $dotenv = Dotenv::createImmutable(CAPRO_SITE_ROOT_DIR); diff --git a/capro-logo.png b/capro-logo.png deleted file mode 100644 index 38947c466c4884fe86033666d7d704e426bde390..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2560 zcmcIm`y&&IALXVokuvh;OP+a0g|IyHS`2B#Fz*aQF$p)4*RqOS<~?CZ51*HXfczA^E?W|o-`0WYY1pp_v z&oM6dgm`0JZ(8yYM`hPf1Yd{+#Da&1ggtZQfBHlNQFflOJUnM9{{!zp6d~}$du4BJ z;f{tgOOr5ix234%v43f6PgRUl)%yu4ewas@H3bEYUSL7qiA;bHB0rV66;~%Pr_q9TM73h^PZWwRO!J+H*yG>UmU!R=O~)`<`n!iue?-sH3bD`D z0QswPxPOwt&QnP<7qr-c+k8y*vOY+#1iMIdjpc+6|oy2VsogP6|gKB*(fJQO&1;LnXAJwwY-V>ZK@^Tej7aurKZL` zdWDm|06zcL=UE<1X@2n4*tT2CH&gC1gkDSWdx2&KE5gY>^nrA8glSIMf1t9G$k)%! zHU1Xcrzwq|6qoS%(}UzeV|#laMACpCk;Crw>-ohJYw9zB&m;9xeSAOsk1szmt6e*Z*vt8yPxjL>eVZ9H@l<{Q-LGfTIR0zW7G4B zYGeD#`_3-O&F5+=59bw`Vmu09fD#>$3Hd#OqPO3K_KXpXpCr)-sGf)wvinR1NN!S$ z?MBb&=o*(2TFa3biXqJ)qVv(D^8p_g)PJB%Jk@1==x0mREY$ubmG>iAjNStdBQ)0u zk0BX1sA*TLvu`uK>ho|WF*^ltiETyF%mgJiQ}k&>-FX#|kYkTUcUv4*8g*`^?R`3fM1$a-vd!dZv^PeK4M#mjq2vmencne z59jTDDFr$s9HwvivkVNp6B;PtFTbM_?$}8_?T`AoZn#&{*Rp;cQo6o^qK@ax((iGz zq8#0Me+`QUf9<$Wx#m%@Or$K&mINgsBLk5pLVe% z zF3hG2(uvapb=SPt&7$|rrvZm{`9-hRlwb*F_8MXm8Qa<{%TUN9;BNmL;25sTP(&FT zFrM{Lhhge}8TbJb%f$1b8L1_Qp7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rap.php +++ b/src/capro_bootstrap.php @@ -2,7 +2,7 @@ namespace xy2z\Capro; -define('CAPRO_VERSION', '1.0.0-alpha.34'); +define('CAPRO_VERSION', '1.0.0-alpha.35'); // Get root dir of the phar file. // Can't use __DIR__ because that could return the .phar file.