Viewed   109 times

I want to execute a php-script from php that will use different constants and different versions of classes that are already defined.

Is there a sandbox php_module where i could just:

sandbox('script.php'); // run in a new php environment

instead of

include('script.php'); // run in the same environment

Or is proc_open() the only option?

PS: The script isn't accessible through the web, so fopen('http://host/script.php') is not an option.



There is runkit, but you may find it simpler to just call the script over the command line (Use shell_exec), if you don't need any interaction between the master and child processes.

Monday, October 24, 2022

Just in case someone else has this trouble, my findings are:

There is nothing to solve -- the sandbox is just really slow, sometimes it took a couple days for the profile to become active and send the IPN. In other words, sandbox isn't good to test these functions at all, just go live and refund a couple tests. Even live sometimes takes a bit of time... I've seen it take a few hours sometimes, so don't go crazy.

Monday, September 19, 2022

It's the difference for new php 5.4 Found the answer here

Had to replace the function_entry with static zend_function_entry

Works now.

Monday, October 10, 2022

You should be able access the table names from the sqlite_master table.

SELECT name FROM sqlite_master WHERE type='table';

The names of the columns are not directly accessible. The easiest way to get them is to query the table and get the column names from the query result.

SELECT * FROM table_name LIMIT 1;
Saturday, September 17, 2022

Some of the methods of inspect module are well-suited for this purpose:

import module
import inspect
src = inspect.getsource(module)
Saturday, November 19, 2022
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :