Giter VIP home page Giter VIP logo

Comments (8)

gnello avatar gnello commented on July 25, 2024

Hi @Boffice,
could you provide a code sample to reproduce the problem?
I was not able to replicate the issue.

Thanks.

from php-mattermost-driver.

Boffice avatar Boffice commented on July 25, 2024
private static function getDriver()
{
    static $driverInstance = null;
    
    if ($driverInstance !== null) {
        return $driverInstance;
    }
    
    $container = new \Pimple\Container([
        'driver' => [
            'url' => '*',
            'login_id' => '*',
            'password' => '*',
        ]
    ]);
    
    $driverInstance = new Driver($container);
    $driverInstance->authenticate();
    return $driverInstance;
}


public function add_user()
{
    $driver = $this->getDriver();

    //Add a new user
    $result = $driver->getUserModel()->createUser([
        'email'    => '[email protected]', 
        'username' => 'test', 
        'password' => 'testpsw'
    ]);

    echo $this->print($result);
}

from php-mattermost-driver.

gnello avatar gnello commented on July 25, 2024

Hi @Boffice,
I can not replicate your problem, it seems ok to me. Plus, I did not figure out how is possible to have that kind of error since this library do not use any Laravel package.

I may suggest you to verify where you are using the Illuminate\Container\Container, and try to follow the error stack trace to get to the source of the problem. Let me know if you need any help with this.

If you are using this library whithin Laravel, maybe you can find more suitable the Laravel Mattermost Driver.

from php-mattermost-driver.

Boffice avatar Boffice commented on July 25, 2024

Looks like psr/container conflicts with Illuminate/container, and i am using Codeigniter. Illuminate/Container is needed for other modules and can't be removed.

from php-mattermost-driver.

gnello avatar gnello commented on July 25, 2024

That is ok, but how is this related to the php-mattermost-driver? The code you posted can not generate that kind of error.

from php-mattermost-driver.

Boffice avatar Boffice commented on July 25, 2024

Issue appears once i include require('modules/mattermost/vendor/autoload.php'); to the controller. driver loads psr/container which conflicts with illuminate/container.

even

public function index()
{
  echo 'hello world';
}

Returns same error.

from php-mattermost-driver.

gnello avatar gnello commented on July 25, 2024

Hi @Boffice, sorry for the late response.

Any update on this?

from php-mattermost-driver.

Boffice avatar Boffice commented on July 25, 2024

Hello, was not able to get around this issue.

from php-mattermost-driver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.