Loading...
 
Skip to main content

History: Console

Source of version: 61 (current)

Copy to clipboard
            ! Console
Tiki Console is to administer your Tiki instance via the command line. It is based on [http://symfony.com/doc/master/components/console/introduction.html|Symfony's Console Component].

You can also use via ((Manager|instance:console in Tiki Manager))

''Please note that the following information is given for [https://tiki.org/Versions|Tiki LTS versions], more commands exists and this list will be updated as the next LTS is released. Source code for next version of Tiki is here: https://gitlab.com/tikiwiki/tiki/-/tree/master/lib/core/Tiki/Command''
{CODE(caption="Type this command in the base directory of your Tiki instance to discover all the commands for your version." theme="default")}php console.php{CODE}
{TABS(name="WYSIWYG" tabs="27.x LTS|24.x LTS")}
If you want to learn the inner workings, source code is here: https://gitlab.com/tikiwiki/tiki/-/tree/27.x/lib/core/Tiki/Command

{CODE(colors="shell", ln="0")}
user@server:/www/tiki$ php console.php
Tiki Console Tool

Usage:
  command [options] [arguments]

Options:
  -h, --help             Display help for the given command. When no command is given display help for the list command
  -q, --quiet            Do not output any message
  -V, --version          Display this application version
      --ansi|--no-ansi   Force (or disable --no-ansi) ANSI output
  -n, --no-interaction   Do not ask any interactive question
      --site=SITE        Multi-Tiki instance
      --as-user=AS-USER  Run the command as a different Tiki user
  -v|vv|vvv, --verbose   Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  completion                           Dump the shell completion script
  help                                 Display help for a command
  list                                 List commands
 attachments
  attachments:migrate                  Convert legacy wiki attachment storage to file galleries or vice versa depending on settings.
 backup
  backup:files                         Create a backup of Tiki instance files
 build
  build:generateiconlist               Generate theme's iconset
 cache
  cache:clear                          Clear Tiki caches
  cache:generate                       Generate Tiki caches
 calendar
  calendar:sync                        Synchronize calendar subscriptions that are due depending on last sync date and refresh rate
 daily-report
  daily-report:sendd                   Send daily user reports
 database
  database:backup                      Create a database backup (with mysqldump)
  database:configure                   Database: Configure (write local.php)
  database:install                     Clean Tiki install
  database:patch                       Apply a specific database schema patch
  database:update                      Update the database to the latest schema
 dev
  dev:buildwsconfs                     Checks or generate .index.php & .htaccess files.
  dev:configure                        Install or update development files
  dev:fixbom                           Fix BOM and line endings for all files
  dev:fixstyle                         Fix code style of changed files
  dev:remove                           Remove Tiki development files
 faker
  faker:comments                       Generate comments fake data
  faker:tracker                        Generate tracker fake data
 files
  files:batchupload                    Batch upload files into the file galleries
  files:check                          Detect orphan or extra files
  files:copy                           Copy files from file galleries to a regular directory on the file system
  files:deleteold                      Remove expired files which were uploaded using the deleteAfter option
  files:index                          Index files
  files:move                           Move files from file galleries to a regular directory on the file system
  files:sync                           Synchronize direct mapping mode file galleries from source
 gallery
  gallery:migrate                      Migrate images from the Image Gallery to the File Gallery
 goal
  goal:check                           Reviews all active goals and assigns rewards.
 index
  index:catch-up                       Catch-up on incremental indexing.
  index:cleanup                        Deletes unused search indexes to free up space and maintain optimal search performance.
  index:compare-engines                Compare search engine results in wikiplugins
  index:optimize                       Optimize the unified search index
  index:rebuild                        Fully rebuild the unified search index
 installer
  installer:lock                       Disable the installer
  installer:unlock                     Enable the installer
 list
  list:execute                         Performs Plugin ListExecute command on a particular page
 mail-in
  mail-in:poll                         Read the mail-in messages
 mail-queue
  mail-queue:send                      Send the messages stored in the Mail Queue
 markdown
  markdown:convert                     Convert wiki pages between Tiki syntax and Markdown
 ml
  ml:train                             Train a particular machine learning model
 multitiki
  multitiki:list                       List MultiTikis in a path
  multitiki:move                       Moves a MultiTiki site from one tiki instance to another
 notification
  notification:digest                  Send out email notification digests
 objects
  objects:export-jsonl                 Export objects in JSONL format, typically to ingest in a machine learning system
  objects:notify-maintainers           Send out email notification to maintainers for objects whose freshness is greater than the limit
 package
  package:clearcache                   Deletes all content from Composer's cache directories.
  package:disable                      Disable a Tiki Package
  package:enable                       Enable a Tiki Package
  package:install                      Install package
  package:list                         List installed/available to install packages
  package:remove                       Remove package
  package:update                       Update package
 plugin
  plugin:approve                       Approve a list of plugin invocations/calls
  plugin:list                          List all plugin invocations/calls
  plugin:pending                       Send notification to users who can approve plugin
  plugin:refresh                       Parses all the pages to refresh the list of plugin invocations/calls
 preferences
  preferences:delete                   Delete a preference
  preferences:export                   Export preferences
  preferences:get                      Get a preference
  preferences:rebuild-index            Fully rebuild the preferences index
  preferences:set                      Set a preference
 profile
  profile:apply                        Apply a profile
  profile:baseline                     Generate the SQL patch to assign profile symbols for an existing installation.
  profile:export:activity-rule-set     Export all activity stream rules into a set
  profile:export:activity-stream-rule  Export an activity stream rule
  profile:export:all-modules           Export all module definitions
  profile:export:article               Export an article definition
  profile:export:article-topic         Export an article topic definition
  profile:export:article-type          Export an article type definition
  profile:export:calendar              Export a calendar
  profile:export:category              Export a category
  profile:export:file-gallery          Export a file gallery definition
  profile:export:finalize              Clean-up the working profile of intermediate data
  profile:export:forum                 Export a forum definition
  profile:export:goal                  Export a goal
  profile:export:goal-set              Export all goals into a set
  profile:export:group                 Export a group definition
  profile:export:include-profile       Includes references from an other profile as valid objects
  profile:export:init                  Initialize profile export for current site.
  profile:export:menu                  Export a menu definition
  profile:export:module                Export a module definition
  profile:export:preference            Include a preference within the profile definition
  profile:export:rating-config         Export an advanced rating configuration
  profile:export:rating-config-set     Export all advanced rating configurations into a set
  profile:export:recent-changes        List the recent changes in prevision of export
  profile:export:rss                   Export an RSS Feed definition
  profile:export:tabular               Export a tracker import-export format definition
  profile:export:tracker               Export a tracker definition
  profile:export:tracker-field         Export a tracker field definition
  profile:export:tracker-item          Export a tracker item definition
  profile:export:wiki-page             Export a wiki page
  profile:forget                       Forget a profile installation
 recommendation
  recommendation:batch                 Identify and send recommendations
 reportcache
  reportcache:clear                    Clean user reports cache
 rss
  rss:clear                            Clear incoming RSS feed cache
  rss:refresh                          Refresh incoming RSS feeds
 scheduler
  scheduler:heal                       Heal scheduled tasks
  scheduler:run                        Run scheduled tasks
 security
  security:vendorcheck                 Check vendor files against known security issues.
 sieve
  sieve:filters                        Execute defined Sieve filters in Cypht
 sitemap
  sitemap:generate                     Generate sitemap
 theme
  theme:install                        Install a new theme
  theme:remove                         Remove a theme
  theme:update                         Update a theme
 tiki
  tiki:info                            Displays the Tiki and/or PHP version
  tiki:stats                           Display a table with the KPIs
 tokens
  tokens:clear                         Remove expired tokens
 tracker
  tracker:clear                        Clear all items from a tracker without warning or notifications. Use with care!
  tracker:convert-attachments          Convert tracker attachments
  tracker:export                       Export a CSV file from a tracker using a tracker import-export format
  tracker:import                       Import a CSV file into a tracker using a tracker import-export format or initiate an ODBC import
  tracker:recalc                       Recalculate all math fields items from a tracker
 translation
  translation:englishupdate            Fix English strings after modifying them.
  translation:export                   Update language.php translations from the database
  translation:getstrings               Update language.php files with new strings
  translation:percentage               Get the translation percentage for each language.php file
 users
  users:create                         Create a new user
  users:list                           Display the list of users in the system
  users:password                       Set the password to a given user
  users:remove-cookies                 Remove expired cookies
  users:temporary                      Create temporary user(s) with specific privileges
  users:unlock                         Unlock a user
 vcs
  vcs:automerge                        Semi Auto Merge
  vcs:update                           Update Tiki to latest version & perform tasks for a smooth update.
{CODE}
/////
If you want to learn the inner workings, source code is here: https://gitlab.com/tikiwiki/tiki/-/tree/24.x/lib/core/Tiki/Command

{CODE(colors="shell", ln="0")}
user@server:/www/tiki$ php console.php
Tiki Console Tool

Usage:
  command [options] [arguments]

Options:
  -h, --help             Display this help message
  -q, --quiet            Do not output any message
  -V, --version          Display this application version
      --ansi             Force ANSI output
      --no-ansi          Disable ANSI output
  -n, --no-interaction   Do not ask any interactive question
      --site=SITE        Multi-Tiki instance
      --as-user=AS-USER  Run the command as a different Tiki user
  -v|vv|vvv, --verbose   Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  help                        Displays help for a command
  list                        Lists commands
 backup
  backup:files                Create a backup of Tiki instance files
 cache
  cache:clear                 Clear Tiki caches
  cache:generate              Generate Tiki caches
 daily-report
  daily-report:send           Send daily user reports
 database
  database:backup             Create a database backup (with mysqldump)
  database:configure          Database: Configure (write local.php)
  database:install            Clean Tiki install
  database:patch              Apply a specific database schema patch
  database:update             Update the database to the latest schema
 dev
  dev:configure               Install or update development files
  dev:fixbom                  Fix BOM and line endings for all files
 faker
  faker:comments              Generate comments fake data
  faker:tracker               Generate tracker fake data
 files
  files:batchupload           Batch upload files into the file galleries
  files:check                 Detect orphan or extra files
  files:copy                  Copy files from file galleries to a regular directory on the file system
  files:deleteold             Remove expired files which were uploaded using the deleteAfter option
  files:index                 Index files
  files:move                  Move files from file galleries to a regular directory on the file system
 gallery
  gallery:migrate             Migrate images from the Image Gallery to the File Gallery
 goal
  goal:check                  Reviews all active goals and assigns rewards.
 index
  index:catch-up              Catch-up on incremental indexing.
  index:compare-engines       Compare search engine results in wikiplugins
  index:optimize              Optimize the unified search index
  index:rebuild               Fully rebuild the unified search index
 installer
  installer:lock              Disable the installer
 list
  list:execute                Performs Plugin ListExecute command on a particular page
 mail-in
  mail-in:poll                Read the mail-in messages
 mail-queue
  mail-queue:send             Send the messages stored in the Mail Queue
 ml
  ml:train                    Train a particular machine learning model
 multitiki
  multitiki:list              List MultiTikis in a path
  multitiki:move              Moves a MultiTiki site from one tiki instance to another
 notification
  notification:digest         Send out email notification digests
 objects
  objects:notify-maintainers  Send out email notification to maintainers for objects whose freshness is greater than the limit
 package
  package:clearcache          Deletes all content from Composer's cache directories.
  package:disable             Disable a Tiki Package
  package:enable              Enable a Tiki Package
  package:install             Install package
  package:list                List installed/available to install packages
  package:remove              Remove package
  package:update              Update package
 plugin
  plugin:approve              Approve a list of plugin invocations/calls
  plugin:list                 List all plugin invocations/calls
  plugin:refresh              Parses all the pages to refresh the list of plugin invocations/calls
 preferences
  preferences:delete          Delete a preference
  preferences:export          Export preferences
  preferences:get             Get a preference
  preferences:rebuild-index   Fully rebuild the preferences index
  preferences:set             Set a preference
 profile
  profile:apply               Apply a profile
  profile:baseline            Generate the SQL patch to assign profile symbols for an existing installation.
  profile:export:init         Initialize profile export for current site.
  profile:forget              Forget a profile installation
 recommendation
  recommendation:batch        Identify and send recommendations
 rss
  rss:clear                   Clear incoming RSS feed cache
  rss:refresh                 Refresh incoming RSS feeds
 scheduler
  scheduler:heal              Heal scheduled tasks
  scheduler:run               Run scheduled tasks
 scss
  scss:compile                Compile SCSS theme files into CSS
 sitemap
  sitemap:generate            Generate sitemap
 theme
  theme:install               Install a new theme
  theme:remove                Remove a theme
  theme:update                Update a theme
 tiki
  tiki:info                   Displays the Tiki and/or PHP version
  tiki:stats                  Display a table with the KPIs
 tokens
  tokens:clear                Remove expired tokens
 tracker
  tracker:clear               Clear all items from a tracker without warning or notifications. Use with care!
  tracker:export              Export a CSV file from a tracker using a tracker tabular format
  tracker:import              Import a CSV file into a tracker using a tracker tabular format or initiate an ODBC import
  tracker:recalc              Recalculate all math fields items from a tracker
 translation
  translation:englishupdate   Fix English strings after modifying them.
  translation:export          Update language.php translations from the database
  translation:getstrings      Update language.php files with new strings
  translation:percentage      Get the translation percentage for each language.php file
 users
  users:create                Create a new user
  users:list                  Display the list of users in the system
  users:password              Set the password to a given user
  users:remove-cookies        Remove expired cookies
  users:unlock                Unlock a user
 vcs
  vcs:automerge               Semi Auto Merge
  vcs:fixids                  Fix the Id's of SVN Keyword for all files
  vcs:update                  Update Tiki to latest version & perform tasks for a smooth update.

{CODE}

{TABS}
~tc~ {img fileId="802"} ~/tc~

!! Examples
Below are some common examples of how to use the console. They are typically for a recent version (so if they don't work, it could be that your Tiki is too old)

!!! Help on database update 
{CODE()}php console.php database:update --help
{CODE}

!!! To mark an upgrade error as registered (so it will be ignored)
{CODE()}php console.php database:update --auto-register
{CODE}
'' This is useful if you get database errors such as "Duplicate entry..." sometimes''

!!! Help on database install
{CODE()}php console.php database:install --help
{CODE}

!!! Translations
{CODE(colors="shell", ln="0")}
  translation:englishupdate   Fix English strings after modifying them.
  translation:export          Update language.php translations from the database
  translation:getstrings      Update language.php files with new strings
  translation:percentage      Get the translation percentage for each language.php file
{CODE}

!!!! Translation Update Examples
For example if you fix a typo in a string which is already translated, e.g. you fix "Setttings" to "Settings":
{CODE(color="tiki" caption="Fixing a typo in the original English string for all languages")}
  php console.php translation:englishupdate
{CODE}

It will update all languages without modifying the translated part (in case it was already translated), so e.g. in the French language.php it will fix this:
{CODE()}
"Setttings" => "Paramètres",
{CODE}

To this:
{CODE()}
"Settings" => "Paramètres",
{CODE}

Without the need to re-translate the string which had a typo in the English original again.

!!!! Parameters
You can use the following parameters with translation:getstrings
{CODE(colors="shell", ln="0")}
[-l|--lang [LANG]] [--outputfiles] [--exclude [EXCLUDE]] [--include [INCLUDE]] [--basedir [BASEDIR]] [--filename [FILENAME]]
{CODE}

{CODE(color="tiki" caption="Getting string for a single language")}
  php console.php translation:getstrings --lang=en
{CODE}

Note: The basedir parameter is working only if it point to this or another Tiki root directory (will search for /lang/...)

!!! Batch Upload
''A console command for ((Batch Upload)) so you can set a scheduled batch upload cron task''

{CODE(caption="Example command line usage" colors="shell")}
# file according to sub-directory name and create missing galleries
php console.php files:batchupload 1  --subdirToSubgal  --createSubgals

# file according using sub-directory with integer name into gallery with corresponding ID
php console.php files:batchupload 1  --subdirToSubgal --subdirIntegerToSubgalId

# set file user etc so apache can manage the files afterwards
php console.php files:batchupload 1  --fileUser apache --fileGroup allusers --fileMode 0775

# upload files from a different directory
php console.php files:batchupload 1 --filesPath /var/www/other/uploads

# more help
php console.php help files:batchupload
{CODE}

!!! Plugin List Execute
Actions can be run in conjunction with ((PluginListExecute)):
{CODE()}
php console.php list:execute "Page Name" "Action Name"
{CODE}

If you see this type of error message:
{CODE()}
[root@server]# php console.php list:execute "Batch Sync Users" "SyncUsersTrackers"
Command not available at this stage. Complete required installation steps.
[root@server]# 
{CODE}

You may need to update the database schema first, with the usual:
{CODE()}
[root@server]# php console.php d:u
{CODE}

!!! Wiki Plugin Approval
{CODE()}
plugin:approve
plugin:list
plugin:refresh
{CODE}

!!! Disable the Installer
Disable the installer:
{CODE()}
php console.php installer:lock
{CODE}

!!!  Manage files from file galleries
Copy files from a gallery to a regular directory on the filesystem:
{CODE()}
php console.php files:copy 1 /tmp/dest/
{CODE}
Move files from a gallery to a regular directory on the filesystem:
{CODE()}
php console.php files:move 1 /tmp/dest/ --confirm
{CODE}

!!! Clear Caches and options
{CODE(caption="All the cache")}php console.php c:c
{CODE}
{CODE(caption="All the cache")}php console.php c:c all
{CODE}
{CODE(caption="Help")}php console.php c:c help
{CODE}
{CODE(caption="Database cache")}php console.php c:c private
{CODE}
{CODE(caption="Modules cache")}php console.php c:c modules
{CODE}
{CODE(caption="Templates cache")}php console.php c:c templates
{CODE}
{CODE(caption="CSS and JS caches")}php console.php c:c public
{CODE}

!!! Users commands
A few commands related to user management are available in the Tiki console.
{CODE()}
 users
  users:create                Create a new user
  users:list                  Display the list of users in the system
  users:password              Set the password to a given user
  users:unlock                Unlock a user
{CODE}

{RBOX(title="Note")}If you get -+Credentials file local.php not found. See http://doc.tiki.org/Installation for more information.+- message it means you are doing fresh install from command line and need to create the -+db/local.php+- file manually first or run the Installer via a web browser.{RBOX}
~tc~ The RBOX above is an alias for {remarksbox type="information" title="Note"} ~/tc~

!!! Getting advanced help
{img fileId="803"}

!!! More advanced examples
See more advanced examples, where memory limit or execution timeout are raised, or rebuild is forced and logged, in this other page:
* ((Search and List from Unified Index))

-=alias=-
* (alias(Command Line Tool)) | (alias(Console Tool)) | (alias(Command-line tool))