Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-16579

Search backends are coupled with the acp

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • 4.0.0-a1
    • Search
    • None

      In the search backend, is needed to send the object of the acp module to execute certain actions, so the search backend depends on the acp module that executes it. This makes they cannot be reused in other things like execute it as a command without having to hardcode things.

      I think the solution would be something like to make the search backend methods to return the current status of the action as an array or something each time they are executed, so who executes it handles how to act (continue or not), instead of the search backend.

      I think the result of the solution could be something like this:

      In acp:

       

      $result = $this->create_index(...);
      if($result[post_indexed] == $result['post_total']) {
         //finished, notify it somehow to the frontend (currently the search backend is who do it now)
         // save current status
      } else {
         // just continue, send the meta refresh or something to the frontend
         // save current status
      }
      

      And from the command line

       

      do {
          $result = $this->create_index(...);
      } while($result[post_indexed] == $result['post_total']);
      

       

       

       

            Unassigned Unassigned
            rubencm rubencm
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: