473,395 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Migrating OOP php4 -> 5 - $this re-assign - Recreating an instance scope outside

48
Hi, I have another problem migrating to php5.

An important piece of my "web kernel" is a system of include / require throw exceptions :

Instead of : require $x
I do : trigger_error ('INC_'.$x...)

Error_handler :
...
$this = $errcontext ["this"] ; //Error!!!!!
include $x ;
...

It allows me to decide some things, to find dinamically files, to log for debug, ... I liked very much this solution and changing that it's a lot of work.

You can require a file in the code of a class method, and the inserted code fits there transparently. So, how can I emulate this when I've changed the scope temporaly, I'm in a third function.
I have to pass the instance reference from a class method to another scope (function -> error_handler -> included file) keeping the $this reference transparently.

Any ideas?
Thanks
Dec 18 '07 #1
1 1281
vituko
48
I think I've found a possible solution with the runkit extension : runkit_method_add (using a temporary and externally created method). Like aggregate_methods in php4...

Any better solution?

Thanks anyway!
Dec 18 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Klaus Boehmer | last post by:
Hello, I'm trying to install gd2 with gif-support as an extension with php4. I compiled the patched version of gd2 - fine. I compiled php4 with gd=shared - fine. I installed it and restarted...
5
by: somaBoy MX | last post by:
I'm planning on installing the PHP5 RC1 on my local machine as a testing server. Are there any particulars I should be aware of for all my PHP4-developed applications to keep working? Or should the...
0
by: dbmethods | last post by:
I just installed Sybase ASE 11.9.2. I did "apt-get install php4-sybase" and it failed to install. Where I can a stable php4-sybase debian package? Thanks
0
by: bissatch | last post by:
Hi, I have installed Apache2. I have installed PHP4.3.0. All is working fine. I have now went and tried to install DOMXML into PHP by simply uncommenting the extension = php_domxml.dll (or...
1
by: dk_sz | last post by:
Is it just me... Or is PHP5 XML very limited? Or am I missing something very obvious? Any way to use PHP4 Dom XML in PHP5? Does anyone know why support for it was dropped? I have following...
2
by: dk_sz | last post by:
Can anyone point me to a guide or something for conversion? I tryed http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/index.en.html but it doesn't work (not all parts anyway) - and as I...
0
by: _andrea.l | last post by:
I'd like to use php5 but at my work we use PHP4. How can use both togheter? I work whith Linux Fedora 4 then I have PHP5 installed so how can install PHP4 and use PHP5 for my experiment and PHP4...
4
by: Andy Baxter | last post by:
hello, I'm using the php4-mysql module with php4 under debian linux (sarge). I have a script, schedule.php, which runs fine when I invoke it from the command line, but fails with the error: ...
2
by: Stefan Huber | last post by:
Hi I've got a really strange problem, and can't find out why it's not working as intended. in order to use php4 and 5 together on a webserver and the requirement for running as different...
3
by: jmark | last post by:
I am currently running php 4.4.7 in windows xp and apache 2. If I enter php in command line. I get the following error The application has failed to start because php5ts.dll was not found" I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.