I would really like to see this code change go through, or at least have a plugin we could install. This way you wont have to worry about others with this code, obviously this isnt a majority that needs this fix. Marius if you implemented that fix would it work correctly with the output buffer? If so I don't think they would mind if you created a plugin to modify these files to allow the output buffer to work.
However it would be nice to see it just in PHPBB if it does not hurt anything.
Outbuffering for integration with Joomla and errors
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Re: Outbuffering for integration with Joomla and errors
actually there is no need to add a default to the switch statement, all that is needed to add a "return" statement in the phpBB3 home directory files:
Cheers, Marius
Code: Select all
if (something)
{
trigger_error(...);
//add a return statement for a clean exit
return;
}
code that must not be executed if something is true
Re: Outbuffering for integration with Joomla and errors
The return; is working for you on all points "it is needed"? (Haven't investigated yet where it would be needed)
Re: Outbuffering for integration with Joomla and errors
In the posting.php file there are 20 occurrences of trigger_error(), which need a return statement after it to allow for a clean exit (as the trigger_error statement would normally call exit as part of the exit hook) . We are now identifying the other types of calls that normally result in phpBB3 exiting, such as the statements that render output.
It is needed because I need to have the exit statement commented out at the bottom of the includes/functions.php file (this crashes Joomla when integrating with phpBB3). When I remove the exit statement, PHP returns to the file in the phpBB3 that was called by the user and will continue to execute code while it was supposed to have died already. Adding a return, will allow for the commenting out if the exit statement, while still stopping the phpBB3 at the correct point.
We are using the posting.php as a proof of principle at the moment and I believe that it should work just fine. When a new phpBB3 version is released however, would it require us to make these modifications all over again?
Thanks, Marius
It is needed because I need to have the exit statement commented out at the bottom of the includes/functions.php file (this crashes Joomla when integrating with phpBB3). When I remove the exit statement, PHP returns to the file in the phpBB3 that was called by the user and will continue to execute code while it was supposed to have died already. Adding a return, will allow for the commenting out if the exit statement, while still stopping the phpBB3 at the correct point.
We are using the posting.php as a proof of principle at the moment and I believe that it should work just fine. When a new phpBB3 version is released however, would it require us to make these modifications all over again?
Thanks, Marius
Re: Outbuffering for integration with Joomla and errors
I think your simply using the wrong approach to integration. Anyway, if it's not too much of a change I guess we can consider doing it. But I would have thought that there are many more such places.
Re: Outbuffering for integration with Joomla and errors
The proof of principle works and I have attached the modified posting.php to this post. As you can see with some minor changes phpBB3 can have a clean exit. (you will also need to comment out the exit statement in /includes/function.php exit hook).
With regards to alternative methods, output buffer methods don't work, Joomla is too complex to resume the rendering of Joomla in a phpBB3 exit hook and cURL implementation is problematic. Have you got any other suggestions if you think this is a wrong approach?
Does phpBB have a restriction on distributing modified source files? Ideally these simple changes can be included in the official phpBB3 release and save us many hours of modification with each new phpBB3 release.
Cheers, Marius
With regards to alternative methods, output buffer methods don't work, Joomla is too complex to resume the rendering of Joomla in a phpBB3 exit hook and cURL implementation is problematic. Have you got any other suggestions if you think this is a wrong approach?
Does phpBB have a restriction on distributing modified source files? Ideally these simple changes can be included in the official phpBB3 release and save us many hours of modification with each new phpBB3 release.
Cheers, Marius
- Attachments
-
posting.php.txt
- (55.22 KiB) Downloaded 698 times
Re: Outbuffering for integration with Joomla and errors
I do not think we will comment it out there... since you can hook the function and return a value. We still want the vanilla product to exit; instead of return;mariusvr wrote:The proof of principle works and I have attached the modified posting.php to this post. As you can see with some minor changes phpBB3 can have a clean exit. (you will also need to comment out the exit statement in /includes/function.php exit hook).

The updater in phpBB3 is capable of detecting modifications and capable of not touching them.Does phpBB have a restriction on distributing modified source files? Ideally these simple changes can be included in the official phpBB3 release and save us many hours of modification with each new phpBB3 release.

But you are right... having the changes in the core would be preferred.
Re: Outbuffering for integration with Joomla and errors
Just come by and say its great that you support Marius for this!
Best rgds!


Best rgds!
Re: Outbuffering for integration with Joomla and errors
Great news: adding the return statments has allowed for a clean phpBB3 exit and for the visual integration into Joomla. Here is the result in action:
http://www.jfusion.org/phpbb3
The modded file only work if you haven't modded any files in the phpBB3 home directory before though. Would it be possible to have a regex type replacement in a phpBB3 mod:
This way we can just do a search any replace on the exisiting phpBB3 code. I'm not familiar with the phpBB3 mod engine, so I would appreciate some insight if this would be possible.
Thanks, Marius
http://www.jfusion.org/phpbb3
The modded file only work if you haven't modded any files in the phpBB3 home directory before though. Would it be possible to have a regex type replacement in a phpBB3 mod:
Code: Select all
$regex[] = '#trigger_error\((.*?)\);#';
$replace[] = ''#trigger_error\($1\);return;#';
Thanks, Marius
Re: Outbuffering for integration with Joomla and errors
Hi there phpBB Devs
I would really like to know what you guys feel about the edits proposed by Marius? We have temporarily removed the modification from our forums as it was hampering our Support capabilities(We were testing on our Support Forums!
) but we can assure you that it will work as Marius posted in the last post! The changes that we have proposed are way too big for a person to apply using a phpBB Mod. Also it could jeopardise the user's forum. But the request for this Frameless integration is huge(Our forums are testament of this claim)! Will give phpBB a great way to expand. Joomla is the biggest CMS in the world while phpBB is the biggest forum software. This is the last roadblock as far as a complete integration is concerned. Would be great to see something positive from you guys sometime soon(We already have implemented this for SMF with ease).
I would really like to know what you guys feel about the edits proposed by Marius? We have temporarily removed the modification from our forums as it was hampering our Support capabilities(We were testing on our Support Forums!
