Uploaded image for project: 'CUBRID APIs'
  1. CUBRID APIs
  2. APIS-97

In PHP calling is_resource($conn) function when $conn = cubrid resource, always returns "Unknown"

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: PHP-8.4.1
    • Fix Version/s: PHP-8.4.1, PHP-Apricot
    • Component/s: PHP Driver
    • Labels:
      None
    • Environment:

      PHP all versions

      Description

      In PHP 5.3.x so far CUBRID Resource is not officially registered as PHP Resource. Therefore calling is_resource($conn) always returns "Unknown" even if $conn is active CUBRID connection.

      I suggest to commit a patch to PHP core which introduces CUBRID Resource. See the above page for reference.

        Issue Links

          Activity

          Hide
          kadishmal Esen Sagynov added a comment -

          The following is the code I currently use as a workaround to determine if the object is an active resource.

          {code}
          if (is_resource($this->result_id) || get_resource_type($this->result_id) == "Unknown" && preg_match('/Resource id #/', strval($this->result_id)))
          {
               // this is an active resource
          }{code}
          Show
          kadishmal Esen Sagynov added a comment - The following is the code I currently use as a workaround to determine if the object is an active resource. {code} if (is_resource($this->result_id) || get_resource_type($this->result_id) == "Unknown" && preg_match('/Resource id #/', strval($this->result_id))) {      // this is an active resource }{code}
          Hide
          hellohuizhang 张慧 added a comment -

          Commit rev: 444

          Show
          hellohuizhang 张慧 added a comment - Commit rev: 444
          Hide
          hellohuizhang 张慧 added a comment -

          We have resolved this issue on PHP-8.4.1 and PHP-Apricot.

          Thank you!

          Show
          hellohuizhang 张慧 added a comment - We have resolved this issue on PHP-8.4.1 and PHP-Apricot. Thank you!

            People

            • Assignee:
              hellohuizhang 张慧
              Reporter:
              kadishmal Esen Sagynov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: