Child pages
  • Export language packs via cli
Skip to end of metadata
Go to start of metadata

Export via cli

General

Since version 1.1.0 oTranCe offers a command line interface for the standard public/index.php. It can be called via cli/shell or using a cronjob.

Calling it without params or with the --help or -h option will show the usage.

php index.php

Usage: index.php [ options ]
--username|-u <string>   The user name to use in oTranCe.
--pass|-p <string>       The password of the user in oTranCe.
--controller|-c <string> The controller to call.
--action|-a [ <string> ] The action of the controller to call. If not given defauls to "index".
--help|-h                Show this help. Example call: php index.php -u User -p Password -c Export -a update-all

oTranCe needs an user that is registered in oTranCe and logs him in. Permissions are checked just like in the web gui.
You can trigger any action of any controller. If there is a cli view for this action defined, you get a clean, cli optimised output. Otherwise you will get the HTML output without the surrounding layout.
Currently there are cli views for the Export controller and it's actions update-all and commit.

These should be the most interesting actions because we want to execute them via shell/cronjob.

 

Export of current state

To trigger the export of the current status into language files you can call:

php pathToOtrance/public/index.php -u MyUserName -p MyUsersPassword -c Export -a update-all

Example output:

Executing: update-all action of controller Export
Exporting language files
cs    Czech               cs/lang.php                                          28.23 KB
cs    Czech               cs/azurelang.php                                     379.00 B
de    Deutsch             de/lang.php                                          54.08 KB
de    Deutsch             de/azurelang.php                                     389.00 B
en    English             en/lang.php                                          28.24 KB
en    English             en/azurelang.php                                     386.00 B

This will export the current state to physical files on disk. They are created and saved in the folder pathToOtranCe/data/export .

Additionally all language files are packed together into archives. They are created in pathToOtranCe/data/downloads.

 

  • No labels