Giter Site home page Giter Site logo

Comments (3)

Spomky avatar Spomky commented on May 9, 2024

It looks like you forgot to include the autoload.php file generated by composer (see in the vendor directory).

<?php

include_once(__DIR__.'/vendor/autoload.php');

use OTPHP\TOTP;
$otp = TOTP::create();

from otphp.

royjr avatar royjr commented on May 9, 2024

Silly me.. I actually had the autoload, but forgot to include that here..
require 'vendor/autoload.php';
and
include_once(__DIR__.'/vendor/autoload.php');

still same error..
Fatal error: Uncaught Error: Call to undefined method OTPHP\TOTP::create() ...

The following works fine for me..
$totp = new TOTP('test',$mySecret,30,'sha1',6);

So it seems as if your changes to 9.0 are not being recognized. To help with some background info.. I used composer to install before realizing I only had php7.0.. so I reinstalled XAMPP completely, verified its using the right php directory and that it was the correct version.. composer update.. and this is where im stuck at. oh wait!

found this in composer's installed.json..
"name": "spomky-labs/otphp", "version": "v8.3.0", "version_normalized": "8.3.0.0",

Yes.. I was doing something stupid. So.. I used a symbolic link before upgrading XAMPP.. and I imported a new htdocs directory.. so I upgraded composer in my backup directory =/

Well, all seems to be working now. Great Work!

from otphp.

Spomky avatar Spomky commented on May 9, 2024

Closing as it seems that you found how to solve that.
Feel free to reopen if needed.

Thanks.

from otphp.

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.