Skip to content

Commit

Permalink
Reorginize classes -> part1
Browse files Browse the repository at this point in the history
Signed-off-by: Dusan Malusev <dusan@dusanmalusev.dev>
  • Loading branch information
CodeLieutenant committed Jan 1, 2024
1 parent fbd386f commit 211fcc6
Show file tree
Hide file tree
Showing 23 changed files with 1,049 additions and 975 deletions.
2 changes: 1 addition & 1 deletion examples/complex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

use phper::{
arrays::ZArray,
classes::{ClassEntity, Visibility},
classes::{entity::ClassEntity, Visibility},
functions::Argument,
ini::{ini_get, Policy},
modules::Module,
Expand Down
2 changes: 1 addition & 1 deletion examples/http-client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use crate::{errors::HttpClientError, request::REQUEST_BUILDER_CLASS};
use phper::{
alloc::ToRefOwned,
classes::{ClassEntity, StaticStateClass, Visibility},
classes::{entity::ClassEntity, StaticStateClass, Visibility},
functions::Argument,
};
use reqwest::blocking::{Client, ClientBuilder};
Expand Down
2 changes: 1 addition & 1 deletion examples/http-client/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// See the Mulan PSL v2 for more details.

use phper::{
classes::{ClassEntity, ClassEntry},
classes::{entity::ClassEntity, entry::ClassEntry},
errors::{exception_class, Throwable},
};

Expand Down
2 changes: 1 addition & 1 deletion examples/http-client/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// See the Mulan PSL v2 for more details.

use crate::{errors::HttpClientError, response::RESPONSE_CLASS};
use phper::classes::{ClassEntity, StaticStateClass, Visibility};
use phper::classes::{entity::ClassEntity, StaticStateClass, Visibility};
use reqwest::blocking::RequestBuilder;
use std::{convert::Infallible, mem::take};

Expand Down
2 changes: 1 addition & 1 deletion examples/http-client/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use crate::errors::HttpClientError;
use phper::{
arrays::{InsertKey, ZArray},
classes::{ClassEntity, StaticStateClass, Visibility},
classes::{entity::ClassEntity, StaticStateClass, Visibility},
values::ZVal,
};
use reqwest::blocking::Response;
Expand Down
2 changes: 1 addition & 1 deletion examples/http-server/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// See the Mulan PSL v2 for more details.

use phper::{
classes::{ClassEntity, ClassEntry},
classes::{entity::ClassEntity, entry::ClassEntry},
errors::{exception_class, Throwable},
};
use std::error::Error;
Expand Down
2 changes: 1 addition & 1 deletion examples/http-server/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

use phper::{
arrays::ZArray,
classes::{ClassEntity, StaticStateClass, Visibility},
classes::{entity::ClassEntity, StaticStateClass, Visibility},
objects::StateObject,
};
use std::convert::Infallible;
Expand Down
2 changes: 1 addition & 1 deletion examples/http-server/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use axum::{
http::{HeaderName, HeaderValue, Response},
};
use phper::{
classes::{ClassEntity, StaticStateClass, Visibility},
classes::{entity::ClassEntity, StaticStateClass, Visibility},
functions::Argument,
objects::StateObject,
};
Expand Down
2 changes: 1 addition & 1 deletion examples/http-server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use axum::{
use hyper::body;
use phper::{
alloc::ToRefOwned,
classes::{ClassEntity, Visibility},
classes::{entity::ClassEntity, Visibility},
functions::Argument,
values::ZVal,
};
Expand Down
5 changes: 3 additions & 2 deletions phper-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use std::{env, ffi::OsStr, fmt::Debug, path::PathBuf, process::Command};

fn main() {
println!("cargo:rerun-if-env-changed=PHP_CONFIG");
println!("cargo:rerun-if-changed=build.rs");
let current_dir = std::env::current_dir().unwrap();
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());

Expand Down Expand Up @@ -41,9 +42,9 @@ fn main() {

builder
.cpp(false)
// .debug(false)
.debug(false)
.files(&c_files)
// .extra_warnings(true)
.extra_warnings(true)
.include("include")
// .flag("-falign-functions")
// .flag("-flto=auto")
Expand Down
4 changes: 1 addition & 3 deletions phper/src/arrays.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,7 @@ impl ZArr {
let ptr = self.as_ptr() as *mut _;
unsafe {
match key {
Key::Index(i) => {
phper_zend_hash_index_exists(ptr, i)
},
Key::Index(i) => phper_zend_hash_index_exists(ptr, i),
Key::Str(s) => {
phper_zend_str_exists(ptr, s.as_ptr().cast(), s.len().try_into().unwrap())
}
Expand Down
Loading

0 comments on commit 211fcc6

Please sign in to comment.