Comments (2)
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.
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)
- Question HOT 1
- Issue on DataDragonAPI::getProfileIcon($id) HOT 17
- Question about Winrate per Champion HOT 2
- Package not working with symfony/console v5 HOT 3
- TFT Implementation HOT 14
- MemCache failed to set key
- Rate limiting - how to handle it? HOT 6
- Third party code endpoint returns 404 not found. HOT 2
- Local DDragon error 500
- Guzzle Update to V7
- Question : Can we select more than one region for init.php ? HOT 2
- [Questions] Proxy and passing region constant thru variable HOT 8
- Using TFT api without needing to set League API Key HOT 2
- PHP 8 Support HOT 7
- Help Wanted SettingsException HOT 5
- A little Help with async request HOT 4
- Help with Tournament Stub HOT 7
- Get object values HOT 8
- getMatchlistByAccount with filters returning 404 HOT 2
- Features Update HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from riot-api.