feat: Version 3.5.2 - Configuration Stripe et gestion des immeubles
- Configuration complète Stripe pour les 3 environnements (DEV/REC/PROD) * DEV: Clés TEST Pierre (mode test) * REC: Clés TEST Client (mode test) * PROD: Clés LIVE Client (mode live) - Ajout de la gestion des bases de données immeubles/bâtiments * Configuration buildings_database pour DEV/REC/PROD * Service BuildingService pour enrichissement des adresses - Optimisations pages et améliorations ergonomie - Mises à jour des dépendances Composer - Nettoyage des fichiers obsolètes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
.gitignore text eol=lf
|
||||
.gitattributes text eol=lf
|
||||
*.md text eol=lf
|
||||
*.php text eol=lf
|
||||
*.yml text eol=lf
|
||||
*.xml text eol=lf
|
||||
@@ -1,132 +0,0 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, caste, color, religion, or sexual
|
||||
identity and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
- Demonstrating empathy and kindness toward other people
|
||||
- Being respectful of differing opinions, viewpoints, and experiences
|
||||
- Giving and gracefully accepting constructive feedback
|
||||
- Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
- Focusing on what is best not just for us as individuals, but for the overall
|
||||
community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
- The use of sexualized language or imagery, and sexual attention or advances of
|
||||
any kind
|
||||
- Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or email address,
|
||||
without their explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
jonatan@maennchen.ch.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series of
|
||||
actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or permanent
|
||||
ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within the
|
||||
community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.1, available at
|
||||
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
||||
|
||||
Community Impact Guidelines were inspired by
|
||||
[Mozilla's code of conduct enforcement ladder][mozilla coc].
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
[https://www.contributor-covenant.org/faq][faq]. Translations are available at
|
||||
[https://www.contributor-covenant.org/translations][translations].
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||
[mozilla coc]: https://github.com/mozilla/diversity
|
||||
[faq]: https://www.contributor-covenant.org/faq
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
||||
@@ -1,139 +0,0 @@
|
||||
# Contributing to ZipStream-PHP
|
||||
|
||||
## Welcome!
|
||||
|
||||
We look forward to your contributions! Here are some examples how you can
|
||||
contribute:
|
||||
|
||||
- [Report a bug](https://github.com/maennchen/ZipStream-PHP/issues/new?labels=bug&template=BUG.md)
|
||||
- [Propose a new feature](https://github.com/maennchen/ZipStream-PHP/issues/new?labels=enhancement&template=FEATURE.md)
|
||||
- [Send a pull request](https://github.com/maennchen/ZipStream-PHP/pulls)
|
||||
|
||||
## We have a Code of Conduct
|
||||
|
||||
Please note that this project is released with a
|
||||
[Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this
|
||||
project you agree to abide by its terms.
|
||||
|
||||
## Any contributions you make will be under the MIT License
|
||||
|
||||
When you submit code changes, your submissions are understood to be under the
|
||||
same [MIT License](https://github.com/maennchen/ZipStream-PHP/blob/main/LICENSE)
|
||||
that covers the project. By contributing to this project, you agree that your
|
||||
contributions will be licensed under its MIT License.
|
||||
|
||||
## Write bug reports with detail, background, and sample code
|
||||
|
||||
In your bug report, please provide the following:
|
||||
|
||||
- A quick summary and/or background
|
||||
- Steps to reproduce
|
||||
- Be specific!
|
||||
- Give sample code if you can.
|
||||
- What you expected would happen
|
||||
- What actually happens
|
||||
- Notes (possibly including why you think this might be happening, or stuff you
|
||||
- tried that didn't work)
|
||||
|
||||
Please do not report a bug for a version of ZIPStream-PHP that is no longer
|
||||
supported (`< 3.0.0`). Please do not report a bug if you are using a version of
|
||||
PHP that is not supported by the version of ZipStream-PHP you are using.
|
||||
|
||||
Please post code and output as text
|
||||
([using proper markup](https://guides.github.com/features/mastering-markdown/)).
|
||||
Do not post screenshots of code or output.
|
||||
|
||||
Please include the output of `composer info | sort`.
|
||||
|
||||
## Workflow for Pull Requests
|
||||
|
||||
1. Fork the repository.
|
||||
2. Create your branch from `main` if you plan to implement new functionality or
|
||||
change existing code significantly; create your branch from the oldest branch
|
||||
that is affected by the bug if you plan to fix a bug.
|
||||
3. Implement your change and add tests for it.
|
||||
4. Ensure the test suite passes.
|
||||
5. Ensure the code complies with our coding guidelines (see below).
|
||||
6. Send that pull request!
|
||||
|
||||
Please make sure you have
|
||||
[set up your user name and email address](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup)
|
||||
for use with Git. Strings such as `silly nick name <root@localhost>` look really
|
||||
stupid in the commit history of a project.
|
||||
|
||||
We encourage you to
|
||||
[sign your Git commits with your GPG key](https://docs.github.com/en/github/authenticating-to-github/signing-commits).
|
||||
|
||||
Pull requests for new features must be based on the `main` branch.
|
||||
|
||||
We are trying to keep backwards compatibility breaks in ZipStream-PHP to a
|
||||
minimum. Please take this into account when proposing changes.
|
||||
|
||||
Due to time constraints, we are not always able to respond as quickly as we
|
||||
would like. Please do not take delays personal and feel free to remind us if you
|
||||
feel that we forgot to respond.
|
||||
|
||||
## Coding Guidelines
|
||||
|
||||
This project comes with a configuration file (located at `/psalm.yml` in the
|
||||
repository) that you can use to perform static analysis (with a focus on type
|
||||
checking):
|
||||
|
||||
```bash
|
||||
$ .composer run test:lint
|
||||
```
|
||||
|
||||
This project comes with a configuration file (located at
|
||||
`/.php-cs-fixer.dist.php` in the repository) that you can use to (re)format your
|
||||
source code for compliance with this project's coding guidelines:
|
||||
|
||||
```bash
|
||||
$ composer run format
|
||||
```
|
||||
|
||||
Please understand that we will not accept a pull request when its changes
|
||||
violate this project's coding guidelines.
|
||||
|
||||
## Using ZipStream-PHP from a Git checkout
|
||||
|
||||
The following commands can be used to perform the initial checkout of
|
||||
ZipStream-PHP:
|
||||
|
||||
```bash
|
||||
$ git clone git@github.com:maennchen/ZipStream-PHP.git
|
||||
|
||||
$ cd ZipStream-PHP
|
||||
```
|
||||
|
||||
Install ZipStream-PHP's dependencies using [Composer](https://getcomposer.org/):
|
||||
|
||||
```bash
|
||||
$ composer install
|
||||
$ composer run install:tools # Install phpDocumentor using phive
|
||||
```
|
||||
|
||||
## Running ZipStream-PHP's test suite
|
||||
|
||||
After following the steps shown above, ZipStream-PHP's test suite is run like
|
||||
this:
|
||||
|
||||
```bash
|
||||
$ composer run test:unit
|
||||
```
|
||||
|
||||
There's some slow tests in the test suite that test the handling of big files in
|
||||
the archives. To skip them use the following command instead:
|
||||
|
||||
```bash
|
||||
$ composer run test:unit:fast
|
||||
```
|
||||
|
||||
## Generating ZipStream-PHP Documentation
|
||||
|
||||
To generate the documentation for the library, run:
|
||||
|
||||
```bash
|
||||
$ composer run docs:generate
|
||||
```
|
||||
|
||||
The guide documentation pages can be found in the `/guides/` directory.
|
||||
@@ -1 +0,0 @@
|
||||
github: maennchen
|
||||
@@ -1,71 +0,0 @@
|
||||
name: 🐞 Bug Report
|
||||
description: Something is broken?
|
||||
labels: ["bug"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
- Create a discussion instead if you are looking for support:
|
||||
https://github.com/maennchen/ZipStream-PHP/discussions
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: ZipStream-PHP version
|
||||
placeholder: x.y.z
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: php-version
|
||||
attributes:
|
||||
label: PHP version
|
||||
placeholder: x.y.z
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
id: constraints
|
||||
attributes:
|
||||
label: Constraints for Bug Report
|
||||
options:
|
||||
- label: |
|
||||
I'm using a version of ZipStream that is currently supported:
|
||||
https://github.com/maennchen/ZipStream-PHP#version-support
|
||||
required: true
|
||||
- label: |
|
||||
I'm using a version of PHP that has active support:
|
||||
https://www.php.net/supported-versions.php
|
||||
required: true
|
||||
- label: |
|
||||
I'm using a version of PHP that is compatible with your used
|
||||
ZipStream version.
|
||||
required: true
|
||||
- label: |
|
||||
I'm using the latest release of the used ZipStream major version.
|
||||
required: true
|
||||
- type: textarea
|
||||
id: summary
|
||||
attributes:
|
||||
label: Summary
|
||||
description: Provide a summary describing the problem you are experiencing.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: current-behaviour
|
||||
attributes:
|
||||
label: Current behavior
|
||||
description: What is the current (buggy) behavior?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: reproduction
|
||||
attributes:
|
||||
label: How to reproduce
|
||||
description: Provide steps to reproduce the bug.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expected-behaviour
|
||||
attributes:
|
||||
label: Expected behavior
|
||||
description: What was the expected (correct) behavior?
|
||||
validations:
|
||||
required: true
|
||||
@@ -1,11 +0,0 @@
|
||||
name: 🎉 Feature Request
|
||||
description: You have a neat idea that should be implemented?
|
||||
labels: ["enhancement"]
|
||||
body:
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
description: Provide a summary of the feature you would like to see implemented.
|
||||
validations:
|
||||
required: true
|
||||
@@ -1,6 +0,0 @@
|
||||
Please go the the `Preview` tab and select the appropriate sub-template:
|
||||
|
||||
* [🐞 Failing Test](?expand=1&template=FAILING_TEST.md)
|
||||
* [🐞 Bug Fix](?expand=1&template=FIX.md)
|
||||
* [⚙ Improvement](?expand=1&template=IMPROVEMENT.md)
|
||||
* [🎉 New Feature](?expand=1&template=NEW_FEATURE.md)
|
||||
@@ -1,13 +0,0 @@
|
||||
<!---
|
||||
name: 🐞 Failing Test
|
||||
about: You found a bug and have a failing test?
|
||||
labels: bug, tests
|
||||
--->
|
||||
|
||||
<!--
|
||||
- Please do not send a pull request for an issue in a version of ZipStream-PHP
|
||||
that is no longer supported.
|
||||
See: https://github.com/maennchen/ZipStream-PHP#version-support
|
||||
- Please target the oldest branch of ZipStream-PHP that is still supported and
|
||||
where the test fails.
|
||||
-->
|
||||
@@ -1,13 +0,0 @@
|
||||
<!---
|
||||
name: 🐞 Bug Fix
|
||||
about: You have a fix for a bug?
|
||||
labels: bug
|
||||
--->
|
||||
|
||||
<!--
|
||||
- Please do not send a pull request for an issue in a version of ZipStream-PHP
|
||||
that is no longer supported.
|
||||
See: https://github.com/maennchen/ZipStream-PHP#version-support
|
||||
- Please target the oldest branch of ZipStream-PHP that is still supported and
|
||||
affected by this bug.
|
||||
-->
|
||||
@@ -1,9 +0,0 @@
|
||||
<!---
|
||||
name: ⚙ Improvement
|
||||
about: You have some improvement to make ZipStream-PHP better?
|
||||
labels: enhancement
|
||||
--->
|
||||
|
||||
<!--
|
||||
- Please target the `main` branch of ZipStream-PHP.
|
||||
-->
|
||||
@@ -1,9 +0,0 @@
|
||||
<!---
|
||||
name: 🎉 New Feature
|
||||
about: You have implemented some neat idea that you want to make part of ZipStream-PHP?
|
||||
labels: type/enhancement
|
||||
--->
|
||||
|
||||
<!--
|
||||
- Please target the `main` branch of ZipStream-PHP.
|
||||
-->
|
||||
@@ -1,22 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
[](https://github.com/ossf/oss-vulnerability-guide/blob/main/finder-guide.md)
|
||||
[](https://github.com/maennchen/ZipStream-PHP/security/advisories/new)
|
||||
[](mailto:jonatan@maennchen.ch)
|
||||
|
||||
This repository follows the
|
||||
[OpenSSF Vulnerability Disclosure guide](https://github.com/ossf/oss-vulnerability-guide/tree/main).
|
||||
You can learn more about it in the
|
||||
[Finders Guide](https://github.com/ossf/oss-vulnerability-guide/blob/main/finder-guide.md).
|
||||
|
||||
Please report vulnerabilities via the
|
||||
[GitHub Security Vulnerability Reporting](https://github.com/maennchen/ZipStream-PHP/security/advisories/new)
|
||||
or via email to [`jonatan@maennchen.ch`](mailto:jonatan@maennchen.ch) if this does
|
||||
not work for you.
|
||||
|
||||
Our vulnerability management team will respond within 3 working days of your
|
||||
report. If the issue is confirmed as a vulnerability, we will open a Security
|
||||
Advisory. This project follows a 90 day disclosure timeline.
|
||||
|
||||
If you have questions about reporting security issues, email the vulnerability
|
||||
management team: [`jonatan@maennchen.ch`](mailto:jonatan@maennchen.ch)
|
||||
@@ -1,15 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "composer"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
groups:
|
||||
github-actions:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "*"
|
||||
@@ -1,14 +0,0 @@
|
||||
annotations:
|
||||
- checks:
|
||||
- fuzzing
|
||||
reasons:
|
||||
- reason: not-applicable # PHP is memory safe
|
||||
- checks:
|
||||
- packaging
|
||||
reasons:
|
||||
- reason: not-supported # Using Composer
|
||||
- checks:
|
||||
- signed-releases
|
||||
reasons:
|
||||
- reason: not-applicable # Releases are distributed via Composer
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
|
||||
name: "Main Branch"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: "Test"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
uses: ./.github/workflows/part_test.yml
|
||||
|
||||
docs:
|
||||
name: "Docs"
|
||||
|
||||
uses: ./.github/workflows/part_docs.yml
|
||||
@@ -1,30 +0,0 @@
|
||||
on:
|
||||
workflow_call: {}
|
||||
|
||||
name: "Dependabot"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
automerge_dependabot:
|
||||
name: "Automerge PRs"
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: fastify/github-action-merge-dependabot@c3bde0759d4f24db16f7b250b2122bc2df57e817 # v3.11.0
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
use-github-auto-merge: true
|
||||
# Major Updates need to be merged manually
|
||||
target: minor
|
||||
@@ -1,51 +0,0 @@
|
||||
on:
|
||||
workflow_call: {}
|
||||
|
||||
name: "Documentation"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
generate:
|
||||
name: "Generate"
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: SetUp PHP
|
||||
id: setup-php
|
||||
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2
|
||||
with:
|
||||
php-version: "8.3"
|
||||
tools: phive
|
||||
- name: Cache Tools
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
|
||||
id: cache
|
||||
with:
|
||||
path: ~/.phive
|
||||
key: tools-${{ runner.os }}-${{ steps.setup-php.outputs.php-version }}-${{ hashFiles('**/phars.xml') }}
|
||||
restore-keys: |
|
||||
tools-${{ runner.os }}-${{ steps.setup-php.outputs.php-version }}-
|
||||
tools-${{ steps.setup-php.outputs.php-version }}-
|
||||
tools-
|
||||
- name: Install Tools
|
||||
run: composer run install:tools
|
||||
- name: Generate Docs
|
||||
run: composer run docs:generate
|
||||
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
||||
with:
|
||||
name: docs
|
||||
path: docs
|
||||
- name: Package for GitHub Pages
|
||||
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
|
||||
with:
|
||||
path: docs
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
releaseName:
|
||||
required: true
|
||||
type: string
|
||||
stable:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
name: "Release"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
create:
|
||||
name: Create Release
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: Create prerelease
|
||||
if: ${{ !inputs.stable }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
gh release create \
|
||||
--repo ${{ github.repository }} \
|
||||
--title ${{ inputs.releaseName }} \
|
||||
--prerelease \
|
||||
--generate-notes \
|
||||
${{ inputs.releaseName }}
|
||||
|
||||
- name: Create release
|
||||
if: ${{ inputs.stable }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
gh release create \
|
||||
--repo ${{ github.repository }} \
|
||||
--title ${{ inputs.releaseName }} \
|
||||
--generate-notes \
|
||||
${{ inputs.releaseName }}
|
||||
|
||||
upload_release:
|
||||
name: "Upload"
|
||||
|
||||
needs: ["create"]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: write
|
||||
attestations: write
|
||||
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
||||
with:
|
||||
name: docs
|
||||
path: docs
|
||||
- run: |
|
||||
tar -czvf docs.tar.gz docs
|
||||
- name: "Attest Documentation"
|
||||
id: attestation
|
||||
uses: actions/attest-build-provenance@520d128f165991a6c774bcb264f323e3d70747f4 # v2.2.0
|
||||
with:
|
||||
subject-path: "docs.tar.gz"
|
||||
- name: Copy Attestation
|
||||
run: cp "$ATTESTATION" docs.tar.gz.sigstore
|
||||
env:
|
||||
ATTESTATION: "${{ steps.attestation.outputs.bundle-path }}"
|
||||
- name: Upload
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
gh release upload --clobber "${{ github.ref_name }}" \
|
||||
docs.tar.gz docs.tar.gz.sigstore
|
||||
@@ -1,181 +0,0 @@
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
name: "Test"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
phpunit:
|
||||
name: PHPUnit (PHP ${{ matrix.php }} on ${{ matrix.os }})
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
continue-on-error: ${{ matrix.experimental }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php: ["8.2", "8.3", "8.4"]
|
||||
os: [ubuntu-latest]
|
||||
experimental: [false]
|
||||
include:
|
||||
- php: nightly
|
||||
os: ubuntu-latest
|
||||
experimental: true
|
||||
- php: "8.4"
|
||||
os: windows-latest
|
||||
experimental: false
|
||||
- php: "8.4"
|
||||
os: macos-latest
|
||||
experimental: false
|
||||
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: SetUp PHP
|
||||
id: setup-php
|
||||
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2
|
||||
with:
|
||||
php-version: "${{ matrix.php }}"
|
||||
tools: phpunit
|
||||
coverage: xdebug
|
||||
extensions: xdebug,zip
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache-common
|
||||
if: "${{ runner.os != 'Windows' }}"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache-windows
|
||||
if: "${{ runner.os == 'Windows' }}"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $env:GITHUB_OUTPUT
|
||||
- name: Cache Deps
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
|
||||
id: cache
|
||||
with:
|
||||
path: ${{ steps.composer-cache-common.outputs.dir }}${{ steps.composer-cache-windows.outputs.dir }}
|
||||
key: deps-${{ runner.os }}-${{ steps.setup-php.outputs.php-version }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: |
|
||||
deps-${{ runner.os }}-${{ steps.setup-php.outputs.php-version }}-composer-
|
||||
deps-${{ runner.os }}-${{ steps.setup-php.outputs.php-version }}-
|
||||
deps-${{ steps.setup-php.outputs.php-version }}-
|
||||
deps-
|
||||
- name: Install Deps
|
||||
if: matrix.php != 'nightly'
|
||||
run: composer install --prefer-dist
|
||||
- name: Install Deps (ignore PHP requirement)
|
||||
if: matrix.php == 'nightly'
|
||||
run: composer install --prefer-dist --ignore-platform-req=php+
|
||||
- name: Run PHPUnit
|
||||
run: composer run test:unit:cov
|
||||
- name: Upload coverage results to Coveralls
|
||||
env:
|
||||
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
COVERALLS_PARALLEL: true
|
||||
COVERALLS_FLAG_NAME: ${{ runner.os }}-${{ steps.setup-php.outputs.php-version }}
|
||||
run: composer run coverage:report
|
||||
continue-on-error: ${{ matrix.experimental }}
|
||||
|
||||
mark_coverage_done:
|
||||
needs: ["phpunit"]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: Coveralls Finished
|
||||
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
|
||||
with:
|
||||
github-token: ${{ secrets.github_token }}
|
||||
parallel-finished: true
|
||||
|
||||
psalm:
|
||||
name: Run Psalm
|
||||
|
||||
runs-on: "ubuntu-latest"
|
||||
|
||||
permissions:
|
||||
security-events: write
|
||||
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: SetUp PHP
|
||||
id: setup-php
|
||||
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2
|
||||
with:
|
||||
php-version: "8.3"
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
- name: Cache Deps
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
|
||||
id: cache
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: deps-${{ runner.os }}-${{ steps.setup-php.outputs.php-version }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: |
|
||||
deps-${{ runner.os }}-${{ steps.setup-php.outputs.php-version }}-composer-
|
||||
deps-${{ runner.os }}-${{ steps.setup-php.outputs.php-version }}-
|
||||
deps-${{ steps.setup-php.outputs.php-version }}-
|
||||
deps-
|
||||
- name: Install Deps
|
||||
run: composer install --prefer-dist
|
||||
- name: Run Psalm
|
||||
run: composer run test:lint -- --report=results.sarif
|
||||
- name: "Upload SARIF"
|
||||
uses: github/codeql-action/upload-sarif@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
||||
php-cs:
|
||||
name: Run PHP-CS
|
||||
|
||||
runs-on: "ubuntu-latest"
|
||||
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: SetUp PHP
|
||||
id: setup-php
|
||||
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2
|
||||
with:
|
||||
php-version: "8.3"
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
- name: Cache Deps
|
||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
|
||||
id: cache
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: deps-${{ runner.os }}-${{ steps.setup-php.outputs.php-version }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: |
|
||||
deps-${{ runner.os }}-${{ steps.setup-php.outputs.php-version }}-composer-
|
||||
deps-${{ runner.os }}-${{ steps.setup-php.outputs.php-version }}-
|
||||
deps-${{ steps.setup-php.outputs.php-version }}-
|
||||
deps-
|
||||
- name: Install Deps
|
||||
run: composer install --prefer-dist
|
||||
- name: Run PHP-CS
|
||||
run: composer run test:formatted
|
||||
@@ -1,50 +0,0 @@
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
workflow_dispatch: {}
|
||||
|
||||
name: "Pull Request"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: "Test"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
uses: ./.github/workflows/part_test.yml
|
||||
|
||||
docs:
|
||||
name: "Docs"
|
||||
|
||||
uses: ./.github/workflows/part_docs.yml
|
||||
|
||||
dependabot:
|
||||
name: "Dependabot"
|
||||
|
||||
if: ${{ github.actor == 'dependabot[bot]'}}
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
contents: write
|
||||
|
||||
uses: ./.github/workflows/part_dependabot.yml
|
||||
|
||||
dependency-review:
|
||||
name: Dependency Review
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: 'Checkout Repository'
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: 'Dependency Review'
|
||||
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
|
||||
@@ -1,78 +0,0 @@
|
||||
# This workflow uses actions that are not certified by GitHub. They are provided
|
||||
# by a third-party and are governed by separate terms of service, privacy
|
||||
# policy, and support documentation.
|
||||
|
||||
name: Scorecard supply-chain security
|
||||
on:
|
||||
# For Branch-Protection check. Only the default branch is supported. See
|
||||
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
|
||||
branch_protection_rule:
|
||||
# To guarantee Maintained check is occasionally updated. See
|
||||
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
|
||||
schedule:
|
||||
- cron: '28 11 * * 3'
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
|
||||
# Declare default permissions as read only.
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
analysis:
|
||||
name: Scorecard analysis
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# Needed to upload the results to code-scanning dashboard.
|
||||
security-events: write
|
||||
# Needed to publish results and get a badge (see publish_results below).
|
||||
id-token: write
|
||||
# Uncomment the permissions below if installing in a private repository.
|
||||
# contents: read
|
||||
# actions: read
|
||||
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
|
||||
# - you want to enable the Branch-Protection check on a *public* repository, or
|
||||
# - you are installing Scorecard on a *private* repository
|
||||
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
|
||||
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
|
||||
|
||||
# Public repositories:
|
||||
# - Publish results to OpenSSF REST API for easy access by consumers
|
||||
# - Allows the repository to include the Scorecard badge.
|
||||
# - See https://github.com/ossf/scorecard-action#publishing-results.
|
||||
# For private repositories:
|
||||
# - `publish_results` will always be set to `false`, regardless
|
||||
# of the value entered here.
|
||||
publish_results: true
|
||||
|
||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||
# format to the repository Actions tab.
|
||||
- name: "Upload artifact"
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
retention-days: 5
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard (optional).
|
||||
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
@@ -1,29 +0,0 @@
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
|
||||
|
||||
name: "Beta Tag"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
name: "Docs"
|
||||
|
||||
uses: ./.github/workflows/part_docs.yml
|
||||
|
||||
release:
|
||||
name: "Release"
|
||||
|
||||
needs: ["docs"]
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: write
|
||||
attestations: write
|
||||
|
||||
uses: ./.github/workflows/part_release.yml
|
||||
with:
|
||||
releaseName: "${{ github.ref_name }}"
|
||||
@@ -1,55 +0,0 @@
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "[0-9]+.[0-9]+.[0-9]+"
|
||||
|
||||
name: "Stable Tag"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
name: "Docs"
|
||||
|
||||
uses: ./.github/workflows/part_docs.yml
|
||||
|
||||
release:
|
||||
name: "Release"
|
||||
|
||||
needs: ["docs"]
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: write
|
||||
attestations: write
|
||||
|
||||
uses: ./.github/workflows/part_release.yml
|
||||
with:
|
||||
releaseName: "${{ github.ref_name }}"
|
||||
stable: true
|
||||
|
||||
deploy_pages:
|
||||
name: "Deploy to GitHub Pages"
|
||||
|
||||
needs: ["release", "docs"]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
|
||||
12
api/vendor/maennchen/zipstream-php/.gitignore
vendored
12
api/vendor/maennchen/zipstream-php/.gitignore
vendored
@@ -1,12 +0,0 @@
|
||||
/composer.lock
|
||||
/cov
|
||||
/coverage.clover.xml
|
||||
/docs
|
||||
.idea
|
||||
/.php-cs-fixer.cache
|
||||
/.phpdoc/cache
|
||||
/.phpunit.result.cache
|
||||
/phpunit.xml
|
||||
/.phpunit.cache
|
||||
/tools
|
||||
/vendor
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phive xmlns="https://phar.io/phive">
|
||||
<phar name="phpdocumentor" version="^3.3.1" installed="3.6.0" location="./tools/phpdocumentor" copy="false"/>
|
||||
<phar name="phpdocumentor" version="^3.3.1" installed="3.8.0" location="./tools/phpdocumentor" copy="false"/>
|
||||
</phive>
|
||||
|
||||
@@ -28,7 +28,8 @@ return $config->setRules([
|
||||
'@PER' => true,
|
||||
'@PER:risky' => true,
|
||||
'@PHP83Migration' => true,
|
||||
'@PHP84Migration' => true,
|
||||
// Enable once PHP 8.4 is the minimum version
|
||||
// '@PHP84Migration' => true,
|
||||
'@PHPUnit84Migration:risky' => true,
|
||||
'array_syntax' => ['syntax' => 'short'],
|
||||
'class_attributes_separation' => true,
|
||||
|
||||
@@ -1 +1 @@
|
||||
php 8.4.3
|
||||
php 8.4.10
|
||||
|
||||
50
api/vendor/maennchen/zipstream-php/README.md
vendored
50
api/vendor/maennchen/zipstream-php/README.md
vendored
@@ -64,6 +64,50 @@ $zip->addFileFromPath(
|
||||
$zip->finish();
|
||||
```
|
||||
|
||||
### Callback Output
|
||||
|
||||
You can stream ZIP data to a custom callback function instead of directly to the browser:
|
||||
|
||||
```php
|
||||
use ZipStream\ZipStream;
|
||||
use ZipStream\Stream\CallbackStreamWrapper;
|
||||
|
||||
// Stream to a callback function with proper file handling
|
||||
$outputFile = fopen('output.zip', 'wb');
|
||||
$backupFile = fopen('backup.zip', 'wb');
|
||||
|
||||
$zip = new ZipStream(
|
||||
outputStream: CallbackStreamWrapper::open(function (string $data) use ($outputFile, $backupFile) {
|
||||
// Handle ZIP data as it's generated
|
||||
fwrite($outputFile, $data);
|
||||
|
||||
// Send to multiple destinations efficiently
|
||||
echo $data; // Browser
|
||||
fwrite($backupFile, $data); // Backup file
|
||||
}),
|
||||
sendHttpHeaders: false,
|
||||
);
|
||||
|
||||
$zip->addFile('hello.txt', 'Hello World!');
|
||||
$zip->finish();
|
||||
|
||||
// Clean up resources
|
||||
fclose($outputFile);
|
||||
fclose($backupFile);
|
||||
```
|
||||
|
||||
## Questions
|
||||
|
||||
**💬 Questions? Please Read This First!**
|
||||
|
||||
If you have a question about using this library, please *do not email the
|
||||
authors directly*. Instead, head over to the
|
||||
[GitHub Discussions](https://github.com/maennchen/ZipStream-PHP/discussions)
|
||||
page — your question might already be answered there! Using Discussions helps
|
||||
build a shared knowledge base, so others can also benefit from the answers. If
|
||||
you need dedicated 1:1 support, check out the options available on
|
||||
[@maennchen's sponsorship page](https://github.com/sponsors/maennchen?frequency=one-time&sponsor=maennchen).
|
||||
|
||||
## Upgrade to version 3.1.2
|
||||
|
||||
- Minimum PHP Version: `8.2`
|
||||
@@ -76,7 +120,7 @@ $zip->finish();
|
||||
- Only 64bit Architecture is supported.
|
||||
- The class `ZipStream\Option\Method` has been replaced with the enum
|
||||
`ZipStream\CompressionMethod`.
|
||||
- Most clases have been flagged as `@internal` and should not be used from the
|
||||
- Most classes have been flagged as `@internal` and should not be used from the
|
||||
outside.
|
||||
If you're using internal resources to extend this library, please open an
|
||||
issue so that a clean interface can be added & published.
|
||||
@@ -88,7 +132,7 @@ $zip->finish();
|
||||
### Archive Options
|
||||
|
||||
- The class `ZipStream\Option\Archive` has been replaced in favor of named
|
||||
arguments in the `ZipStream\ZipStream` constuctor.
|
||||
arguments in the `ZipStream\ZipStream` constructor.
|
||||
- The archive options `largeFileSize` & `largeFileMethod` has been removed. If
|
||||
you want different `compressionMethods` based on the file size, you'll have to
|
||||
implement this yourself.
|
||||
@@ -101,7 +145,7 @@ $zip->finish();
|
||||
filesizes this way.
|
||||
- The archive option `deflateLevel` has been replaced with the option
|
||||
`defaultDeflateLevel` and can be overridden for every file.
|
||||
- The first argument (`name`) of the `ZipStream\ZipStream` constuctor has been
|
||||
- The first argument (`name`) of the `ZipStream\ZipStream` constructor has been
|
||||
replaced with the named argument `outputName`.
|
||||
- Headers are now also sent if the `outputName` is empty. If you do not want to
|
||||
automatically send http headers, set `sendHttpHeaders` to `false`.
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php-64bit": "^8.2",
|
||||
"php-64bit": "^8.3",
|
||||
"ext-mbstring": "*",
|
||||
"ext-zlib": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^11.0",
|
||||
"phpunit/phpunit": "^12.0",
|
||||
"guzzlehttp/guzzle": "^7.5",
|
||||
"ext-zip": "*",
|
||||
"mikey179/vfsstream": "^1.6",
|
||||
@@ -57,7 +57,7 @@
|
||||
"test:formatted": "@format --dry-run --stop-on-violation --using-cache=no",
|
||||
"test:lint": "psalm --stats --show-info=true --find-unused-psalm-suppress",
|
||||
"coverage:report": "php-coveralls --coverage_clover=coverage.clover.xml --json_path=coveralls-upload.json --insecure",
|
||||
"install:tools": "phive install --trust-gpg-keys 0x67F861C3D889C656 --trust-gpg-keys 0x8AC0BAA79732DD42",
|
||||
"install:tools": "phive install --trust-gpg-keys 0x67F861C3D889C656 --trust-gpg-keys 0x8AC0BAA79732DD42 --trust-gpg-keys 0x6DA3ACC4991FFAE5",
|
||||
"docs:generate": "tools/phpdocumentor --sourcecode"
|
||||
},
|
||||
"autoload": {
|
||||
|
||||
@@ -7,7 +7,7 @@ using the options ``SIMULATION_STRICT`` or ``SIMULATION_LAX`` in the
|
||||
|
||||
In the ``SIMULATION_STRICT`` mode, ``ZipStream`` will not allow to calculate the
|
||||
size based on reading the whole file. ``SIMULATION_LAX`` will read the whole
|
||||
file if neccessary.
|
||||
file if necessary.
|
||||
|
||||
``SIMULATION_STRICT`` is therefore useful to make sure that the size can be
|
||||
calculated efficiently.
|
||||
|
||||
@@ -12,11 +12,14 @@ Here is the full list of options available to you. You can also have a look at
|
||||
|
||||
$zip = new ZipStream(
|
||||
// Define output stream
|
||||
// (argument is eiter a resource or implementing
|
||||
// (argument is either a resource or implementing
|
||||
// `Psr\Http\Message\StreamInterface`)
|
||||
//
|
||||
// Setup with `psr/http-message` & `guzzlehttp/psr7` dependencies
|
||||
// required when using `Psr\Http\Message\StreamInterface`.
|
||||
//
|
||||
// Can also use CallbackStreamWrapper for custom output handling:
|
||||
// outputStream: CallbackStreamWrapper::open(function($data) { /* handle data */ }),
|
||||
outputStream: $filePointer,
|
||||
|
||||
// Set the deflate level (default is 6; use -1 to disable it)
|
||||
|
||||
@@ -37,3 +37,77 @@ Stream to S3 Bucket
|
||||
$zip->finish();
|
||||
|
||||
fclose($zipFile);
|
||||
|
||||
Stream to Callback Function
|
||||
---------------------------
|
||||
|
||||
The CallbackStreamWrapper allows you to stream ZIP data to a custom callback function,
|
||||
enabling flexible output handling such as streaming to multiple destinations,
|
||||
progress tracking, or data transformation.
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
use ZipStream\ZipStream;
|
||||
use ZipStream\Stream\CallbackStreamWrapper;
|
||||
|
||||
// Example 1: Stream to multiple destinations with proper file handling
|
||||
$backupFile = fopen('backup.zip', 'wb');
|
||||
$logFile = fopen('transfer.log', 'ab');
|
||||
|
||||
$zip = new ZipStream(
|
||||
outputStream: CallbackStreamWrapper::open(function (string $data) use ($backupFile, $logFile) {
|
||||
// Send to browser
|
||||
echo $data;
|
||||
|
||||
// Save to file efficiently
|
||||
fwrite($backupFile, $data);
|
||||
|
||||
// Log transfer progress
|
||||
fwrite($logFile, "Transferred " . strlen($data) . " bytes\n");
|
||||
}),
|
||||
sendHttpHeaders: false,
|
||||
);
|
||||
|
||||
$zip->addFile('hello.txt', 'Hello World!');
|
||||
$zip->finish();
|
||||
|
||||
// Clean up resources
|
||||
fclose($backupFile);
|
||||
fclose($logFile);
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
// Example 2: Progress tracking
|
||||
$totalBytes = 0;
|
||||
$zip = new ZipStream(
|
||||
outputStream: CallbackStreamWrapper::open(function (string $data) use (&$totalBytes) {
|
||||
$totalBytes += strlen($data);
|
||||
reportProgress($totalBytes); // Report progress to your tracking system
|
||||
|
||||
// Your actual output handling
|
||||
echo $data;
|
||||
}),
|
||||
sendHttpHeaders: false,
|
||||
);
|
||||
|
||||
$zip->addFile('large_file.txt', str_repeat('A', 10000));
|
||||
$zip->finish();
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
// Example 3: Data transformation using PHP stream filters
|
||||
// For data transformations, prefer PHP's built-in stream filters
|
||||
$outputStream = fopen('php://output', 'w');
|
||||
stream_filter_append($outputStream, 'convert.base64-encode');
|
||||
|
||||
$zip = new ZipStream(
|
||||
outputStream: $outputStream,
|
||||
sendHttpHeaders: false,
|
||||
);
|
||||
|
||||
$zip->addFile('secret.txt', 'Confidential data');
|
||||
$zip->finish();
|
||||
fclose($outputStream);
|
||||
|
||||
.. note::
|
||||
For data transformations, PHP's built-in stream filters are preferred over callback transformations. Stream filters operate at the stream level and maintain data integrity. You can register custom filters using ``stream_filter_register()`` for specialized transformations.
|
||||
|
||||
@@ -39,7 +39,7 @@ as well:
|
||||
If ``composer install`` yields the following error, your installation is missing
|
||||
the `mbstring extension <https://www.php.net/manual/en/book.mbstring.php>`_,
|
||||
either `install it <https://www.php.net/manual/en/mbstring.installation.php>`_
|
||||
or run the follwoing command:
|
||||
or run the following command:
|
||||
|
||||
.. code-block::
|
||||
Your requirements could not be resolved to an installable set of packages.
|
||||
@@ -120,7 +120,7 @@ It is recommended to extract with another tool like
|
||||
`7-zip <https://www.7-zip.org/>`_.
|
||||
See `#146 <https://github.com/maennchen/ZipStream-PHP/issues/146>`_.
|
||||
|
||||
It is the responsability of the client code to make sure that files are not
|
||||
It is the responsibility of the client code to make sure that files are not
|
||||
saved with the same path, as it is not possible for the library to figure it out
|
||||
while streaming a zip.
|
||||
See `#154 <https://github.com/maennchen/ZipStream-PHP/issues/154>`_.
|
||||
|
||||
@@ -4,6 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace ZipStream;
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
enum CompressionMethod: int
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -4,4 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace ZipStream;
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
abstract class Exception extends \Exception {}
|
||||
|
||||
@@ -8,7 +8,9 @@ use DateTimeInterface;
|
||||
use ZipStream\Exception;
|
||||
|
||||
/**
|
||||
* This Exception gets invoked if a file wasn't found
|
||||
* This Exception gets invoked if a DOS time is overflowing
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class DosTimeOverflowException extends Exception
|
||||
{
|
||||
|
||||
@@ -8,6 +8,8 @@ use ZipStream\Exception;
|
||||
|
||||
/**
|
||||
* This Exception gets invoked if a file wasn't found
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class FileNotFoundException extends Exception
|
||||
{
|
||||
|
||||
@@ -7,7 +7,9 @@ namespace ZipStream\Exception;
|
||||
use ZipStream\Exception;
|
||||
|
||||
/**
|
||||
* This Exception gets invoked if a file wasn't found
|
||||
* This Exception gets invoked if a file isn't readable
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class FileNotReadableException extends Exception
|
||||
{
|
||||
|
||||
@@ -8,6 +8,8 @@ use ZipStream\Exception;
|
||||
|
||||
/**
|
||||
* This Exception gets invoked if a file is not as large as it was specified.
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class FileSizeIncorrectException extends Exception
|
||||
{
|
||||
|
||||
@@ -8,6 +8,8 @@ use ZipStream\Exception;
|
||||
|
||||
/**
|
||||
* This Exception gets invoked if a counter value exceeds storage size
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class OverflowException extends Exception
|
||||
{
|
||||
|
||||
@@ -8,6 +8,8 @@ use ZipStream\Exception;
|
||||
|
||||
/**
|
||||
* This Exception gets invoked if a resource like `fread` returns false
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class ResourceActionException extends Exception
|
||||
{
|
||||
|
||||
@@ -9,6 +9,8 @@ use ZipStream\Exception;
|
||||
/**
|
||||
* This Exception gets invoked if a strict simulation is executed and the file
|
||||
* information can't be determined without reading the entire file.
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class SimulationFileUnknownException extends Exception
|
||||
{
|
||||
|
||||
@@ -8,6 +8,8 @@ use ZipStream\Exception;
|
||||
|
||||
/**
|
||||
* This Exception gets invoked if a stream can't be read.
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class StreamNotReadableException extends Exception
|
||||
{
|
||||
|
||||
@@ -9,6 +9,8 @@ use ZipStream\Exception;
|
||||
/**
|
||||
* This Exception gets invoked if a non seekable stream is
|
||||
* provided and zero headers are disabled.
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class StreamNotSeekableException extends Exception
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ use ZipStream\Exception\StreamNotSeekableException;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
class File
|
||||
final class File
|
||||
{
|
||||
private const CHUNKED_READ_BLOCK_SIZE = 0x1000000;
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ namespace ZipStream;
|
||||
|
||||
/**
|
||||
* ZipStream execution operation modes
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
enum OperationMode
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ use RuntimeException;
|
||||
* @internal
|
||||
* TODO: Make class readonly when requiring PHP 8.2 exclusively
|
||||
*/
|
||||
class PackField
|
||||
final class PackField
|
||||
{
|
||||
public const MAX_V = 0xFFFFFFFF;
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace ZipStream;
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
enum Version: int
|
||||
{
|
||||
case STORE = 0x000A; // 1.00
|
||||
|
||||
@@ -64,6 +64,8 @@ use ZipStream\Exception\ResourceActionException;
|
||||
* // write archive footer to stream
|
||||
* $zip->finish();
|
||||
* ```
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class ZipStream
|
||||
{
|
||||
@@ -691,7 +693,7 @@ class ZipStream
|
||||
/**
|
||||
* Write zip footer to stream.
|
||||
*
|
||||
* The clase is left in an unusable state after `finish`.
|
||||
* The class is left in an unusable state after `finish`.
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user