phpxlsx CLI command
phpxlsx CLI command
phpxlsx Premium licenses include a phpxlsx-cli script to speed up developments and assist you in the work with phpxlsx by generating sample code skeletons, checking server settings, returning information and other useful tasks.
To run phpxlsx-cli.php and view all available options, execute:
If no option or valid parameter are set, the help information is displayed.
For example, the following command generates a skeleton (phpxlsx-sample-skeleton.php as default) to create a new XLSX adding cell, html and sheet methods:
The available options are the following:.
Supported methods in spreadsheets generated from scratch:
- activeSheet
- backgroundImage
- break
- cell
- cellRange
- chart
- comment
- csv
- definedName
- footer
- function
- getCell
- header
- html
- image
- link
- mathEquation
- properties
- removeCell
- rtl
- settings
- shape
- sheet
- style
- svg
- table
- textBox
Supported methods in spreadsheets generated with a template:
- getTemplateVariables
- removeVariable
- removeVariableImage
- replaceImage
- replaceText
- setTemplateSymbol
Template methods are only added to the skeleton when a XLSX template is set using "-t" parameter:
These template methods are not added to the skeleton when creating a new XLSX without a template.
Other supported methods:
- encrypt
- protect
- sign
- stream
- transform
To display all available methods use --view-methods:
Generate a phpxlsx skeleton using cell, html and sheet methods:
Generate a phpxlsx skeleton using a template and replaceImage and replaceText methods:
Generate a phpxlsx skeleton and save the sample as custom-skeleton.php:
Check server settings:
View phpxlsx license information: