Changeset 711
- Timestamp:
- 11/15/08 15:20:31 (4 years ago)
- Location:
- trunk/core/data/TWiki
- Files:
-
- 1 edited
- 1 moved
-
CommandAndCGIScripts.txt (moved) (moved from trunk/core/data/TWiki/TWikiScripts.txt) (14 diffs)
-
CompleteDocumentation.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/data/TWiki/CommandAndCGIScripts.txt
r700 r711 1 1 %META:TOPICINFO{author="ProjectContributor" date="1168672578" format="1.1" version="$Rev$"}% 2 2 %STARTINCLUDE% 3 ---+ TWikiCGI and Command Line Scripts4 5 _Programs on the TWikiserver performing actions such as rendering, saving and renaming topics._6 7 The TWiki scripts are located in the =twiki/bin= and =twiki/tools= directories. This topic describes the interfaces to some of those scripts. All scripts in the =twiki/bin= directory can be called from the CGI ([[http://en.wikipedia.org/wiki/Common_Gateway_Interface][Common Gateway Interface]]) environment or from the command line. The scripts in the =twiki/tools= directory can only be called from the command line.3 ---+ CGI and Command Line Scripts 4 5 _Programs on the server performing actions such as rendering, saving and renaming topics._ 6 7 These scripts are located in the =bin= and =tools= directories. This topic describes the interfaces to some of those scripts. All scripts in the =twiki/bin= directory can be called from the CGI ([[http://en.wikipedia.org/wiki/Common_Gateway_Interface][Common Gateway Interface]]) environment or from the command line. The scripts in the =twiki/tools= directory can only be called from the command line. 8 8 9 9 %TOC% … … 14 14 ---+++ General Information 15 15 ---++++ CGI environment 16 In the CGI environment parameters are passed to the scripts via the URL and URL parameters. Environment variables are also used to determine the user performing the action. If the environment is not set up, the default TWikiuser is used (usually =guest=).16 In the CGI environment parameters are passed to the scripts via the URL and URL parameters. Environment variables are also used to determine the user performing the action. If the environment is not set up, the default user is used (usually =guest=). 17 17 ---++++ Command-line 18 18 You *must* be have the =twiki/bin= directory on the perl path to run the scripts from the command line. To avoid issues with file permissions, run the scripts as the web server user such as =nobody= or =www=. … … 29 29 30 30 | *Parameter* | *Description* | *Default* | 31 | =topic= | If this is set to a URL, TWikiwill immediately redirect to that URL. Otherwise it overrides the URL and is taken as the topic name (you can pass Web.<nop>TopicName) | |31 | =topic= | If this is set to a URL, %WIKITOOLNAME% will immediately redirect to that URL. Otherwise it overrides the URL and is taken as the topic name (you can pass Web.<nop>TopicName) | | 32 32 | =user= | Command-line only; set the name of the user performing the action. Note: this usage is inherently insecure, as it bypasses webserver login constraints. For this reason only authorised users should be allowed to execute scripts from the command line. | | 33 33 | =skin= | Overrides the default skin path (see [[Skins]]) | | … … 54 54 55 55 ---+++ =configure= 56 =configure= is the browser script used for inspection and configuration of the TWikiconfiguration. None of the parameters to this script are useable for any purpose except =configure=. See [[%SCRIPTURLPATH{"configure"}%][configure]].56 =configure= is the browser script used for inspection of, and cahnges to, the site configuration. None of the parameters to this script are useable for any purpose except =configure=. See [[%SCRIPTURLPATH{"configure"}%][configure]]. 57 57 58 58 ---+++ =edit= … … 78 78 79 79 ---+++ =login= 80 Used for logging in w hen TWiki login is being used (e.g !TemplateLoginManager).80 Used for logging in with !TemplateLoginManager. 81 81 | *Parameter* | *Description* | *Default* | 82 82 | =origurl= | URL that was being accessed when an access violation occurred. the login process will redirect to this URL if it is successful | none | … … 159 159 160 160 ---+++ =rdiff= 161 Renders the differences between version of a TWikitopic161 Renders the differences between version of a topic 162 162 163 163 | *Parameter* | *Description* | *Default* | … … 190 190 191 191 ---+++ =rest= 192 This REST ([[http://en.wikipedia.org/wiki/REST][Representational State Transfer]]) script can be invoked via http in the same way as the other TWikiscripts (see *Invocation Examples*, below) to execute a function that is associated to a "subject" and a "verb" (see below). These functions are usually registered by plugins using the =TWiki::Func::registerRESTHandler= method. The =rest= script will print the result directly to the browser unless the =endPoint= parameter is specified, in which case it will output a redirect to the given topic.192 This REST ([[http://en.wikipedia.org/wiki/REST][Representational State Transfer]]) script can be invoked via http in the same way as the other scripts (see *Invocation Examples*, below) to execute a function that is associated to a "subject" and a "verb" (see below). These functions are usually registered by plugins using the =TWiki::Func::registerRESTHandler= method. The =rest= script will print the result directly to the browser unless the =endPoint= parameter is specified, in which case it will output a redirect to the given topic. 193 193 194 194 The =rest= script supports the following parameters: … … 200 200 The function is free to use any other query parameters for its own purposes. 201 201 202 %X% The =rest= script should *always* require authentication in any TWikithat has logins. Otherwise there is a risk of opening up major security holes. So make sure you add it to the list of authenticated scripts if you are using =ApacheLogin=.202 %X% The =rest= script should *always* require authentication in any site that has logins. Otherwise there is a risk of opening up major security holes. So make sure you add it to the list of authenticated scripts if you are using =ApacheLogin=. 203 203 204 204 ---++++ Invocation Examples … … 236 236 | =templatetopic= | Name of a topic to use as a template for the text and form (new topic _only_) | | 237 237 | =text= | New text of the topic | | 238 | =forcenewrevision= | if set, forces a revision even if TWikithinks one isn't needed | |238 | =forcenewrevision= | if set, forces a revision even if %WIKITOOLNAME% thinks one isn't needed | | 239 239 | =topicparent= | If 'none' remove any current topic parent. If the name of a topic, set the topic parent to this. | | 240 240 | =formtemplate= | if defined, use the named template for the form (will remove the form is set to 'none') | | … … 305 305 for example: 306 306 1 from browser %SCRIPTURL{"statistics"}% updates _all user webs_ 307 2 from browser %SCRIPTURL{"statistics"}%?webs= TWiki,Main,Sandbox updates _TWiki,Main,Sandbox_307 2 from browser %SCRIPTURL{"statistics"}%?webs=Userweb,Sandbox updates _Userweb,Sandbox_ 308 308 3 from browser %SCRIPTURL{"statistics"}%/%WEB% updates %WEB% 309 309 4 from command line twiki/bin/statistics updates _all user webs_ 310 5 from command line twiki/bin/statistics -webs= TWiki,Main,Sandbox updates _TWiki,Main,Sandbox_310 5 from command line twiki/bin/statistics -webs=Userweb,Sandbox updates _Userweb,Sandbox_ 311 311 6 from command line twiki/bin/statistics %WEB%.<nop>WebHome updates %WEB% 312 312 313 see TWikiSiteTools#WebStatistics_site_statistics for updating statistics using cron.313 see SiteTools#WebStatistics_site_statistics for updating statistics using cron. 314 314 315 315 ---+++ =upload= … … 336 336 | =contenttype= | Allows you to specify a different *Content-Type:* (e.g. =contenttype=text/plain=) | | 337 337 | =rev= | Revision to view (e.g. =rev=45=) | | 338 | =template= | Allows you to specify a different skin template, overriding the 'view' template the view script would normally use. The default template is =view=. For example, you could specify [[%SCRIPTURLPATH{"view"}%/%WEB%/%TOPIC%?template=edit][%SCRIPTURLPATH{"view"}%/%WEB%/%TOPIC%?template=edit]]. This is mainly useful when you have specialised templates for a TWiki Application. | |338 | =template= | Allows you to specify a different skin template, overriding the 'view' template the view script would normally use. The default template is =view=. For example, you could specify [[%SCRIPTURLPATH{"view"}%/%WEB%/%TOPIC%?template=edit][%SCRIPTURLPATH{"view"}%/%WEB%/%TOPIC%?template=edit]]. This is mainly useful when you have specialised templates for a Wiki Application. | | 339 339 | =topic= | redirects (at the beging of the cgi script running) to show the spcified Web.Topic, or, redirects to a URL, if allowed by {AllowRedirectUrl} and {PermittedRedirectHostUrls} | | 340 340 341 %X% For historical reasons, the view script has a special interpretation of the =text= skin. In earlier TWiki versionsthe =skin=text= parameter was used like this:341 %X% For historical reasons, the view script has a special interpretation of the =text= skin. In TWiki < 4.0 the =skin=text= parameter was used like this: 342 342 =http<nop>://.../view/MyWeb/MyTopic?skin=text&contenttype=text/plain&raw=on= 343 343 which shows the topic as plain text; useful for those who want to download plain text for the topic. … … 358 358 359 359 ---+++ =geturl.pl= 360 This is a very simple script to get the content of a web site. It is marked as _deprecated_ and might be removed (or enhanced) in a future TWikirelease. Its functions are covered by the standard =wget= and =curl= commands.360 This is a very simple script to get the content of a web site. It is marked as _deprecated_ and might be removed (or enhanced) in a future release. Its functions are covered by the standard =wget= and =curl= commands. 361 361 * Usage: =geturl.pl <host> <path> [<port> [<header>]]= 362 362 * Example: =geturl.pl some.domain /some/dir/file.html 80= … … 364 364 365 365 ---+++ =rewriteshebang.pl= 366 Simple script to rewrite the =#!/usr/bin/perl= shebang lines specific to your local Perl installation. It will rewrite the first line of all your TWikicgi scripts so they use a different shebang line. Use it if your perl is in a non-standard location, or you want to use a different interpreter (such as 'speedy').366 Simple script to rewrite the =#!/usr/bin/perl= shebang lines specific to your local Perl installation. It will rewrite the first line of all your cgi scripts so they use a different shebang line. Use it if your perl is in a non-standard location, or you want to use a different interpreter (such as 'speedy'). 367 367 368 368 ---+++ =tick_twiki.pl= 369 This script executes a number of non-essential regular administration tasks that will help keep your TWikihealthy and happy, such as removing expired sessions and lease files.369 This script executes a number of non-essential regular administration tasks that will help keep your site healthy and happy, such as removing expired sessions and lease files. 370 370 371 371 It is intended to be run as a cron job or a scheduled task once a week. Example crontab entry:%BR% … … 374 374 __Note:__ The script has to be run by a user who can write files created by the webserver user. 375 375 376 377 378 376 __Related Topics:__ AdminDocumentationCategory, DeveloperDocumentationCategory -
trunk/core/data/TWiki/CompleteDocumentation.txt
r709 r711 1 1 %META:TOPICINFO{author="ProjectContributor" date="1168078214" format="1.1" version="$Rev: 14760 $"}% 2 ---+!! TWikiReference Manual (%WIKIVERSION%)2 ---+!! Reference Manual (%WIKIVERSION%) 3 3 4 4 This page contains all documentation topics as one long, complete reference sheet. … … 98 98 99 99 ------ 100 %INCLUDE{" TWikiScripts"}%100 %INCLUDE{"CommandAndCGIScripts"}% 101 101 102 102 [[#PageTop][Back to top]]
Note: See TracChangeset
for help on using the changeset viewer.
