Git Product home page Git Product logo

Comments (2)

DanNicolau avatar DanNicolau commented on September 24, 2024

Hi, I had the same issue. I tried the getting started example which has the default set to null. It seems that the null eventually leads to a thrown error:

	public static function checkInit()
	{
		if (!self::$initialized)
			throw new SettingsException('DataDragon class was not initialized - version is potentially unknown.');
	}

Maybe there is a way to retrieve the latest version number? If not I may create some functionality since I am creating a project and my intent is to have as little necessary maintenance as possible.

Adding on: I have found this in Riot Documentation:

Data Dragon versions aren't always equivalent to the League of Legends client version. You can determine which version of Data Dragon each region is on by using the realms endpoint within the Static Data API. You can also find all valid Data Dragon versions by using the versions endpoint. Both the realm and versions endpoints draw their information from the corresponding Data Dragon files which can be found in the table below.

-https://developer.riotgames.com/static-data.html

I think this may help resolve your issue. I think the getting started documentation should reflect this functionality.

from riot-api.

dolejska-daniel avatar dolejska-daniel commented on September 24, 2024

Hello, the library needs DataDragonAPI to be initialized for static data calls to work. You can either initialize it by yourself:

DataDragonAPI::initByCdn();
$api = new LeagueAPI(...);
$api->getStaticChampion(203, false, 'en_US');

or let the library initialize DataDragonAPI on its own by specifying option LeagueAPI::SET_DATADRAGON_INIT:

$api = new LeagueAPI([
    LeagueAPI::SET_DATADRAGON_INIT => true,
    ...
]);
$api->getStaticChampion(203, false, 'en_US');

Let me know if this works and close the issue,
Daniel

from riot-api.

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.