Comments (4)
Oh thank you @oleibman, but I yes, I should have said. If we have this, then we get the error I reported earlier:
require_once('../../../../wp-load.php');
require_once __DIR__ . '/../vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Helper\Sample;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Style\Border;
use PhpOffice\PhpSpreadsheet\Style\Fill;
use PhpOffice\PhpSpreadsheet\Style\Font;
use PhpOffice\PhpSpreadsheet\Style\Style;
use PhpOffice\PhpSpreadsheet\Style\Alignment;
$spreadsheet = new Spreadsheet();
But then if we swap the first two lines round like this, and click the button to submit the data, no error happens - but nothing happens.
require_once __DIR__ . '/../vendor/autoload.php';
require_once('../../../../wp-load.php');
use PhpOffice\PhpSpreadsheet\Helper\Sample;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Style\Border;
use PhpOffice\PhpSpreadsheet\Style\Fill;
use PhpOffice\PhpSpreadsheet\Style\Font;
use PhpOffice\PhpSpreadsheet\Style\Style;
use PhpOffice\PhpSpreadsheet\Style\Alignment;
$spreadsheet = new Spreadsheet();
from phpspreadsheet.
Not a WordPress user, but I will ask what could be a pertinent question. Before any use
statements in my mainline program, I have the statement:
require __DIR__ . '/vendor/autoload.php'; // note your location may vary
You mention a require_once
for WordPress; are you also including the statement above or equivalent?
from phpspreadsheet.
Sorry it wasn't a simple solution. I don't have any other ideas. Have you asked this question of WordPress?
from phpspreadsheet.
Thanks very much anyway! Not that easy to contact WordPress alas, but I'll try some Facebook groups too. Much appreciated.
from phpspreadsheet.
Related Issues (20)
- SET TRANSACTION ISOLATION LEVEL SERIALIZABLE in php?!! help me!!!!!!!!!! HOT 2
- Error: Typed property PhpOffice\PhpSpreadsheet\Worksheet\Worksheet::$parent must not be accessed before initialization HOT 5
- Chart: Not able to use multiple bar types (DataSeries::TYPE_BARCHART) in a single chart.
- Checking and converting loaded content in HTML Reader based on charset HOT 7
- Php 7.1 doesn't work with 1.11 and 1.12 versions (at least) HOT 1
- ZipStream error HOT 1
- Not able to write an xlsm file - phpoffice phpspreadsheet version 1.25.2 HOT 1
- Xml::loadSpreadsheetFromString() tries to open file when using falsy argument
- XML-Readers: Border Specification
- XML-Reader: support rich text HOT 1
- XML-Reader: interpret zoom
- PhpSpreadsheet can't retrieve images placed inside cell HOT 2
- Feature request: functionality to detect and read sheet tables and related styles HOT 6
- HTML export ignores setSize / getColor cell formats HOT 5
- v2.0.0 data corruption in non-UTF-8 apps as a result of dependency voku/portable-utf8 autoloader setting default_charset and mb_internal_encoding to "UTF-8" HOT 2
- Incorrect reader used for CSV files with BOM HOT 1
- The way to Protect only a particular cell is not working. How do i lock a particular row or column HOT 1
- Image can#t be inserted inside Cell, the same way as the newest Excel sheet or google sheet HOT 4
- Cannot read csv files that contain '<a href=' and do not have the extension ‘.csv’ ‘.tsv’.
- Textboxes, shape are not visible when using mergefields in file that contains image (Excel) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpspreadsheet.