Menu

#611 WorkingWiki context object

workingwiki
open
None
5
2014-09-30
2014-09-30
Lee Worden
No

Creating a global (for now) object that records the state of WW processing, getting us away from using a bunch of global variables and static class methods.

Related

Bugs: #610

Discussion

  • Lee Worden

    Lee Worden - 2014-09-30

    Should I build it into MediaWiki's RequestContext object, or keep it separate?

    Well, the business of using it without MediaWiki seems to answer that one. Never mind.

     
  • Lee Worden

    Lee Worden - 2014-09-30

    Anway, so I'm going to make WW use a global $wwContext, which is an object with member variables $wwContext->wwInterface and $wwContext->wwStorage, and others to come.

    I may want to move all the config variables $wwEnableWhatever into that object as well, at some point.

     
  • Lee Worden

    Lee Worden - 2014-09-30

    A problem with this is how to call the MW hooks. They are WWInterface class methods currently. I think maybe I'll redo that by putting anonymous functions in the hook data structure instead of names of class methods.

     
  • Lee Worden

    Lee Worden - 2014-09-30

    I am doing a replace of WWInterface:: to $wwContext->wwInterface->.

    After that, I'll need to

    • replace WWStorage by $wwContext->wwStorage->
    • put global wwContext; declaration into all functions that need it.
    • replace ->$ by -> and make sure the static variables that I'm changing to member variables are set up appropriately.
    • write constructors
    • change 'public static' functions to just 'public'
    • fix all the hooks, including those that are set on-the-fly in various special pages' code, etc.
    • There may be a few other places such as function callbacks where e.g. 'WWStorage::' appears in a string. get these right.
    • test everything pretty assertively.
    • update the documentation that refers to these things (in the Developer Documentation pages).
     

    Last edit: Lee Worden 2014-09-30
    • Lee Worden

      Lee Worden - 2014-09-30

      replace ->$ by -> and make sure the static variables that I'm changing to member variables are set up appropriately.

      Occurrences of ->$

      WWInterface:

      • default_project_name
      • cache_file_contents
      • dynamic_placeholder_counter
      • error_queue
      • projects_to_lock
      • uniq_tokens
      • projects_list_from_db
      • projects_to_list
      • modified_projects
      • projects_in_use
      • projects_to_update_archived_project_files

      wwStorage:

      • currently_parsing_key
      • archiving_in_progress
      • pagetext_cache
      • to_archive
      • seq_dir
       
    • Lee Worden

      Lee Worden - 2014-10-01
      • replace WWStorage by $wwContext->wwStorage->
      • put global wwContext; declaration into all functions that need it.
      • replace ->$ by -> and make sure the static variables that I'm changing to member variables are set up appropriately.
      • write constructors
      • change 'public static' functions to just 'public'
      • fix all the hooks, including those that are set on-the-fly in various special pages' code, etc.
      • There may be a few other places such as function callbacks where e.g. 'WWStorage::' appears in a string. get these right.

      done

      • test everything pretty assertively.
      • update the documentation that refers to these things (in the Developer Documentation pages).

      not done

       

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.