Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-10313

eZMySQLDB constructor does not exit always if mysql extension is not available

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 3.10.0alpha1, 3.8.8, 3.9.2
    • 3.8.7, 3.9.1, 3.9.1rc1
    • Misc
    • None

    Description

      If the PHP mysql extension is not loaded, the eZMySQLDB class does exit in its constructor when the function eZAppendWarningItem exists (web interface, defined in index.php), but not when that function does not exist, for example in cronjobs. So if the mysql extension is not loaded the runcronjobs script will fail with a fatal error, but you can't see why, even not in the debug output. mysql_connect will cause the fatal error because the function is not available, but it won't show the message due to the @ before the function call.

      Proposed solution: besides using eZAppendWarningItem, the constructor should also write its error message to the debug output and always return wether eZAppendWarningItem exists or not.

      On some distros different php.ini files are used for the webserver and the CLI, so this bug can cause you some serious headache if you don't know what's happening.

      Attachments

        Activity

          People

            cyberwolf cyberwolf
            cyberwolf cyberwolf
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: