File: commands.it.html

package info (click to toggle)
rivet 0.5.0-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,664 kB
  • ctags: 1,359
  • sloc: sh: 8,342; xml: 6,622; ansic: 4,367; tcl: 2,813; makefile: 99; lisp: 78; sql: 25
file content (171 lines) | stat: -rw-r--r-- 21,563 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Comandi e variabili Tcl di Rivet</title><link rel="stylesheet" href="rivet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.66.1"><link rel="start" href="index.it.html" title="Apache Rivet"><link rel="up" href="index.it.html" title="Apache Rivet"><link rel="prev" href="directives.it.html" title="Direttive di Apache"><link rel="next" href="examples.it.html" title="Esempi ed uso"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Comandi e variabili Tcl di Rivet</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="directives.it.html"><img src="images/prev.png" alt="Indietro"></a></td><th width="60%" align="center"></th><td width="20%" align="right"><a accesskey="n" href="examples.it.html"><img src="images/next.png" alt="Avanti"></a></td></tr></table></div><div class="section" lang="it"><div class="titlepage"><div><div><hr><h2 class="title" style="clear: both"><a name="commands"></a>Comandi e variabili Tcl di Rivet</h2></div></div></div><div class="variablelist"><dl><dt><span class="term">
	  <div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">var</span>  (<span style="font-family:monospace; font-weight: bold;">get</span> | <span style="font-family:monospace; font-weight: bold;">list</span> | <span style="font-family:monospace; font-weight: bold;">exists</span> | <span style="font-family:monospace; font-weight: bold;">number</span> | <span style="font-family:monospace; font-weight: bold;">all</span>)</div></div>
	</span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
	    Il comando <span style="font-family:monospace"><span><b class="command">var</b></span></span> recupera le informazioni
	    circa le variabili GET o POST, inviando lo script tramite una
	    richiesta del client. Il trattamento di entrambe le 
	    variabili GET e POST  identico, in considerazione delle 
	    loro origini. Notate che vi sono due forme aggiuntive di 
	    <span style="font-family:monospace"><span><b class="command">var</b></span></span>: <span style="font-family:monospace"><span><b class="command">var_qs</b></span></span> e 
	    <span style="font-family:monospace"><span><b class="command">var_post</b></span></span>.
	    Queste due forme restringono le informazioni sui parametri
	    ottenendo rispettivamente la querystring 
	    (?foo=bar&amp;bee=bop) o la POSTing.
	  </div><div class="variablelist"><dl><dt><span class="term">
		<div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex ">?<span style="font-family:monospace; font-weight: bold;">get</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>varname</tt></i></span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>?<span class="optional">default</span>?</tt></i></span>?</div></div>
	      </span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
		  Ritorna il valore della variabile
		  <i class="replaceable"><tt>varname</tt></i>
		  come una stringa (anche se vi sono valori multipli). Se
		  non esiste come variabile GET o POST, viene restituito 
		  il valore 
	<i class="replaceable"><tt>?<span class="optional">default</span>?</tt></i>,
		  altrimenti viene ritornato "" (una stringa vuota).
		</div></div></dd><dt><span class="term">
		<div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex ">?<span style="font-family:monospace; font-weight: bold;">list</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>varname</tt></i></span>?</div></div>
	      </span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
		  Restituisce il valore della variabile
		  <i class="replaceable"><tt>varname</tt></i> come
		  una lista, se vi sono valori multipli.
		</div></div></dd><dt><span class="term">
		<div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex ">?<span style="font-family:monospace; font-weight: bold;">exists</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>varname</tt></i></span>?</div></div>
	      </span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
		  Restituisce 1 se
		  <i class="replaceable"><tt>varname</tt></i>
		  esiste, 0 se non lo .
		</div></div></dd><dt><span class="term">
		<div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex ">?<span style="font-family:monospace; font-weight: bold;">number</span>?</div></div>
	      </span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
		  Restituisce il numero di variabili.
		</div></div></dd><dt><span class="term">
		<div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex ">?<span style="font-family:monospace; font-weight: bold;">all</span>?</div></div>
	      </span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
		  Restituisce una lista di nomi di variabili e valori.
		</div></div></dd></dl></div><div style="margin-bottom:1.5ex ; padding .5ex">
	    Vedete <a href="examples.it.html#variable_access" title="Esempio3.Accesso alle variabili">Esempio3, &#8220;Accesso alle variabili&#8221;</a>.
	  </div></div></dd></dl></div><div class="variablelist"><dl><dt><span class="term">
	  <div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">upload</span>  (<span style="font-family:monospace; font-weight: bold;">channel</span> | <span style="font-family:monospace; font-weight: bold;">save</span> | <span style="font-family:monospace; font-weight: bold;">data</span> | <span style="font-family:monospace; font-weight: bold;">exists</span> | <span style="font-family:monospace; font-weight: bold;">size</span> | <span style="font-family:monospace; font-weight: bold;">type</span> | <span style="font-family:monospace; font-weight: bold;">filename</span>)</div></div>
	</span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">Il comando upload  usato per la manipolazione del 
	  caricamento dei file. Vedete le principali direttive di Apache 
	  per altri tipi di configurazioni del funzionamento di questa 
	  caratteristica di Rivet. </div><div class="variablelist"><dl><dt><span class="term">
		<div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex ">?<span style="font-family:monospace; font-weight: bold;">channel</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>uploadname</tt></i></span>?</div></div>
	      </span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
		  Quando date il nome ad un file caricato,
		  <i class="replaceable"><tt>uploadname</tt></i>
		  restituisce un canale Tcl che pu essere usato per
		  accedere allo stesso file.
		</div></div></dd><dt><span class="term">
		<div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex ">?<span style="font-family:monospace; font-weight: bold;">save</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>uploadname</tt></i></span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>filename</tt></i></span>?</div></div>
	      </span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
		  Salva 
		  <i class="replaceable"><tt>uploadname</tt></i> nel
		  file
		  <i class="replaceable"><tt>filename</tt></i>.
		</div></div></dd><dt><span class="term">
		<div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex ">?<span style="font-family:monospace; font-weight: bold;">data</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>uploadname</tt></i></span>?</div></div>
	      </span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
		  Restituisce i dati caricati dal server. Questo  il
		  binario pulito. In altre parole, potr lavorare
		  anche con file come immagini, eseguibili, compressi 
		  e cos via.
		</div></div></dd><dt><span class="term">
		<div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex ">?<span style="font-family:monospace; font-weight: bold;">size</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>uploadname</tt></i></span>?</div></div>
	      </span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
		  Restituisce la dimensione del file caricato.
		</div></div></dd><dt><span class="term">
		<div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex ">?<span style="font-family:monospace; font-weight: bold;">type</span>?</div></div>
	      </span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
		  Se il <tt class="varname">Content-type</tt>  impostato, viene
		  restituito il valore, altrimenti una stringa vuota.
		</div></div></dd><dt><span class="term">
		<div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex ">?<span style="font-family:monospace; font-weight: bold;">filename</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>uploadname</tt></i></span>?</div></div>
	      </span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
		  Viene restituito il nome del file dell'host remoto 
		  che ha caricato il file.
		</div></div></dd><dt><span class="term">
		<div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex ">?<span style="font-family:monospace; font-weight: bold;">names</span>?</div></div>
	      </span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
		  Restituisce i nomi delle variabili, in una lista, di
		  tutti i file caricati.
		</div></div></dd></dl></div><div style="margin-bottom:1.5ex ; padding .5ex">
	    See <a href="examples.it.html#upload" title="Esempio4.Caricare file">Esempio4, &#8220;Caricare file&#8221;</a>.
	  </div></div></dd></dl></div><div class="variablelist"><dl><dt><span class="term">
	  <div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">load_env</span>  ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>array_name</tt></i></span>?</div></div>
	</span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
	    Carica l'array delle variabili d'ambiente all'interno dello
	    specificato nome di array. Utilizza l'array
	    ::request::env come valore predefinito.
	  </div><div style="margin-bottom:1.5ex ; padding .5ex">
	    Le pagine di Rivet sono eseguite nel namespace
	    ::request, quindi non  necessario 
	    precisare il nome dell'array per pi utenti, va bene
	    accedervi tramite env.
	  </div></div></dd><dt><span class="term">
	  <div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">load_headers</span>  ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>array_name</tt></i></span>?</div></div>
	</span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
	    Carica gli header che provengono dalla richiesta di un
	    client all'interno del nome dell'array indicato, o usa
	    headers se non  stato indicato alcun 
	    nome.
	  </div></div></dd><dt><span class="term">
	  <div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">load_cookies</span>  ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>array_name</tt></i></span>?</div></div>
	</span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
	    Carica l'array delle variabili cookie all'interno del nome
	    dell'array indicato. Utilizza l'array
	    cookies come valore predefinito.
	  </div></div></dd><dt><span class="term">
	  <div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">include</span>  ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>filename_name</tt></i></span>?</div></div>
	</span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
	    Include un file senza analizzarlo per processare i tag &lt;?
	    e ?&gt;.  Questo  il metodo migliore per includere un file 
	    HTML o qualsiasi altro contenuto statico.
	  </div></div></dd><dt><span class="term">
	  <div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">parse</span>  ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>filename</tt></i></span>?</div></div>
	</span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
	    Come il comando Tcl <span style="font-family:monospace"><span><b class="command">source</b></span></span>, ma analizza
	    pure i tag di elaborazione per Rivet  &lt;? e ?&gt;.
	    Utilizzando questo comando, potete utilizzare diversi file 
	    .rvt.
	  </div></div></dd><dt><span class="term">
	  <div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">headers</span>  (<span style="font-family:monospace; font-weight: bold;">set</span> | <span style="font-family:monospace; font-weight: bold;">redirect</span> | <span style="font-family:monospace; font-weight: bold;">add</span> | <span style="font-family:monospace; font-weight: bold;">type</span> | <span style="font-family:monospace; font-weight: bold;">numeric</span>)</div></div>
	</span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
	    Il comando <span style="font-family:monospace"><span><b class="command">headers</b></span></span>  per l'assegnazione e
	    l'elaborazione di header HTTP.
	  </div><div style="margin-bottom:1.5ex ; padding .5ex">
	    <div class="variablelist"><dl><dt><span class="term"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex ">?<span style="font-family:monospace; font-weight: bold;">set</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>headername</tt></i></span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>value</tt></i></span>?</div></div>
		</span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
		    Assegna in modo discrezionale i valori ed i nomi
		    agli header.
		  </div></div></dd><dt><span class="term">
		  <div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex ">?<span style="font-family:monospace; font-weight: bold;">redirect</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>uri</tt></i></span>?</div></div>
		</span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
		    Redirige dalla pagina corrente ad un nuovo URI.
		    <span class="emphasis"><em>Questo</em></span> viene fatto nel primo
		    blocco di codice Tcl.
		  </div></div></dd><dt><span class="term">
                  <div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex ">?<span style="font-family:monospace; font-weight: bold;">add</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>headername</tt></i></span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>value</tt></i></span>?</div></div>
                </span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">Aggiunge testo all'header
		  <tt class="varname">headername</tt>.</div></div></dd><dt><span class="term"><div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex ">?<span style="font-family:monospace; font-weight: bold;">type</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>content-type</tt></i></span>?</div></div>
		</span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
		    Questo comando assegna l'header
		    <tt class="constant">Content-type</tt> ritornato dallo
		    script,  utile se desiderate inviare, con Rivet, 
		    altri contenuti oltre all'HTML (PNG o immagini
		    jpeg, per esempio).
		  </div></div></dd><dt><span class="term">
                  <div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex ">?<span style="font-family:monospace; font-weight: bold;">numeric</span>? ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>response code</tt></i></span>?</div></div>
		</span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">Assegna un codice di risposta numerico, come per
		  esempio 200, 404 o 500.
		  </div></div></dd></dl></div>
	  </div></div></dd><dt><span class="term">
	  <div class="cmdsynopsis" style="width:80%"><div style="background:#bbbbff ; margin:1ex ; padding:.4ex ;  word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">makeurl</span>  ?<span style="font-family:monospace; font-weight: bold;"><i class="replaceable"><tt>filename</tt></i></span>?</div></div>
	</span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
	    Crea una URL di riferimento a se stesso dal nome di un file.
	    Per esempio:
	    <pre style="background:#bbffbb ; width:90ex ; margin: 2ex ;      padding: 1ex; border: solid black 1px ; white-space: pre;      font-family:monospace ; " class="programlisting">makeurl /tclp.gif</pre>
	    restituisce
	    <tt class="constant">http://[hostname]:[port]/tclp.gif</tt>.
	    Dove hostname e port sono il nome dell'host e la porta del
	    server in questione.
	  </div></div></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="directives.it.html"><img src="images/prev.png" alt="Indietro"></a></td><td width="20%" align="center"><a accesskey="u" href="index.it.html"><img src="images/up.png" alt="Risali"></a></td><td width="40%" align="right"><a accesskey="n" href="examples.it.html"><img src="images/next.png" alt="Avanti"></a></td></tr><tr><td width="40%" align="left" valign="top">Direttive di Apache</td><td width="20%" align="center"><a accesskey="h" href="index.it.html"><img src="images/home.png" alt="Partenza"></a></td><td width="40%" align="right" valign="top">Esempi ed uso</td></tr></table></div></body></html>