├── .gitignore ├── LICENSE ├── README.md ├── SteamApi ├── App.php ├── Client.php ├── Containers │ ├── Achievement.php │ ├── App.php │ ├── Game.php │ ├── Player.php │ └── Player │ │ ├── Bans.php │ │ └── Level.php ├── Exceptions │ ├── ApiArgumentException.php │ └── ApiCallFailedException.php ├── Interfaces │ ├── IApp.php │ ├── INews.php │ ├── IPlayer.php │ ├── IUser.php │ └── User │ │ └── IStats.php ├── News.php ├── Player.php ├── User.php └── User │ └── Stats.php ├── composer.json ├── composer.lock ├── phpunit.xml ├── test-steam-api-key.php_sample ├── tests ├── SteamApi │ ├── AppTest.php │ ├── ClientTest.php │ ├── NewsTest.php │ ├── PlayerTest.php │ ├── User │ │ └── StatsTest.php │ └── UserTest.php ├── TestBootstrap.php └── UnitTestCase.php └── wercker.yml /.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | test-steam-api-key.php 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Joao Lopes 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![wercker status](https://app.wercker.com/status/b2600b2d77b8d35f086f6554f402739c/m/master "wercker status")](https://app.wercker.com/project/bykey/b2600b2d77b8d35f086f6554f402739c) 2 | 3 | # About 4 | PHP Wrapper to communicate with Steam Web API 5 | 6 | # SteamID64 Finder 7 | Please refer to [http://steamid.co/](http://steamid.co/) or [http://steamidconverter.com/](http://steamidconverter.com/) to find the user steam id. 8 | 9 | 10 | # Install 11 | Add to your composer.json 12 | 13 | ``` 14 | { 15 | "require": { 16 | "jocolopes/steamapi": "dev-master" 17 | } 18 | } 19 | ``` 20 | 21 | 22 | # Usage 23 | 24 | ## User Class 25 | ``` 26 | $user = new \SteamApi\User('YOUR-STEAM-KEY', 'THE-STEAMID64'); 27 | ``` 28 | #### Get Player Bans 29 | ``` 30 | $user->GetPlayerBans(); 31 | // OR 32 | $user->GetPlayerBans('THE-FIRST-STEAMID64,THE-SECOND-STEAMID64,THE-ANY-STEAMID64'); 33 | ``` 34 | 35 | #### Get Player Summaries 36 | ``` 37 | $user->GetPlayerSummaries(); 38 | // OR 39 | $user->GetPlayerSummaries('THE-FIRST-STEAMID64,THE-SECOND-STEAMID64,THE-ANY-STEAMID64'); 40 | ``` 41 | 42 | #### Get Friend List 43 | ``` 44 | $user->GetFriendList(); 45 | ``` 46 | 47 | #### Get UserGroup List 48 | ``` 49 | $user->GetUserGroupList(); 50 | ``` 51 | 52 | #### ResolveVanityUrl 53 | ``` 54 | $user->ResolveVanityUrl('id-of-user-to-translate-into-steam-id'); 55 | // Example 56 | $user->ResolveVanityUrl('pr00fgames'); // Result: 76561197963455129 57 | ``` 58 | 59 | ## Player Class 60 | ``` 61 | $player = new \SteamApi\Player('YOUR-STEAM-KEY', 'THE-STEAMID64'); 62 | ``` 63 | 64 | #### Get Steam Level 65 | ``` 66 | $player->GetSteamLevel(); 67 | ``` 68 | 69 | #### Get Player Level Details 70 | ``` 71 | $player->GetPlayerLevelDetails(); 72 | ``` 73 | 74 | #### Get Badges 75 | ``` 76 | $player->GetBadges(); 77 | ``` 78 | 79 | #### Get Community Badge Progress 80 | ``` 81 | $player->GetCommunityBadgeProgress(); 82 | ``` 83 | 84 | #### Get Owned Games 85 | ``` 86 | $player->GetOwnedGames(); 87 | ``` 88 | 89 | #### Get Recently Played Games 90 | ``` 91 | $player->GetRecentlyPlayedGames(); 92 | ``` 93 | 94 | #### Is Playing Shared Game 95 | ``` 96 | $player->IsPlayingSharedGame($gameId); 97 | ``` 98 | 99 | ## News Class 100 | ``` 101 | $news = new \SteamApi\News('YOUR-STEAM-KEY'); 102 | ``` 103 | 104 | #### Get News For App 105 | 106 | ``` 107 | $news->GetNewsForApp($appId[, $numberOfNews, $maxLength]); // Last 2 arguments are optional 108 | ``` 109 | 110 | 111 | ## App Class 112 | 113 | ``` 114 | $app = new \SteamApi\App('YOUR-STEAM-KEY'); 115 | ``` 116 | 117 | #### Get App Details 118 | ``` 119 | $app->appDetails($appId); 120 | ``` 121 | 122 | #### Get Servers At Address 123 | ``` 124 | $app->GetServersAtAddress($address); // Hostname or IP:Port 125 | ``` 126 | 127 | #### Get App List 128 | ``` 129 | $app->GetAppList(); 130 | ``` 131 | 132 | 133 | #### Check for up to date application 134 | ``` 135 | $app->UpToDateCheck($appId, $appVersion); 136 | ``` 137 | 138 | ## User Stats 139 | ``` 140 | $stats = new Stats('YOUR-STEAM-KEY', 'THE-STEAMID64'); 141 | ``` 142 | 143 | #### Get Global Stats For Game 144 | ``` 145 | $stats->GetGlobalStatsForGame($gameId, array('STATS-NAME')); 146 | // Example 147 | $stats->GetGlobalStatsForGame(17740, array('global.map.emp_isle')); 148 | ``` 149 | 150 | #### Get Number Of Current Players 151 | ``` 152 | $stats->GetNumberOfCurrentPlayers($appId); 153 | ``` 154 | 155 | #### Get Schema For Game 156 | ``` 157 | $stats->GetSchemaForGame($appId); 158 | ``` 159 | 160 | #### Get Player Achievements 161 | ``` 162 | $stats->GetPlayerAchievements($appId); 163 | ``` 164 | 165 | #### Get Global Achievement Percentages For App 166 | ``` 167 | $stats->GetGlobalAchievementPercentagesForApp($appId); 168 | ``` 169 | 170 | #### Get User Stats Fo rGame 171 | ``` 172 | $stats->GetUserStatsForGame($appId); 173 | ``` 174 | 175 | # More Info 176 | Please Refer to the tests folder to get more information on how to use the library 177 | 178 | # Objective 179 | The objective of this library is to wrap the steam web API into a php object. 180 | 181 | There are some missing methods that I plan to implement soon. 182 | 183 | Feel free to add some missing methods and as for a pull request on this repo. 184 | 185 | The missing methods can be found using the [swissapiknife](https://github.com/Lagg/steam-swissapiknife). 186 | 187 | 188 | # FAQ 189 | 190 | ## Do I need anything special to use this library? 191 | You do need PHP 5.4+ and composer. You also need to load the `vendor/autoload.php` into your project. 192 | 193 | ## Will this work on my framework? 194 | This library is framework agnostic, maybe the framework you're using requires some aditional setup. 195 | 196 | If your framework uses composer you should be good to go. But let me know if you run into any troubles. 197 | 198 | ## Found a bug, what should I do? 199 | If you have the capacity to fix it yourself by all means do and create a pull request. 200 | 201 | If you don't, raise an issue on github and me or someone else will try to fix it. -------------------------------------------------------------------------------- /SteamApi/App.php: -------------------------------------------------------------------------------- 1 | url = 'http://store.steampowered.com/'; 21 | $this->interface = 'api'; 22 | $this->method = 'appdetails'; 23 | $this->version = null; 24 | 25 | $arguments = [ 26 | 'appids' => $appid 27 | ]; 28 | 29 | $client = $this->setUpClient($arguments); 30 | $apps = $this->convertToObjects($client); 31 | 32 | return count($apps) == 1 ? $apps[0] : $apps; 33 | } 34 | 35 | public function GetAppList() 36 | { 37 | $this->url = "http://api.steampowered.com/"; 38 | $this->interface = 'ISteamApps'; 39 | $this->method = __FUNCTION__; 40 | $this->version = 2; 41 | 42 | $client = $this->setUpClient(); 43 | 44 | return $client->applist->apps; 45 | } 46 | 47 | public function GetServersAtAddress($addressOrIp) 48 | { 49 | $this->url = "http://api.steampowered.com/"; 50 | $this->interface = 'ISteamApps'; 51 | $this->method = __FUNCTION__; 52 | $this->version = 1; 53 | 54 | $arguments = [ 55 | 'addr' => $addressOrIp 56 | ]; 57 | 58 | $client = $this->setUpClient($arguments)->response; 59 | 60 | return $client->servers; 61 | } 62 | 63 | public function UpToDateCheck($appId, $version){ 64 | $this->url = "http://api.steampowered.com/"; 65 | $this->interface = 'ISteamApps'; 66 | $this->method = __FUNCTION__; 67 | $this->version = 1; 68 | 69 | $arguments = [ 70 | 'appid' => $appId, 71 | 'version' => $version 72 | ]; 73 | 74 | $client = $this->setUpClient($arguments)->response; 75 | 76 | return $client; 77 | 78 | } 79 | 80 | protected function convertToObjects($apps) 81 | { 82 | $cleanedApps = array(); 83 | 84 | foreach ($apps as $app) { 85 | $cleanedApps[] = new AppContainer($app->data); 86 | } 87 | 88 | usort($cleanedApps, function($a, $b) 89 | { 90 | return strcmp($a->name, $b->name); 91 | }); 92 | 93 | return $cleanedApps; 94 | } 95 | } -------------------------------------------------------------------------------- /SteamApi/Client.php: -------------------------------------------------------------------------------- 1 | client = new GuzzleClient(); 28 | $this->apiKey = $steamApiKey; 29 | } 30 | 31 | public function getApiKey(){ 32 | return $this->apiKey; 33 | } 34 | 35 | public function buildUrl($version = false) 36 | { 37 | $url = $this->url; 38 | if ($this->interface) { 39 | $url .= $this->interface . '/'; 40 | } 41 | 42 | if ($this->method){ 43 | $url .= $this->method . '/'; 44 | } 45 | 46 | if ($version) { 47 | return $url . 'v'. $this->version . '/'; 48 | } 49 | 50 | return $url; 51 | } 52 | 53 | public function setUpService($arguments = null){ 54 | if ($arguments == null) { 55 | throw new ApiArgumentRequiredException(); 56 | } 57 | 58 | $parameters = [ 59 | 'key' => $this->apiKey, 60 | 'format' => $this->apiFormat, 61 | 'input_json' => $arguments, 62 | ]; 63 | 64 | $steamUrl = $this->buildUrl(true); 65 | 66 | $parameters = http_build_query($parameters); 67 | 68 | try{ 69 | $response = $this->client->get($steamUrl . '?' . $parameters); 70 | $response = $this->prepareResponse($response); 71 | } catch (ClientException $e) { 72 | throw new ApiCallFailedException($e->getMessage(), $e->getResponse()->getStatusCode(), $e); 73 | } 74 | catch (ServerException $e) { 75 | throw new ApiCallFailedException('Api call failed to complete due to a server error.', $e->getResponse()->getStatusCode(), $e); 76 | 77 | } catch (Exception $e) { 78 | throw new ApiCallFailedException($e->getMessage(), $e->getCode(), $e); 79 | } 80 | 81 | return $response->body; 82 | } 83 | 84 | public function setUpClient(array $arguments = array()){ 85 | $versionFlag = ! is_null($this->version); 86 | $steamUrl = $this->buildUrl($versionFlag); 87 | 88 | $parameters = [ 89 | 'key' => $this->apiKey, 90 | 'format' => $this->apiFormat 91 | ]; 92 | 93 | if (! empty($arguments)) { 94 | $parameters = array_merge($parameters, $arguments); 95 | } 96 | 97 | $parameters = http_build_query($parameters); 98 | 99 | try { 100 | $response = $this->client->get($steamUrl . '?' . $parameters); 101 | $response = $this->prepareResponse($response); 102 | } catch (ClientException $e) { 103 | throw new ApiCallFailedException($e->getMessage(), $e->getResponse()->getStatusCode(), $e); 104 | } 105 | catch (ServerException $e) { 106 | throw new ApiCallFailedException('Api call failed to complete due to a server error.', $e->getResponse()->getStatusCode(), $e); 107 | 108 | } catch (Exception $e) { 109 | throw new ApiCallFailedException($e->getMessage(), $e->getCode(), $e); 110 | } 111 | 112 | return $response->body; 113 | } 114 | 115 | public function prepareResponse($response) 116 | { 117 | try { 118 | $result = new \stdClass(); 119 | $result->code = $response->getStatusCode(); 120 | $result->body = json_decode($response->getBody()); 121 | 122 | } catch (ClientException $e) { 123 | throw new ApiCallFailedException($e->getMessage(), $e->getResponse()->getStatusCode(), $e); 124 | 125 | } catch (ServerException $e) { 126 | throw new ApiCallFailedException('Api call failed to complete due to a server error.', $e->getResponse()->getStatusCode(), $e); 127 | 128 | } catch (Exception $e) { 129 | throw new ApiCallFailedException($e->getMessage(), $e->getCode(), $e); 130 | } 131 | 132 | return $result; 133 | } 134 | } -------------------------------------------------------------------------------- /SteamApi/Containers/Achievement.php: -------------------------------------------------------------------------------- 1 | apiName = $achievement->apiname; 17 | $this->achieved = $achievement->achieved; 18 | $this->name = $achievement->name; 19 | $this->description = $achievement->description; 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /SteamApi/Containers/App.php: -------------------------------------------------------------------------------- 1 | id = $app->steam_appid; 27 | $this->name = $app->name; 28 | $this->controllerSupport = isset($app->controller_support) ? $app->controller_support : 'None'; 29 | $this->description = $app->detailed_description; 30 | $this->about = $app->about_the_game; 31 | $this->header = $app->header_image; 32 | $this->website = !is_null($app->website) ? $app->website : 'None'; 33 | $this->pcRequirements = $app->pc_requirements; 34 | $this->legal = isset($app->legal_notice) ? $app->legal_notice : 'None'; 35 | $this->developers = isset($app->developers) ? $app->developers : null; 36 | $this->publishers = $app->publishers; 37 | $this->price = isset($app->price_overview) ? $app->price_overview : $this->getFakePriceObject(); 38 | $this->platforms = $app->platforms; 39 | $this->metacritic = isset($app->metacritic) ? $app->metacritic : $this->getFakeMetacriticObject(); 40 | $this->categories = isset($app->categories) ? $app->categories : null; 41 | $this->genres = isset($app->genres) ? $app->genres : null; 42 | $this->release = $app->release_date; 43 | } 44 | 45 | protected function getFakeMetacriticObject() 46 | { 47 | $object = new \stdClass(); 48 | $object->url = null; 49 | $object->score = 'No Score'; 50 | 51 | return $object; 52 | } 53 | 54 | protected function getFakePriceObject() 55 | { 56 | $object = new \stdClass(); 57 | $object->final = 'No price found'; 58 | 59 | return $object; 60 | } 61 | 62 | } -------------------------------------------------------------------------------- /SteamApi/Containers/Game.php: -------------------------------------------------------------------------------- 1 | appId = $app->appid; 19 | $this->name = isset($app->name) ? $app->name : null; 20 | $this->playtimeTwoWeeks = isset($app->playtime_2weeks) ? $this->convertFromMinutes($app->playtime_2weeks) : '0 minutes'; 21 | $this->playtimeForever = isset($app->playtime_forever) ? $app->playtime_forever : 0; 22 | $this->playtimeForeverReadable = $this->convertFromMinutes($this->playtimeForever); 23 | $this->icon = isset($app->img_icon_url) ? $this->getImageForGame($app->appid, $app->img_icon_url) : null; 24 | $this->logo = isset($app->img_logo_url) ? $this->getImageForGame($app->appid, $app->img_logo_url) : null; 25 | $this->header = 'http://cdn.steampowered.com/v/gfx/apps/'. $this->appId .'/header.jpg'; 26 | $this->hasCommunityVisibleStats = isset($app->has_community_visible_stats) ? $app->has_community_visible_stats : 0; 27 | } 28 | 29 | protected function getImageForGame($appId, $hash) 30 | { 31 | if ($hash != null) { 32 | return 'http://media.steampowered.com/steamcommunity/public/images/apps/'. $appId .'/'. $hash .'.jpg'; 33 | } 34 | 35 | return null; 36 | } 37 | 38 | protected function convertFromMinutes($minutes) 39 | { 40 | $seconds = $minutes * 60; 41 | 42 | $secondsInAMinute = 60; 43 | $secondsInAnHour = 60 * $secondsInAMinute; 44 | $secondsInADay = 24 * $secondsInAnHour; 45 | 46 | // extract days 47 | $days = floor($seconds / $secondsInADay); 48 | 49 | // extract hours 50 | $hourSeconds = $seconds % $secondsInADay; 51 | $hours = floor($hourSeconds / $secondsInAnHour); 52 | 53 | // extract minutes 54 | $minuteSeconds = $hourSeconds % $secondsInAnHour; 55 | $minutes = floor($minuteSeconds / $secondsInAMinute); 56 | 57 | // extract the remaining seconds 58 | $remainingSeconds = $minuteSeconds % $secondsInAMinute; 59 | $seconds = ceil($remainingSeconds); 60 | 61 | // return the final string 62 | $output = ''; 63 | 64 | if ($days > 0) $output .= $days .' days '; 65 | if ($hours > 0) $output .= $hours .' hours '; 66 | 67 | $output .= $minutes .' minutes'; 68 | 69 | return $output; 70 | } 71 | 72 | } -------------------------------------------------------------------------------- /SteamApi/Containers/Player.php: -------------------------------------------------------------------------------- 1 | steamId = $player->steamid; 35 | $this->communityVisibilityState = $player->communityvisibilitystate; 36 | $this->profileState = $player->profilestate; 37 | $this->personaName = $player->personaname; 38 | $this->lastLogoff = date('F jS, Y h:ia', $player->lastlogoff); 39 | $this->profileUrl = $player->profileurl; 40 | $this->avatar = $player->avatar; 41 | $this->avatarMedium = $player->avatarmedium; 42 | $this->avatarFull = $player->avatarfull; 43 | $this->personaState = $this->convertPersonaState($player->personastate); 44 | $this->primaryClanId = isset($player->primaryclanid) ? $player->primaryclanid : null; 45 | $this->timecreated = isset($player->timecreated) ? date('F jS, Y h:ia', $player->timecreated) : null; 46 | $this->personaStateFlags = isset($player->personastateflags) ? $player->personastateflags : null; 47 | } 48 | 49 | protected function convertPersonaState($personaState) 50 | { 51 | switch ($personaState) { 52 | case 0: 53 | return 'Offline'; 54 | break; 55 | case 1: 56 | return 'Online'; 57 | break; 58 | case 2: 59 | return 'Busy'; 60 | break; 61 | case 3: 62 | return 'Away'; 63 | break; 64 | case 4: 65 | return 'Snooze'; 66 | break; 67 | case 5: 68 | return 'Looking to Trade'; 69 | break; 70 | case 6: 71 | return 'Looking to Play'; 72 | break; 73 | } 74 | } 75 | 76 | } -------------------------------------------------------------------------------- /SteamApi/Containers/Player/Bans.php: -------------------------------------------------------------------------------- 1 | steamId = $player->SteamId; 16 | $this->communityBanned = $player->CommunityBanned; 17 | $this->VACBanned = $player->VACBanned; 18 | $this->numberOfVACBans = intval($player->NumberOfVACBans); 19 | $this->daysSinceLastBan = intval($player->DaysSinceLastBan); 20 | $this->economyBan = $player->EconomyBan; 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /SteamApi/Containers/Player/Level.php: -------------------------------------------------------------------------------- 1 | playerXp = $levelDetails->player_xp; 17 | $this->playerLevel = $levelDetails->player_level; 18 | $this->xpToLevelUp = $levelDetails->player_xp_needed_to_level_up; 19 | $this->xpForCurrentLevel = $levelDetails->player_xp_needed_current_level; 20 | 21 | $this->currentLevelMin = $this->xpForCurrentLevel; 22 | $this->currentLevelMax = $this->playerXp + $this->xpToLevelUp; 23 | 24 | $levelRange = $this->currentLevelMax - $this->currentLevelMin; 25 | 26 | $this->percentThroughLevel = $this->percent($this->xpToLevelUp, $levelRange); 27 | } 28 | 29 | private function percent ($num_amount, $num_total) 30 | { 31 | if($num_amount == 0 || $num_total == 0){ 32 | return 0; 33 | } 34 | else { 35 | $count1 = $num_amount / $num_total; 36 | $count2 = $count1 * 100; 37 | $count = number_format($count2, 0); 38 | return $count; 39 | } 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /SteamApi/Exceptions/ApiArgumentException.php: -------------------------------------------------------------------------------- 1 | method = __FUNCTION__; 15 | $this->version = 2; 16 | 17 | // Set up the arguments 18 | $arguments = [ 19 | 'appid' => $appId, 20 | 'count' => $count 21 | ]; 22 | if (!is_null($maxLength)) $arguments['maxlength'] = $maxLength; 23 | 24 | // Get the client 25 | $client = $this->setUpClient($arguments); 26 | 27 | return $client->appnews; 28 | } 29 | } -------------------------------------------------------------------------------- /SteamApi/Player.php: -------------------------------------------------------------------------------- 1 | setSteamId($steamId); 18 | } 19 | 20 | public function setSteamId($steamId) { 21 | $this->steamId = $steamId; 22 | } 23 | 24 | public function getSteamId() { 25 | return $this->steamId; 26 | } 27 | 28 | public function GetSteamLevel() 29 | { 30 | // Set up the api details 31 | $this->method = __FUNCTION__; 32 | $this->version = 1; 33 | 34 | // Set up the arguments 35 | $arguments = ['steamId' => $this->steamId]; 36 | $arguments = json_encode($arguments); 37 | 38 | // Get the client 39 | $client = $this->setUpService($arguments)->response; 40 | 41 | return intval($client->player_level); 42 | } 43 | 44 | public function GetPlayerLevelDetails() 45 | { 46 | 47 | // Set up the api details 48 | $this->method = 'GetBadges'; 49 | $this->version = 1; 50 | 51 | // Set up the arguments 52 | $arguments = ['steamId' => $this->steamId]; 53 | $arguments = json_encode($arguments); 54 | 55 | $details = $this->setUpService($arguments)->response; 56 | 57 | $details = new Level($details); 58 | 59 | return $details; 60 | } 61 | 62 | public function GetBadges() 63 | { 64 | // Set up the api details 65 | $this->method = __FUNCTION__; 66 | $this->version = 1; 67 | 68 | // Set up the arguments 69 | $arguments = ['steamId' => $this->steamId]; 70 | $arguments = json_encode($arguments); 71 | 72 | // Get the client 73 | $client = $this->setUpService($arguments)->response; 74 | return $client->badges; 75 | } 76 | 77 | public function GetCommunityBadgeProgress($badgeId = null) 78 | { 79 | // Set up the api details 80 | $this->method = __FUNCTION__; 81 | $this->version = 1; 82 | 83 | // Set up the arguments 84 | $arguments = ['steamId' => $this->steamId]; 85 | if ($badgeId != null) $arguments['badgeid'] = $badgeId; 86 | $arguments = json_encode($arguments); 87 | 88 | // Get the client 89 | $client = $this->setUpService($arguments)->response; 90 | 91 | return $client; 92 | } 93 | 94 | public function GetOwnedGames($includeAppInfo = true, $includePlayedFreeGames = false, $appIdsFilter = array()) 95 | { 96 | // Set up the api details 97 | $this->method = __FUNCTION__; 98 | $this->version = 1; 99 | 100 | // Set up the arguments 101 | $arguments = ['steamId' => $this->steamId]; 102 | if ($includeAppInfo) $arguments['include_appinfo'] = $includeAppInfo; 103 | if ($includePlayedFreeGames) $arguments['include_played_free_games'] = $includePlayedFreeGames; 104 | if (count($appIdsFilter) > 0) $arguments['appids_filter'] = $appIdsFilter; 105 | $arguments = json_encode($arguments); 106 | 107 | // Get the client 108 | $client = $this->setUpService($arguments)->response; 109 | 110 | // Clean up the games 111 | $games = $this->convertToObjects($client->games); 112 | 113 | return $games; 114 | } 115 | 116 | public function GetRecentlyPlayedGames($count = null) 117 | { 118 | // Set up the api details 119 | $this->method = __FUNCTION__; 120 | $this->version = 1; 121 | 122 | // Set up the arguments 123 | $arguments = ['steamId' => $this->steamId]; 124 | if (!is_null($count)) $arguments['count'] = $count; 125 | $arguments = json_encode($arguments); 126 | 127 | // Get the client 128 | $client = $this->setUpService($arguments)->response; 129 | 130 | if ($client->total_count > 0) { 131 | // Clean up the games 132 | $games = $this->convertToObjects($client->games); 133 | 134 | return $games; 135 | } 136 | 137 | return null; 138 | } 139 | 140 | public function IsPlayingSharedGame($appIdPlaying) 141 | { 142 | // Set up the api details 143 | $this->method = __FUNCTION__; 144 | $this->version = 1; 145 | 146 | // Set up the arguments 147 | $arguments = [ 148 | 'steamId' => $this->steamId, 149 | 'appid_playing' => $appIdPlaying 150 | ]; 151 | $arguments = json_encode($arguments); 152 | 153 | // Get the client 154 | $client = $this->setUpService($arguments)->response; 155 | 156 | return $client->lender_steamid; 157 | } 158 | 159 | protected function convertToObjects($games) 160 | { 161 | $cleanedGames = array(); 162 | 163 | foreach ($games as $game) { 164 | $cleanedGames[] = new Game($game); 165 | } 166 | 167 | usort($cleanedGames, function($a, $b) 168 | { 169 | return strcmp($a->name, $b->name); 170 | }); 171 | 172 | return $cleanedGames; 173 | } 174 | } -------------------------------------------------------------------------------- /SteamApi/User.php: -------------------------------------------------------------------------------- 1 | setSteamId($steamId); 13 | } 14 | 15 | public function setSteamId($steamId) { 16 | $this->steamId = $steamId; 17 | } 18 | 19 | public function getSteamId() { 20 | return $this->steamId; 21 | } 22 | 23 | 24 | public function GetPlayerBans($steamId = null){ 25 | $this->method = __FUNCTION__; 26 | $this->version = 1; 27 | 28 | if ($steamId == null) { 29 | $steamId = $this->steamId; 30 | } 31 | 32 | // Set up the arguments 33 | $arguments = [ 34 | 'steamids' => $steamId 35 | ]; 36 | 37 | // Get the client 38 | $client = $this->setUpClient($arguments); 39 | 40 | $bans = $this->convertToObjects($client->players, '\SteamApi\Containers\Player\Bans'); 41 | 42 | return count($bans) === 1 ? $bans[0] : $bans; 43 | } 44 | 45 | public function GetPlayerSummaries($steamId = null) 46 | { 47 | // Set up the api details 48 | $this->method = __FUNCTION__; 49 | $this->version = 2; 50 | 51 | if ($steamId == null) { 52 | $steamId = $this->steamId; 53 | } 54 | 55 | // Set up the arguments 56 | $arguments = [ 57 | 'steamids' => $steamId 58 | ]; 59 | 60 | // Get the client 61 | $client = $this->setUpClient($arguments)->response; 62 | 63 | // Clean up the games 64 | $players = $this->convertToObjects($client->players); 65 | 66 | return count($players) == 1 ? $players[0] : $players; 67 | } 68 | 69 | public function GetFriendList($relationship = 'all') 70 | { 71 | // Set up the api details 72 | $this->method = __FUNCTION__; 73 | $this->version = 1; 74 | 75 | // Set up the arguments 76 | $arguments = [ 77 | 'steamid' => $this->steamId, 78 | 'relationship' => $relationship 79 | ]; 80 | 81 | // Get the client 82 | $client = $this->setUpClient($arguments)->friendslist; 83 | 84 | // Clean up the games 85 | $steamIds = array(); 86 | 87 | foreach ($client->friends as $friend) { 88 | $steamIds[] = $friend->steamid; 89 | } 90 | 91 | $friends = $this->GetPlayerSummaries(implode(',', $steamIds)); 92 | 93 | return $friends; 94 | } 95 | 96 | public function GetUserGroupList($steamId = null) 97 | { 98 | // Set up the api details 99 | $this->method = __FUNCTION__; 100 | $this->version = 1; 101 | 102 | if ($steamId == null) { 103 | $steamId = $this->steamId; 104 | } 105 | 106 | // Set up the arguments 107 | $arguments = [ 108 | 'steamid' => $steamId 109 | ]; 110 | 111 | // Get the client 112 | $client = $this->setUpClient($arguments)->response; 113 | 114 | return $client->groups; 115 | } 116 | 117 | public function ResolveVanityUrl($vanityUrl) 118 | { 119 | // Set up the api details 120 | $this->method = __FUNCTION__; 121 | $this->version = 1; 122 | 123 | // Set up the arguments 124 | $arguments = [ 125 | 'vanityurl' => $vanityUrl 126 | ]; 127 | 128 | // Get the client 129 | $client = $this->setUpClient($arguments)->response; 130 | 131 | return property_exists($client, 'steamid') ? strval($client->steamid) : null; 132 | } 133 | 134 | protected function convertToObjects($players, $class = '\SteamApi\Containers\Player') 135 | { 136 | $cleanedPlayers = array(); 137 | 138 | foreach ($players as $player) { 139 | $cleanedPlayers[] = new $class($player); 140 | } 141 | 142 | return $cleanedPlayers; 143 | } 144 | } -------------------------------------------------------------------------------- /SteamApi/User/Stats.php: -------------------------------------------------------------------------------- 1 | setSteamId($steamId); 15 | } 16 | 17 | public function setSteamId($steamId) { 18 | $this->steamId = $steamId; 19 | } 20 | 21 | public function getSteamId() { 22 | return $this->steamId; 23 | } 24 | 25 | public function GetGlobalStatsForGame($appId, array $statsName){ 26 | $this->method = __FUNCTION__; 27 | $this->version = 1; 28 | 29 | $count = count($statsName); 30 | $arguments = [ 31 | 'count' => $count, 32 | 'appid' => $appId, 33 | 'l' => 'english' 34 | ]; 35 | 36 | for($i = 0; $i < $count; $i++){ 37 | $arguments['name['.$i.']'] = $statsName[$i]; 38 | } 39 | 40 | $client = $this->setUpClient($arguments)->response; 41 | 42 | return $client->globalstats; 43 | } 44 | 45 | public function GetNumberOfCurrentPlayers($appId){ 46 | $this->method = __FUNCTION__; 47 | $this->version = 1; 48 | 49 | $arguments = [ 50 | 'appid' => $appId, 51 | ]; 52 | 53 | $client = $this->setUpClient($arguments)->response; 54 | 55 | return $client->player_count; 56 | } 57 | 58 | public function GetSchemaForGame($appId){ 59 | $this->method = __FUNCTION__; 60 | $this->version = 2; 61 | 62 | $arguments = [ 63 | 'appid' => $appId, 64 | ]; 65 | 66 | $client = $this->setUpClient($arguments); 67 | 68 | return $client->game; 69 | } 70 | 71 | public function GetPlayerAchievements($appId, $steamId = null) 72 | { 73 | $this->method = __FUNCTION__; 74 | $this->version = 1; 75 | 76 | if(is_null($steamId)){ 77 | $steamId = $this->steamId; 78 | } 79 | 80 | $arguments = [ 81 | 'steamid' => $steamId, 82 | 'appid' => $appId, 83 | 'l' => 'english' 84 | ]; 85 | 86 | $client = $this->setUpClient($arguments)->playerstats; 87 | 88 | $achievements = $this->convertToObjects($client->achievements); 89 | 90 | return $achievements; 91 | } 92 | 93 | public function GetGlobalAchievementPercentagesForApp($gameId) 94 | { 95 | $this->method = __FUNCTION__; 96 | $this->version = 2; 97 | 98 | $arguments = [ 99 | 'gameid' => $gameId, 100 | 'l' => 'english' 101 | ]; 102 | 103 | $client = $this->setUpClient($arguments)->achievementpercentages; 104 | 105 | return $client->achievements; 106 | } 107 | 108 | public function GetUserStatsForGame($appId, $steamId = null) 109 | { 110 | $this->method = __FUNCTION__; 111 | $this->version = 2; 112 | 113 | if(is_null($steamId)){ 114 | $steamId = $this->steamId; 115 | } 116 | 117 | $arguments = [ 118 | 'steamid' => $steamId, 119 | 'appid' => $appId, 120 | 'l' => 'english' 121 | ]; 122 | 123 | $client = $this->setUpClient($arguments)->playerstats; 124 | 125 | return $client; 126 | } 127 | 128 | protected function convertToObjects($achievements) 129 | { 130 | $cleanedAchievements = array(); 131 | 132 | foreach ($achievements as $achievement) { 133 | $cleanedAchievements[] = new Achievement($achievement); 134 | } 135 | 136 | return $cleanedAchievements; 137 | } 138 | } -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jocolopes/steamapi", 3 | "description": "Steam Web Api Generic Integration", 4 | "type": "library", 5 | "keywords": ["library","steam","steamapi","jocolopes","webapi", "steamwebapi"], 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "Joao Lopes", 10 | "email": "jocolopes@gmail.com" 11 | } 12 | ], 13 | "autoload": { 14 | "classmap": [ 15 | "tests", 16 | "SteamApi" 17 | ] 18 | }, 19 | "require": { 20 | "guzzlehttp/guzzle": "5.0.*@dev" 21 | }, 22 | "require-dev": { 23 | "phpunit/phpunit": "4.6.*@dev" 24 | } 25 | } -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "hash": "386672c080d8e5dd92d98268a6efab3a", 8 | "packages": [ 9 | { 10 | "name": "guzzlehttp/guzzle", 11 | "version": "dev-master", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/guzzle/guzzle.git", 15 | "reference": "e38282adb29395e9de7e49e982412f7be5db31ac" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/guzzle/guzzle/zipball/e38282adb29395e9de7e49e982412f7be5db31ac", 20 | "reference": "e38282adb29395e9de7e49e982412f7be5db31ac", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "guzzlehttp/ringphp": "~1.0", 25 | "php": ">=5.4.0" 26 | }, 27 | "require-dev": { 28 | "ext-curl": "*", 29 | "phpunit/phpunit": "~4.0", 30 | "psr/log": "~1.0" 31 | }, 32 | "type": "library", 33 | "extra": { 34 | "branch-alias": { 35 | "dev-master": "5.0-dev" 36 | } 37 | }, 38 | "autoload": { 39 | "psr-4": { 40 | "GuzzleHttp\\": "src/" 41 | } 42 | }, 43 | "notification-url": "https://packagist.org/downloads/", 44 | "license": [ 45 | "MIT" 46 | ], 47 | "authors": [ 48 | { 49 | "name": "Michael Dowling", 50 | "email": "mtdowling@gmail.com", 51 | "homepage": "https://github.com/mtdowling" 52 | } 53 | ], 54 | "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", 55 | "homepage": "http://guzzlephp.org/", 56 | "keywords": [ 57 | "client", 58 | "curl", 59 | "framework", 60 | "http", 61 | "http client", 62 | "rest", 63 | "web service" 64 | ], 65 | "time": "2015-01-24 01:07:13" 66 | }, 67 | { 68 | "name": "guzzlehttp/ringphp", 69 | "version": "1.0.5", 70 | "source": { 71 | "type": "git", 72 | "url": "https://github.com/guzzle/RingPHP.git", 73 | "reference": "a903f51b692427318bc813217c0e6505287e79a4" 74 | }, 75 | "dist": { 76 | "type": "zip", 77 | "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/a903f51b692427318bc813217c0e6505287e79a4", 78 | "reference": "a903f51b692427318bc813217c0e6505287e79a4", 79 | "shasum": "" 80 | }, 81 | "require": { 82 | "guzzlehttp/streams": "~3.0", 83 | "php": ">=5.4.0", 84 | "react/promise": "~2.0" 85 | }, 86 | "require-dev": { 87 | "ext-curl": "*", 88 | "phpunit/phpunit": "~4.0" 89 | }, 90 | "suggest": { 91 | "ext-curl": "Guzzle will use specific adapters if cURL is present" 92 | }, 93 | "type": "library", 94 | "extra": { 95 | "branch-alias": { 96 | "dev-master": "1.0-dev" 97 | } 98 | }, 99 | "autoload": { 100 | "psr-4": { 101 | "GuzzleHttp\\Ring\\": "src/" 102 | } 103 | }, 104 | "notification-url": "https://packagist.org/downloads/", 105 | "license": [ 106 | "MIT" 107 | ], 108 | "authors": [ 109 | { 110 | "name": "Michael Dowling", 111 | "email": "mtdowling@gmail.com", 112 | "homepage": "https://github.com/mtdowling" 113 | } 114 | ], 115 | "time": "2014-12-11 05:50:32" 116 | }, 117 | { 118 | "name": "guzzlehttp/streams", 119 | "version": "3.0.0", 120 | "source": { 121 | "type": "git", 122 | "url": "https://github.com/guzzle/streams.git", 123 | "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" 124 | }, 125 | "dist": { 126 | "type": "zip", 127 | "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", 128 | "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", 129 | "shasum": "" 130 | }, 131 | "require": { 132 | "php": ">=5.4.0" 133 | }, 134 | "require-dev": { 135 | "phpunit/phpunit": "~4.0" 136 | }, 137 | "type": "library", 138 | "extra": { 139 | "branch-alias": { 140 | "dev-master": "3.0-dev" 141 | } 142 | }, 143 | "autoload": { 144 | "psr-4": { 145 | "GuzzleHttp\\Stream\\": "src/" 146 | } 147 | }, 148 | "notification-url": "https://packagist.org/downloads/", 149 | "license": [ 150 | "MIT" 151 | ], 152 | "authors": [ 153 | { 154 | "name": "Michael Dowling", 155 | "email": "mtdowling@gmail.com", 156 | "homepage": "https://github.com/mtdowling" 157 | } 158 | ], 159 | "description": "Provides a simple abstraction over streams of data", 160 | "homepage": "http://guzzlephp.org/", 161 | "keywords": [ 162 | "Guzzle", 163 | "stream" 164 | ], 165 | "time": "2014-10-12 19:18:40" 166 | }, 167 | { 168 | "name": "react/promise", 169 | "version": "v2.2.0", 170 | "source": { 171 | "type": "git", 172 | "url": "https://github.com/reactphp/promise.git", 173 | "reference": "365fcee430dfa4ace1fbc75737ca60ceea7eeeef" 174 | }, 175 | "dist": { 176 | "type": "zip", 177 | "url": "https://api.github.com/repos/reactphp/promise/zipball/365fcee430dfa4ace1fbc75737ca60ceea7eeeef", 178 | "reference": "365fcee430dfa4ace1fbc75737ca60ceea7eeeef", 179 | "shasum": "" 180 | }, 181 | "require": { 182 | "php": ">=5.4.0" 183 | }, 184 | "type": "library", 185 | "extra": { 186 | "branch-alias": { 187 | "dev-master": "2.0-dev" 188 | } 189 | }, 190 | "autoload": { 191 | "psr-4": { 192 | "React\\Promise\\": "src/" 193 | }, 194 | "files": [ 195 | "src/functions_include.php" 196 | ] 197 | }, 198 | "notification-url": "https://packagist.org/downloads/", 199 | "license": [ 200 | "MIT" 201 | ], 202 | "authors": [ 203 | { 204 | "name": "Jan Sorgalla", 205 | "email": "jsorgalla@googlemail.com" 206 | } 207 | ], 208 | "description": "A lightweight implementation of CommonJS Promises/A for PHP", 209 | "time": "2014-12-30 13:32:42" 210 | } 211 | ], 212 | "packages-dev": [ 213 | { 214 | "name": "doctrine/instantiator", 215 | "version": "1.0.4", 216 | "source": { 217 | "type": "git", 218 | "url": "https://github.com/doctrine/instantiator.git", 219 | "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119" 220 | }, 221 | "dist": { 222 | "type": "zip", 223 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f976e5de371104877ebc89bd8fecb0019ed9c119", 224 | "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119", 225 | "shasum": "" 226 | }, 227 | "require": { 228 | "php": ">=5.3,<8.0-DEV" 229 | }, 230 | "require-dev": { 231 | "athletic/athletic": "~0.1.8", 232 | "ext-pdo": "*", 233 | "ext-phar": "*", 234 | "phpunit/phpunit": "~4.0", 235 | "squizlabs/php_codesniffer": "2.0.*@ALPHA" 236 | }, 237 | "type": "library", 238 | "extra": { 239 | "branch-alias": { 240 | "dev-master": "1.0.x-dev" 241 | } 242 | }, 243 | "autoload": { 244 | "psr-0": { 245 | "Doctrine\\Instantiator\\": "src" 246 | } 247 | }, 248 | "notification-url": "https://packagist.org/downloads/", 249 | "license": [ 250 | "MIT" 251 | ], 252 | "authors": [ 253 | { 254 | "name": "Marco Pivetta", 255 | "email": "ocramius@gmail.com", 256 | "homepage": "http://ocramius.github.com/" 257 | } 258 | ], 259 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 260 | "homepage": "https://github.com/doctrine/instantiator", 261 | "keywords": [ 262 | "constructor", 263 | "instantiate" 264 | ], 265 | "time": "2014-10-13 12:58:55" 266 | }, 267 | { 268 | "name": "phpdocumentor/reflection-docblock", 269 | "version": "2.0.3", 270 | "source": { 271 | "type": "git", 272 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", 273 | "reference": "38743b677965c48a637097b2746a281264ae2347" 274 | }, 275 | "dist": { 276 | "type": "zip", 277 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/38743b677965c48a637097b2746a281264ae2347", 278 | "reference": "38743b677965c48a637097b2746a281264ae2347", 279 | "shasum": "" 280 | }, 281 | "require": { 282 | "php": ">=5.3.3" 283 | }, 284 | "require-dev": { 285 | "phpunit/phpunit": "3.7.*@stable" 286 | }, 287 | "suggest": { 288 | "dflydev/markdown": "1.0.*", 289 | "erusev/parsedown": "~0.7" 290 | }, 291 | "type": "library", 292 | "extra": { 293 | "branch-alias": { 294 | "dev-master": "2.0.x-dev" 295 | } 296 | }, 297 | "autoload": { 298 | "psr-0": { 299 | "phpDocumentor": [ 300 | "src/" 301 | ] 302 | } 303 | }, 304 | "notification-url": "https://packagist.org/downloads/", 305 | "license": [ 306 | "MIT" 307 | ], 308 | "authors": [ 309 | { 310 | "name": "Mike van Riel", 311 | "email": "mike.vanriel@naenius.com" 312 | } 313 | ], 314 | "time": "2014-08-09 10:27:07" 315 | }, 316 | { 317 | "name": "phpspec/prophecy", 318 | "version": "v1.3.1", 319 | "source": { 320 | "type": "git", 321 | "url": "https://github.com/phpspec/prophecy.git", 322 | "reference": "9ca52329bcdd1500de24427542577ebf3fc2f1c9" 323 | }, 324 | "dist": { 325 | "type": "zip", 326 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/9ca52329bcdd1500de24427542577ebf3fc2f1c9", 327 | "reference": "9ca52329bcdd1500de24427542577ebf3fc2f1c9", 328 | "shasum": "" 329 | }, 330 | "require": { 331 | "doctrine/instantiator": "~1.0,>=1.0.2", 332 | "phpdocumentor/reflection-docblock": "~2.0" 333 | }, 334 | "require-dev": { 335 | "phpspec/phpspec": "~2.0" 336 | }, 337 | "type": "library", 338 | "extra": { 339 | "branch-alias": { 340 | "dev-master": "1.2.x-dev" 341 | } 342 | }, 343 | "autoload": { 344 | "psr-0": { 345 | "Prophecy\\": "src/" 346 | } 347 | }, 348 | "notification-url": "https://packagist.org/downloads/", 349 | "license": [ 350 | "MIT" 351 | ], 352 | "authors": [ 353 | { 354 | "name": "Konstantin Kudryashov", 355 | "email": "ever.zet@gmail.com", 356 | "homepage": "http://everzet.com" 357 | }, 358 | { 359 | "name": "Marcello Duarte", 360 | "email": "marcello.duarte@gmail.com" 361 | } 362 | ], 363 | "description": "Highly opinionated mocking framework for PHP 5.3+", 364 | "homepage": "http://phpspec.org", 365 | "keywords": [ 366 | "Double", 367 | "Dummy", 368 | "fake", 369 | "mock", 370 | "spy", 371 | "stub" 372 | ], 373 | "time": "2014-11-17 16:23:49" 374 | }, 375 | { 376 | "name": "phpunit/php-code-coverage", 377 | "version": "2.0.15", 378 | "source": { 379 | "type": "git", 380 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 381 | "reference": "34cc484af1ca149188d0d9e91412191e398e0b67" 382 | }, 383 | "dist": { 384 | "type": "zip", 385 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/34cc484af1ca149188d0d9e91412191e398e0b67", 386 | "reference": "34cc484af1ca149188d0d9e91412191e398e0b67", 387 | "shasum": "" 388 | }, 389 | "require": { 390 | "php": ">=5.3.3", 391 | "phpunit/php-file-iterator": "~1.3", 392 | "phpunit/php-text-template": "~1.2", 393 | "phpunit/php-token-stream": "~1.3", 394 | "sebastian/environment": "~1.0", 395 | "sebastian/version": "~1.0" 396 | }, 397 | "require-dev": { 398 | "ext-xdebug": ">=2.1.4", 399 | "phpunit/phpunit": "~4" 400 | }, 401 | "suggest": { 402 | "ext-dom": "*", 403 | "ext-xdebug": ">=2.2.1", 404 | "ext-xmlwriter": "*" 405 | }, 406 | "type": "library", 407 | "extra": { 408 | "branch-alias": { 409 | "dev-master": "2.0.x-dev" 410 | } 411 | }, 412 | "autoload": { 413 | "classmap": [ 414 | "src/" 415 | ] 416 | }, 417 | "notification-url": "https://packagist.org/downloads/", 418 | "license": [ 419 | "BSD-3-Clause" 420 | ], 421 | "authors": [ 422 | { 423 | "name": "Sebastian Bergmann", 424 | "email": "sb@sebastian-bergmann.de", 425 | "role": "lead" 426 | } 427 | ], 428 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 429 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 430 | "keywords": [ 431 | "coverage", 432 | "testing", 433 | "xunit" 434 | ], 435 | "time": "2015-01-24 10:06:35" 436 | }, 437 | { 438 | "name": "phpunit/php-file-iterator", 439 | "version": "1.3.4", 440 | "source": { 441 | "type": "git", 442 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 443 | "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" 444 | }, 445 | "dist": { 446 | "type": "zip", 447 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", 448 | "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", 449 | "shasum": "" 450 | }, 451 | "require": { 452 | "php": ">=5.3.3" 453 | }, 454 | "type": "library", 455 | "autoload": { 456 | "classmap": [ 457 | "File/" 458 | ] 459 | }, 460 | "notification-url": "https://packagist.org/downloads/", 461 | "include-path": [ 462 | "" 463 | ], 464 | "license": [ 465 | "BSD-3-Clause" 466 | ], 467 | "authors": [ 468 | { 469 | "name": "Sebastian Bergmann", 470 | "email": "sb@sebastian-bergmann.de", 471 | "role": "lead" 472 | } 473 | ], 474 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 475 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 476 | "keywords": [ 477 | "filesystem", 478 | "iterator" 479 | ], 480 | "time": "2013-10-10 15:34:57" 481 | }, 482 | { 483 | "name": "phpunit/php-text-template", 484 | "version": "1.2.0", 485 | "source": { 486 | "type": "git", 487 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 488 | "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" 489 | }, 490 | "dist": { 491 | "type": "zip", 492 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", 493 | "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", 494 | "shasum": "" 495 | }, 496 | "require": { 497 | "php": ">=5.3.3" 498 | }, 499 | "type": "library", 500 | "autoload": { 501 | "classmap": [ 502 | "Text/" 503 | ] 504 | }, 505 | "notification-url": "https://packagist.org/downloads/", 506 | "include-path": [ 507 | "" 508 | ], 509 | "license": [ 510 | "BSD-3-Clause" 511 | ], 512 | "authors": [ 513 | { 514 | "name": "Sebastian Bergmann", 515 | "email": "sb@sebastian-bergmann.de", 516 | "role": "lead" 517 | } 518 | ], 519 | "description": "Simple template engine.", 520 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 521 | "keywords": [ 522 | "template" 523 | ], 524 | "time": "2014-01-30 17:20:04" 525 | }, 526 | { 527 | "name": "phpunit/php-timer", 528 | "version": "1.0.5", 529 | "source": { 530 | "type": "git", 531 | "url": "https://github.com/sebastianbergmann/php-timer.git", 532 | "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" 533 | }, 534 | "dist": { 535 | "type": "zip", 536 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", 537 | "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", 538 | "shasum": "" 539 | }, 540 | "require": { 541 | "php": ">=5.3.3" 542 | }, 543 | "type": "library", 544 | "autoload": { 545 | "classmap": [ 546 | "PHP/" 547 | ] 548 | }, 549 | "notification-url": "https://packagist.org/downloads/", 550 | "include-path": [ 551 | "" 552 | ], 553 | "license": [ 554 | "BSD-3-Clause" 555 | ], 556 | "authors": [ 557 | { 558 | "name": "Sebastian Bergmann", 559 | "email": "sb@sebastian-bergmann.de", 560 | "role": "lead" 561 | } 562 | ], 563 | "description": "Utility class for timing", 564 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 565 | "keywords": [ 566 | "timer" 567 | ], 568 | "time": "2013-08-02 07:42:54" 569 | }, 570 | { 571 | "name": "phpunit/php-token-stream", 572 | "version": "1.4.0", 573 | "source": { 574 | "type": "git", 575 | "url": "https://github.com/sebastianbergmann/php-token-stream.git", 576 | "reference": "db32c18eba00b121c145575fcbcd4d4d24e6db74" 577 | }, 578 | "dist": { 579 | "type": "zip", 580 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/db32c18eba00b121c145575fcbcd4d4d24e6db74", 581 | "reference": "db32c18eba00b121c145575fcbcd4d4d24e6db74", 582 | "shasum": "" 583 | }, 584 | "require": { 585 | "ext-tokenizer": "*", 586 | "php": ">=5.3.3" 587 | }, 588 | "require-dev": { 589 | "phpunit/phpunit": "~4.2" 590 | }, 591 | "type": "library", 592 | "extra": { 593 | "branch-alias": { 594 | "dev-master": "1.4-dev" 595 | } 596 | }, 597 | "autoload": { 598 | "classmap": [ 599 | "src/" 600 | ] 601 | }, 602 | "notification-url": "https://packagist.org/downloads/", 603 | "license": [ 604 | "BSD-3-Clause" 605 | ], 606 | "authors": [ 607 | { 608 | "name": "Sebastian Bergmann", 609 | "email": "sebastian@phpunit.de" 610 | } 611 | ], 612 | "description": "Wrapper around PHP's tokenizer extension.", 613 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/", 614 | "keywords": [ 615 | "tokenizer" 616 | ], 617 | "time": "2015-01-17 09:51:32" 618 | }, 619 | { 620 | "name": "phpunit/phpunit", 621 | "version": "dev-master", 622 | "source": { 623 | "type": "git", 624 | "url": "https://github.com/sebastianbergmann/phpunit.git", 625 | "reference": "3d6600da7eb6cb37d25143eea3fd09875c3ede49" 626 | }, 627 | "dist": { 628 | "type": "zip", 629 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3d6600da7eb6cb37d25143eea3fd09875c3ede49", 630 | "reference": "3d6600da7eb6cb37d25143eea3fd09875c3ede49", 631 | "shasum": "" 632 | }, 633 | "require": { 634 | "ext-dom": "*", 635 | "ext-json": "*", 636 | "ext-pcre": "*", 637 | "ext-reflection": "*", 638 | "ext-spl": "*", 639 | "php": ">=5.3.3", 640 | "phpspec/prophecy": "~1.3.1", 641 | "phpunit/php-code-coverage": "~2.0", 642 | "phpunit/php-file-iterator": "~1.3", 643 | "phpunit/php-text-template": "~1.2", 644 | "phpunit/php-timer": "~1.0", 645 | "phpunit/phpunit-mock-objects": "~2.3", 646 | "sebastian/comparator": "~1.1", 647 | "sebastian/diff": "~1.2", 648 | "sebastian/environment": "~1.2", 649 | "sebastian/exporter": "~1.0", 650 | "sebastian/global-state": "~1.0", 651 | "sebastian/version": "~1.0", 652 | "symfony/yaml": "~2.1|~3.0" 653 | }, 654 | "suggest": { 655 | "phpunit/php-invoker": "~1.1" 656 | }, 657 | "bin": [ 658 | "phpunit" 659 | ], 660 | "type": "library", 661 | "extra": { 662 | "branch-alias": { 663 | "dev-master": "4.6.x-dev" 664 | } 665 | }, 666 | "autoload": { 667 | "classmap": [ 668 | "src/" 669 | ] 670 | }, 671 | "notification-url": "https://packagist.org/downloads/", 672 | "license": [ 673 | "BSD-3-Clause" 674 | ], 675 | "authors": [ 676 | { 677 | "name": "Sebastian Bergmann", 678 | "email": "sebastian@phpunit.de", 679 | "role": "lead" 680 | } 681 | ], 682 | "description": "The PHP Unit Testing framework.", 683 | "homepage": "https://phpunit.de/", 684 | "keywords": [ 685 | "phpunit", 686 | "testing", 687 | "xunit" 688 | ], 689 | "time": "2015-01-24 14:25:39" 690 | }, 691 | { 692 | "name": "phpunit/phpunit-mock-objects", 693 | "version": "2.3.0", 694 | "source": { 695 | "type": "git", 696 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", 697 | "reference": "c63d2367247365f688544f0d500af90a11a44c65" 698 | }, 699 | "dist": { 700 | "type": "zip", 701 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/c63d2367247365f688544f0d500af90a11a44c65", 702 | "reference": "c63d2367247365f688544f0d500af90a11a44c65", 703 | "shasum": "" 704 | }, 705 | "require": { 706 | "doctrine/instantiator": "~1.0,>=1.0.1", 707 | "php": ">=5.3.3", 708 | "phpunit/php-text-template": "~1.2" 709 | }, 710 | "require-dev": { 711 | "phpunit/phpunit": "~4.3" 712 | }, 713 | "suggest": { 714 | "ext-soap": "*" 715 | }, 716 | "type": "library", 717 | "extra": { 718 | "branch-alias": { 719 | "dev-master": "2.3.x-dev" 720 | } 721 | }, 722 | "autoload": { 723 | "classmap": [ 724 | "src/" 725 | ] 726 | }, 727 | "notification-url": "https://packagist.org/downloads/", 728 | "license": [ 729 | "BSD-3-Clause" 730 | ], 731 | "authors": [ 732 | { 733 | "name": "Sebastian Bergmann", 734 | "email": "sb@sebastian-bergmann.de", 735 | "role": "lead" 736 | } 737 | ], 738 | "description": "Mock Object library for PHPUnit", 739 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", 740 | "keywords": [ 741 | "mock", 742 | "xunit" 743 | ], 744 | "time": "2014-10-03 05:12:11" 745 | }, 746 | { 747 | "name": "sebastian/comparator", 748 | "version": "1.1.0", 749 | "source": { 750 | "type": "git", 751 | "url": "https://github.com/sebastianbergmann/comparator.git", 752 | "reference": "c484a80f97573ab934e37826dba0135a3301b26a" 753 | }, 754 | "dist": { 755 | "type": "zip", 756 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/c484a80f97573ab934e37826dba0135a3301b26a", 757 | "reference": "c484a80f97573ab934e37826dba0135a3301b26a", 758 | "shasum": "" 759 | }, 760 | "require": { 761 | "php": ">=5.3.3", 762 | "sebastian/diff": "~1.1", 763 | "sebastian/exporter": "~1.0" 764 | }, 765 | "require-dev": { 766 | "phpunit/phpunit": "~4.1" 767 | }, 768 | "type": "library", 769 | "extra": { 770 | "branch-alias": { 771 | "dev-master": "1.1.x-dev" 772 | } 773 | }, 774 | "autoload": { 775 | "classmap": [ 776 | "src/" 777 | ] 778 | }, 779 | "notification-url": "https://packagist.org/downloads/", 780 | "license": [ 781 | "BSD-3-Clause" 782 | ], 783 | "authors": [ 784 | { 785 | "name": "Jeff Welch", 786 | "email": "whatthejeff@gmail.com" 787 | }, 788 | { 789 | "name": "Volker Dusch", 790 | "email": "github@wallbash.com" 791 | }, 792 | { 793 | "name": "Bernhard Schussek", 794 | "email": "bschussek@2bepublished.at" 795 | }, 796 | { 797 | "name": "Sebastian Bergmann", 798 | "email": "sebastian@phpunit.de" 799 | } 800 | ], 801 | "description": "Provides the functionality to compare PHP values for equality", 802 | "homepage": "http://www.github.com/sebastianbergmann/comparator", 803 | "keywords": [ 804 | "comparator", 805 | "compare", 806 | "equality" 807 | ], 808 | "time": "2014-11-16 21:32:38" 809 | }, 810 | { 811 | "name": "sebastian/diff", 812 | "version": "1.2.0", 813 | "source": { 814 | "type": "git", 815 | "url": "https://github.com/sebastianbergmann/diff.git", 816 | "reference": "5843509fed39dee4b356a306401e9dd1a931fec7" 817 | }, 818 | "dist": { 819 | "type": "zip", 820 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/5843509fed39dee4b356a306401e9dd1a931fec7", 821 | "reference": "5843509fed39dee4b356a306401e9dd1a931fec7", 822 | "shasum": "" 823 | }, 824 | "require": { 825 | "php": ">=5.3.3" 826 | }, 827 | "require-dev": { 828 | "phpunit/phpunit": "~4.2" 829 | }, 830 | "type": "library", 831 | "extra": { 832 | "branch-alias": { 833 | "dev-master": "1.2-dev" 834 | } 835 | }, 836 | "autoload": { 837 | "classmap": [ 838 | "src/" 839 | ] 840 | }, 841 | "notification-url": "https://packagist.org/downloads/", 842 | "license": [ 843 | "BSD-3-Clause" 844 | ], 845 | "authors": [ 846 | { 847 | "name": "Kore Nordmann", 848 | "email": "mail@kore-nordmann.de" 849 | }, 850 | { 851 | "name": "Sebastian Bergmann", 852 | "email": "sebastian@phpunit.de" 853 | } 854 | ], 855 | "description": "Diff implementation", 856 | "homepage": "http://www.github.com/sebastianbergmann/diff", 857 | "keywords": [ 858 | "diff" 859 | ], 860 | "time": "2014-08-15 10:29:00" 861 | }, 862 | { 863 | "name": "sebastian/environment", 864 | "version": "1.2.1", 865 | "source": { 866 | "type": "git", 867 | "url": "https://github.com/sebastianbergmann/environment.git", 868 | "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7" 869 | }, 870 | "dist": { 871 | "type": "zip", 872 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e6c71d918088c251b181ba8b3088af4ac336dd7", 873 | "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7", 874 | "shasum": "" 875 | }, 876 | "require": { 877 | "php": ">=5.3.3" 878 | }, 879 | "require-dev": { 880 | "phpunit/phpunit": "~4.3" 881 | }, 882 | "type": "library", 883 | "extra": { 884 | "branch-alias": { 885 | "dev-master": "1.2.x-dev" 886 | } 887 | }, 888 | "autoload": { 889 | "classmap": [ 890 | "src/" 891 | ] 892 | }, 893 | "notification-url": "https://packagist.org/downloads/", 894 | "license": [ 895 | "BSD-3-Clause" 896 | ], 897 | "authors": [ 898 | { 899 | "name": "Sebastian Bergmann", 900 | "email": "sebastian@phpunit.de" 901 | } 902 | ], 903 | "description": "Provides functionality to handle HHVM/PHP environments", 904 | "homepage": "http://www.github.com/sebastianbergmann/environment", 905 | "keywords": [ 906 | "Xdebug", 907 | "environment", 908 | "hhvm" 909 | ], 910 | "time": "2014-10-25 08:00:45" 911 | }, 912 | { 913 | "name": "sebastian/exporter", 914 | "version": "1.1.0", 915 | "source": { 916 | "type": "git", 917 | "url": "https://github.com/sebastianbergmann/exporter.git", 918 | "reference": "35ab8d385eef068186c83e23ae83c96b0288b3ee" 919 | }, 920 | "dist": { 921 | "type": "zip", 922 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/35ab8d385eef068186c83e23ae83c96b0288b3ee", 923 | "reference": "35ab8d385eef068186c83e23ae83c96b0288b3ee", 924 | "shasum": "" 925 | }, 926 | "require": { 927 | "php": ">=5.3.3", 928 | "sebastian/recursion-context": "~1.0" 929 | }, 930 | "require-dev": { 931 | "phpunit/phpunit": "~4.4" 932 | }, 933 | "type": "library", 934 | "extra": { 935 | "branch-alias": { 936 | "dev-master": "1.1.x-dev" 937 | } 938 | }, 939 | "autoload": { 940 | "classmap": [ 941 | "src/" 942 | ] 943 | }, 944 | "notification-url": "https://packagist.org/downloads/", 945 | "license": [ 946 | "BSD-3-Clause" 947 | ], 948 | "authors": [ 949 | { 950 | "name": "Jeff Welch", 951 | "email": "whatthejeff@gmail.com" 952 | }, 953 | { 954 | "name": "Volker Dusch", 955 | "email": "github@wallbash.com" 956 | }, 957 | { 958 | "name": "Bernhard Schussek", 959 | "email": "bschussek@2bepublished.at" 960 | }, 961 | { 962 | "name": "Sebastian Bergmann", 963 | "email": "sebastian@phpunit.de" 964 | }, 965 | { 966 | "name": "Adam Harvey", 967 | "email": "aharvey@php.net" 968 | } 969 | ], 970 | "description": "Provides the functionality to export PHP variables for visualization", 971 | "homepage": "http://www.github.com/sebastianbergmann/exporter", 972 | "keywords": [ 973 | "export", 974 | "exporter" 975 | ], 976 | "time": "2015-01-24 09:57:24" 977 | }, 978 | { 979 | "name": "sebastian/global-state", 980 | "version": "1.0.0", 981 | "source": { 982 | "type": "git", 983 | "url": "https://github.com/sebastianbergmann/global-state.git", 984 | "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" 985 | }, 986 | "dist": { 987 | "type": "zip", 988 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", 989 | "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", 990 | "shasum": "" 991 | }, 992 | "require": { 993 | "php": ">=5.3.3" 994 | }, 995 | "require-dev": { 996 | "phpunit/phpunit": "~4.2" 997 | }, 998 | "suggest": { 999 | "ext-uopz": "*" 1000 | }, 1001 | "type": "library", 1002 | "extra": { 1003 | "branch-alias": { 1004 | "dev-master": "1.0-dev" 1005 | } 1006 | }, 1007 | "autoload": { 1008 | "classmap": [ 1009 | "src/" 1010 | ] 1011 | }, 1012 | "notification-url": "https://packagist.org/downloads/", 1013 | "license": [ 1014 | "BSD-3-Clause" 1015 | ], 1016 | "authors": [ 1017 | { 1018 | "name": "Sebastian Bergmann", 1019 | "email": "sebastian@phpunit.de" 1020 | } 1021 | ], 1022 | "description": "Snapshotting of global state", 1023 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 1024 | "keywords": [ 1025 | "global state" 1026 | ], 1027 | "time": "2014-10-06 09:23:50" 1028 | }, 1029 | { 1030 | "name": "sebastian/recursion-context", 1031 | "version": "1.0.0", 1032 | "source": { 1033 | "type": "git", 1034 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 1035 | "reference": "3989662bbb30a29d20d9faa04a846af79b276252" 1036 | }, 1037 | "dist": { 1038 | "type": "zip", 1039 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252", 1040 | "reference": "3989662bbb30a29d20d9faa04a846af79b276252", 1041 | "shasum": "" 1042 | }, 1043 | "require": { 1044 | "php": ">=5.3.3" 1045 | }, 1046 | "require-dev": { 1047 | "phpunit/phpunit": "~4.4" 1048 | }, 1049 | "type": "library", 1050 | "extra": { 1051 | "branch-alias": { 1052 | "dev-master": "1.0.x-dev" 1053 | } 1054 | }, 1055 | "autoload": { 1056 | "classmap": [ 1057 | "src/" 1058 | ] 1059 | }, 1060 | "notification-url": "https://packagist.org/downloads/", 1061 | "license": [ 1062 | "BSD-3-Clause" 1063 | ], 1064 | "authors": [ 1065 | { 1066 | "name": "Jeff Welch", 1067 | "email": "whatthejeff@gmail.com" 1068 | }, 1069 | { 1070 | "name": "Sebastian Bergmann", 1071 | "email": "sebastian@phpunit.de" 1072 | }, 1073 | { 1074 | "name": "Adam Harvey", 1075 | "email": "aharvey@php.net" 1076 | } 1077 | ], 1078 | "description": "Provides functionality to recursively process PHP variables", 1079 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context", 1080 | "time": "2015-01-24 09:48:32" 1081 | }, 1082 | { 1083 | "name": "sebastian/version", 1084 | "version": "1.0.4", 1085 | "source": { 1086 | "type": "git", 1087 | "url": "https://github.com/sebastianbergmann/version.git", 1088 | "reference": "a77d9123f8e809db3fbdea15038c27a95da4058b" 1089 | }, 1090 | "dist": { 1091 | "type": "zip", 1092 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/a77d9123f8e809db3fbdea15038c27a95da4058b", 1093 | "reference": "a77d9123f8e809db3fbdea15038c27a95da4058b", 1094 | "shasum": "" 1095 | }, 1096 | "type": "library", 1097 | "autoload": { 1098 | "classmap": [ 1099 | "src/" 1100 | ] 1101 | }, 1102 | "notification-url": "https://packagist.org/downloads/", 1103 | "license": [ 1104 | "BSD-3-Clause" 1105 | ], 1106 | "authors": [ 1107 | { 1108 | "name": "Sebastian Bergmann", 1109 | "email": "sebastian@phpunit.de", 1110 | "role": "lead" 1111 | } 1112 | ], 1113 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 1114 | "homepage": "https://github.com/sebastianbergmann/version", 1115 | "time": "2014-12-15 14:25:24" 1116 | }, 1117 | { 1118 | "name": "symfony/yaml", 1119 | "version": "v2.6.3", 1120 | "target-dir": "Symfony/Component/Yaml", 1121 | "source": { 1122 | "type": "git", 1123 | "url": "https://github.com/symfony/Yaml.git", 1124 | "reference": "82462a90848a52c2533aa6b598b107d68076b018" 1125 | }, 1126 | "dist": { 1127 | "type": "zip", 1128 | "url": "https://api.github.com/repos/symfony/Yaml/zipball/82462a90848a52c2533aa6b598b107d68076b018", 1129 | "reference": "82462a90848a52c2533aa6b598b107d68076b018", 1130 | "shasum": "" 1131 | }, 1132 | "require": { 1133 | "php": ">=5.3.3" 1134 | }, 1135 | "type": "library", 1136 | "extra": { 1137 | "branch-alias": { 1138 | "dev-master": "2.6-dev" 1139 | } 1140 | }, 1141 | "autoload": { 1142 | "psr-0": { 1143 | "Symfony\\Component\\Yaml\\": "" 1144 | } 1145 | }, 1146 | "notification-url": "https://packagist.org/downloads/", 1147 | "license": [ 1148 | "MIT" 1149 | ], 1150 | "authors": [ 1151 | { 1152 | "name": "Symfony Community", 1153 | "homepage": "http://symfony.com/contributors" 1154 | }, 1155 | { 1156 | "name": "Fabien Potencier", 1157 | "email": "fabien@symfony.com" 1158 | } 1159 | ], 1160 | "description": "Symfony Yaml Component", 1161 | "homepage": "http://symfony.com", 1162 | "time": "2015-01-03 15:33:07" 1163 | } 1164 | ], 1165 | "aliases": [], 1166 | "minimum-stability": "stable", 1167 | "stability-flags": { 1168 | "guzzlehttp/guzzle": 20, 1169 | "phpunit/phpunit": 20 1170 | }, 1171 | "prefer-stable": false, 1172 | "prefer-lowest": false, 1173 | "platform": [], 1174 | "platform-dev": [] 1175 | } 1176 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | ./tests/ 15 | 16 | -------------------------------------------------------------------------------- /test-steam-api-key.php_sample: -------------------------------------------------------------------------------- 1 | app = new App($this->steamApiKey); 13 | } 14 | 15 | public function testBuildUrl(){ 16 | $this->assertEquals($this->app->buildUrl(), 'http://api.steampowered.com/ISteamApps/'); 17 | } 18 | 19 | public function testAppDetails(){ 20 | $result = $this->app->appDetails(620); 21 | $this->assertEquals($result->name, 'Portal 2'); 22 | } 23 | 24 | public function testGetServersAtAddress(){ 25 | $servers = $this->app->GetServersAtAddress('127.0.0.1'); 26 | $this->assertGreaterThanOrEqual(0, count($servers)); 27 | } 28 | 29 | public function testGetAppList(){ 30 | $result = $this->app->GetAppList(); 31 | $this->assertGreaterThanOrEqual(1000, count($result)); 32 | } 33 | 34 | public function testUpToDateCheck(){ 35 | $result = $this->app->UpToDateCheck(620, 1); 36 | // TODO: Implement 37 | // Don't know how to use this one. 38 | } 39 | } -------------------------------------------------------------------------------- /tests/SteamApi/ClientTest.php: -------------------------------------------------------------------------------- 1 | steamApiKey); 19 | $client->setUpClient(); 20 | } 21 | 22 | /** 23 | * @expectedException SteamApi\Exceptions\ApiArgumentRequiredException 24 | **/ 25 | public function testArgumentRequired(){ 26 | $client = new Client($this->steamApiKey); 27 | $client->setUpService(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tests/SteamApi/NewsTest.php: -------------------------------------------------------------------------------- 1 | news = new News($this->steamApiKey); 14 | } 15 | 16 | public function testBuildUrl(){ 17 | $this->assertEquals($this->news->buildUrl(), 'http://api.steampowered.com/ISteamNews/'); 18 | } 19 | 20 | public function testGetNewsForApp() { 21 | $totalNews = 2; 22 | $appId = 620; // Portal 2 23 | $result = $this->news->GetNewsForApp($appId, $totalNews); 24 | $this->assertEquals($result->appid, $appId); 25 | $this->assertEquals(count($result->newsitems), 2); 26 | } 27 | } -------------------------------------------------------------------------------- /tests/SteamApi/PlayerTest.php: -------------------------------------------------------------------------------- 1 | player = new Player($this->steamApiKey, '76561197963455129'); 14 | } 15 | 16 | public function testBuildUrl(){ 17 | $this->assertEquals($this->player->buildUrl(), 'http://api.steampowered.com/IPlayerService/'); 18 | } 19 | 20 | public function testGetSteamLevel() { 21 | $result = $this->player->GetSteamLevel(); 22 | $this->assertGreaterThanOrEqual(20, $result, "Player level is invalid"); 23 | } 24 | 25 | public function testGetPlayerLevelDetails() { 26 | $result = $this->player->GetPlayerLevelDetails(); 27 | $this->assertObjectHasAttribute('playerXp', $result, "No playerXp"); 28 | $this->assertObjectHasAttribute('playerLevel', $result, "No playerLevel"); 29 | $this->assertObjectHasAttribute('xpToLevelUp', $result, "No xpToLevelUp"); 30 | $this->assertObjectHasAttribute('xpForCurrentLevel', $result, "No xpForCurrentLevel"); 31 | $this->assertObjectHasAttribute('currentLevelMin', $result, "No currentLevelMin"); 32 | $this->assertObjectHasAttribute('currentLevelMax', $result, "No currentLevelMax"); 33 | $this->assertObjectHasAttribute('percentThroughLevel', $result, "No percentThroughLevel"); 34 | } 35 | 36 | public function testGetBadges() { 37 | $result = $this->player->GetBadges(); 38 | $this->assertGreaterThanOrEqual(19, count($result)); 39 | } 40 | 41 | public function testGetCommunityBadgeProgress(){ 42 | $result = $this->player->GetCommunityBadgeProgress(); 43 | $this->assertGreaterThanOrEqual(0, count($result->quests)); 44 | } 45 | 46 | public function testGetOwnedGames(){ 47 | $result = $this->player->GetOwnedGames(); 48 | $this->assertGreaterThanOrEqual(346, count($result)); 49 | } 50 | 51 | public function testGetRecentlyPlayedGames(){ 52 | $result = $this->player->GetRecentlyPlayedGames(); 53 | $this->assertGreaterThanOrEqual(0, count($result)); 54 | } 55 | 56 | public function testIsPlayingSharedGame(){ 57 | $result = $this->player->IsPlayingSharedGame(620); 58 | $this->assertGreaterThanOrEqual(0, count($result)); 59 | } 60 | } -------------------------------------------------------------------------------- /tests/SteamApi/User/StatsTest.php: -------------------------------------------------------------------------------- 1 | stats = new Stats($this->steamApiKey, '76561197963455129'); 13 | } 14 | 15 | public function testBuildUrl(){ 16 | $this->assertEquals($this->stats->buildUrl(), 'http://api.steampowered.com/ISteamUserStats/'); 17 | } 18 | 19 | public function testGetGlobalStatsForGame(){ 20 | $result = $this->stats->GetGlobalStatsForGame(17740, array('global.map.emp_isle')); 21 | $this->assertGreaterThanOrEqual(100, $result->{'global.map.emp_isle'}->total); 22 | } 23 | 24 | public function testGetNumberOfCurrentPlayers(){ 25 | $result = $this->stats->GetNumberOfCurrentPlayers(620); 26 | $this->assertGreaterThanOrEqual(0, $result); 27 | } 28 | 29 | public function testGetSchemaForGame(){ 30 | $result = $this->stats->GetSchemaForGame(620); 31 | $this->assertEquals($result->gameName, 'Portal 2'); 32 | } 33 | 34 | public function testGetPlayerAchievements(){ 35 | $achievements = $this->stats->GetPlayerAchievements(620); 36 | $this->assertGreaterThanOrEqual(50, count($achievements)); 37 | } 38 | 39 | public function testGetGlobalAchievementPercentagesForApp(){ 40 | $result = $this->stats->GetGlobalAchievementPercentagesForApp(620); 41 | $this->assertGreaterThanOrEqual(50, count($result)); 42 | } 43 | 44 | public function testGetUserStatsForGame(){ 45 | $result = $this->stats->GetUserStatsForGame(620); 46 | $this->assertEquals($result->gameName, 'Portal 2'); 47 | } 48 | } -------------------------------------------------------------------------------- /tests/SteamApi/UserTest.php: -------------------------------------------------------------------------------- 1 | user = new \SteamApi\User($this->steamApiKey, '76561197963455129'); 9 | } 10 | 11 | public function testBuildUrl(){ 12 | $this->assertEquals($this->user->buildUrl(), 'http://api.steampowered.com/ISteamUser/'); 13 | } 14 | 15 | public function testSteamIdIsSet(){ 16 | $this->assertEquals($this->user->getSteamId(), '76561197963455129'); 17 | } 18 | 19 | public function testGetPlayerBans(){ 20 | $result = $this->user->GetPlayerBans(); 21 | $this->assertEquals($result->steamId, '76561197963455129'); 22 | $this->assertEquals($result->communityBanned, false); 23 | $this->assertEquals($result->VACBanned, false); 24 | $this->assertEquals($result->numberOfVACBans, 0); 25 | $this->assertEquals($result->daysSinceLastBan, 0); 26 | $this->assertEquals($result->economyBan, 'none'); 27 | } 28 | 29 | public function testMultipleGetPlayerBans(){ 30 | $result = $this->user->GetPlayerBans('76561197963455129,76561197988736941'); 31 | $this->assertEquals($result[0]->communityBanned, false); 32 | $this->assertEquals($result[0]->VACBanned, false); 33 | $this->assertEquals($result[0]->numberOfVACBans, 0); 34 | $this->assertEquals($result[0]->daysSinceLastBan, 0); 35 | $this->assertEquals($result[0]->economyBan, 'none'); 36 | 37 | $this->assertEquals($result[1]->communityBanned, false); 38 | $this->assertEquals($result[1]->VACBanned, false); 39 | $this->assertEquals($result[1]->numberOfVACBans, 0); 40 | $this->assertEquals($result[1]->daysSinceLastBan, 0); 41 | $this->assertEquals($result[1]->economyBan, 'none'); 42 | } 43 | 44 | public function testGetPlayerSummaries(){ 45 | $result = $this->user->GetPlayerSummaries(); 46 | $this->assertEquals($result->profileUrl, 'http://steamcommunity.com/id/pr00fgames/'); 47 | } 48 | 49 | public function testMultipleGetPlayerSummaries(){ 50 | $result = $this->user->GetPlayerSummaries('76561197988736941,76561197963455129'); 51 | $this->assertTrue($result[0]->profileUrl === 'http://steamcommunity.com/id/dorsiguer/' || $result[0]->profileUrl == 'http://steamcommunity.com/id/pr00fgames/'); 52 | $this->assertTrue($result[1]->profileUrl === 'http://steamcommunity.com/id/dorsiguer/' || $result[1]->profileUrl == 'http://steamcommunity.com/id/pr00fgames/'); 53 | } 54 | 55 | public function testGetFriendList(){ 56 | $result = $this->user->GetFriendList(); 57 | $this->assertGreaterThanOrEqual(20, $result); 58 | } 59 | 60 | public function testGetUserGroupList(){ 61 | $result = $this->user->GetUserGroupList(); 62 | $this->assertGreaterThanOrEqual(5, count($result)); 63 | } 64 | 65 | public function testResolveVanityUrl(){ 66 | $steamId = $this->user->ResolveVanityUrl('pr00fgames'); 67 | $this->assertEquals($steamId, '76561197963455129'); 68 | } 69 | 70 | public function testNullResolveVanityUrl(){ 71 | $steamId = $this->user->ResolveVanityUrl('poaspodopispaodipoasdpoipoidsapoisdpoaipoisda'); 72 | $this->assertNull($steamId); 73 | } 74 | } -------------------------------------------------------------------------------- /tests/TestBootstrap.php: -------------------------------------------------------------------------------- 1 | steamApiKey = $key; 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /wercker.yml: -------------------------------------------------------------------------------- 1 | box: wercker/php 2 | build: 3 | steps: 4 | - script: 5 | name: install dependencies 6 | code: composer install --no-interaction --prefer-source 7 | - script: 8 | name: run phpunit tests 9 | code: phpunit --------------------------------------------------------------------------------