WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #10861, comment 1


Ignore:
Timestamp:
03/05/11 19:40:00 (4 years ago)
Author:
hakre
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #10861, comment 1

    initial v1  
    1 The constructor (PHP 4, PHP 5) still might have errors. In case PHP 5 prefers the class names function instead of the __construct() function (for example for backwards compability reasons, I was not able to clarify that in all details), the register_shutdown_function will be called with PHP 4 and PHP 5. It should only called with PHP 4. 
     1The constructor (PHP 4, PHP 5) still might have errors. In case PHP 5 prefers the class names function instead of the `__construct()` function (for example for backwards compability reasons, I was not able to clarify that in all details), the register_shutdown_function will be called with PHP 4 and PHP 5. It should only called with PHP 4. 
    22 
    3 Additionally, having an empty function (wpdb::__destruct) does not make any sense. This leads to asking oneself: what is all the fuzz about? Constructor, Destructor, NIL. I assume this needs a cleanup. 
     3Additionally, having an empty function (`wpdb::__destruct()`) does not make any sense. This leads to asking oneself: what is all the fuzz about? Constructor, Destructor, NIL. I assume this needs a cleanup. 
    44 
    5 This would also lead to a solution for some other important point: Never register a __destruct function as a shutdown function. This will most often lead to problems (the function is called two times) and errors (the object is already destroyed when the shutdown function is (to be) executed). 
     5This would also lead to a solution for some other important point: Never register a `__destruct()` function as a shutdown function. This will most often lead to problems (the function is called two times) and errors (the object is already destroyed when the shutdown function is (to be) executed). 
    66 
    77Therefore I suggest to remove this all from the object, I will provide a second patch for it.