Download the PHP package scottlaurent/fsrs without Composer

On this page you can find all versions of the php package scottlaurent/fsrs. 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 fsrs

FSRS PHP

A PHP implementation of the Free Spaced Repetition Scheduler (FSRS) algorithm.

PHP Version License Tests

FSRS is a modern spaced repetition algorithm that adapts to your memory patterns, making learning more efficient than traditional methods like Anki's default algorithm.\n\n## How FSRS Works\n\nFSRS is based on the Three Components of Memory model and implements several key principles:\n\n### Core Memory Components\n- Stability (S): Storage strength of memory - how long it can be retained\n- Retrievability (R): Retrieval strength of memory - how easily it can be recalled \n- Difficulty (D): Inherent complexity of the material (1-10 scale)\n\n### Key Principles\n1. Exponential Forgetting: Memory follows the curve R(t) = 2^(-t/S)\n2. Difficulty Impact: More complex material results in lower stability increases\n3. Stability Decay: Higher current stability leads to smaller future stability gains\n4. Retrievability Effect: Lower retrievability at review time enables higher stability increases\n\n### Memory States\nCards progress through four distinct states:\n- New (0): Never studied before\n- Learning (1): Short-term learning with frequent reviews\n- Review (2): Long-term review with spaced intervals\n- Relearning (3): Forgotten cards returned to short-term learning"

Table of Contents

Installation

Install via Composer:

Quickstart

Usage

Basic Card Review

Advanced Usage

Card States

Cards progress through different states:

Rating System

Configuration

Custom Parameters

Parameters Explained

API Reference

Manager Class

__construct(...)

Create a new FSRS manager with optional custom parameters.

generateRepetitionSchedule(Card $card, ?DateTime $repeatDate = null): array

Generate scheduling options for a card review.

Parameters:

Returns: Array with keys 1-4 representing rating options, each containing a card property with the updated card state.

getCardRetrievability(Card $card, ?DateTime $now = null): float

Calculate the probability of successfully recalling a card at a given time.

Parameters:

Returns: Float between 0.0 and 1.0 representing recall probability.

reviewCard(Card $card, int $rating, ?DateTime $reviewDate = null, ?int $reviewDurationMs = null): array

Convenience method to review a card and get both the updated card and review log.

Parameters:

Returns: Array with 'card' and 'log' keys.

Serialization Methods

Card Class

__construct(...)

Create a new card with optional parameters.

Properties:

Serialization Methods

ReviewLog Class

The ReviewLog class tracks review sessions with enhanced metadata.

Properties:

Serialization Methods

Development

This package uses Docker for development and testing.

Setup

Available Commands

Testing

Run the test suite:

The project includes comprehensive tests:

Test coverage is maintained at >90% with detailed behavioral scenarios.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for your changes
  4. Ensure all tests pass with make test
  5. Submit a pull request

Inspiration

This PHP implementation is inspired by and compatible with:

The FSRS algorithm was developed by Jarrett Ye and represents a significant improvement over traditional SM-2 based algorithms.

License

MIT License - see the LICENSE file for details.

Related Projects


Learn more about spaced repetition: spaced-repetition.com


All versions of fsrs with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2|^8.3
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 scottlaurent/fsrs contains the following files

Loading the files please wait ...