No description
- PHP 100%
| src | ||
| tests | ||
| .gitignore | ||
| .onedev-buildspec.yml | ||
| .phpactor.json | ||
| composer.json | ||
| LICENSE | ||
| peck.json | ||
| phpling | ||
| phpstan.neon | ||
| phpunit.xml | ||
| pint.json | ||
| README.md | ||
| rector.php | ||
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:
- Create a new Composer package with type
phpling-track - Implement the
Phpling\Core\Contracts\TrackProviderinterface - Register your provider in the
extra.phpling.providerfield of yourcomposer.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