We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19388
    • 297 Posts
    Hi,
    I’m totally newbie in this area. I went out of the simple snippets development to this new world, and also Revo, that for me is new too.
    We were discusing before a contribution to have an option like evo had to install some packages just after the MODx install. I’m not going to discuss the idea at this moment. Now I’m learning how to do some things, as I’m starting and learning.
    I’ve been reading the documentation, API, xPDO, Transport Packages, 3rd party components, etc.
    In a first step, I want to show only the avalaible packages from the provider, but I know I had a lot of things to do and I have done the things wrong sad

    I have this code, that I added as component to test:
    <?php
    $modx->setLogLevel(modX::LOG_LEVEL_INFO);  
    $modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');  
    
    $modx->loadClass('transport.modTransportManager','',false, true); 
    $tman = new modTransportManager($modx);  
    $tman->getActiveWorkspace();
    $pak = $tman->scanForPackages();
    print_r($pak);
    print_r($tman->providers);
    ?>


    It shows two empty arrays and some errors:

    [2010-11-19 08:36:48] (ERROR @ /modx204/manager/index.php)

    Could not load class: modWorkspace from transport.mysql.modworkspace.

    [2010-11-19 08:36:48] (ERROR @ /modx204/manager/index.php)

    Could not load class: modWorkspace from transport.mysql.modworkspace.

    [2010-11-19 08:36:48] (ERROR @ /modx204/manager/index.php)

    Invalid class specified:

    [2010-11-19 08:36:48] (ERROR @ /modx204/manager/index.php)

    Could not find an active workspace!

    [2010-11-19 08:36:48] (ERROR @ /modx204/manager/index.php)

    Could not load class: xPDOTransport from transport.xpdotransport.

    [2010-11-19 08:36:48] (ERROR @ /modx204/manager/index.php)

    Could not load class: modWorkspace from transport.mysql.modworkspace.

    [2010-11-19 08:36:48] (ERROR @ /modx204/manager/index.php)

    Could not load class: modWorkspace from transport.mysql.modworkspace.

    [2010-11-19 08:36:48] (ERROR @ /modx204/manager/index.php)

    Invalid class specified:

    [2010-11-19 08:36:48] (ERROR @ /modx204/manager/index.php)

    Could not find an active workspace!

    [2010-11-19 08:36:48] (ERROR @ /modx204/manager/index.php)

    Error 42S22 executing statement:
    Array
    (
    [0] => 42S22
    [1] => 1054
    [2] => Unknown column ’modTransportProvider.disabled’ in ’where clause’
    )

    [2010-11-19 08:36:48] (ERROR @ /modx204/manager/index.php)

    Could not find any active transport providers.

    Array ( ) Array ( )


    I’m pretty sure I have to do more things, like loading the modWorkspace class. But I don’t know what this class is and what it does...

    Any help? Please, be patient, I’m learning! smiley
      • 22303 MODX Staff
      • 10,725 Posts
      I don’t think scanForPackages does what you think it does. What are you trying to accomplish? Getting a list of packages from the modxcms.com transport provider requires some remote calls via cURL or using sockets. See the processor at core/model/modx/processors/workspace/packages/rest/getnodes.php for an example. You may even be able to just use the processor for what you need; see executeProcessor() (or runProcessor() in 2.0.5 and current develop branch at GitHub).
        • 19388
        • 297 Posts
        Thanks. Now I understand it a little bit more. I’ll continue testing smiley