phpxlsx CLI command

phpxlsx CLI command

Information

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.

How to use

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:

Available options

The available options are the following:.

Skeleton methods

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
  • rtl
  • settings
  • shape
  • sheet
  • style
  • svg
  • table
  • textBox

Supported methods in spreadsheets generated with a template:

  • getTemplateVariables
  • removeVariable
  • 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:

Examples

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: