Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-21255 Mnet overhaul for Moodle 2.0
  3. MDL-21261

Updates to work with new plugin infrasturcture or moodle installation/upgrading

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: MNet
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Gliffy Diagrams

        Issue Links

          Activity

          mjollnir Penny Leach created issue -
          mjollnir Penny Leach made changes -
          Field Original Value New Value
          Link This issue will be resolved by MDL-19157 [ MDL-19157 ]
          mjollnir Penny Leach made changes -
          Link This issue will be resolved by MDL-19024 [ MDL-19024 ]
          mjollnir Penny Leach made changes -
          Link This issue will be resolved by MDL-18699 [ MDL-18699 ]
          Hide
          skodak Petr Skoda added a comment -

          I think the mnet_publishes() should be itself converted to standard way of describing things in /db/ folder. Take for example new lib/db/services.php - mnet could add new db/mnet.php which would describe published methods/functions. This would instantly add mnet support to all plugins. I suppose it would require multiple changes in mnet table.

          Show
          skodak Petr Skoda added a comment - I think the mnet_publishes() should be itself converted to standard way of describing things in /db/ folder. Take for example new lib/db/services.php - mnet could add new db/mnet.php which would describe published methods/functions. This would instantly add mnet support to all plugins. I suppose it would require multiple changes in mnet table.
          Hide
          mjollnir Penny Leach added a comment - - edited

          ok, i've been having a look at this and I think actually all that needs to happen is the parent_type and parent fields of mdl_mnet_rpc need to be changed. Here's the distinct value of those fields now:

           parent_type |    parent
          -------------+--------------
           auth        | mnet
           enrol       | mnet
           portfolio   | mahara
           repository  | mahara
           repository  | remotemoodle

          The db/mnet.php array would need to still organise methods by "service" - eg auth/mnet would look like:

          $publishes = array(
              'sso_idp' => array(
                  'apiversion' => 1,
                  'methods' => array(
                      'user_authorise',
                      'keepalive_server',
                      // ...
                  ),
              ),
          );

          There might be a bit of mucking around though because at the moment we don't have a standard contract library file for plugins - eg auth has auth/mnet/auth.php and enrol has enrol/mnet/enrol.php and portfolio uses lib.php and questiontypes use questiontype.php etc.

          This has to be specified in the xmlrpc client call - eg

          $mnetrequest->set_method('auth/mnet/auth.php/user_authorise');

          though, so it shouldn't be a problem for the xmlrpc server, it's just a pity that it's not standardised.

          Show
          mjollnir Penny Leach added a comment - - edited ok, i've been having a look at this and I think actually all that needs to happen is the parent_type and parent fields of mdl_mnet_rpc need to be changed. Here's the distinct value of those fields now: parent_type | parent -------------+-------------- auth | mnet enrol | mnet portfolio | mahara repository | mahara repository | remotemoodle The db/mnet.php array would need to still organise methods by "service" - eg auth/mnet would look like: $publishes = array( 'sso_idp' => array( 'apiversion' => 1, 'methods' => array( 'user_authorise', 'keepalive_server', // ... ), ), ); There might be a bit of mucking around though because at the moment we don't have a standard contract library file for plugins - eg auth has auth/mnet/auth.php and enrol has enrol/mnet/enrol.php and portfolio uses lib.php and questiontypes use questiontype.php etc. This has to be specified in the xmlrpc client call - eg $mnetrequest->set_method('auth/mnet/auth.php/user_authorise'); though, so it shouldn't be a problem for the xmlrpc server, it's just a pity that it's not standardised.
          Hide
          mjollnir Penny Leach added a comment -

          Looking into this more, I'm starting to wonder if we need to save more information in the database.

          At the moment, we just save the rpc function in the database. We don't store:

          • Whether it's a function or a method
          • If it's a method, what class it's in
          • If it's a method, whether it's static or not (MDL-16277)
          • What file the method can be found in (MDL-21349)
          Show
          mjollnir Penny Leach added a comment - Looking into this more, I'm starting to wonder if we need to save more information in the database. At the moment, we just save the rpc function in the database. We don't store: Whether it's a function or a method If it's a method, what class it's in If it's a method, whether it's static or not ( MDL-16277 ) What file the method can be found in ( MDL-21349 )
          mjollnir Penny Leach made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          jerome Jérôme Mouneyrac added a comment -

          I don't know what is important for mnet, but just for information for the web service, we save in the db: class name and file name (they are all methods).

          Show
          jerome Jérôme Mouneyrac added a comment - I don't know what is important for mnet, but just for information for the web service, we save in the db: class name and file name (they are all methods).
          Hide
          mjollnir Penny Leach added a comment -

          ok, I'm pretty happy with this now!

          Show
          mjollnir Penny Leach added a comment - ok, I'm pretty happy with this now!
          mjollnir Penny Leach made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Fix Version/s 2.0 [ 10122 ]
          Resolution Fixed [ 1 ]
          mjollnir Penny Leach made changes -
          Link This issue has been marked as being related by MDL-21486 [ MDL-21486 ]
          Hide
          skodak Petr Skoda added a comment -

          I think the upgrade_plugin_mnet_functions() should be moved into lib/upgradelib.php

          Show
          skodak Petr Skoda added a comment - I think the upgrade_plugin_mnet_functions() should be moved into lib/upgradelib.php
          Hide
          mjollnir Penny Leach added a comment -

          Sure, makes no difference to me

          Show
          mjollnir Penny Leach added a comment - Sure, makes no difference to me
          dougiamas Martin Dougiamas made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          QA Assignee nobody
          dougiamas Martin Dougiamas made changes -
          Workflow jira [ 34654 ] MDL Workflow [ 63654 ]
          dougiamas Martin Dougiamas made changes -
          Workflow MDL Workflow [ 63654 ] MDL Full Workflow [ 92899 ]

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10