What's on this page
Library
You can use the Cecil as a PHP library.
Installation
composer require cecil/cecil
Usage
Build
Build with the default configuration.
Cecil::create()->build();
Build with custom configuration :
Cecil::create([
'title' => "My website",
'baseurl' => 'http://localhost:8000/',
])->build();
The main parameter of the create
method should be a PHP array or a Cecil\Config
instance.
Change source directory
Cecil::create()
->setSourceDir(__DIR__.'/source')
->build();
Change destination directory
Cecil::create()
->setDestinationDir(__DIR__.'/destination')
->build();
Example
<?php
date_default_timezone_set('Europe/Paris');
require_once 'vendor/autoload.php';
use Cecil\Builder;
// Run the builder
Cecil::create(
[
'title' => "My website",
'baseurl' => 'http://localhost:8000/',
]
)->build();
// Run a local server
exec('php -S localhost:8000 -t _site');