No description
Find a file
2025-11-18 22:49:07 +11:00
src feat: some vibe coded stuff 2025-11-18 22:49:07 +11:00
tests feat: some vibe coded stuff 2025-11-18 22:49:07 +11:00
.gitignore Add --force flag to reset and suppress prompts during tests 2025-11-18 22:30:00 +11:00
.onedev-buildspec.yml Edit .onedev-buildspec.yml 2025-11-17 23:23:33 +11:00
.phpactor.json Refactor to use Exercise DTO with Carapace 2025-11-17 22:55:30 +11:00
composer.json Refactor to use Exercise DTO with Carapace 2025-11-17 22:55:30 +11:00
LICENSE init 2025-11-10 22:56:04 +11:00
peck.json fix: peck 2025-11-18 21:53:58 +11:00
phpling Refactor: Single phpling binary with command auto-discovery 2025-11-11 22:26:54 +11:00
phpstan.neon Refactor to use Exercise DTO with Carapace 2025-11-17 22:55:30 +11:00
phpunit.xml Add --force flag to reset and suppress prompts during tests 2025-11-18 22:30:00 +11:00
pint.json Refactor to use Exercise DTO with Carapace 2025-11-17 22:55:30 +11:00
README.md init 2025-11-10 22:56:04 +11:00
rector.php Refactor to use Exercise DTO with Carapace 2025-11-17 22:55:30 +11:00

Phpling Core

Core library for Phpling - the foundation for creating interactive programming learning exercises.

What is this?

This package contains the core functionality for the Phpling learning system, including:

  • Exercise discovery and management
  • Test runner infrastructure
  • Progress tracking
  • CLI commands
  • Track provider interface for extensibility

Installation

This package is not meant to be installed directly. Instead, install the main phpling/phpling package or a specific track like phpling/php-track.

Creating Your Own Track

To create a custom track (like Laravel, Symfony, etc.), you need to:

  1. Create a new Composer package with type phpling-track
  2. Implement the Phpling\Core\Contracts\TrackProvider interface
  3. Register your provider in the extra.phpling.provider field of your composer.json

Example composer.json:

{
    "name": "vendor/phpling-laravel-track",
    "type": "phpling-track",
    "require": {
        "phpling/core": "^1.0"
    },
    "autoload": {
        "psr-4": {
            "Vendor\\PhplingLaravel\\": "src/"
        }
    },
    "extra": {
        "phpling": {
            "provider": "Vendor\\PhplingLaravel\\LaravelTrackProvider"
        }
    }
}

Example TrackProvider implementation:

<?php

namespace Vendor\PhplingLaravel;

use Phpling\Core\Contracts\TrackProvider;

class LaravelTrackProvider implements TrackProvider
{
    public function getName(): string
    {
        return 'laravel';
    }

    public function getDescription(): string
    {
        return 'Learn Laravel framework fundamentals';
    }

    public function getExercisesPath(): string
    {
        return __DIR__ . '/../exercises';
    }

    public function getTestsPath(): string
    {
        return __DIR__ . '/../tests/exercises';
    }

    public function getExercisesToCopy(): array
    {
        $exercises = [];
        $exercisesPath = $this->getExercisesPath();
        
        foreach (glob($exercisesPath . '/*.php') as $file) {
            $basename = basename($file);
            $exercises[$file] = 'exercises/' . $basename;
        }
        
        return $exercises;
    }
}

License

MIT