hot to set disable_functions like php?
3 posts
• Page 1 of 1
hot to set disable_functions like php?
for some security problems , I want to disable some functions
I didn't find relevant settings in web.config
so if i's possible ,how to ?
thx!!
Adesun
I didn't find relevant settings in web.config
so if i's possible ,how to ?
thx!!
Adesun
- adesun
- Posts: 11
- Joined: April 23rd, 2012, 3:22 am
Re: hot to set disable_functions like php?
"disable_functions" option is currently not supported.
However it is possible to modify a set of declared functions by implementing simple library in C#. So if you know C# and you are working on a Web application:
Just hook into delegate PHP.Core.RequestContext.RequestBegin
Do it in some code that executes ideally once - when your (web)application starts, before first request is processed (e.g. in global.asax, Application_OnStart).
In the function {...}, you can add/remove functions from the dictionary
RequestBegin is called after all the configuration is loaded, before request is processed, and before any compilation begins, so you are free to alter set of functions that will be used during request.
However it is possible to modify a set of declared functions by implementing simple library in C#. So if you know C# and you are working on a Web application:
Just hook into delegate PHP.Core.RequestContext.RequestBegin
- Code: Select all
PHP.Core.RequestContext.RequestBegin += () => {...};
Do it in some code that executes ideally once - when your (web)application starts, before first request is processed (e.g. in global.asax, Application_OnStart).
In the function {...}, you can add/remove functions from the dictionary
- Code: Select all
ApplicationContext.Default.Functions
RequestBegin is called after all the configuration is loaded, before request is processed, and before any compilation begins, so you are free to alter set of functions that will be used during request.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: hot to set disable_functions like php?
got it !
thank you very much!
- adesun
- Posts: 11
- Joined: April 23rd, 2012, 3:22 am
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 11 guests