php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #59160 function that behaves like an include, but is a function
Submitted: 2010-04-13 22:12 UTC Modified: 2010-04-14 16:39 UTC
From: alecgorge at gmail dot com Assigned:
Status: Closed Package: bcompiler (PECL)
PHP Version: 5.3.2 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: alecgorge at gmail dot com
New email:
PHP Version: OS:

 

 [2010-04-13 22:12 UTC] alecgorge at gmail dot com
Description:
------------
Bcompiler has a handy 'bool bcompiler_read  (  resource $filehandle  )'.

Would it be possible to have something like 'bool bcompiler_include ( resource $filehandle )', that would behave like include, where it would include the whole file, just as if it wasn't bcompiled.

Since the code for handling included files in their entirety already exists, and you have other code that handles fopen resources quite nicely, it shouldn't be too much code to implement my request. I am no PHP C guru by anymeans, but I have fixed some bugs before in other extensions.

This would be very useful for people who want to distribute a commercial php, mixed in with public php.

If you can at least give me a few tips (what functions to look in, etc) to point me the right direction, I might be able to do this myself (but most likely not).

Reproduce code:
---------------
not relevant

Expected result:
----------------
not relevant


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-13 23:29 UTC] alan at akbkhome dot com
have a look at bcompiler.c
line 1286:PHP_FUNCTION(bcompiler_load)

It would not take to much playing around to get that to work, 
and accept a resource or a string - and behave acordingly
 [2010-04-14 06:03 UTC] val@php.net
You see, the include() handling in PHP/Zend sources is tricky and changes over time. Duplicating it in bcompiler isn't desirable, because it will pose compatibility issues.

What's the problem with just using include() for bcompiled files? Maybe we can start with it, and develop a suitable solution to this problem?
 [2010-04-14 16:39 UTC] alecgorge at gmail dot com
I see what you mean Val. I don't know what I was thinking! I thought it didn't work with different protocols, but I think my test was setup wrong, because now that it is the afternoon and I am actually awake, everything is working fine. Submitting bugs at 1 am just isn't a smart thing!

I have gone ahead and closed this bug. Thanks for not actually trying to understand my problem instead of just telling me I am stupid!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 09:01:26 2024 UTC