MODX3 Processor can't instantiate required class

Hello,

I am trying to instantiate a class inside processor, but I am getting error 500.

Don’t understand why.

thank you in advance for tipps what 's my mistake.

Bye
Chris

<?php

namespace customer\processors\customers;

use MODX\Revolution\Processors\Processor;
use MODX\Revolution\Mail\modPHPMailer;
use MODX\Revolution\Mail\modMail;
use MODX\Revolution\modChunk;
use xPDO\Om\xPDOQuery;
use xPDO\Om\xPDOObject;
use MODX\Revolution\modX;


class sendnewpw extends Processor
{

    public function initialize() {

        include_once $this->modx->getOption('login.core_path',null,$this->modx->getOption('core_path').'components/login/').'model/login/logintest.class.php';

       if ( !class_exists('Logintest') ) {
            $this->modx->log(modX::LOG_LEVEL_ERROR, __FILE__ . ' class Logintest not exits...: '  );
       }else{
            $this->modx->log(modX::LOG_LEVEL_WARN , __FILE__ . ' class Logintest exits...: '  );
            $login = new Logintest();
       }

        return true;
    } 
    

    public function process() {

       return true;
  }

}
<?php
/**
 * Login
 *
 * Copyright 2010 by Shaun McCormick <shaun@modx.com>
 *
 * Login is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option) any
 * later version.
 *
 * Login is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * Login; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA 02111-1307 USA
 *
 * @package login
 */

/**
 * MODx Login Class
 *
 * @package login
 */
class Logintest {


    function __construct(modX &$modx,array $config = array()) {
        $this->modx->log(1, __FILE__ . ' login... __construct: ' );
        return true;
    }

}

Use \Logintest instead (with the backslash at the beginning), so that the class name isn’t relative to the current namespace:

$login = new \Logintest($this->modx);

$this->modx is not defined in the class “Logintest”. Use $modx->log(...).

There’s some information here about MODX 3 processors that might be useful to you (or not).

perfect. thank you for this information. :pray: