Library

You can use PHPoole as a PHP library.

Installation

composer require narno/phpoole-library

Usage

PHPoole::create(
    [
        'site' => [
            'title'   => "My website",
            'baseurl' => 'http://localhost:8000/',
        ],
    ]
)->build();

The main param of the create method shoud be a PHP array or a PHPoole\Config instance.

Change source directory

PHPoole::create()
    ->setSourceDir(__DIR__.'/source')
    ->build();

Change destination directory

PHPoole::create()
    ->setDestinationDir(__DIR__.'/destination')
    ->build();

Example

<?php
date_default_timezone_set('Europe/Paris');
require_once 'vendor/autoload.php';
use PHPoole\PHPoole;

PHPoole::create(
    [
        'site' => [
            'title'   => "My website",
            'baseurl' => 'http://localhost:8000/',
        ],
    ]
)->build(); // Launch the builder

// Run a local server
exec('php -S localhost:8000 -t _site');
Suggest a modification