Created
December 17, 2015 09:57
-
-
Save samsamm777/69673580ef7c03c2e34e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// setup file cache - CCP wants you to respect their cache timers, meaning | |
// some of the API Pages will return the same data for a specific while, or worse | |
// an error. If you use one of the availabe caching implementations, | |
// pheal will do the caching transparently for you. | |
// in this example we use the file cache, and configure it so it will write the cache files | |
// to /tmp/phealcache | |
Config::getInstance()->cache = new \Pheal\Cache\FileStorage('cache/'); | |
// The EVE API blocks applications which cause too many errors. Requesting a page | |
// that the API key does not allow to request is one of those possible errors. | |
// Pheal can be configured so pheal will request the AccessMask of a specific key | |
// and block requests to API Pages not covered by that key. | |
Config::getInstance()->access = new \Pheal\Access\StaticCheck(); | |
// create pheal object with default values | |
// so far this will not use caching, and since no key is supplied | |
// only allow access to the public parts of the EVE API | |
// | |
// in this example, instead of using the scopenameScope getter, | |
// we set the scope directly in the constructor | |
$pheal = new Pheal($keyID, $vCode, "char"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment