peachpiecompiler / peachpie

PeachPie - the PHP compiler and runtime for .NET and .NET Core
https://www.peachpie.io
Apache License 2.0
2.33k stars 202 forks source link

Issues about using require_once on peachpie (how should i do it?) #1036

Closed gabrielesilinic closed 2 years ago

gabrielesilinic commented 2 years ago

i'm making a webapp, i originally wanted to make it all in PHP because that's what the shared hosting service provided,

but now i would like to create the rest of the libraries in C# (because it has a nicer syntax, it's the language i know better, also has a rigid static typing PHP doesn't have and a decent system of getters and setters unlike PHP) while still use PHP to seamlessly generate the dynamic pages (we could say that PHP it's going to be the "middle-end" between the backend libraries and the browser frontend, generating dynamic pages in C# looks a little more tedious)

but all the wonderful require_once paths i used to have inside my code in order to keep it clean don't work as intended anymore, they keep causing runtime errors and i really hate it does something like require_once exists but it's specific for peachpie so everything stops crashing?

i'm talking about calling some PHP functions/classes declared in another PHP file from PHP all running on/via peachpie (i found out how to do it with C# classes, it was a wonderful experience)

i'm extremly confused right now and the documentation on peachpie.io it's very unorganized, most of the stuff i figured out was from blog posts, so i can't find the solution easily by myself (help?)

gabrielesilinic commented 2 years ago

nevermind, i'm stupid, the copy command did not work as expected