Skip to content

0.4.x dev #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# Copyright (c) 2019 jmjoy
# PHPER is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.

name: CI

on:
push:
branches:
- master
- 0.4.x-dev
pull_request:
branches: [ "**" ]

Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) 2019 jmjoy
# PHPER is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.

name: License

on:
push:
branches:
- master
pull_request:
branches: [ "**" ]

jobs:
license-check:
name: License check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check License Header
uses: apache/skywalking-eyes/header/@d5466651aaded6fbd588d2278eccc469afc89d92
with:
config: .licenserc.yaml
33 changes: 33 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2019 jmjoy
# PHPER is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.

header:
license:
spdx-id: MulanPSL-2.0
copyright-owner: jmjoy
software-name: PHPER

paths-ignore:
- 'LICENSE'
- 'NOTICE'
- '**/*.md'
- '**/*.lock'
- '**/.gitignore'
- '**/.gitmodules'
- 'vendor'
- '.cargo'
- '.vscode'
- '.idea'

comment: on-failure

dependency:
files:
- Cargo.toml
10 changes: 10 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Copyright (c) 2019 jmjoy
# PHPER is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.

fn_args_layout = "Compressed"
format_code_in_doc_comments = true
format_macro_bodies = true
Expand Down
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Copyright (c) 2019 jmjoy
# PHPER is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.

[workspace]
members = [
"phper",
Expand Down
10 changes: 10 additions & 0 deletions examples/hello/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Copyright (c) 2019 jmjoy
# PHPER is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.

[package]
name = "hello"
version = "0.0.0"
Expand Down
10 changes: 10 additions & 0 deletions examples/http-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Copyright (c) 2019 jmjoy
# PHPER is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.

[package]
name = "http-client"
version = "0.0.0"
Expand Down
10 changes: 10 additions & 0 deletions examples/http-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Copyright (c) 2019 jmjoy
# PHPER is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.

[package]
name = "http-server"
version = "0.0.0"
Expand Down
10 changes: 10 additions & 0 deletions examples/logging/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Copyright (c) 2019 jmjoy
# PHPER is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.

[package]
name = "logging"
version = "0.0.0"
Expand Down
10 changes: 10 additions & 0 deletions phper-alloc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Copyright (c) 2019 jmjoy
# PHPER is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.

[package]
name = "phper-alloc"
version = "0.4.0-alpha.3"
Expand Down
10 changes: 10 additions & 0 deletions phper-alloc/src/macros.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2019 jmjoy
// PHPER is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan
// PSL v2. You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
// KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.

/// Wrapper of `EBox::new`.
///
/// # Examples
Expand Down
10 changes: 10 additions & 0 deletions phper-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Copyright (c) 2019 jmjoy
# PHPER is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.

[package]
name = "phper-build"
version = "0.4.0-alpha.3"
Expand Down
10 changes: 10 additions & 0 deletions phper-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Copyright (c) 2019 jmjoy
# PHPER is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.

[package]
name = "phper-macros"
version = "0.4.0-alpha.3"
Expand Down
10 changes: 10 additions & 0 deletions phper-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Copyright (c) 2019 jmjoy
# PHPER is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.

[package]
name = "phper-sys"
version = "0.4.0-alpha.3"
Expand Down
10 changes: 10 additions & 0 deletions phper-test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Copyright (c) 2019 jmjoy
# PHPER is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.

[package]
name = "phper-test"
version = "0.4.0-alpha.3"
Expand Down
10 changes: 10 additions & 0 deletions phper-test/etc/php-fpm.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
; Copyright (c) 2019 jmjoy
; PHPER is licensed under Mulan PSL v2.
; You can use this software according to the terms and conditions of the Mulan
; PSL v2. You may obtain a copy of Mulan PSL v2 at:
; http://license.coscl.org.cn/MulanPSL2
; THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
; KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
; NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
; See the Mulan PSL v2 for more details.

[global]
error_log = /tmp/.php-fpm.log

Expand Down
10 changes: 10 additions & 0 deletions phper/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Copyright (c) 2019 jmjoy
# PHPER is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.

[package]
name = "phper"
version = "0.4.0-alpha.3"
Expand Down
5 changes: 2 additions & 3 deletions phper/src/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ use std::{
convert::TryInto,
marker::PhantomData,
mem::{transmute, zeroed, MaybeUninit},
os::raw::c_int,
str,
};

Expand Down Expand Up @@ -120,7 +119,7 @@ impl ExecuteData {

pub fn get_parameter(&mut self, index: usize) -> &mut ZVal {
unsafe {
let val = phper_zend_call_arg(self.as_mut_ptr(), index as c_int);
let val = phper_zend_call_var_num(self.as_mut_ptr(), index.try_into().unwrap());
ZVal::from_mut_ptr(val)
}
}
Expand Down Expand Up @@ -306,7 +305,7 @@ impl ZVal {
}

fn inner_expect_z_res(&self) -> crate::Result<&mut ZRes> {
if self.get_type_info().is_object() {
if self.get_type_info().is_resource() {
unsafe { Ok(ZRes::from_mut_ptr(phper_z_res_p(self.as_ptr()))) }
} else {
Err(ExpectTypeError::new(TypeInfo::RESOURCE, self.get_type_info()).into())
Expand Down
10 changes: 10 additions & 0 deletions tests/integration/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Copyright (c) 2019 jmjoy
# PHPER is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.

[package]
name = "integration"
version = "0.0.0"
Expand Down