Download the PHP package mauserrifle/simresults without Composer

On this page you can find all versions of the php package mauserrifle/simresults. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package simresults

Simresults

Minimum PHP Version CI Status Total Downloads License

Simresults is an open-source, object-oriented library built using PHP. It allows you to read out log files of a race game and transforms them to a simple data model to easily read out this data.

This project is the core of the website simresults.net , which allows you to upload your race log files and transform them to a readable format. The uploaded results become saved and public, so visitors can share them with their fellow racers. An example result can be found at http://simresults.net/130529-X2g.

The website is a service but also a demonstration of what is possible using this library. This library does not supply any HTML templates or whatsoever. Any 'implementation' is up to you within your own project and is not limited to any framework.

This project is created (2013) and maintained by Maurice van der Star

Please consider donating to cover future development.

It's also possible to use the Simresults website remote results API. This requires much less work and programming knowledge.

Sponsors

Consider sponsoring Simresults and be featured on this page! :)

Supported games

Simresults supports a wide range of games:

The following expansions of RACE (07) should work too:

Please note that Formula Truck will be reported as as a rFactor game.

Results from F1 challenge and GTR might miss laps.

Results from Assetto Corsa (race_out.json) and Raceroom might only contain 1 lap.

Features

rFactor reader

lib/Data/Reader/Rfactor2.php

Project Cars Server reader

lib/Data/Reader/ProjectCarsServer.php

Assetto Corsa reader

lib/Data/Reader/AssettoCorsa.php

Assetto Corsa Server reader

lib/Data/Reader/AssettoCorsaServer.php

Assetto Corsa Server reader JSON

lib/Data/Reader/AssettoCorsaServerJson.php

Assetto Corsa Competizione

lib/Data/Reader/AssettoCorsaCompetizione.php

Assetto Corsa Evo server reader

lib/Data/Reader/AssettoCorsaEvoServer.php

RaceRoom Server reader

lib/Data/Reader/RaceRoomServer.php

RACE 07 reader

lib/Data/Reader/Race07.php

iRacing reader

lib/Data/Reader/Iracing.php

Requirements

Installation and example

Simresults can be installed and autoloaded using composer. But ofcourse it will work with any PSR-0 autoloader.

Example for Linux/OSX

Install composer.

Add the Simresults package to the composer.json file:

composer require mauserrifle/simresults:dev-develop

Create index.php:

<?php

// Load code
require(realpath('vendor/autoload.php'));

// Path to the result source file
$file = realpath(dirname(__FILE__)
        .'/vendor/mauserrifle/simresults/tests/logs/rfactor2'
        .DIRECTORY_SEPARATOR.'race.xml');

// Get a reader using the source file
$reader = \Simresults\Data_Reader::factory($file);

// Get the first session. Note: Use `getSessions()` to get all sessions
$session = $reader->getSession();

// Get participants sorted by their position
$participants = $session->getParticipants();

// Get the driver name of the second participant
$driver_name = $participants[1]->getDriver()->getName();

// Get the best lap of the second participant
$best_lap = $participants[1]->getBestLap();

// Get the best lap of the session
$session_best_lap = $session->getBestLap();

// Format the gap between the two laps
$helper = new \Simresults\Helper;
$best_lap_gap = $helper->formatTime($session_best_lap->getGap($best_lap));
echo $best_lap_gap;

Run server

 php -S localhost:8000

Open http://localhost:8000 and all should work!

For further usage please read the classes code within the lib folder. They are carefully documented.

Bugs

Have a bug or a feature request? Please open a new issue.

Known issues

Caching

Some classes like Participant do heavy caching. So changing any value after calling sorting methods will be pointless. There are no cache invalidate methods (yet). Most likely they will never be needed as there's no use case you actually would want to change values after reading out all data.

When writing a reader. NEVER call methods like getVehicle() on Participant (which uses cached methods). Re-use your own created objects (like $vehicle) within the reading to prevent any early invalid cache. Do this for all type of objects.

Laps missing

Logs tend to miss lap data on all games. Check the logs.

Marked as RACE session while it's not

The Race 07 reader detects qualify if all drivers are DNF. There's no session type in these log files. This detection might be false in some cases.

Date is not right of session

GTR, GTL, F1 challenge don't have a timestamp or timezone information. So dates are created using the default timezone.

Contributing

The project is designed to be extended with new features and game support. Feel free to fork Simresults on GitHub and submit a pull request!

The project is tested using PHPUnit and phpspec. If you offer any changes, make sure all your new additions are tested.

Running simresults tests

To run the tests, use the following command:

./vendor/bin/phpunit
./vendor/bin/phpspec run

License

The Simresults library is open-sourced software licensed under the ISC license.


All versions of simresults with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mauserrifle/simresults contains the following files

Loading the files please wait ...