├── .asf.yaml ├── .github └── workflows │ ├── container.yml │ ├── license.yml │ ├── pecl.yml │ └── rust.yml ├── .gitignore ├── .licenserc.yaml ├── .rustfmt.toml ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── NOTICE ├── README.md ├── build.rs ├── config.m4 ├── dist-material ├── LICENSE ├── LICENSE.tpl ├── NOTICE └── licenses │ ├── LICENSE-aho-corasick.txt │ ├── LICENSE-async-stream-impl.txt │ ├── LICENSE-async-stream.txt │ ├── LICENSE-axum-core.txt │ ├── LICENSE-axum.txt │ ├── LICENSE-bincode.txt │ ├── LICENSE-bindgen.txt │ ├── LICENSE-bytes.txt │ ├── LICENSE-convert_case.txt │ ├── LICENSE-dashmap.txt │ ├── LICENSE-data-encoding.txt │ ├── LICENSE-derive_more.txt │ ├── LICENSE-errno-dragonfly.txt │ ├── LICENSE-h2.txt │ ├── LICENSE-hostname.txt │ ├── LICENSE-http-body.txt │ ├── LICENSE-hyper.txt │ ├── LICENSE-instant.txt │ ├── LICENSE-libloading.txt │ ├── LICENSE-matchers.txt │ ├── LICENSE-matches.txt │ ├── LICENSE-matchit.txt │ ├── LICENSE-memchr.txt │ ├── LICENSE-mio.txt │ ├── LICENSE-nom.txt │ ├── LICENSE-nu-ansi-term.txt │ ├── LICENSE-openssl-sys.txt │ ├── LICENSE-overload.txt │ ├── LICENSE-phper-alloc.txt │ ├── LICENSE-phper-build.txt │ ├── LICENSE-phper-macros.txt │ ├── LICENSE-phper-sys.txt │ ├── LICENSE-phper.txt │ ├── LICENSE-redox_syscall.txt │ ├── LICENSE-regex-automata.txt │ ├── LICENSE-ring.txt │ ├── LICENSE-rustls-native-certs.txt │ ├── LICENSE-schannel.txt │ ├── LICENSE-sharded-slab.txt │ ├── LICENSE-slab.txt │ ├── LICENSE-spin.txt │ ├── LICENSE-systemstat.txt │ ├── LICENSE-termcolor.txt │ ├── LICENSE-tokio-macros.txt │ ├── LICENSE-tokio-native-tls.txt │ ├── LICENSE-tokio-stream.txt │ ├── LICENSE-tokio-util.txt │ ├── LICENSE-tokio.txt │ ├── LICENSE-tonic-build.txt │ ├── LICENSE-tonic.txt │ ├── LICENSE-tower-layer.txt │ ├── LICENSE-tower-service.txt │ ├── LICENSE-tower.txt │ ├── LICENSE-tracing-attributes.txt │ ├── LICENSE-tracing-core.txt │ ├── LICENSE-tracing-futures.txt │ ├── LICENSE-tracing-log.txt │ ├── LICENSE-tracing-subscriber.txt │ ├── LICENSE-tracing.txt │ ├── LICENSE-try-lock.txt │ ├── LICENSE-untrusted.txt │ ├── LICENSE-valuable.txt │ ├── LICENSE-want.txt │ ├── LICENSE-webpki.txt │ ├── LICENSE-which.txt │ ├── LICENSE-winapi-util.txt │ └── LICENSE-winreg.txt ├── docker-compose.yml ├── docker └── Dockerfile ├── docs ├── README.md ├── en │ ├── configuration │ │ ├── context-injection.md │ │ ├── ini-settings.md │ │ ├── report-log.md │ │ └── zend-observer.md │ ├── contribution │ │ ├── compiling.md │ │ └── release-agent.md │ ├── reporter │ │ ├── kafka-reporter.md │ │ └── standalone-reporter.md │ └── setup │ │ └── service-agent │ │ └── php-agent │ │ ├── README.md │ │ └── Supported-list.md └── menu.yml ├── package.tpl.xml ├── rust-toolchain.toml ├── scripts ├── Cargo.toml └── src │ ├── command │ ├── create_package_xml.rs │ └── mod.rs │ └── main.rs ├── src ├── channel.rs ├── component.rs ├── context.rs ├── errors.rs ├── execute.rs ├── lib.rs ├── log.rs ├── module.rs ├── plugin │ ├── mod.rs │ ├── plugin_amqplib.rs │ ├── plugin_curl.rs │ ├── plugin_memcache.rs │ ├── plugin_memcached.rs │ ├── plugin_mongodb.rs │ ├── plugin_mysqli.rs │ ├── plugin_pdo.rs │ ├── plugin_predis.rs │ ├── plugin_psr3.rs │ ├── plugin_redis.rs │ ├── plugin_swoole.rs │ └── style.rs ├── request.rs ├── tag.rs ├── util.rs └── worker.rs ├── tests ├── common │ └── mod.rs ├── conf │ ├── php-fpm.1.conf │ ├── php-fpm.2.conf │ └── php.ini ├── data │ └── expected_context.yaml ├── e2e.rs └── php │ ├── composer.json │ ├── composer.lock │ ├── fpm │ ├── curl-multi.enter.php │ ├── curl.enter.php │ ├── curl.test.php │ ├── guzzle.php │ ├── index.php │ ├── memcache.php │ ├── memcached.php │ ├── mongodb.php │ ├── monolog.php │ ├── mysqli.php │ ├── pdo.php │ ├── predis.php │ ├── rabbitmq.php │ ├── redis.fail.php │ └── redis.succ.php │ └── swoole │ ├── main.1.php │ └── main.2.php └── worker ├── Cargo.toml └── src ├── channel.rs ├── lib.rs ├── main.rs └── reporter ├── mod.rs ├── reporter_grpc.rs └── reporter_kafka.rs /.asf.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | github: 17 | description: Apache SkyWalking PHP Agent 18 | homepage: https://skywalking.apache.org/ 19 | labels: 20 | - skywalking 21 | - observability 22 | - apm 23 | - distributed-tracing 24 | - service-mesh 25 | - dapper 26 | - php 27 | enabled_merge_buttons: 28 | squash: true 29 | merge: false 30 | rebase: false 31 | protected_branches: 32 | master: 33 | required_status_checks: 34 | strict: true 35 | contexts: 36 | - license 37 | - pecl-required 38 | - required 39 | required_pull_request_reviews: 40 | dismiss_stale_reviews: true 41 | required_approving_review_count: 1 42 | -------------------------------------------------------------------------------- /.github/workflows/container.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | name: Container 17 | 18 | on: 19 | release: 20 | types: 21 | - published 22 | 23 | jobs: 24 | container: 25 | name: container 26 | runs-on: ubuntu-24.04 27 | steps: 28 | - name: Checkout 29 | uses: actions/checkout@v2 30 | with: 31 | submodules: 'recursive' 32 | 33 | - name: Set output 34 | id: vars 35 | run: echo ::set-output name=VERSION::$(echo ${{ github.event.release.tag_name }} | sed "s/v//") 36 | 37 | - name: Log in to registry 38 | run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin 39 | 40 | - name: Docker build 41 | run: | 42 | cd docker 43 | docker build -t skywalking-php --build-arg SKYWALKING_AGENT=${{ steps.vars.outputs.VERSION }} . 44 | docker tag skywalking-php ghcr.io/apache/skywalking-php:latest 45 | docker tag skywalking-php ghcr.io/apache/skywalking-php:${{ steps.vars.outputs.VERSION }} 46 | docker push ghcr.io/apache/skywalking-php:latest 47 | docker push ghcr.io/apache/skywalking-php:${{ steps.vars.outputs.VERSION }} 48 | -------------------------------------------------------------------------------- /.github/workflows/license.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | name: License 17 | 18 | on: 19 | push: 20 | branches: 21 | - master 22 | pull_request: 23 | branches: 24 | - "**" 25 | 26 | jobs: 27 | license: 28 | name: license 29 | runs-on: ubuntu-24.04 30 | steps: 31 | - name: Checkout 32 | uses: actions/checkout@v2 33 | with: 34 | submodules: 'recursive' 35 | - name: Check License Header 36 | uses: apache/skywalking-eyes/header/@d299844e334855087f18ae1fe3c81ae8d22bc282 37 | with: 38 | config: .licenserc.yaml 39 | - name: Check Dependencies License 40 | uses: apache/skywalking-eyes/dependency/@d299844e334855087f18ae1fe3c81ae8d22bc282 41 | with: 42 | config: .licenserc.yaml 43 | - name: Check Dependencies Licenses Summary 44 | run: | 45 | go install github.com/apache/skywalking-eyes/cmd/license-eye@d299844e334855087f18ae1fe3c81ae8d22bc282 46 | license-eye dependency resolve --summary ./dist-material/LICENSE.tpl -c .licenserc.yaml || exit 1 47 | if [ ! -z "$(git diff -U0 ./dist-material/LICENSE)" ]; then 48 | echo "LICENSE file is not updated correctly" 49 | git diff -U0 ./dist-material/LICENSE 50 | exit 1 51 | fi 52 | -------------------------------------------------------------------------------- /.github/workflows/pecl.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | name: PECL 17 | 18 | on: 19 | push: 20 | branches: 21 | - master 22 | pull_request: 23 | branches: 24 | - "**" 25 | 26 | env: 27 | CARGO_TERM_COLOR: always 28 | RUST_BACKTRACE: "1" 29 | RUSTFLAGS: "-D warnings" 30 | LLVM_CONFIG_PATH: llvm-config-18 31 | RUSTUP_HOME: /tmp/rustup 32 | CARGO_HOME: /tmp/cargo 33 | 34 | jobs: 35 | pecl-required: 36 | needs: 37 | - pecl 38 | runs-on: ubuntu-24.04 39 | steps: 40 | - name: Check results 41 | run: | 42 | [[ ${{ needs.pecl.result }} == 'success' ]] || exit 1; 43 | 44 | pecl: 45 | name: PECL 46 | strategy: 47 | fail-fast: false 48 | matrix: 49 | os: 50 | - ubuntu-24.04 51 | - macos-14 52 | version: 53 | - php: "8.2" 54 | swoole: "5.1.1" 55 | option: 56 | - 'enable-cargo-debug=\"no\" enable-kafka-reporter=\"no\"' 57 | - 'enable-cargo-debug=\"no\" enable-kafka-reporter=\"yes\"' 58 | 59 | runs-on: ${{ matrix.os }} 60 | steps: 61 | - name: Checkout 62 | uses: actions/checkout@v2 63 | with: 64 | submodules: 'recursive' 65 | 66 | - name: Install dependencies for Linux 67 | if: matrix.os == 'ubuntu-24.04' 68 | run: sudo apt-get update && sudo apt-get install -y llvm-18-dev libclang-18-dev protobuf-compiler libsasl2-dev 69 | 70 | - name: Install protobuf for Macos 71 | if: matrix.os == 'macos-14' 72 | run: brew install protobuf 73 | 74 | - name: Setup PHP 75 | uses: shivammathur/setup-php@v2 76 | with: 77 | php-version: ${{ matrix.version.php }} 78 | tools: php-config 79 | extensions: swoole-${{ matrix.version.swoole }} 80 | 81 | - name: Install Rust Stable Globally 82 | run: | 83 | curl https://sh.rustup.rs -sSf | sudo -E sh -s -- -y --default-toolchain none 84 | 85 | - name: PECL install 86 | run: | 87 | sudo bash -c "\ 88 | source /tmp/cargo/env && \ 89 | cargo version && \ 90 | cargo run -p scripts --release -- create-package-xml --version 0.0.0 --notes 'Just for TEST.' && \ 91 | cat package.xml && \ 92 | pecl install -D '${{ matrix.option }}' package.xml" 93 | php -d "extension=skywalking_agent" --ri skywalking_agent 94 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo, will have compiled files and executables. 2 | /target/ 3 | # These are backup files generated by rustfmt. 4 | **/*.rs.bk 5 | # Local Cargo config file. 6 | /.cargo/config.toml 7 | # PHP composer vendor. 8 | /tests/php/vendor/ 9 | 10 | /skywalking_agent-*.tgz 11 | /skywalking_agent-*.tgz.asc 12 | /skywalking_agent-*.tgz.sha512 13 | /package.xml 14 | /.vagrant 15 | 16 | *.lo 17 | *.la 18 | .libs 19 | acinclude.m4 20 | aclocal.m4 21 | autom4te.cache 22 | build 23 | config.guess 24 | config.h 25 | config.h.in 26 | config.h.in~ 27 | config.log 28 | config.nice 29 | config.status 30 | config.sub 31 | configure 32 | configure.ac 33 | configure.in 34 | include 35 | install-sh 36 | libtool 37 | ltmain.sh 38 | Makefile 39 | Makefile.fragments 40 | Makefile.global 41 | Makefile.objects 42 | missing 43 | mkinstalldirs 44 | modules 45 | php_test_results_*.txt 46 | phpt.* 47 | run-test-info.php 48 | run-tests.php 49 | tests/**/*.diff 50 | tests/**/*.out 51 | tests/**/*.exp 52 | tests/**/*.log 53 | tests/**/*.db 54 | tests/**/*.mem 55 | tmp-php.ini 56 | .fleet 57 | .idea 58 | -------------------------------------------------------------------------------- /.licenserc.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | header: 17 | license: 18 | spdx-id: Apache-2.0 19 | copyright-owner: Apache Software Foundation 20 | 21 | paths-ignore: 22 | - '**/*.json' 23 | - '**/*.lock' 24 | - '**/*.md' 25 | - '**/.gitignore' 26 | - '**/.gitmodules' 27 | - '.cargo' 28 | - '.idea' 29 | - '.vscode' 30 | - 'LICENSE' 31 | - 'NOTICE' 32 | - 'config.m4' 33 | - 'vendor' 34 | - 'dist-material' 35 | - 'target' 36 | 37 | comment: on-failure 38 | 39 | dependency: 40 | files: 41 | - Cargo.toml 42 | -------------------------------------------------------------------------------- /.rustfmt.toml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | fn_params_layout = "Compressed" 17 | format_code_in_doc_comments = true 18 | format_macro_bodies = true 19 | format_macro_matchers = true 20 | format_strings = true 21 | imports_granularity = "Crate" 22 | merge_derives = true 23 | newline_style = "Unix" 24 | normalize_comments = true 25 | reorder_impl_items = true 26 | use_field_init_shorthand = true 27 | wrap_comments = true 28 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | [workspace] 17 | members = [ 18 | ".", 19 | "scripts", 20 | "worker", 21 | ] 22 | 23 | [workspace.package] 24 | version = "1.0.0" 25 | authors = ["Apache Software Foundation", "jmjoy ", "Yanlong He "] 26 | edition = "2024" 27 | rust-version = "1.85" 28 | repository = "https://github.com/apache/skywalking-php" 29 | license = "Apache-2.0" 30 | 31 | [workspace.dependencies] 32 | bincode = { version = "2.0.1", features = ["serde"] } 33 | 34 | [package] 35 | name = "skywalking-php" 36 | version = { workspace = true } 37 | authors = { workspace = true } 38 | description = "Apache SkyWalking PHP Agent." 39 | edition = { workspace = true } 40 | rust-version = { workspace = true } 41 | repository = { workspace = true } 42 | license = { workspace = true } 43 | readme = "README.md" 44 | publish = false 45 | 46 | [lib] 47 | name = "skywalking_agent" 48 | crate-type = ["lib", "cdylib"] 49 | 50 | [features] 51 | kafka-reporter = ["skywalking-php-worker/kafka-reporter"] 52 | 53 | [dependencies] 54 | anyhow = { version = "1.0.97", features = ["backtrace"] } 55 | bincode = { workspace = true } 56 | dashmap = "6.1.0" 57 | futures-util = "0.3.31" 58 | hostname = "0.4.1" 59 | libc = "0.2.171" 60 | once_cell = "1.21.3" 61 | phper = "0.16.0" 62 | prost = "0.13.5" 63 | rdkafka = { version = "0.37.0", optional = true } 64 | skywalking = { version = "0.9.0", features = ["management"] } 65 | skywalking-php-worker = { path = "worker" } 66 | systemstat = "0.2.4" 67 | thiserror = "2.0.12" 68 | time = { version = "0.3", features = ["formatting"] } 69 | tokio = { version = "1.44.2", features = ["full"] } 70 | tokio-stream = "0.1.17" 71 | tonic = { version = "0.12.0", features = ["tls-native-roots"] } 72 | tracing = { version = "0.1.41", features = ["attributes"] } 73 | tracing-subscriber = { version = "0.3.19", features = ["env-filter", "time", "local-time"] } 74 | url = "2.5.4" 75 | 76 | [dev-dependencies] 77 | axum = "0.8.3" 78 | fastcgi-client = "0.9.0" 79 | reqwest = { version = "0.12.15", features = ["trust-dns", "json", "stream"] } 80 | 81 | [build-dependencies] 82 | phper-build = "0.15.1" 83 | 84 | [lints.rust] 85 | unexpected_cfgs = { level = "warn", check-cfg = ['cfg(phper_major_version, values("8"))'] } 86 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Apache SkyWalking 2 | Copyright 2017-2024 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Apache SkyWalking PHP Agent 2 | 3 | Sky Walking logo 4 | 5 | **SkyWalking PHP** The PHP Agent for Apache SkyWalking, which provides the native tracing abilities for PHP project. 6 | 7 | **SkyWalking** an APM(application performance monitor) system, especially designed for 8 | microservices, cloud native and container-based (Docker, Kubernetes, Mesos) architectures. 9 | 10 | [![GitHub stars](https://img.shields.io/github/stars/apache/skywalking-php.svg?style=for-the-badge&label=Stars&logo=github)](https://github.com/apache/skywalking-php) 11 | [![Twitter Follow](https://img.shields.io/twitter/follow/asfskywalking.svg?style=for-the-badge&label=Follow&logo=twitter)](https://twitter.com/AsfSkyWalking) 12 | 13 | ## Documentation 14 | 15 | * [Official documentation](https://skywalking.apache.org/docs/#PHPAgent) 16 | 17 | ## How to create issue? 18 | 19 | Submit an [GitHub Issue](https://github.com/apache/skywalking/issues/new/choose) in the Apache Skywalking repository, by using [PHP] as title prefix. 20 | 21 | ## Installation Requirements 22 | 23 | SkyWalking PHP Agent requires SkyWalking 8.4+ and PHP 7.2+ 24 | 25 | ## Support List 26 | 27 | * PHP-FPM Ecosystem 28 | * [x] [cURL](https://www.php.net/manual/en/book.curl.php#book.curl) 29 | * [x] [PDO](https://www.php.net/manual/en/book.pdo.php) 30 | * [x] [MySQL Improved](https://www.php.net/manual/en/book.mysqli.php) 31 | * [x] [Memcached](https://www.php.net/manual/en/book.memcached.php) 32 | * [x] [phpredis](https://github.com/phpredis/phpredis) 33 | * [ ] [php-amqp](https://github.com/php-amqp/php-amqp) 34 | * [ ] [php-rdkafka](https://github.com/arnaud-lb/php-rdkafka) 35 | * [x] [predis](https://github.com/predis/predis) 36 | * [x] [php-amqplib](https://github.com/php-amqplib/php-amqplib) for Message Queuing Producer 37 | * [x] [MongoDB](https://www.php.net/manual/en/set.mongodb.php) 38 | * [x] [Memcache](https://www.php.net/manual/en/book.memcache.php) 39 | 40 | * Swoole Ecosystem 41 | 42 | *The components of the PHP-FPM ecosystem can also be used in Swoole regardless of the flag `SWOOLE_HOOK_ALL`.* 43 | 44 | ## Contact Us 45 | 46 | * Mail list: **dev@skywalking.apache.org**. Mail to `dev-subscribe@skywalking.apache.org`, follow the reply to subscribe the mail list. 47 | * Join `skywalking` channel at [Apache Slack](http://s.apache.org/slack-invite). If the link is not working, find the latest one at [Apache INFRA WIKI](https://cwiki.apache.org/confluence/display/INFRA/Slack+Guest+Invites). 48 | * Twitter, [ASFSkyWalking](https://twitter.com/AsfSkyWalking) 49 | 50 | ## Stargazers over time 51 | 52 | [![Stargazers over time](https://starchart.cc/apache/skywalking-php.svg)](https://starchart.cc/apache/skywalking-php) 53 | 54 | ## License 55 | 56 | [Apache 2.0](LICENSE) 57 | -------------------------------------------------------------------------------- /build.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | fn main() { 17 | phper_build::register_all(); 18 | } 19 | -------------------------------------------------------------------------------- /config.m4: -------------------------------------------------------------------------------- 1 | dnl Licensed to the Apache Software Foundation (ASF) under one or more 2 | dnl contributor license agreements. See the NOTICE file distributed with 3 | dnl this work for additional information regarding copyright ownership. 4 | dnl The ASF licenses this file to You under the Apache License, Version 2.0 5 | dnl (the "License"); you may not use this file except in compliance with 6 | dnl the License. You may obtain a copy of the License at 7 | dnl 8 | dnl http://www.apache.org/licenses/LICENSE-2.0 9 | dnl 10 | dnl Unless required by applicable law or agreed to in writing, software 11 | dnl distributed under the License is distributed on an "AS IS" BASIS, 12 | dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | dnl See the License for the specific language governing permissions and 14 | dnl limitations under the License. 15 | 16 | PHP_ARG_ENABLE([skywalking_agent], 17 | [whether to enable skywalking_agent support], 18 | [AS_HELP_STRING([--enable-skywalking_agent], 19 | [Enable skywalking_agent support])], 20 | [no]) 21 | 22 | PHP_ARG_ENABLE([cargo_debug], [whether to enable cargo debug mode], 23 | [ --enable-cargo-debug Enable cargo debug], no, no) 24 | 25 | PHP_ARG_ENABLE([kafka_reporter], [whether to enable kafka reporter], 26 | [ --enable-kafka-reporter Enable kafka reporter], no, no) 27 | 28 | if test "$PHP_THREAD_SAFETY" == "yes"; then 29 | AC_MSG_ERROR([skywalking_agent does not support ZTS]) 30 | fi 31 | 32 | if test "$PHP_SKYWALKING_AGENT" != "no"; then 33 | AC_PATH_PROG(CARGO, cargo, no) 34 | if ! test -x "$CARGO"; then 35 | AC_MSG_ERROR([cargo command missing, please reinstall the cargo distribution]) 36 | fi 37 | 38 | AC_PATH_PROG(PROTOC, protoc, no) 39 | if ! test -x "$PROTOC"; then 40 | AC_MSG_ERROR([protoc command missing, please reinstall the protoc distribution]) 41 | fi 42 | 43 | AC_DEFINE(HAVE_SKYWALKING_AGENT, 1, [ Have skywalking_agent support ]) 44 | 45 | PHP_NEW_EXTENSION(skywalking_agent, [ ], $ext_shared) 46 | 47 | CARGO_MODE_FLAGS="--release" 48 | CARGO_MODE_DIR="release" 49 | CARGO_FEATURES_FLAGS="" 50 | 51 | if test "$PHP_CARGO_DEBUG" != "no"; then 52 | CARGO_MODE_FLAGS="" 53 | CARGO_MODE_DIR="debug" 54 | fi 55 | 56 | if test "$PHP_KAFKA_REPORTER" != "no"; then 57 | CARGO_FEATURES_FLAGS="--features kafka-reporter" 58 | fi 59 | 60 | cat >>Makefile.objects<< EOF 61 | all: cargo_build 62 | 63 | clean: cargo_clean 64 | 65 | cargo_build: 66 | PHP_CONFIG=$PHP_PHP_CONFIG cargo build $CARGO_MODE_FLAGS $CARGO_FEATURES_FLAGS 67 | if [[ -f ./target/$CARGO_MODE_DIR/libskywalking_agent.dylib ]] ; then \\ 68 | cp ./target/$CARGO_MODE_DIR/libskywalking_agent.dylib ./modules/skywalking_agent.so ; fi 69 | if [[ -f ./target/$CARGO_MODE_DIR/libskywalking_agent.so ]] ; then \\ 70 | cp ./target/$CARGO_MODE_DIR/libskywalking_agent.so ./modules/skywalking_agent.so ; fi 71 | 72 | cargo_clean: 73 | cargo clean 74 | 75 | .PHONY: cargo_build cargo_clean 76 | EOF 77 | 78 | AC_CONFIG_LINKS([ \ 79 | .rustfmt.toml:.rustfmt.toml \ 80 | Cargo.lock:Cargo.lock \ 81 | Cargo.toml:Cargo.toml \ 82 | build.rs:build.rs \ 83 | docker-compose.yml:docker-compose.yml \ 84 | rust-toolchain.toml:rust-toolchain.toml \ 85 | scripts:scripts \ 86 | src:src \ 87 | tests:tests \ 88 | worker:worker \ 89 | ]) 90 | fi 91 | -------------------------------------------------------------------------------- /dist-material/LICENSE.tpl: -------------------------------------------------------------------------------- 1 | {{ .LicenseContent }} 2 | 3 | ======================================================================= 4 | Apache SkyWalking Subcomponents: 5 | 6 | The Apache SkyWalking project contains subcomponents with separate copyright 7 | notices and license terms. Your use of the source code for the these 8 | subcomponents is subject to the terms and conditions of the following 9 | licenses. 10 | ======================================================================== 11 | 12 | {{ range .Groups }} 13 | ======================================================================== 14 | {{ .LicenseID }} licenses 15 | ======================================================================== 16 | The following components are provided under the {{ .LicenseID }} License. See project link for details. 17 | {{- if contains .LicenseID "Apache-2.0" }} 18 | The text of each license is the standard Apache 2.0 license. 19 | {{- else }} 20 | The text of each license is also included in licenses/LICENSE-[project].txt. 21 | {{ end }} 22 | 23 | {{- range .Deps }}{{ if and (ne .Name "skywalking-php") (ne .Name "skywalking-php-worker") }} 24 | https://crates.io/crates/{{ .Name }}/{{ .Version }} {{ .Version }} {{ .LicenseID }}{{ end }}{{- end }} 25 | {{ end }} 26 | -------------------------------------------------------------------------------- /dist-material/NOTICE: -------------------------------------------------------------------------------- 1 | Apache SkyWalking 2 | Copyright 2017-2023 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | 7 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-aho-corasick.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Andrew Gallant 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-async-stream-impl.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Carl Lerche 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | 27 | Copyright (c) 2018 David Tolnay 28 | 29 | Permission is hereby granted, free of charge, to any 30 | person obtaining a copy of this software and associated 31 | documentation files (the "Software"), to deal in the 32 | Software without restriction, including without 33 | limitation the rights to use, copy, modify, merge, 34 | publish, distribute, sublicense, and/or sell copies of 35 | the Software, and to permit persons to whom the Software 36 | is furnished to do so, subject to the following 37 | conditions: 38 | 39 | The above copyright notice and this permission notice 40 | shall be included in all copies or substantial portions 41 | of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 44 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 45 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 46 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 47 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 48 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 49 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 50 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 51 | DEALINGS IN THE SOFTWARE. 52 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-async-stream.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Carl Lerche 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | 27 | Copyright (c) 2018 David Tolnay 28 | 29 | Permission is hereby granted, free of charge, to any 30 | person obtaining a copy of this software and associated 31 | documentation files (the "Software"), to deal in the 32 | Software without restriction, including without 33 | limitation the rights to use, copy, modify, merge, 34 | publish, distribute, sublicense, and/or sell copies of 35 | the Software, and to permit persons to whom the Software 36 | is furnished to do so, subject to the following 37 | conditions: 38 | 39 | The above copyright notice and this permission notice 40 | shall be included in all copies or substantial portions 41 | of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 44 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 45 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 46 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 47 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 48 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 49 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 50 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 51 | DEALINGS IN THE SOFTWARE. 52 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-axum-core.txt: -------------------------------------------------------------------------------- 1 | Copyright 2021 Axum Contributors 2 | 3 | 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: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | 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. 8 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-axum.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Axum Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-bincode.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Ty Overby 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-bindgen.txt: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2013, Jyun-Yan You 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-bytes.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 Carl Lerche 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-convert_case.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 David Purdum 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-dashmap.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Acrimon 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-data-encoding.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-2020 Julien Cretin 4 | Copyright (c) 2017-2020 Google Inc. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-derive_more.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Jelte Fennema 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-errno-dragonfly.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Michael Neumann 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-h2.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 h2 authors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-hostname.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 fengcen 4 | Copyright (c) 2019 svartalf 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-http-body.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Hyper Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-hyper.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2021 Sean McArthur 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-instant.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019, Sébastien Crozet 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the author nor the names of its contributors may be used 15 | to endorse or promote products derived from this software without specific 16 | prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-libloading.txt: -------------------------------------------------------------------------------- 1 | Copyright © 2015, Simonas Kazlauskas 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without 4 | fee is hereby granted, provided that the above copyright notice and this permission notice appear 5 | in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 8 | SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 9 | AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 10 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 11 | NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 12 | THIS SOFTWARE. 13 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-matchers.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Eliza Weisman 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-matches.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2016 Simon Sapin 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-matchit.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Ibraheem Ahmed 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-memchr.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Andrew Gallant 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-mio.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Carl Lerche and other MIO contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-nom.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2019 Geoffroy Couprie 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-nu-ansi-term.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Benjamin Sago 4 | Copyright (c) 2021-2022 The Nushell Project Developers 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-openssl-sys.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Alex Crichton 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-overload.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Daniel Augusto Rizzi Salvadori 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-redox_syscall.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Redox OS Developers 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-regex-automata.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 The Rust Project Developers 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-rustls-native-certs.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Joseph Birr-Pixton 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-schannel.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 steffengy 2 | 3 | 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: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | 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. 8 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-sharded-slab.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Eliza Weisman 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-slab.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Carl Lerche 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-spin.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Mathijs van de Nes 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-systemstat.txt: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-termcolor.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Andrew Gallant 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-tokio-macros.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022 Tokio Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | 27 | The MIT License (MIT) 28 | 29 | Copyright (c) 2019 Yoshua Wuyts 30 | 31 | Permission is hereby granted, free of charge, to any person obtaining a copy 32 | of this software and associated documentation files (the "Software"), to deal 33 | in the Software without restriction, including without limitation the rights 34 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 35 | copies of the Software, and to permit persons to whom the Software is 36 | furnished to do so, subject to the following conditions: 37 | 38 | The above copyright notice and this permission notice shall be included in all 39 | copies or substantial portions of the Software. 40 | 41 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 42 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 43 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 44 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 45 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 46 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 47 | SOFTWARE. 48 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-tokio-native-tls.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Tokio Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-tokio-stream.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2023 Tokio Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-tokio-util.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022 Tokio Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-tokio.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2023 Tokio Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-tonic-build.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 Lucio Franco 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-tonic.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 Lucio Franco 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-tower-layer.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Tower Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-tower-service.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Tower Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-tower.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Tower Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-tracing-attributes.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Tokio Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-tracing-core.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Tokio Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-tracing-futures.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Tokio Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-tracing-log.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Tokio Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-tracing-subscriber.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Tokio Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-tracing.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Tokio Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-try-lock.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 Sean McArthur 2 | Copyright (c) 2016 Alex Crichton 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-untrusted.txt: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2016 Brian Smith. 2 | // 3 | // Permission to use, copy, modify, and/or distribute this software for any 4 | // purpose with or without fee is hereby granted, provided that the above 5 | // copyright notice and this permission notice appear in all copies. 6 | // 7 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES 8 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR 10 | // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-valuable.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021 Valuable Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-want.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018-2019 Sean McArthur 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-webpki.txt: -------------------------------------------------------------------------------- 1 | Except as otherwise noted, this project is licensed under the following 2 | (ISC-style) terms: 3 | 4 | Copyright 2015 Brian Smith. 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR 13 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | 18 | The files under third-party/chromium are licensed as described in 19 | third-party/chromium/LICENSE. 20 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-which.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 fangyuanziti 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-winapi-util.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Andrew Gallant 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /dist-material/licenses/LICENSE-winreg.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Igor Shaula 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | services: 17 | collector: 18 | image: ghcr.io/apache/skywalking-agent-test-tool/mock-collector:f4f5ef22b1df623464772816bb6b42ba611444ff 19 | ports: 20 | - "19876:19876" 21 | - "12800:12800" 22 | healthcheck: 23 | test: [ "CMD", "curl", "http://127.0.0.1:12800/healthCheck" ] 24 | interval: 10s 25 | timeout: 5s 26 | retries: 10 27 | 28 | mysql: 29 | image: mysql:5.7.42-debian 30 | ports: 31 | - "3306:3306" 32 | environment: 33 | - MYSQL_ROOT_PASSWORD=password 34 | - MYSQL_DATABASE=skywalking 35 | healthcheck: 36 | test: [ "CMD", "mysqlcheck", "-h127.0.0.1", "-P3306", "-uroot", "-ppassword", "--all-databases" ] 37 | interval: 10s 38 | timeout: 5s 39 | retries: 10 40 | 41 | redis: 42 | image: bitnami/redis:7.0.4 43 | ports: 44 | - "6379:6379" 45 | environment: 46 | - REDIS_PASSWORD=password 47 | 48 | memcached: 49 | image: memcached:1.6.17 50 | ports: 51 | - "11211:11211" 52 | 53 | rabbitmq: 54 | image: rabbitmq:3.12.8 55 | ports: 56 | - "5672:5672" 57 | environment: 58 | - RABBITMQ_DEFAULT_USER=guest 59 | - RABBITMQ_DEFAULT_PASS=guest 60 | healthcheck: 61 | test: [ "CMD", "rabbitmq-diagnostics", "check_running" ] 62 | interval: 10s 63 | timeout: 5s 64 | retries: 10 65 | 66 | mongo: 67 | image: mongo:4.4.10 68 | ports: 69 | - "27017:27017" 70 | environment: 71 | MONGO_INITDB_ROOT_USERNAME: root 72 | MONGO_INITDB_ROOT_PASSWORD: example 73 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | FROM php:8.1-fpm-bullseye as builder 17 | 18 | ARG SKYWALKING_AGENT 19 | 20 | ENV RUSTUP_HOME=/usr/local/rustup \ 21 | CARGO_HOME=/usr/local/cargo \ 22 | PATH=/usr/local/cargo/bin:$PATH \ 23 | RUST_VERSION=1.85.0 24 | 25 | 26 | RUN apt update \ 27 | && apt install -y wget protobuf-compiler libclang-dev \ 28 | && wget https://static.rust-lang.org/rustup/archive/1.25.1/x86_64-unknown-linux-gnu/rustup-init \ 29 | && chmod +x rustup-init \ 30 | && ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host x86_64-unknown-linux-gnu \ 31 | && rm rustup-init \ 32 | && chmod -R a+w $RUSTUP_HOME $CARGO_HOME \ 33 | && pecl install skywalking_agent-$SKYWALKING_AGENT \ 34 | && docker-php-ext-enable skywalking_agent \ 35 | && apt-get remove -y --auto-remove wget protobuf-compiler \ 36 | && rm -rf /var/lib/apt/lists/* 37 | 38 | FROM php:8.1-fpm-bullseye 39 | LABEL org.opencontainers.image.source=https://github.com/apache/skywalking-php 40 | LABEL org.opencontainers.image.description="The PHP Agent for Apache SkyWalking, which provides the native tracing abilities for PHP project." 41 | LABEL org.opencontainers.image.licenses="Apache 2.0" 42 | COPY --from=builder /usr/local/etc/php/conf.d/docker-php-ext-skywalking_agent.ini /usr/local/etc/php/conf.d/ 43 | COPY --from=builder /usr/local/lib/php/extensions/no-debug-non-zts-20210902/skywalking_agent.so /usr/local/lib/php/extensions/no-debug-non-zts-20210902/ 44 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # SkyWalking PHP Agent 2 | 3 | **This is the official documentation of SkyWalking PHP Agent. Welcome to the SkyWalking community!** 4 | 5 | In here, you could learn how to set up PHP agent for the PHP services. 6 | -------------------------------------------------------------------------------- /docs/en/configuration/context-injection.md: -------------------------------------------------------------------------------- 1 | # Context Injection 2 | 3 | If you want to fetch the SkyWalking Context in your PHP code, which is super helpful for debugging and observability, 4 | You can enable the configuration item `skywalking_agent.inject_context`. 5 | 6 | ## Description 7 | 8 | `skywalking_agent.inject_context` 9 | 10 | Whether to enable automatic injection of skywalking context variables (such as `SW_TRACE_ID`). For `php-fpm` mode, it will be injected into the `$_SERVER` variable. For `swoole` mode, it will be injected into the `$request->server` variable. 11 | 12 | ## Configuration 13 | 14 | ```ini 15 | [skywalking_agent] 16 | extension = skywalking_agent.so 17 | skywalking_agent.inject_context = On 18 | ``` 19 | 20 | ## Usage 21 | 22 | For `php-fpm` mode: 23 | 24 | ```php 25 | on('request', function ($request, $response) { 40 | echo $request->server["SW_SERVICE_NAME"]; // get service name 41 | echo $request->server["SW_INSTANCE_NAME"]; // get instance name 42 | echo $request->server["SW_TRACE_ID"]; // get trace id 43 | }); 44 | ``` 45 | -------------------------------------------------------------------------------- /docs/en/configuration/report-log.md: -------------------------------------------------------------------------------- 1 | # Report Log 2 | 3 | ## Overview 4 | 5 | In `skywalking-php`, the log level configuration is managed using the `skywalking_agent.psr_logging_level` directive in your `php.ini` file. This configuration defines the minimum log level that will be reported to SkyWalking. The log levels are based on PSR-3 standards and allow you to control the verbosity of the logs sent to SkyWalking. 6 | 7 | ## Configuration 8 | 9 | You can set the `skywalking_agent.psr_logging_level` in your `php.ini` file: 10 | 11 | ```ini 12 | skywalking_agent.psr_logging_level = Info 13 | ``` 14 | 15 | The possible values for this configuration are: 16 | 17 | - `Off`: No logs will be reported to SkyWalking. 18 | - `Debug`: Logs with the level "Debug" or higher will be reported. 19 | - `Info`: Logs with the level "Info" or higher will be reported. 20 | - `Notice`: Logs with the level "Notice" or higher will be reported. 21 | - `Warning`: Logs with the level "Warning" or higher will be reported. 22 | - `Error`: Logs with the level "Error" or higher will be reported. 23 | - `Critical`: Logs with the level "Critical" or higher will be reported. 24 | - `Alert`: Logs with the level "Alert" or higher will be reported. 25 | - `Emergency`: Logs with the level "Emergency" or higher will be reported. 26 | 27 | ### Default Value 28 | 29 | The default value for `skywalking_agent.psr_logging_level` is set to `Off`, which means no log will be reported to SkyWalking unless specified otherwise. 30 | 31 | ## How It Works 32 | 33 | The `skywalking_agent.psr_logging_level` setting works by hooking into any PHP `LoggerInterface` implementation that follows the PSR-3 standard. The agent listens for log events and compares the log level with the configured value. 34 | 35 | - If the log level is **greater than or equal to** the specified `skywalking_agent.psr_logging_level`, the log is reported to SkyWalking. 36 | - Logs with a level **lower than** the configured value will be ignored and not sent to SkyWalking. 37 | 38 | This approach ensures that only relevant logs (those that meet or exceed the configured severity level) are sent to SkyWalking, minimizing noise and focusing on more critical events. 39 | 40 | ## Example Usage 41 | 42 | To report logs of level `Warning` and higher to SkyWalking, you would set the configuration as follows: 43 | 44 | ```ini 45 | skywalking_agent.psr_logging_level = Warning 46 | ``` 47 | 48 | With this setting, logs at the levels `Warning`, `Error`, `Critical`, `Alert`, and `Emergency` will be sent to SkyWalking, while logs at the `Debug`, `Info`, and `Notice` levels will be ignored. 49 | 50 | ## Conclusion 51 | 52 | The `skywalking_agent.psr_logging_level` configuration gives you fine-grained control over the logging behavior of your SkyWalking PHP agent. Adjusting the log level allows you to ensure that only the most important logs are captured, optimizing your monitoring and debugging workflows. 53 | -------------------------------------------------------------------------------- /docs/en/configuration/zend-observer.md: -------------------------------------------------------------------------------- 1 | # Zend observer 2 | 3 | > Refer to: 4 | 5 | By default, skywalking-php hooks the `zend_execute_internal` and `zend_execute_ex` functions to implement auto instrumentation. 6 | 7 | But there are some drawbacks: 8 | 9 | - All PHP function calls are placed on the native C stack, which is limited by the value set in `ulimit -s`. 10 | - Not compatible with the new JIT added in PHP 8. 11 | 12 | ## The observer API in PHP 8+ 13 | 14 | Now, zend observer api is a new generation method, and it is also a method currently recommended by PHP8. 15 | 16 | This method has no stack problem and will not affect JIT. 17 | 18 | ## Configuration 19 | 20 | The following configuration example enables JIT in PHP8 and zend observer support in skywalking-php at the same time. 21 | 22 | ```ini 23 | [opcache] 24 | zend_extension = opcache 25 | ; Enable JIT 26 | opcache.jit = tracing 27 | 28 | [skywalking_agent] 29 | extension = skywalking_agent.so 30 | ; Switch to use zend observer api to implement auto instrumentation. 31 | skywalking_agent.enable_zend_observer = On 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/en/contribution/compiling.md: -------------------------------------------------------------------------------- 1 | # Compiling project 2 | 3 | This document will help you compile and build the package file. 4 | 5 | Prepare PHP and Rust environments. 6 | 7 | ## Install PHP Environment 8 | 9 | For Debian user: 10 | 11 | ```shell 12 | sudo apt install php-cli php-dev 13 | ``` 14 | 15 | For MacOS user: 16 | 17 | ```shell 18 | brew install php 19 | ``` 20 | 21 | ## Install Rust Environment 22 | 23 | Install Rust 1.85.0+. 24 | 25 | For Linux user: 26 | 27 | ```shell 28 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh 29 | ``` 30 | 31 | For MacOS user: 32 | 33 | ```shell 34 | brew install rust 35 | ``` 36 | 37 | ## Install requirement 38 | 39 | For Debian user: 40 | 41 | ```shell 42 | sudo apt install gcc make llvm-dev libclang-dev clang protobuf-compiler 43 | ``` 44 | 45 | For MacOS user: 46 | 47 | ```shell 48 | brew install protobuf 49 | ``` 50 | 51 | ## Build and install Skywalking PHP Agent from archive file 52 | 53 | For Linux user: 54 | 55 | ```shell 56 | sudo pecl install skywalking_agent-x.y.z.tgz 57 | ``` 58 | 59 | For MacOS user: 60 | 61 | > Running the `pecl install` command with the php installed in brew may encounter the problem of `mkdir`, please refer to 62 | > [Installing PHP and PECL Extensions on MacOS](https://patriqueouimet.ca/tip/installing-php-and-pecl-extensions-on-macos). 63 | 64 | ```shell 65 | pecl install skywalking_agent-x.y.z.tgz 66 | ``` 67 | 68 | The extension file `skywalking_agent.so` is generated in the php extension folder, get it by run `php-config --extension-dir`. 69 | -------------------------------------------------------------------------------- /docs/en/reporter/kafka-reporter.md: -------------------------------------------------------------------------------- 1 | # Kafka reporter 2 | 3 | By default, the configuration option `skywalking_agent.reporter_type` is `grpc`, means that the skywalking agent will report the traces, metrics, logs etc. to SkyWalking OAP Server by gPRC protocol. 4 | 5 | At the same time, SkyWalking also supports kafka-fetcher, so you can report traces, metrics, logs, etc. by kafka. 6 | 7 | But the skywalking agent does not compile the `kafka-reporter` feature by default, you need to enable the it. 8 | 9 | ## Steps 10 | 11 | 1. Compile the skywalking agent with feature `kafka-reporter`. 12 | 13 | For pecl: 14 | 15 | ```shell 16 | pecl install skywalking_agent 17 | ``` 18 | 19 | Enable the kafka reporter interactively: 20 | 21 | ```txt 22 | 68 source files, building 23 | running: phpize 24 | Configuring for: 25 | PHP Api Version: 20220829 26 | Zend Module Api No: 20220829 27 | Zend Extension Api No: 420220829 28 | enable cargo debug? [no] : 29 | enable kafka reporter? [no] : yes 30 | ``` 31 | 32 | Or, build from sources: 33 | 34 | ```shell 35 | phpize 36 | ./configure --enable-kafka-reporter 37 | make 38 | make install 39 | ``` 40 | 41 | 2. Config `php.ini`. 42 | 43 | Switch to use kafka reporter. 44 | 45 | ```ini 46 | [skywalking_agent] 47 | extension = skywalking_agent.so 48 | skywalking_agent.reporter_type = kafka 49 | skywalking_agent.kafka_bootstrap_servers = 127.0.0.1:9092,127.0.0.2:9092,127.0.0.3:9092 50 | ``` 51 | 52 | If you want to custom the kafka reporter properties, you can specify it by JSON format: 53 | 54 | ```ini 55 | skywalking_agent.kafka_producer_config = {"delivery.timeout.ms": "12000"} 56 | ``` 57 | -------------------------------------------------------------------------------- /docs/en/reporter/standalone-reporter.md: -------------------------------------------------------------------------------- 1 | # Standalone reporter 2 | 3 | When the reporter type is `grpc` or `kafka`, the `skywalking_agent` extension forks a child process during 4 | the extension initialization phase to act as a worker process for sending data to the SkyWalking OAP server 5 | or Kafka. 6 | 7 | However, this approach has some limitations, such as: 8 | 9 | 1. It cannot be used with the `php-fpm` daemon mode. 10 | 2. Multiple worker processes can be redundant when there are several `php-fpm` processes on the instance. 11 | 12 | To address these issues, `skywalking_agent` introduces a new reporter type: `standalone`. 13 | 14 | With the `standalone` reporter type, the `skywalking_agent` extension no longer forks a child process. 15 | Instead, the user needs to manually start an independent worker process. 16 | 17 | ## Steps 18 | 19 | 1. Compile the standalone `skywalking-php-worker` binary: 20 | 21 | ```shell 22 | cargo build -p skywalking-php-worker --bin skywalking-php-worker --all-features --release 23 | ``` 24 | 25 | 2. Run `skywalking-php-worker`: 26 | 27 | Assuming the socket file path is `/tmp/skywalking-php-worker.sock` and the SkyWalking OAP server address is `127.0.0.1:11800`, the command is: 28 | 29 | ```shell 30 | ./target/release/skywalking-php-worker -s /tmp/skywalking-php-worker.sock grpc --server-addr 127.0.0.1:11800 31 | ``` 32 | 33 | For additional parameters, refer to `./target/release/skywalking-php-worker --help`. 34 | 35 | 3. Configure `php.ini`: 36 | 37 | ```ini 38 | [skywalking_agent] 39 | extension = skywalking_agent.so 40 | skywalking_agent.reporter_type = standalone 41 | skywalking_agent.standalone_socket_path = /tmp/skywalking-php-worker.sock 42 | ``` 43 | -------------------------------------------------------------------------------- /docs/en/setup/service-agent/php-agent/README.md: -------------------------------------------------------------------------------- 1 | # Setup PHP Agent 2 | 3 | 1. Agent is available for PHP 7.2 - 8.x. 4 | 2. Build from source. 5 | 3. Configure `php.ini`. 6 | 7 | ## Requirements 8 | 9 | - GCC / Clang 10 | - Rustc 1.85+ 11 | - Cargo 12 | - Libclang 9.0+ 13 | - Make 14 | - Protoc 15 | 16 | ## Install dependencies 17 | 18 | ### For Debian-base OS 19 | 20 | ```shell 21 | sudo apt install gcc make llvm-13-dev libclang-13-dev protobuf-c-compiler protobuf-compiler 22 | ``` 23 | 24 | ### For Alpine Linux 25 | 26 | ```shell 27 | apk add gcc make musl-dev llvm15-dev clang15-dev protobuf-c-compiler 28 | ``` 29 | 30 | ## Install Rust globally 31 | 32 | The officially recommended way to install Rust is via [`rustup`](https://www.rust-lang.org/tools/install). 33 | 34 | > **Notice:** Because the source code toolchain is override by `rust-toolchain.toml`, 35 | > so if you don't need multi version Rust, we recommend to install Rust by these 36 | > way: 37 | > 38 | > 1. Install through OS package manager (The Rust version in the source must be >= 1.85). 39 | > 40 | > 2. Through `rustup` but set `default-toolchain` to none. 41 | > 42 | > ```shell 43 | > curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none 44 | > ``` 45 | 46 | ## Install 47 | 48 | > **Notice:** If you compile `skywalking_agent` in Alpine Linux, you have to disable `crt-static`, 49 | > otherwise the problem will be throw: "the libclang shared library at 50 | > /usr/lib/libclang.so.15.0.7 could not be opened: Dynamic loading not supported". 51 | > 52 | > You can disable `crt-static` by environment variable: 53 | > 54 | > ```shell 55 | > export RUSTFLAGS="-C target-feature=-crt-static" 56 | > ``` 57 | 58 | ### Install from pecl.net 59 | 60 | ```shell script 61 | pecl install skywalking_agent 62 | ``` 63 | 64 | ### Install from the source codes 65 | 66 | ```shell script 67 | git clone --recursive https://github.com/apache/skywalking-php.git 68 | cd skywalking-php 69 | 70 | phpize 71 | ./configure 72 | make 73 | make install 74 | ``` 75 | 76 | ## Configure 77 | 78 | For scenarios where php-fpm runs in the foreground (`php-fpm -F`), or where a PHP script starts 79 | a single Swoole server, you can use the `grpc` reporter mode. 80 | 81 | For scenarios where php-fpm runs as a daemon, or where a PHP script forks multiple Swoole servers, 82 | it is recommended to use the `standalone` reporter mode. 83 | 84 | Configure skywalking agent in your `php.ini`. 85 | 86 | ```ini 87 | [skywalking_agent] 88 | extension = skywalking_agent.so 89 | 90 | ; Enable skywalking_agent extension or not. 91 | skywalking_agent.enable = Off 92 | 93 | ; Reporter type, optional values are `grpc`, `kafka` and `standalone`. 94 | skywalking_agent.reporter_type = grpc 95 | 96 | ; Log file path. 97 | skywalking_agent.log_file = /tmp/skywalking-agent.log 98 | 99 | ; Log level: one of `OFF`, `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`. 100 | skywalking_agent.log_level = INFO 101 | 102 | ; Address of skywalking oap server. 103 | skywalking_agent.server_addr = 127.0.0.1:11800 104 | 105 | ; Application service name. 106 | skywalking_agent.service_name = hello-skywalking 107 | ``` 108 | 109 | Refer to the Configuration section for more configuration items. 110 | 111 | > **Notice:** It is not recommended to enable `skywalking_agent.enable` by default globally, 112 | > because skywalking agent will modify the hook function and fork a new process to be a worker. 113 | > Enabling it by default will cause extra meaningless consumption when skywalking agent is not 114 | > needed (such as simply executing a php script). 115 | 116 | ## Run 117 | 118 | Start `php-fpm` server: 119 | 120 | ```shell 121 | php-fpm -F -d "skywalking_agent.enable=On" 122 | ``` 123 | 124 | > **Notice:** It is necessary to keep the `php-fpm` process running in the foreground 125 | > (by specifying the `-F` parameter, etc.), or switch to using the `standalone` reporter mode. 126 | > Running `php-fpm` as a daemon in `grpc` reporter mode will cause the `skywalking-agent` reporter 127 | > process immediately exit. 128 | -------------------------------------------------------------------------------- /docs/en/setup/service-agent/php-agent/Supported-list.md: -------------------------------------------------------------------------------- 1 | # Supported SAPI, extension and library 2 | 3 | The following plugins provide the distributed tracing capability. 4 | 5 | ## Supported SAPI 6 | 7 | * PHP-FPM 8 | * CLI under [Swoole](https://www.swoole.com/) 9 | 10 | ## Supported PHP extension 11 | 12 | * [cURL](https://www.php.net/manual/en/book.curl.php#book.curl) 13 | * [PDO](https://www.php.net/manual/en/book.pdo.php) 14 | * [MySQL Improved](https://www.php.net/manual/en/book.mysqli.php) 15 | * [Memcached](https://www.php.net/manual/en/book.memcached.php) 16 | * [phpredis](https://github.com/phpredis/phpredis) 17 | * [MongoDB](https://www.php.net/manual/en/set.mongodb.php) 18 | * [Memcache](https://www.php.net/manual/en/book.memcache.php) 19 | 20 | ## Supported PHP library 21 | 22 | * [predis](https://github.com/predis/predis) 23 | * [php-amqplib](https://github.com/php-amqplib/php-amqplib) for Message Queuing Producer 24 | -------------------------------------------------------------------------------- /docs/menu.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | catalog: 17 | - name: "Get Started" 18 | catalog: 19 | - name: "PHP Agent Setup" 20 | path: "/en/setup/service-agent/php-agent/readme" 21 | - name: "Plugins" 22 | catalog: 23 | - name: "Supported SAPI, extension and library" 24 | path: "/en/setup/service-agent/php-agent/Supported-list" 25 | - name: "Configuration" 26 | catalog: 27 | - name: "INI Settings" 28 | path: "/en/configuration/ini-settings" 29 | - name: "Zend Observer" 30 | path: "/en/configuration/zend-observer" 31 | - name: "Context Injection" 32 | path: "/en/configuration/context-injection" 33 | - name: "Report Log" 34 | path: "/en/configuration/report-log" 35 | - name: "Reporter" 36 | catalog: 37 | - name: "Kafka Reporter" 38 | path: "/en/reporter/kafka-reporter" 39 | - name: "Standalone Reporter" 40 | path: "/en/reporter/standalone-reporter" 41 | - name: "Contribution" 42 | catalog: 43 | - name: "Compiling Guidance" 44 | path: "/en/contribution/compiling/" 45 | - name: "PHP Agent Release Guidance" 46 | path: "/en/contribution/release-agent/" 47 | -------------------------------------------------------------------------------- /package.tpl.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 20 | skywalking_agent 21 | pecl.php.net 22 | Apache SkyWalking PHP Agent. 23 | The PHP Agent for Apache SkyWalking, which provides the native tracing abilities for PHP project. 24 | 25 | Apache SkyWalking 26 | skywalking 27 | dev@skywalking.apache.org 28 | yes 29 | 30 | 31 | 32 | jmjoy 33 | jmjoy 34 | jmjoy@apache.org 35 | yes 36 | 37 | 38 | Yanlong He 39 | yanlong 40 | yanlong@php.net 41 | yes 42 | 43 | {{ date }} 44 | 45 | {{ version }} 46 | {{ version }} 47 | 48 | 49 | stable 50 | stable 51 | 52 | Apache-2.0 53 | 54 | {{ notes }} 55 | 56 | 57 | 58 | {% for file in files %} 59 | {% endfor %} 60 | 61 | 62 | 63 | 64 | 65 | 7.2.0 66 | 67 | 68 | 1.4.0 69 | 70 | 71 | 72 | skywalking_agent 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | [toolchain] 17 | channel = "1.85" 18 | components = ["clippy", "rustfmt"] 19 | -------------------------------------------------------------------------------- /scripts/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | [package] 17 | name = "scripts" 18 | version = "0.0.0" 19 | authors = { workspace = true } 20 | description = "The Scripts of Apache SkyWalking PHP Agent." 21 | edition = { workspace = true } 22 | rust-version = { workspace = true } 23 | repository = { workspace = true } 24 | license = { workspace = true } 25 | publish = false 26 | 27 | [dependencies] 28 | anyhow = "1.0.97" 29 | chrono = { version = "0.4.40", default-features = false, features = ["std"] } 30 | clap = { version = "4.5.36", features = ["derive"] } 31 | serde = { version = "1.0.219", features = ["derive"] } 32 | tera = "1.20.0" 33 | tracing = "0.1.41" 34 | tracing-subscriber = "0.3.19" 35 | -------------------------------------------------------------------------------- /scripts/src/command/create_package_xml.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use chrono::{DateTime, Local}; 17 | use clap::Parser; 18 | use serde::Serialize; 19 | use std::{fs, path::PathBuf, process::Command, time::SystemTime}; 20 | use tera::{Context, Tera}; 21 | use tracing::info; 22 | 23 | /// Create package.xml from template file. 24 | #[derive(Parser, Debug)] 25 | pub struct CreatePackageXmlCommand { 26 | /// Template file path. 27 | #[clap(long, default_value = "./package.tpl.xml")] 28 | tpl_path: PathBuf, 29 | 30 | /// Target file path. 31 | #[clap(long, default_value = "./package.xml")] 32 | target_path: PathBuf, 33 | 34 | /// Project directory path. 35 | #[clap(long, default_value = ".")] 36 | project_path: PathBuf, 37 | 38 | /// Version of skywalking_agent. 39 | #[clap(long)] 40 | version: String, 41 | 42 | /// Release date, default is current local timezone date. 43 | #[clap(long)] 44 | date: Option, 45 | 46 | /// Release notes. 47 | #[clap(long)] 48 | notes: String, 49 | } 50 | 51 | #[derive(Serialize)] 52 | struct File { 53 | name: String, 54 | role: String, 55 | } 56 | 57 | impl File { 58 | fn new(path: &str) -> Self { 59 | let path = path.trim_matches('"'); 60 | let role = if path.ends_with(".md") 61 | || path.starts_with("docs/") 62 | || path.starts_with("dist-material/") 63 | || ["LICENSE", "NOTICE"].contains(&path) 64 | { 65 | "doc" 66 | } else { 67 | "src" 68 | }; 69 | 70 | Self { 71 | name: path.to_owned(), 72 | role: role.to_owned(), 73 | } 74 | } 75 | } 76 | 77 | impl CreatePackageXmlCommand { 78 | pub fn run(&self) -> anyhow::Result<()> { 79 | info!(tpl_path = ?&self.tpl_path, "read template content"); 80 | let tpl = fs::read_to_string(&self.tpl_path)?; 81 | 82 | let mut context = Context::new(); 83 | context.insert("date", &self.get_date()); 84 | context.insert("version", &self.version); 85 | context.insert("notes", &self.notes); 86 | context.insert("files", &self.get_git_files()?); 87 | 88 | let mut tera = Tera::default(); 89 | let contents = tera.render_str(&tpl, &context)?; 90 | 91 | info!(target_path = ?&self.target_path, "write target content"); 92 | fs::write(&self.target_path, contents)?; 93 | 94 | Ok(()) 95 | } 96 | 97 | fn get_date(&self) -> String { 98 | match &self.date { 99 | Some(date) => date.to_owned(), 100 | None => { 101 | let datetime: DateTime = SystemTime::now().into(); 102 | datetime.format("%Y-%m-%d").to_string() 103 | } 104 | } 105 | } 106 | 107 | fn get_git_files(&self) -> anyhow::Result> { 108 | let output = Command::new("git") 109 | .args(["ls-tree", "-r", "HEAD", "--name-only"]) 110 | .output()?; 111 | let content = String::from_utf8(output.stdout)?; 112 | Ok(content.split_whitespace().map(File::new).collect()) 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /scripts/src/command/mod.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | mod create_package_xml; 17 | 18 | use self::create_package_xml::CreatePackageXmlCommand; 19 | use clap::Subcommand; 20 | 21 | #[derive(Subcommand, Debug)] 22 | pub enum Commands { 23 | CreatePackageXml(CreatePackageXmlCommand), 24 | } 25 | 26 | impl Commands { 27 | pub fn run(&self) -> anyhow::Result<()> { 28 | match self { 29 | Commands::CreatePackageXml(cmd) => cmd.run(), 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /scripts/src/main.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | mod command; 17 | 18 | use crate::command::Commands; 19 | use anyhow::Context; 20 | use clap::Parser; 21 | use tracing::metadata::LevelFilter; 22 | use tracing_subscriber::FmtSubscriber; 23 | 24 | /// Args. 25 | #[derive(Parser, Debug)] 26 | #[clap(author, version, about, long_about = None)] 27 | struct Args { 28 | /// Log level. 29 | #[clap(long, default_value = "INFO")] 30 | log_level: LevelFilter, 31 | 32 | #[clap(subcommand)] 33 | command: Commands, 34 | } 35 | 36 | fn setup_log(args: &Args) -> anyhow::Result<()> { 37 | let subscriber = FmtSubscriber::builder() 38 | .with_max_level(args.log_level) 39 | .finish(); 40 | 41 | tracing::subscriber::set_global_default(subscriber).context("setting default subscriber failed") 42 | } 43 | 44 | fn main() -> anyhow::Result<()> { 45 | let args = Args::parse(); 46 | setup_log(&args)?; 47 | args.command.run()?; 48 | Ok(()) 49 | } 50 | -------------------------------------------------------------------------------- /src/channel.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use anyhow::anyhow; 17 | use once_cell::sync::OnceCell; 18 | use skywalking::reporter::{CollectItem, Report}; 19 | use std::{ 20 | io::Write, 21 | ops::DerefMut, 22 | os::unix::net::UnixStream, 23 | path::{Path, PathBuf}, 24 | sync::Mutex, 25 | }; 26 | use tracing::error; 27 | 28 | fn channel_send(data: CollectItem, mut sender: T) -> anyhow::Result<()> 29 | where 30 | T: DerefMut, 31 | { 32 | let content = bincode::serde::encode_to_vec(&data, bincode::config::standard())?; 33 | 34 | sender.write_all(&content.len().to_le_bytes())?; 35 | sender.write_all(&content)?; 36 | sender.flush()?; 37 | 38 | Ok(()) 39 | } 40 | 41 | pub struct Reporter { 42 | worker_addr: PathBuf, 43 | stream: OnceCell>, 44 | } 45 | 46 | impl Reporter { 47 | pub fn new(worker_addr: impl AsRef) -> Self { 48 | Self { 49 | worker_addr: worker_addr.as_ref().to_path_buf(), 50 | stream: OnceCell::new(), 51 | } 52 | } 53 | 54 | fn try_report(&self, item: CollectItem) -> anyhow::Result<()> { 55 | let stream = self 56 | .stream 57 | .get_or_try_init(|| UnixStream::connect(&self.worker_addr).map(Mutex::new))? 58 | .lock() 59 | .map_err(|_| anyhow!("Get Lock failed"))?; 60 | 61 | channel_send(item, stream) 62 | } 63 | } 64 | 65 | impl Report for Reporter { 66 | fn report(&self, item: CollectItem) { 67 | if let Err(err) = self.try_report(item) { 68 | error!(?err, "channel send failed"); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/component.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License.. 15 | 16 | //! Component ID 17 | //! 18 | //! 19 | 20 | pub const COMPONENT_PHP_ID: i32 = 8001; 21 | pub const COMPONENT_PHP_CURL_ID: i32 = 8002; 22 | pub const COMPONENT_PHP_PDO_ID: i32 = 8003; 23 | pub const COMPONENT_PHP_MYSQLI_ID: i32 = 8004; 24 | pub const COMPONENT_PHP_PREDIS_ID: i32 = 8006; 25 | pub const COMPONENT_PHP_MEMCACHED_ID: i32 = 20; 26 | pub const COMPONENT_PHP_REDIS_ID: i32 = 7; 27 | pub const COMPONENT_AMQP_PRODUCER_ID: i32 = 144; 28 | pub const COMPONENT_MONGODB_ID: i32 = 9; 29 | -------------------------------------------------------------------------------- /src/context.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use anyhow::anyhow; 17 | use dashmap::DashMap; 18 | use once_cell::sync::Lazy; 19 | use skywalking::trace::{ 20 | propagation::encoder::encode_propagation, 21 | span::{HandleSpanObject, Span}, 22 | trace_context::TracingContext, 23 | }; 24 | 25 | pub const SW_HEADER: &str = "sw8"; 26 | 27 | static REQUEST_CONTEXT: Lazy, RequestContext>> = Lazy::new(DashMap::new); 28 | 29 | pub struct RequestContext { 30 | pub tracing_context: TracingContext, 31 | pub entry_span: Span, 32 | } 33 | 34 | impl RequestContext { 35 | pub fn set_global(request_id: Option, ctx: Self) { 36 | REQUEST_CONTEXT.insert(request_id, ctx); 37 | } 38 | 39 | pub fn remove_global(request_id: Option) -> Option { 40 | REQUEST_CONTEXT.remove(&request_id).map(|(_, ctx)| ctx) 41 | } 42 | 43 | pub fn try_with_global( 44 | request_id: Option, f: impl FnOnce(&mut RequestContext) -> anyhow::Result, 45 | ) -> anyhow::Result { 46 | REQUEST_CONTEXT 47 | .get_mut(&request_id) 48 | .map(|mut ctx| f(ctx.value_mut())) 49 | .transpose()? 50 | .ok_or_else(|| anyhow!("global tracing context not exists")) 51 | } 52 | 53 | pub fn try_with_global_ctx( 54 | request_id: Option, f: impl FnOnce(&mut TracingContext) -> anyhow::Result, 55 | ) -> anyhow::Result { 56 | Self::try_with_global(request_id, |ctx| f(&mut ctx.tracing_context)) 57 | } 58 | 59 | pub fn try_get_sw_header(request_id: Option, peer: &str) -> crate::Result { 60 | Ok(Self::try_with_global(request_id, |req_ctx| { 61 | Ok(encode_propagation( 62 | &req_ctx.tracing_context, 63 | &req_ctx.get_primary_span().span_object().operation_name, 64 | peer, 65 | )) 66 | })?) 67 | } 68 | 69 | /// Primary endpoint name is used for endpoint dependency. 70 | #[inline] 71 | fn get_primary_span(&self) -> &Span { 72 | &self.entry_span 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/errors.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use anyhow::anyhow; 17 | use std::{result, str::Utf8Error}; 18 | 19 | pub type Result = result::Result; 20 | 21 | #[derive(Debug, thiserror::Error)] 22 | pub enum Error { 23 | #[error(transparent)] 24 | PHPer(#[from] phper::Error), 25 | 26 | #[error(transparent)] 27 | Anyhow(#[from] anyhow::Error), 28 | } 29 | 30 | impl From for Error { 31 | fn from(e: Utf8Error) -> Self { 32 | Self::Anyhow(e.into()) 33 | } 34 | } 35 | 36 | impl From for Error { 37 | fn from(e: url::ParseError) -> Self { 38 | Self::Anyhow(e.into()) 39 | } 40 | } 41 | 42 | impl From for Error { 43 | fn from(e: String) -> Self { 44 | Self::Anyhow(anyhow!("{}", e)) 45 | } 46 | } 47 | 48 | impl From<&str> for Error { 49 | fn from(e: &str) -> Self { 50 | Self::Anyhow(anyhow!("{}", e)) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/log.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use std::fmt::Display; 17 | 18 | #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] 19 | pub enum PsrLogLevel { 20 | Off, 21 | Debug, 22 | Info, 23 | Notice, 24 | Warning, 25 | Error, 26 | Critical, 27 | Alert, 28 | Emergency, 29 | } 30 | 31 | impl From<&str> for PsrLogLevel { 32 | fn from(s: &str) -> Self { 33 | match &*s.to_uppercase() { 34 | "DEBUG" => PsrLogLevel::Debug, 35 | "INFO" => PsrLogLevel::Info, 36 | "NOTICE" => PsrLogLevel::Notice, 37 | "WARNING" => PsrLogLevel::Warning, 38 | "ERROR" => PsrLogLevel::Error, 39 | "CRITICAL" => PsrLogLevel::Critical, 40 | "ALERT" => PsrLogLevel::Alert, 41 | "EMERGENCY" => PsrLogLevel::Emergency, 42 | _ => PsrLogLevel::Off, 43 | } 44 | } 45 | } 46 | 47 | impl Display for PsrLogLevel { 48 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 49 | match self { 50 | PsrLogLevel::Off => "OFF".fmt(f), 51 | PsrLogLevel::Debug => "DEBUG".fmt(f), 52 | PsrLogLevel::Info => "INFO".fmt(f), 53 | PsrLogLevel::Notice => "NOTICE".fmt(f), 54 | PsrLogLevel::Warning => "WARNING".fmt(f), 55 | PsrLogLevel::Error => "ERROR".fmt(f), 56 | PsrLogLevel::Critical => "CRITICAL".fmt(f), 57 | PsrLogLevel::Alert => "ALERT".fmt(f), 58 | PsrLogLevel::Emergency => "EMERGENCY".fmt(f), 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/plugin/style.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use crate::execute::{get_this_mut, validate_num_args}; 17 | use anyhow::Context; 18 | use phper::{ 19 | objects::ZObj, 20 | values::{ExecuteData, ZVal}, 21 | }; 22 | 23 | /// Api style. 24 | #[derive(Clone, Copy)] 25 | pub enum ApiStyle { 26 | /// Object-oriented. 27 | OO, 28 | /// Procedural. 29 | Procedural, 30 | } 31 | 32 | impl ApiStyle { 33 | pub fn get_this_mut(self, execute_data: &mut ExecuteData) -> anyhow::Result<&mut ZObj> { 34 | match self { 35 | ApiStyle::OO => get_this_mut(execute_data), 36 | ApiStyle::Procedural => execute_data 37 | .get_mut_parameter(0) 38 | .as_mut_z_obj() 39 | .context("first argument isn't object"), 40 | } 41 | } 42 | 43 | pub fn get_mut_parameter(self, execute_data: &mut ExecuteData, index: usize) -> &mut ZVal { 44 | let index = match self { 45 | ApiStyle::OO => index, 46 | ApiStyle::Procedural => index + 1, 47 | }; 48 | execute_data.get_mut_parameter(index) 49 | } 50 | 51 | pub fn validate_num_args( 52 | self, execute_data: &mut ExecuteData, num: usize, 53 | ) -> anyhow::Result<()> { 54 | let num = match self { 55 | ApiStyle::OO => num, 56 | ApiStyle::Procedural => num + 1, 57 | }; 58 | validate_num_args(execute_data, num) 59 | } 60 | 61 | pub fn generate_operation_name(self, class_name: Option<&str>, function_name: &str) -> String { 62 | match self { 63 | ApiStyle::OO => format!("{}->{}", class_name.unwrap_or_default(), function_name), 64 | ApiStyle::Procedural => function_name.to_owned(), 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/tag.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License.. 15 | 16 | //! Tags 17 | //! 18 | //! Virtual Cache 19 | //! 20 | //! 21 | //! 22 | //! Virtual Database 23 | //! 24 | //! 25 | 26 | use std::fmt::Display; 27 | 28 | pub const TAG_CACHE_TYPE: &str = "cache.type"; 29 | pub const TAG_CACHE_OP: &str = "cache.op"; 30 | pub const TAG_CACHE_CMD: &str = "cache.cmd"; 31 | pub const TAG_CACHE_KEY: &str = "cache.key"; 32 | 33 | pub enum CacheOp { 34 | Read, 35 | Write, 36 | } 37 | 38 | impl Display for CacheOp { 39 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 40 | match self { 41 | Self::Read => write!(f, "read"), 42 | Self::Write => write!(f, "write"), 43 | } 44 | } 45 | } 46 | 47 | pub const TAG_DB_STATEMENT: &str = "db.statement"; 48 | pub const TAG_DB_TYPE: &str = "db.type"; 49 | 50 | pub const TAG_MQ_BROKER: &str = "mq.broker"; 51 | pub const TAG_MQ_TOPIC: &str = "mq.topic"; 52 | pub const TAG_MQ_QUEUE: &str = "mq.queue"; 53 | -------------------------------------------------------------------------------- /src/util.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use anyhow::anyhow; 17 | use once_cell::sync::Lazy; 18 | use phper::{ini::ini_get, sys, values::ZVal}; 19 | use std::{ 20 | ffi::CStr, 21 | panic::{UnwindSafe, catch_unwind}, 22 | }; 23 | use systemstat::{IpAddr, Platform, System}; 24 | 25 | pub static IPS: Lazy> = Lazy::new(|| { 26 | System::new() 27 | .networks() 28 | .ok() 29 | .and_then(|networks| { 30 | let addrs = networks 31 | .values() 32 | .flat_map(|network| { 33 | network 34 | .addrs 35 | .iter() 36 | .filter_map(|network_addr| match network_addr.addr { 37 | IpAddr::V4(addr) => { 38 | if network.name == "lo" 39 | || network.name.starts_with("docker") 40 | || network.name.starts_with("br-") 41 | { 42 | None 43 | } else { 44 | Some(addr.to_string()) 45 | } 46 | } 47 | _ => None, 48 | }) 49 | }) 50 | .collect::>(); 51 | 52 | if addrs.is_empty() { None } else { Some(addrs) } 53 | }) 54 | .unwrap_or_else(|| vec!["127.0.0.1".to_owned()]) 55 | }); 56 | 57 | pub fn z_val_to_string(zv: &ZVal) -> Option { 58 | zv.as_z_str() 59 | .and_then(|zs| zs.to_str().ok()) 60 | .map(|s| s.to_string()) 61 | } 62 | 63 | pub fn catch_unwind_result crate::Result + UnwindSafe, R>( 64 | f: F, 65 | ) -> crate::Result { 66 | match catch_unwind(f) { 67 | Ok(r) => r, 68 | Err(e) => match e.downcast_ref::<&str>() { 69 | Some(s) => Err(anyhow!("paniced: {}", s).into()), 70 | _ => match e.downcast_ref::() { 71 | Some(s) => Err(anyhow!("paniced: {}", s).into()), 72 | _ => Err(anyhow!("paniced").into()), 73 | }, 74 | }, 75 | } 76 | } 77 | 78 | pub fn get_sapi_module_name() -> &'static CStr { 79 | unsafe { CStr::from_ptr(sys::sapi_module.name) } 80 | } 81 | 82 | pub fn get_str_ini_with_default(name: &str) -> String { 83 | ini_get::>(name) 84 | .and_then(|s| s.to_str().ok()) 85 | .map(ToOwned::to_owned) 86 | .unwrap_or_default() 87 | } 88 | -------------------------------------------------------------------------------- /src/worker.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use crate::module::{ 17 | AUTHENTICATION, ENABLE_TLS, HEARTBEAT_PERIOD, PROPERTIES_REPORT_PERIOD_FACTOR, REPORTER_TYPE, 18 | SERVER_ADDR, SERVICE_INSTANCE, SERVICE_NAME, SOCKET_FILE_PATH, SSL_CERT_CHAIN_PATH, 19 | SSL_KEY_PATH, SSL_TRUSTED_CA_PATH, WORKER_THREADS, is_standalone_reporter_type, 20 | }; 21 | #[cfg(feature = "kafka-reporter")] 22 | use crate::module::{KAFKA_BOOTSTRAP_SERVERS, KAFKA_PRODUCER_CONFIG}; 23 | #[cfg(feature = "kafka-reporter")] 24 | use skywalking_php_worker::reporter::KafkaReporterConfiguration; 25 | use skywalking_php_worker::{ 26 | HeartBeatConfiguration, WorkerConfiguration, new_tokio_runtime, 27 | reporter::{GrpcReporterConfiguration, ReporterConfiguration}, 28 | start_worker, 29 | }; 30 | use std::{cmp::Ordering, num::NonZeroUsize, process::exit, thread::available_parallelism}; 31 | use tracing::error; 32 | 33 | pub fn init_worker() { 34 | if is_standalone_reporter_type() { 35 | return; 36 | } 37 | 38 | unsafe { 39 | // TODO Shutdown previous worker before fork if there is a PHP-FPM reload 40 | // operation. 41 | // TODO Change the worker process name. 42 | 43 | let pid = libc::fork(); 44 | match pid.cmp(&0) { 45 | Ordering::Less => { 46 | error!("fork failed"); 47 | } 48 | Ordering::Equal => { 49 | // Ensure worker process exits when master process exists. 50 | #[cfg(target_os = "linux")] 51 | libc::prctl(libc::PR_SET_PDEATHSIG, libc::SIGTERM); 52 | 53 | let reporter_config = match REPORTER_TYPE.as_str() { 54 | "grpc" => ReporterConfiguration::Grpc(GrpcReporterConfiguration { 55 | authentication: AUTHENTICATION.clone(), 56 | enable_tls: *ENABLE_TLS, 57 | server_addr: SERVER_ADDR.clone(), 58 | ssl_cert_chain_path: SSL_CERT_CHAIN_PATH.clone(), 59 | ssl_key_path: SSL_KEY_PATH.clone(), 60 | ssl_trusted_ca_path: SSL_TRUSTED_CA_PATH.clone(), 61 | }), 62 | #[cfg(feature = "kafka-reporter")] 63 | "kafka" => ReporterConfiguration::Kafka(KafkaReporterConfiguration { 64 | kafka_bootstrap_servers: KAFKA_BOOTSTRAP_SERVERS.clone(), 65 | kafka_producer_config: KAFKA_PRODUCER_CONFIG.clone(), 66 | }), 67 | typ => { 68 | error!("unknown reporter type, {}", typ); 69 | exit(1); 70 | } 71 | }; 72 | 73 | let config = WorkerConfiguration { 74 | socket_file_path: SOCKET_FILE_PATH.to_path_buf(), 75 | heart_beat: Some(HeartBeatConfiguration { 76 | service_instance: SERVICE_INSTANCE.clone(), 77 | service_name: SERVICE_NAME.clone(), 78 | heartbeat_period: *HEARTBEAT_PERIOD, 79 | properties_report_period_factor: *PROPERTIES_REPORT_PERIOD_FACTOR, 80 | }), 81 | reporter_config, 82 | }; 83 | 84 | // Run the worker in subprocess. 85 | let rt = new_tokio_runtime(worker_threads()); 86 | match rt.block_on(start_worker(config)) { 87 | Ok(_) => { 88 | exit(0); 89 | } 90 | Err(err) => { 91 | error!(?err, "worker exit unexpectedly"); 92 | exit(1); 93 | } 94 | } 95 | } 96 | Ordering::Greater => {} 97 | } 98 | } 99 | } 100 | 101 | fn worker_threads() -> usize { 102 | let worker_threads = *WORKER_THREADS; 103 | if worker_threads <= 0 { 104 | available_parallelism().map(NonZeroUsize::get).unwrap_or(1) 105 | } else { 106 | worker_threads as usize 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /tests/conf/php-fpm.1.conf: -------------------------------------------------------------------------------- 1 | ; Licensed to the Apache Software Foundation (ASF) under one or more 2 | ; contributor license agreements. See the NOTICE file distributed with 3 | ; this work for additional information regarding copyright ownership. 4 | ; The ASF licenses this file to You under the Apache License, Version 2.0 5 | ; (the "License"); you may not use this file except in compliance with 6 | ; the License. You may obtain a copy of the License at 7 | ; 8 | ; http://www.apache.org/licenses/LICENSE-2.0 9 | ; 10 | ; Unless required by applicable law or agreed to in writing, software 11 | ; distributed under the License is distributed on an "AS IS" BASIS, 12 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ; See the License for the specific language governing permissions and 14 | ; limitations under the License. 15 | 16 | ;;;;;;;;;;;;;;;;;;;;; 17 | ; FPM Configuration ; 18 | ;;;;;;;;;;;;;;;;;;;;; 19 | 20 | error_log = /dev/stderr 21 | log_level = notice 22 | daemonize = no 23 | 24 | ;;;;;;;;;;;;;;;;;;;; 25 | ; Pool Definitions ; 26 | ;;;;;;;;;;;;;;;;;;;; 27 | 28 | [www] 29 | 30 | user = 1000 31 | group = 1000 32 | listen = 127.0.0.1:9001 33 | pm = ondemand 34 | pm.max_children = 9 35 | pm.max_requests = 500 36 | -------------------------------------------------------------------------------- /tests/conf/php-fpm.2.conf: -------------------------------------------------------------------------------- 1 | ; Licensed to the Apache Software Foundation (ASF) under one or more 2 | ; contributor license agreements. See the NOTICE file distributed with 3 | ; this work for additional information regarding copyright ownership. 4 | ; The ASF licenses this file to You under the Apache License, Version 2.0 5 | ; (the "License"); you may not use this file except in compliance with 6 | ; the License. You may obtain a copy of the License at 7 | ; 8 | ; http://www.apache.org/licenses/LICENSE-2.0 9 | ; 10 | ; Unless required by applicable law or agreed to in writing, software 11 | ; distributed under the License is distributed on an "AS IS" BASIS, 12 | ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ; See the License for the specific language governing permissions and 14 | ; limitations under the License. 15 | 16 | ;;;;;;;;;;;;;;;;;;;;; 17 | ; FPM Configuration ; 18 | ;;;;;;;;;;;;;;;;;;;;; 19 | 20 | error_log = /dev/stderr 21 | log_level = notice 22 | daemonize = no 23 | 24 | ;;;;;;;;;;;;;;;;;;;; 25 | ; Pool Definitions ; 26 | ;;;;;;;;;;;;;;;;;;;; 27 | 28 | [www] 29 | 30 | user = 1000 31 | group = 1000 32 | listen = 127.0.0.1:9002 33 | pm = ondemand 34 | pm.max_children = 9 35 | pm.max_requests = 500 36 | -------------------------------------------------------------------------------- /tests/php/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "skywalking-agent/php-test", 3 | "type": "project", 4 | "authors": [ 5 | { 6 | "name": "jmjoy", 7 | "email": "jmjoy@apache.org" 8 | } 9 | ], 10 | "require": { 11 | "php": ">=7.2", 12 | "ext-swoole": ">=4.5", 13 | "predis/predis": "^2.0", 14 | "guzzlehttp/guzzle": "^7.4", 15 | "webmozart/assert": "^1.11", 16 | "php-amqplib/php-amqplib": "^3.5", 17 | "monolog/monolog": "^2.10" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/php/fpm/curl-multi.enter.php: -------------------------------------------------------------------------------- 1 | (function () { 30 | $ch = curl_init(); 31 | curl_setopt($ch, CURLOPT_URL, "http://127.0.0.1:9011/curl.test.php?multi=1"); 32 | curl_setopt($ch, CURLOPT_TIMEOUT, 10); 33 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 34 | curl_setopt($ch, CURLOPT_POST, 1); 35 | curl_setopt($ch, CURLOPT_POSTFIELDS, ["foo" => "bar"]); 36 | curl_setopt($ch, CURLOPT_HTTPHEADER, ["X-FOO:BAR"]); 37 | return $ch; 38 | })(), 39 | 'callback' => function ($output) { 40 | Assert::same($output, "ok"); 41 | }, 42 | ], 43 | [ 44 | 'curl' => (function () { 45 | $ch = curl_init(); 46 | curl_setopt_array($ch, [ 47 | CURLOPT_URL => "http://127.0.0.1:9011/curl.test.php?multi=2", 48 | CURLOPT_TIMEOUT => 10, 49 | CURLOPT_RETURNTRANSFER => 1, 50 | CURLOPT_POST => 1, 51 | CURLOPT_POSTFIELDS => ["foo" => "bar"], 52 | CURLOPT_HTTPHEADER => ["X-FOO: BAR"], 53 | ]); 54 | return $ch; 55 | })(), 56 | 'callback' => function ($output) { 57 | Assert::same($output, "ok"); 58 | }, 59 | ], 60 | [ 61 | 'curl' => (function () { 62 | $ch = curl_init(); 63 | curl_setopt($ch, CURLOPT_URL, "http://127.0.0.1:9011/not-exists.php?multi=3"); 64 | curl_setopt($ch, CURLOPT_TIMEOUT, 10); 65 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 66 | curl_setopt($ch, CURLOPT_HEADER, 0); 67 | return $ch; 68 | })(), 69 | 'callback' => function ($output) {}, 70 | ], 71 | ]; 72 | curl_multi_request($curl_callbacks); 73 | } 74 | 75 | sleep(5); 76 | 77 | echo "ok"; 78 | 79 | function curl_multi_request($curl_callbacks) { 80 | $mh = curl_multi_init(); 81 | 82 | foreach ($curl_callbacks as $curl_callback) { 83 | curl_multi_add_handle($mh, $curl_callback['curl']); 84 | } 85 | 86 | do { 87 | $mrc = curl_multi_exec($mh, $active); 88 | } while ($mrc == CURLM_CALL_MULTI_PERFORM); 89 | 90 | while ($active && $mrc == CURLM_OK) { 91 | if (curl_multi_select($mh) == -1) { 92 | return; 93 | } 94 | do { 95 | $mrc = curl_multi_exec($mh, $active); 96 | } while ($mrc == CURLM_CALL_MULTI_PERFORM); 97 | } 98 | 99 | while ($info = curl_multi_info_read($mh)) { 100 | $content = curl_multi_getcontent($info['handle']); 101 | foreach ($curl_callbacks as $curl_callback) { 102 | if ($curl_callback['curl'] == $info['handle']) { 103 | call_user_func($curl_callback['callback'], $content); 104 | break; 105 | } 106 | } 107 | } 108 | 109 | foreach ($curl_callbacks as $curl_callback) { 110 | curl_multi_remove_handle($mh, $curl_callback['curl']); 111 | } 112 | 113 | curl_multi_close($mh); 114 | } 115 | -------------------------------------------------------------------------------- /tests/php/fpm/curl.enter.php: -------------------------------------------------------------------------------- 1 | "bar"]); 40 | curl_setopt($ch, CURLOPT_HTTPHEADER, ["X-FOO:BAR"]); 41 | $output = curl_exec($ch); 42 | curl_close($ch); 43 | Assert::same($output, "ok"); 44 | } 45 | 46 | { 47 | $ch = curl_init(); 48 | curl_setopt_array($ch, [ 49 | CURLOPT_URL => "http://127.0.0.1:9011/curl.test.php?single=2", 50 | CURLOPT_TIMEOUT => 10, 51 | CURLOPT_RETURNTRANSFER => 1, 52 | CURLOPT_POST => 1, 53 | CURLOPT_POSTFIELDS => ["foo" => "bar"], 54 | CURLOPT_HTTPHEADER => ["X-FOO: BAR"], 55 | ]); 56 | $output = curl_exec($ch); 57 | curl_close($ch); 58 | Assert::same($output, "ok"); 59 | } 60 | 61 | { 62 | $ch = curl_init(); 63 | curl_setopt($ch, CURLOPT_URL, "http://127.0.0.1:9011/not-exists.php?single=3"); 64 | curl_setopt($ch, CURLOPT_TIMEOUT, 10); 65 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 66 | curl_setopt($ch, CURLOPT_HEADER, 0); 67 | curl_exec($ch); 68 | curl_close($ch); 69 | } 70 | 71 | { 72 | $ch = curl_init(); 73 | curl_setopt($ch, CURLOPT_URL, "http://127.0.0.1:9012/guzzle.php"); 74 | curl_setopt($ch, CURLOPT_TIMEOUT, 10); 75 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 76 | curl_setopt($ch, CURLOPT_HEADER, 0); 77 | $output = curl_exec($ch); 78 | curl_close($ch); 79 | Assert::same($output, "ok"); 80 | } 81 | 82 | echo "ok"; 83 | -------------------------------------------------------------------------------- /tests/php/fpm/curl.test.php: -------------------------------------------------------------------------------- 1 | request('GET', 'http://127.0.0.1:9011/index.php', [ 25 | 'auth' => ['user', 'pass'] 26 | ]); 27 | Assert::same($res->getStatusCode(), 200); 28 | Assert::eq($res->getBody(), 'ok'); 29 | } 30 | 31 | echo "ok"; 32 | -------------------------------------------------------------------------------- /tests/php/fpm/index.php: -------------------------------------------------------------------------------- 1 | connect("127.0.0.1", 11211); 26 | 27 | $mc->set("foo", "Hello!"); 28 | $mc->set("bar", "Memcached..."); 29 | 30 | Assert::same($mc->get("foo"), 'Hello!'); 31 | Assert::same($mc->get("bar"), "Memcached..."); 32 | 33 | Assert::false($mc->get("not-exists")); 34 | } 35 | 36 | { 37 | $mc = memcache_connect("127.0.0.1", 11211); 38 | 39 | memcache_set($mc, "foo", "Hello!!"); 40 | 41 | Assert::same(memcache_get($mc, "foo"), 'Hello!!'); 42 | 43 | Assert::false(memcache_get($mc, "not-exists")); 44 | } 45 | 46 | echo "ok"; 47 | -------------------------------------------------------------------------------- /tests/php/fpm/memcached.php: -------------------------------------------------------------------------------- 1 | addServer("127.0.0.1", 11211); 26 | 27 | $mc->set("foo", "Hello!"); 28 | $mc->set("bar", "Memcached..."); 29 | 30 | Assert::same($mc->get("foo"), 'Hello!'); 31 | Assert::same($mc->get("bar"), "Memcached..."); 32 | 33 | $mc->setMulti(array( 34 | 'key1' => 'value1', 35 | 'key2' => 'value2', 36 | 'key3' => 'value3' 37 | )); 38 | 39 | Assert::false($mc->get("not-exists")); 40 | } 41 | 42 | echo "ok"; 43 | -------------------------------------------------------------------------------- /tests/php/fpm/mongodb.php: -------------------------------------------------------------------------------- 1 | 1]); 22 | $manager->executeCommand('admin', $command); 23 | } 24 | 25 | { 26 | $bulk = new MongoDB\Driver\BulkWrite; 27 | $bulk->insert(['x' => 1, 'y' => 'foo']); 28 | $bulk->insert(['x' => 2, 'y' => 'bar']); 29 | $bulk->insert(['x' => 3, 'y' => 'baz']); 30 | $manager->executeBulkWrite('my_db.my_collection', $bulk); 31 | } 32 | 33 | { 34 | $query = new MongoDB\Driver\Query(['x' => 1], []); 35 | $manager->executeQuery('my_db.my_collection', $query); 36 | } 37 | 38 | try { 39 | $manager2 = new MongoDB\Driver\Manager("mongodb://root:example@127.0.0.1:27018,127.0.0.1:27019"); 40 | $command = new MongoDB\Driver\Command(['ping' => 1]); 41 | $manager2->executeCommand('admin', $command); 42 | } catch(MongoDB\Driver\Exception\ConnectionTimeoutException $e) { 43 | } 44 | 45 | echo "ok"; 46 | -------------------------------------------------------------------------------- /tests/php/fpm/monolog.php: -------------------------------------------------------------------------------- 1 | str = $str; 28 | } 29 | public function __toString() { 30 | return $this->str; 31 | } 32 | } 33 | 34 | $logger = new Logger('my_logger'); 35 | 36 | $logger->info('This is a INFO level log.'); 37 | $logger->warning('This is a WARNING level log.'); 38 | $logger->error(new MyString('This is a ERROR level log.'), [ 39 | "foo" => 123, "bar" => false, "baz" => new MyString("test"), 40 | ]); 41 | 42 | echo "ok"; 43 | -------------------------------------------------------------------------------- /tests/php/fpm/mysqli.php: -------------------------------------------------------------------------------- 1 | query("SELECT 1"); 25 | Assert::notFalse($result); 26 | } 27 | 28 | { 29 | $mysqli = new mysqli("127.0.0.1", "root", "password", "skywalking", 3306); 30 | $result = $mysqli->query("SELECT * FROM `mysql`.`user` WHERE `User` = 'root'"); 31 | $rs = $result->fetch_all(); 32 | Assert::same(count($rs), 2); 33 | } 34 | 35 | { 36 | $mysqli = mysqli_connect("127.0.0.1", "root", "password", "skywalking", 3306); 37 | $result = mysqli_query($mysqli, "SELECT * FROM `mysql`.`user` WHERE `User` = 'root'"); 38 | $rs = $result->fetch_all(); 39 | Assert::same(count($rs), 2); 40 | } 41 | 42 | { 43 | mysqli_report(MYSQLI_REPORT_OFF); 44 | $mysqli = mysqli_init(); 45 | @mysqli_real_connect($mysqli, "127.0.0.1", "root", "password_incorrect", "skywalking", 3306); 46 | } 47 | 48 | echo "ok"; 49 | -------------------------------------------------------------------------------- /tests/php/fpm/pdo.php: -------------------------------------------------------------------------------- 1 | exec("SELECT 1"); 25 | Assert::notFalse($result); 26 | } 27 | 28 | { 29 | $pdo = new PDO("mysql:dbname=skywalking;host=127.0.0.1:3306", "root", "password"); 30 | $sth = $pdo->prepare("SELECT * FROM `mysql`.`user` WHERE `User` = :user", [PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY]); 31 | $sth->execute(['user' => 'root']); 32 | $rs = $sth->fetchAll(); 33 | Assert::same(count($rs), 2); 34 | } 35 | 36 | { 37 | $pdo = new PDO("mysql:dbname=skywalking;host=127.0.0.1:3306;", "root", "password"); 38 | $sth = $pdo->prepare("SELECT * FROM `mysql`.`user` WHERE `User` = :user", [PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY]); 39 | $sth->execute(['user' => 'anon']); 40 | $rs = $sth->fetchAll(); 41 | Assert::same(count($rs), 0); 42 | } 43 | 44 | { 45 | Assert::throws(function () { 46 | $pdo = new PDO("mysql:dbname=skywalking;host=127.0.0.1;port=3306", "root", "password"); 47 | $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 48 | $sth = $pdo->prepare("SELECT * FROM not_exist"); 49 | $sth->execute(); 50 | }, PDOException::class); 51 | } 52 | 53 | echo "ok"; 54 | -------------------------------------------------------------------------------- /tests/php/fpm/predis.php: -------------------------------------------------------------------------------- 1 | auth('password'); 26 | $client->set('foo', 'bar'); 27 | $value = $client->get('foo'); 28 | Assert::same($value, 'bar'); 29 | $client->get('not-exists'); 30 | } 31 | 32 | echo "ok"; 33 | -------------------------------------------------------------------------------- /tests/php/fpm/rabbitmq.php: -------------------------------------------------------------------------------- 1 | channel(); 28 | 29 | $channel->queue_declare('queue_test', false, false, false, false); 30 | $channel->exchange_declare('exchange_test', 'direct', false, false, false); 31 | $channel->queue_bind('queue_test', 'exchange_test', 'routing_test'); 32 | 33 | { 34 | $msg = new AMQPMessage('Hello World!'); 35 | $channel->basic_publish($msg, '', 'queue_test'); 36 | } 37 | 38 | { 39 | $msg = new AMQPMessage('Hello World!', ['content_type' => 'text/plain']); 40 | $channel->basic_publish($msg, 'exchange_test', 'routing_test'); 41 | } 42 | 43 | { 44 | $msg = new AMQPMessage('Hello World!'); 45 | $msg->set('application_headers', new AMQPTable(['foo' => 'bar'])); 46 | $channel->basic_publish($msg, '', 'not_exists'); 47 | } 48 | 49 | echo "ok"; 50 | -------------------------------------------------------------------------------- /tests/php/fpm/redis.fail.php: -------------------------------------------------------------------------------- 1 | connect("127.0.0.1", 6379); 26 | $client->set('foo', 'bar'); 27 | } catch (RedisException $e) { 28 | } 29 | 30 | echo "ok"; 31 | -------------------------------------------------------------------------------- /tests/php/fpm/redis.succ.php: -------------------------------------------------------------------------------- 1 | connect("127.0.0.1", 6379); 26 | $client->auth('password'); 27 | $client->mSet(['key0' => 'value0', 'key1' => 'value1']); 28 | Assert::same($client->get('key0'), 'value0'); 29 | Assert::same($client->get('key1'), 'value1'); 30 | } 31 | 32 | echo "ok"; 33 | -------------------------------------------------------------------------------- /tests/php/swoole/main.1.php: -------------------------------------------------------------------------------- 1 | set([ 27 | 'reactor_num' => 3, 28 | 'worker_num' => 3, 29 | 'enable_coroutine' => true, 30 | 'hook_flags' => 0, 31 | ]); 32 | 33 | $http->on('start', function ($server) { 34 | echo "Swoole http server is started at http://127.0.0.1:9501\n"; 35 | }); 36 | 37 | $http->on('request', function ($request, $response) { 38 | try { 39 | switch ($request->server['request_uri']) { 40 | case "/": 41 | break; 42 | 43 | case "/curl": 44 | { 45 | $ch = curl_init(); 46 | curl_setopt($ch, CURLOPT_URL, "http://127.0.0.1:9501/?swoole=1"); 47 | curl_setopt($ch, CURLOPT_TIMEOUT, 10); 48 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 49 | curl_setopt($ch, CURLOPT_HEADER, 0); 50 | $output = curl_exec($ch); 51 | curl_close($ch); 52 | Assert::same($output, "ok"); 53 | } 54 | 55 | { 56 | $ch = curl_init(); 57 | curl_setopt($ch, CURLOPT_URL, "http://127.0.0.1:9502/"); 58 | curl_setopt($ch, CURLOPT_TIMEOUT, 10); 59 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 60 | curl_setopt($ch, CURLOPT_HEADER, 0); 61 | $output = curl_exec($ch); 62 | curl_close($ch); 63 | Assert::same($output, "ok"); 64 | } 65 | 66 | break; 67 | 68 | default: 69 | throw new DomainException("Unknown operation"); 70 | } 71 | 72 | $response->header('Content-Type', 'text/plain'); 73 | $response->end('ok'); 74 | 75 | } catch (Exception $e) { 76 | $response->status(500); 77 | $response->header('Content-Type', 'text/plain'); 78 | $response->end($e->getMessage() . "\n" . $e->getTraceAsString()); 79 | } 80 | }); 81 | 82 | $http->start(); 83 | -------------------------------------------------------------------------------- /tests/php/swoole/main.2.php: -------------------------------------------------------------------------------- 1 | set([ 27 | 'reactor_num' => 3, 28 | 'worker_num' => 3, 29 | 'enable_coroutine' => true, 30 | 'hook_flags' => SWOOLE_HOOK_ALL, 31 | ]); 32 | 33 | $http->on('start', function ($server) { 34 | echo "Swoole http server is started at http://127.0.0.1:9502\n"; 35 | }); 36 | 37 | $http->on('request', function ($request, $response) { 38 | try { 39 | switch ($request->server['request_uri']) { 40 | case "/": 41 | break; 42 | 43 | case '/curl': 44 | { 45 | $ch = curl_init(); 46 | curl_setopt($ch, CURLOPT_URL, "http://127.0.0.1:9502/?swoole=2"); 47 | curl_setopt($ch, CURLOPT_TIMEOUT, 10); 48 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 49 | curl_setopt($ch, CURLOPT_HEADER, 0); 50 | $output = curl_exec($ch); 51 | curl_close($ch); 52 | Assert::same($output, "ok"); 53 | } 54 | break; 55 | 56 | case '/pdo': 57 | { 58 | $pdo = new PDO("mysql:dbname=skywalking;host=127.0.0.1;port=3306", "root", "password"); 59 | $result = $pdo->exec("SELECT 1"); 60 | Assert::notFalse($result); 61 | } 62 | break; 63 | 64 | case '/mysqli': 65 | { 66 | $mysqli = new mysqli("127.0.0.1", "root", "password", "skywalking", 3306); 67 | $result = $mysqli->query("SELECT 1"); 68 | Assert::notFalse($result); 69 | } 70 | break; 71 | 72 | case '/memcached': 73 | { 74 | $mc = new Memcached(); 75 | $mc->addServer("127.0.0.1", 11211); 76 | 77 | $mc->set("foo000", "bar000"); 78 | Assert::same($mc->get("foo000"), 'bar000'); 79 | } 80 | break; 81 | 82 | case '/redis': 83 | { 84 | $client = new Redis(); 85 | $client->connect("127.0.0.1", 6379); 86 | $client->auth('password'); 87 | $client->set('foo001', 'bar001'); 88 | Assert::same($client->get('foo001'), 'bar001'); 89 | } 90 | break; 91 | 92 | case '/predis': 93 | { 94 | $client = new Predis\Client(); 95 | $client->auth('password'); 96 | $client->set('foo002', 'bar002'); 97 | Assert::same($client->get('foo002'), 'bar002'); 98 | } 99 | break; 100 | 101 | case '/mongodb': 102 | { 103 | $manager = new MongoDB\Driver\Manager("mongodb://root:example@127.0.0.1:27017"); 104 | $command = new MongoDB\Driver\Command(['ping' => 1]); 105 | $manager->executeCommand('admin', $command); 106 | } 107 | break; 108 | 109 | case '/memcache': 110 | { 111 | $mc = new Memcache(); 112 | $mc->addServer("127.0.0.1", 11211); 113 | 114 | $mc->set("foo000", "bar000"); 115 | Assert::same($mc->get("foo000"), 'bar000'); 116 | } 117 | break; 118 | 119 | default: 120 | throw new DomainException("Unknown operation"); 121 | } 122 | 123 | $response->header('Content-Type', 'text/plain'); 124 | $response->end('ok'); 125 | 126 | } catch (Exception $e) { 127 | $response->status(500); 128 | $response->header('Content-Type', 'text/plain'); 129 | $response->end($e->getMessage() . "\n" . $e->getTraceAsString()); 130 | } 131 | }); 132 | 133 | $http->start(); 134 | -------------------------------------------------------------------------------- /worker/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | [package] 17 | name = "skywalking-php-worker" 18 | version = { workspace = true } 19 | authors = { workspace = true } 20 | description = "Apache SkyWalking PHP Worker." 21 | edition = { workspace = true } 22 | rust-version = { workspace = true } 23 | repository = { workspace = true } 24 | license = { workspace = true } 25 | readme = "README.md" 26 | publish = false 27 | 28 | [features] 29 | standalone = ["clap", "tracing-subscriber"] 30 | kafka-reporter = ["skywalking/kafka-reporter", "rdkafka/sasl"] 31 | 32 | [dependencies] 33 | anyhow = { version = "1.0.97", features = ["backtrace"] } 34 | bincode = { workspace = true } 35 | clap = { version = "4.5.36", features = ["derive"], optional = true } 36 | libc = "0.2.171" 37 | once_cell = "1.21.3" 38 | prost = "0.13.5" 39 | rdkafka = { version = "0.37.0", optional = true } 40 | serde_json = { version = "1.0.140", features = ["preserve_order"] } 41 | skywalking = { version = "0.9.0", features = ["management"] } 42 | tokio = { version = "1.44.2", features = ["full"] } 43 | tokio-stream = "0.1.17" 44 | tonic = { version = "0.12.0", features = ["tls-native-roots"] } 45 | tracing = { version = "0.1.41", features = ["attributes", "log"] } 46 | tracing-subscriber = { version = "0.3.19", features = ["env-filter"], optional = true } 47 | 48 | [[bin]] 49 | name = "skywalking-php-worker" 50 | required-features = ["standalone", "kafka-reporter"] 51 | -------------------------------------------------------------------------------- /worker/src/channel.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use skywalking::reporter::{CollectItem, Report}; 17 | use std::mem::size_of; 18 | use tokio::{io::AsyncReadExt, sync::mpsc}; 19 | use tracing::error; 20 | 21 | pub async fn channel_receive(receiver: &mut tokio::net::UnixStream) -> anyhow::Result { 22 | let mut size_buf = [0u8; size_of::()]; 23 | receiver.read_exact(&mut size_buf).await?; 24 | let size = usize::from_le_bytes(size_buf); 25 | 26 | let mut content = vec![0u8; size]; 27 | receiver.read_exact(&mut content).await?; 28 | 29 | let (item, _) = bincode::serde::decode_from_slice(&content, bincode::config::standard())?; 30 | Ok(item) 31 | } 32 | 33 | pub struct TxReporter(pub mpsc::Sender); 34 | 35 | impl Report for TxReporter { 36 | fn report(&self, item: CollectItem) { 37 | if let Err(err) = self.0.try_send(item) { 38 | error!(?err, "Send collect item failed"); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /worker/src/main.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use clap::Parser; 17 | use skywalking_php_worker::{ 18 | WorkerConfiguration, new_tokio_runtime, 19 | reporter::{GrpcReporterConfiguration, KafkaReporterConfiguration, ReporterConfiguration}, 20 | start_worker, 21 | }; 22 | use std::{num::NonZeroUsize, path::PathBuf, thread::available_parallelism}; 23 | use tracing::log::LevelFilter; 24 | use tracing_subscriber::{EnvFilter, FmtSubscriber}; 25 | 26 | #[derive(Parser, Debug)] 27 | #[command(version, about, long_about = None)] 28 | struct Args { 29 | /// Path of socket file to listening 30 | #[arg(short, long)] 31 | socket_file_path: PathBuf, 32 | 33 | /// Count of worker threads, default is `nproc` 34 | #[arg(long)] 35 | worker_threads: Option, 36 | 37 | /// Log level, will be overwritten by env `RUST_LOG` 38 | #[arg(short, long, default_value = "INFO")] 39 | log_level: LevelFilter, 40 | 41 | /// Select reporter 42 | #[command(subcommand)] 43 | reporter: ReporterArgs, 44 | } 45 | 46 | #[derive(Parser, Debug)] 47 | #[command(version, about, long_about = None)] 48 | enum ReporterArgs { 49 | /// Report to Skywalking OAP via grpc protocol 50 | Grpc { 51 | /// skywalking server address 52 | #[arg(long)] 53 | server_addr: String, 54 | 55 | /// Skywalking agent authentication token 56 | #[arg(long)] 57 | authentication: Option, 58 | 59 | /// Wether to enable tls for gPRC 60 | #[arg(long)] 61 | enable_tls: bool, 62 | 63 | /// The gRPC SSL trusted ca file 64 | #[arg(long, required_if_eq("enable_tls", "true"))] 65 | ssl_cert_chain_path: Option, 66 | 67 | /// The private key file. Enable mTLS when ssl_key_path and 68 | /// ssl_cert_chain_path exist 69 | #[arg(long)] 70 | ssl_key_path: Option, 71 | 72 | /// The certificate file. Enable mTLS when ssl_key_path and 73 | /// ssl_cert_chain_path exist 74 | #[arg(long)] 75 | ssl_trusted_ca_path: Option, 76 | }, 77 | /// Report to kafka 78 | Kafka { 79 | /// A list of host/port pairs to use for establishing the initial 80 | /// connection to the Kafka cluster. Only available when the 81 | /// reporter type is `kafka` 82 | #[arg(long)] 83 | kafka_bootstrap_servers: String, 84 | 85 | /// Configure Kafka Producer configuration in JSON format. 86 | /// Only available when the reporter type is `kafka` 87 | #[arg(long)] 88 | kafka_producer_config: Option, 89 | }, 90 | } 91 | 92 | impl From for ReporterConfiguration { 93 | fn from(args: ReporterArgs) -> Self { 94 | match args { 95 | ReporterArgs::Grpc { 96 | server_addr, 97 | authentication, 98 | enable_tls, 99 | ssl_cert_chain_path, 100 | ssl_key_path, 101 | ssl_trusted_ca_path, 102 | } => ReporterConfiguration::Grpc(GrpcReporterConfiguration { 103 | server_addr, 104 | authentication: authentication.unwrap_or_default(), 105 | enable_tls, 106 | ssl_cert_chain_path: ssl_cert_chain_path.unwrap_or_default(), 107 | ssl_key_path: ssl_key_path.unwrap_or_default(), 108 | ssl_trusted_ca_path: ssl_trusted_ca_path.unwrap_or_default(), 109 | }), 110 | ReporterArgs::Kafka { 111 | kafka_bootstrap_servers, 112 | kafka_producer_config, 113 | } => ReporterConfiguration::Kafka(KafkaReporterConfiguration { 114 | kafka_bootstrap_servers, 115 | kafka_producer_config: kafka_producer_config.unwrap_or_default(), 116 | }), 117 | } 118 | } 119 | } 120 | 121 | fn init_logger(log_level: &LevelFilter) -> anyhow::Result<()> { 122 | let filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| { 123 | EnvFilter::new(format!( 124 | "info,skywalking_agent={log_level},skywalking_php_worker={log_level}" 125 | )) 126 | }); 127 | 128 | let subscriber = FmtSubscriber::builder() 129 | .with_env_filter(filter) 130 | .with_ansi(false) 131 | .finish(); 132 | 133 | tracing::subscriber::set_global_default(subscriber)?; 134 | 135 | Ok(()) 136 | } 137 | 138 | fn worker_threads(worker_threads: Option) -> usize { 139 | worker_threads.unwrap_or_else(|| available_parallelism().map(NonZeroUsize::get).unwrap_or(1)) 140 | } 141 | 142 | fn main() -> anyhow::Result<()> { 143 | let args = Args::parse(); 144 | 145 | init_logger(&args.log_level)?; 146 | 147 | let rt = new_tokio_runtime(worker_threads(args.worker_threads)); 148 | 149 | rt.block_on(start_worker(WorkerConfiguration { 150 | socket_file_path: args.socket_file_path, 151 | heart_beat: None, 152 | reporter_config: args.reporter.into(), 153 | }))?; 154 | 155 | Ok(()) 156 | } 157 | -------------------------------------------------------------------------------- /worker/src/reporter/mod.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | mod reporter_grpc; 17 | mod reporter_kafka; 18 | 19 | pub use reporter_grpc::GrpcReporterConfiguration; 20 | #[cfg(feature = "kafka-reporter")] 21 | pub use reporter_kafka::KafkaReporterConfiguration; 22 | use skywalking::reporter::{CollectItemConsume, CollectItemProduce}; 23 | 24 | pub enum ReporterConfiguration { 25 | Grpc(GrpcReporterConfiguration), 26 | 27 | #[cfg(feature = "kafka-reporter")] 28 | Kafka(KafkaReporterConfiguration), 29 | } 30 | 31 | pub async fn run_reporter( 32 | config: ReporterConfiguration, producer: impl CollectItemProduce, 33 | consumer: impl CollectItemConsume, 34 | ) -> anyhow::Result<()> { 35 | match config { 36 | ReporterConfiguration::Grpc(config) => { 37 | reporter_grpc::run_reporter(config, producer, consumer).await 38 | } 39 | #[cfg(feature = "kafka-reporter")] 40 | ReporterConfiguration::Kafka(config) => { 41 | reporter_kafka::run_reporter(config, producer, consumer).await 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /worker/src/reporter/reporter_grpc.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use anyhow::anyhow; 17 | use skywalking::reporter::{CollectItemConsume, CollectItemProduce, grpc::GrpcReporter}; 18 | use std::time::Duration; 19 | use tokio::time::sleep; 20 | use tonic::transport::{Certificate, Channel, ClientTlsConfig, Endpoint, Identity}; 21 | use tracing::{debug, info, warn}; 22 | 23 | pub struct GrpcReporterConfiguration { 24 | pub server_addr: String, 25 | pub authentication: String, 26 | pub enable_tls: bool, 27 | pub ssl_cert_chain_path: String, 28 | pub ssl_key_path: String, 29 | pub ssl_trusted_ca_path: String, 30 | } 31 | 32 | pub async fn run_reporter( 33 | config: GrpcReporterConfiguration, producer: impl CollectItemProduce, 34 | consumer: impl CollectItemConsume, 35 | ) -> anyhow::Result<()> { 36 | let endpoint = create_endpoint(&config).await?; 37 | let channel = connect(endpoint).await; 38 | 39 | let mut reporter = GrpcReporter::new_with_pc(channel, producer, consumer); 40 | 41 | if !config.authentication.is_empty() { 42 | reporter = reporter.with_authentication(config.authentication); 43 | } 44 | 45 | info!("Worker is ready..."); 46 | 47 | let handle = reporter 48 | .reporting() 49 | .await 50 | .with_status_handle(|message, status| { 51 | warn!(?status, "Collect failed: {}", message); 52 | }) 53 | .spawn(); 54 | 55 | handle 56 | .await 57 | .map_err(|err| anyhow!("Tracer reporting failed: {:?}", err))?; 58 | 59 | Ok(()) 60 | } 61 | 62 | async fn create_endpoint(config: &GrpcReporterConfiguration) -> anyhow::Result { 63 | let scheme = if config.enable_tls { "https" } else { "http" }; 64 | 65 | let url = format!("{}://{}", scheme, config.server_addr); 66 | debug!(url, "Create Endpoint"); 67 | let mut endpoint = Endpoint::from_shared(url)?; 68 | 69 | debug!( 70 | enable_tls = config.enable_tls, 71 | ssl_trusted_ca_path = config.ssl_trusted_ca_path, 72 | ssl_key_path = config.ssl_key_path, 73 | ssl_cert_chain_path = config.ssl_cert_chain_path, 74 | "Skywalking TLS info" 75 | ); 76 | 77 | if config.enable_tls { 78 | let domain_name = config.server_addr.split(':').next().unwrap_or_default(); 79 | debug!(domain_name, "Configure TLS domain"); 80 | let mut tls = ClientTlsConfig::new().domain_name(domain_name); 81 | 82 | let ssl_trusted_ca_path = &config.ssl_trusted_ca_path; 83 | if !ssl_trusted_ca_path.is_empty() { 84 | debug!(ssl_trusted_ca_path, "Configure TLS CA"); 85 | let ca_cert = tokio::fs::read(&config.ssl_trusted_ca_path).await?; 86 | let ca_cert = Certificate::from_pem(ca_cert); 87 | tls = tls.ca_certificate(ca_cert); 88 | } 89 | 90 | let ssl_key_path = &config.ssl_key_path; 91 | let ssl_cert_chain_path = &config.ssl_cert_chain_path; 92 | if !ssl_key_path.is_empty() && !ssl_cert_chain_path.is_empty() { 93 | debug!(ssl_trusted_ca_path, "Configure mTLS"); 94 | let client_cert = tokio::fs::read(&config.ssl_cert_chain_path).await?; 95 | let client_key = tokio::fs::read(&config.ssl_key_path).await?; 96 | let client_identity = Identity::from_pem(client_cert, client_key); 97 | tls = tls.identity(client_identity); 98 | } 99 | 100 | endpoint = endpoint.tls_config(tls)?; 101 | } 102 | 103 | Ok(endpoint) 104 | } 105 | 106 | #[tracing::instrument(skip_all)] 107 | async fn connect(endpoint: Endpoint) -> Channel { 108 | let channel = loop { 109 | match endpoint.connect().await { 110 | Ok(channel) => break channel, 111 | Err(err) => { 112 | warn!(?err, "Connect to skywalking server failed, retry after 10s"); 113 | sleep(Duration::from_secs(10)).await; 114 | } 115 | } 116 | }; 117 | 118 | let uri = &*endpoint.uri().to_string(); 119 | info!(uri, "Skywalking server connected"); 120 | 121 | channel 122 | } 123 | -------------------------------------------------------------------------------- /worker/src/reporter/reporter_kafka.rs: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one or more 2 | // contributor license agreements. See the NOTICE file distributed with 3 | // this work for additional information regarding copyright ownership. 4 | // The ASF licenses this file to You under the Apache License, Version 2.0 5 | // (the "License"); you may not use this file except in compliance with 6 | // the License. You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #![cfg(feature = "kafka-reporter")] 17 | 18 | use anyhow::{Context, bail}; 19 | use skywalking::reporter::{ 20 | CollectItemConsume, CollectItemProduce, 21 | kafka::{KafkaReportBuilder, RDKafkaClientConfig}, 22 | }; 23 | use std::collections::HashMap; 24 | 25 | pub struct KafkaReporterConfiguration { 26 | pub kafka_bootstrap_servers: String, 27 | pub kafka_producer_config: String, 28 | } 29 | 30 | pub async fn run_reporter( 31 | config: KafkaReporterConfiguration, producer: impl CollectItemProduce, 32 | consumer: impl CollectItemConsume, 33 | ) -> anyhow::Result<()> { 34 | let mut client_config = RDKafkaClientConfig::new(); 35 | 36 | client_config.set("bootstrap.servers", config.kafka_bootstrap_servers); 37 | 38 | let config = serde_json::from_str::>(&config.kafka_producer_config) 39 | .context("parse kafka producer config failed")?; 40 | for (key, value) in config { 41 | client_config.set(key, value); 42 | } 43 | 44 | let (_, reporting) = KafkaReportBuilder::new_with_pc(client_config, producer, consumer) 45 | .build() 46 | .await?; 47 | let handle = reporting.spawn(); 48 | if let Err(err) = handle.await { 49 | bail!("wait handle failed: {:?}", err); 50 | } 51 | 52 | Ok(()) 53 | } 54 | --------------------------------------------------------------------------------