简体   繁体   中英

Get Stream HttpSignatures\Context Not Found

I'm just a typical non professional PHP guy writing small apps for my website.

I am trying to install GetStream.io but because I don't know how to use composer (actually i tried, but i'm really not a terminal kind of person).

Anyway I couldn't create a autoloader as instructed by GetStream GitHub so I ended up creating my own autoloader.php using some codes pieced together from Stackoverflow.

My code

    <?

    function __autoload_namespaced_module($class) {
        $path = str_replace('\\', '/', $class);

        if (file_exists($file = ( $path . '.php'))) {
            require_once($file);
        }
    }

    spl_autoload_register();
    spl_autoload_register('__autoload_namespaced_module');
    ?>

So yay i learnt something new today on autoload!!!

Until......

Fatal error: Class 'HttpSignatures\\Context' not found in /GetStream/Stream/Signer.php on line 36

So now I know HttpSignatures\\Context should be a php file in the home folder right, or something right but i check Git hub there's no such file....

Anyone encounter same problem and can install this SDK without composer?

Using composer to generate autoload files, or looking for dependencies can be a very difficult task for someone like me who are just using PHP to do simple apps.

I went through the steps in to use composer in MAC OS and it was complicated, very complicated and no idea what i was supposed to do following steps didn't help.

At last, I went online and find online PHP editors, and ended up with PHPStorm which gave me good syntax highlighter etc, and COMPOSER!

Now I finally know what composer is for and how it works.

TLDR: People who are having problem with composer, and have no idea what composer is, can try download PHPStorm for the 30days trial and just use it to generate the needed files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM