Including a 3rd party php api

Discussion in 'Developing, APIs and extending' started by Ian R, Sep 10, 2012.

  1. Ian R

    Ian R New Member

    I'm trying to write a small app into my helpdesk but I'm wanting to use sphinxsearch for full-text searching. Is there a way to use include or require within the swift framework? It seems to try but then doesn't actually work. I'm guessing this may be by design but I really have no clue. Does anyone know how to use include(blahblah.php); with kayako?

    I am quite new to kayako as well as php programming so I may be missing something simple.

    Thanks,

    Ian
     
  2. ad_amin

    ad_amin Established Member

    Hi,
    You can put it under __swift/thirdparty directory and then include it like this:
    PHP:
    require_once ('./' SWIFT_BASEDIRECTORY '/' SWIFT_THIRDPARTYDIRECTORY '/plugin/plugin.php');
    or you can add this as a library and put it under __swift/library and then load it by calling:
    PHP:
    SWIFT_Loader::LoadLibrary('libraryname:librarymainfile');
    You can check other libraries to see how they are structured.
     
  3. Ian R

    Ian R New Member

    Excellent, seems to be working now. Thanks.
     

Share This Page