-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Generate components classes (#5)
* feat: Create logger * fix: Const * fix: STDOUT * fix: STDOUT * fix: stdin * feat: Manage app elements by classes * fix: Rename classes * fix: Runner * feat: log request * fix: json_decode * fix: Classes definitions * fix: Remove logs * feat: Add logs * feat: Test apcu cache * fix: apcu * feat: Log * fix: Remove log * fix: Json Serialize * feat: Manage CLI * feat: cache encoded manifest * fix: CLI * docs: README.md
- Loading branch information
1 parent
16d0f5b
commit aeea532
Showing
16 changed files
with
1,540 additions
and
1,835 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Lenra | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,76 @@ | ||
## Load deps | ||
<div id="top"></div> | ||
<!-- | ||
*** This README was created with https://github.com/othneildrew/Best-README-Template | ||
--> | ||
|
||
```bash | ||
docker run --rm --interactive --tty -v $PWD:/app composer install | ||
|
||
|
||
<!-- PROJECT SHIELDS --> | ||
[![Contributors][contributors-shield]][contributors-url] | ||
[![Forks][forks-shield]][forks-url] | ||
[![Stargazers][stars-shield]][stars-url] | ||
[![Issues][issues-shield]][issues-url] | ||
[![MIT License][license-shield]][license-url] | ||
|
||
|
||
|
||
<!-- PROJECT LOGO --> | ||
<br /> | ||
<div align="center"> | ||
|
||
<h3 align="center">App Lib for PHP based projects</h3> | ||
|
||
<p align="center"> | ||
This lib integrates all the elements the app needs in order to only keep the views, listeners and resources in the app project. | ||
<br /> | ||
<br /> | ||
<a href="https://github.com/lenra-io/app-lib-php/issues">Report Bug</a> | ||
· | ||
<a href="https://github.com/lenra-io/app-lib-php/issues">Request Feature</a> | ||
</p> | ||
</div> | ||
|
||
|
||
<!-- USAGE EXAMPLES --> | ||
## Usage | ||
|
||
To incorporate it into your Lenra app project, simply run the following command: | ||
```console | ||
composer require lenra/app | ||
``` | ||
|
||
### Lenra API calls | ||
|
||
To call a Lenra API from a listener, use the `Lenra\App\Api` instance provided in the . | ||
|
||
You can then create a document using the data API with the following code: | ||
```php | ||
class CustomType extends \Lenra\App\Data { | ||
public string $value; | ||
public function __construct(string $value = null) { | ||
$this->value = $value; | ||
} | ||
} | ||
|
||
$myDoc = $request->api->data()->coll(CustomType::class)->createDoc(new CustomType("Hello world"))->wait(); | ||
``` | ||
|
||
<p align="right">(<a href="#top">back to top</a>)</p> | ||
|
||
|
||
|
||
<!-- CONTRIBUTING --> | ||
## Contributing | ||
|
||
## Generate components classes | ||
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. | ||
|
||
If you have a suggestion that would make this better, please open an issue with the tag "enhancement". | ||
Don't forget to give the project a star if you liked it! Thanks again! | ||
|
||
### Generate components classes | ||
|
||
A part of this lib is generated from the [Lenra API](https://github.com/lenra-io/api). | ||
To generate the classes, run the following commands: | ||
|
||
```bash | ||
# Load API | ||
|
@@ -16,8 +81,45 @@ php vendor/bin/jane generate | |
php script/generate-classes.php | ||
``` | ||
|
||
## Run unit tests | ||
### Run unit tests | ||
|
||
```bash | ||
./vendor/bin/phpunit test | ||
``` | ||
``` | ||
|
||
|
||
<p align="right">(<a href="#top">back to top</a>)</p> | ||
|
||
|
||
|
||
<!-- LICENSE --> | ||
## License | ||
|
||
Distributed under the **MIT** License. See [LICENSE](./LICENSE) for more information. | ||
|
||
<p align="right">(<a href="#top">back to top</a>)</p> | ||
|
||
|
||
|
||
<!-- CONTACT --> | ||
## Contact | ||
|
||
Lenra - [@lenra_dev](https://twitter.com/lenra_dev) - [email protected] | ||
|
||
Project Link: [https://github.com/lenra-io/app-lib-php](https://github.com/lenra-io/app-lib-php) | ||
|
||
<p align="right">(<a href="#top">back to top</a>)</p> | ||
|
||
|
||
<!-- MARKDOWN LINKS & IMAGES --> | ||
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --> | ||
[contributors-shield]: https://img.shields.io/github/contributors/lenra-io/app-lib-php.svg?style=for-the-badge | ||
[contributors-url]: https://github.com/lenra-io/app-lib-php/graphs/contributors | ||
[forks-shield]: https://img.shields.io/github/forks/lenra-io/app-lib-php.svg?style=for-the-badge | ||
[forks-url]: https://github.com/lenra-io/app-lib-php/network/members | ||
[stars-shield]: https://img.shields.io/github/stars/lenra-io/app-lib-php.svg?style=for-the-badge | ||
[stars-url]: https://github.com/lenra-io/app-lib-php/stargazers | ||
[issues-shield]: https://img.shields.io/github/issues/lenra-io/app-lib-php.svg?style=for-the-badge | ||
[issues-url]: https://github.com/lenra-io/app-lib-php/issues | ||
[license-shield]: https://img.shields.io/github/license/lenra-io/app-lib-php.svg?style=for-the-badge | ||
[license-url]: https://github.com/lenra-io/app-lib-php/blob/master/LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.