Не спец в настройке сервера. Подскажите, что сделать, чтобы запустить библиотеку PHPStamp (ссылка
на github). Возможно ли это без composer, без строки ssh, просто собрать файлы в папке, подключить все с require_once и получить файл docx отредактированный на выходе?
В исходной инструкции указан такой пример:
composer require shadz3rg/php-stamp
or
{
"require": {
"shadz3rg/php-stamp": "0.1.*"
}
}
require 'vendor/autoload.php';
use PHPStamp\Templator;
use PHPStamp\Document\WordDocument;
$cachePath = 'path/to/writable/directory/';
$templator = new Templator($cachePath);
$documentPath = 'path/to/document.docx';
$document = new WordDocument($documentPath);
$values = array(
'library' => 'PHPStamp 0.1',
'simpleValue' => 'I am simple value',
'nested' => array(
'firstValue' => 'First child value',
'secondValue' => 'Second child value'
),
'header' => 'test of a table row',
'students' => array(
array('id' => 1, 'name' => 'Student 1', 'mark' => '10'),
array('id' => 2, 'name' => 'Student 2', 'mark' => '4'),
array('id' => 3, 'name' => 'Student 3', 'mark' => '7')
),
'maxMark' => 10,
'todo' => array(
'TODO 1',
'TODO 2',
'TODO 3'
)
);
$result = $templator->render($document, $values);
$result->download();