PHPOffice / PHPWord

A pure PHP library for reading and writing word processing documents
https://phpoffice.github.io/PHPWord/
Other
7.2k stars 2.69k forks source link

PHPWord + MODX #1422

Open alexbom opened 6 years ago

alexbom commented 6 years ago

This is:

Expected Behavior

$phpWord get global variable without errors like in Readme :)

Current Behavior

modx phpword

Failure Information

Same behavior on phpword/bootstrap.php & phpword/vendor/autoload.php File is loaded, but the error is comming:

Fatal error: Uncaught Error: Class 'PhpOffice\PhpWord\PhpWord' not found in...

How to Reproduce

First tried in snippet, then tried in console simple installation code from Readme:

<?php
require_once 'phpword/vendor/autoload.php';

$phpWord = new \PhpOffice\PhpWord\PhpWord();

Context

Breaking brain for 2 days, my friends! :) Please, help )

troosan commented 6 years ago

I'm guessing this is not a PHPWord issue but rather a modx/composer issue.

alexbom commented 6 years ago

I've installed composer locally and made installation instructions of PHPWord. Then i've uploaded PHPWord files to remote server. So i don't need composer this way. Don't i?

troosan commented 6 years ago

Indeed, not sure what the relative path should be when executing code through eval(...) though