goba Mon Aug 20 10:01:27 2001 EDT
Modified files:
/phpdoc/hu/language constants.xml control-structures.xml
expressions.xml functions.xml references.xml
types.xml variables.xml
Log:
WS and other fixes ported
Index: phpdoc/hu/language/constants.xml
diff -u phpdoc/hu/language/constants.xml:1.5 phpdoc/hu/language/constants.xml:1.6
--- phpdoc/hu/language/constants.xml:1.5 Sun Aug 19 10:21:30 2001
+++ phpdoc/hu/language/constants.xml Mon Aug 20 10:01:26 2001
@@ -263,11 +263,12 @@
<programlisting>
<![CDATA[
<?php
-function report_error ($file, $line, $message) {
+function report_error ($file, $line, $message)
+{
echo "hiba t�rt�nt a $file f�jlban a $line sorban: $message.";
}
-report_error (__FILE__,__LINE__, "G�z van!");
+report_error(__FILE__, __LINE__, "G�z van!");
?>
]]>
</programlisting>
Index: phpdoc/hu/language/control-structures.xml
diff -u phpdoc/hu/language/control-structures.xml:1.9
phpdoc/hu/language/control-structures.xml:1.10
--- phpdoc/hu/language/control-structures.xml:1.9 Sun Aug 19 10:21:30 2001
+++ phpdoc/hu/language/control-structures.xml Mon Aug 20 10:01:26 2001
@@ -274,22 +274,22 @@
<programlisting>
<![CDATA[
/* 1. vari�ci� */
+
+$i = 1;
+while ($i <= 10) {
+ print $i++; /* a ki�rt �rt�k $i, csak
+ ut�na n�vel�nk
+ (post-inkrement�ci�) */
+}
- $i = 1;
- while ($i <= 10) {
- print $i++; /* a ki�rt �rt�k $i, csak
- ut�na n�vel�nk
- (post-inkrement�ci�) */
- }
-
- /* 2. vari�ci� */
+/* 2. vari�ci� */
- $i = 1;
- while ($i <= 10):
- print $i;
- $i++;
- endwhile;
- ]]>
+$i = 1;
+while ($i <= 10):
+ print $i;
+ $i++;
+endwhile;
+]]>
</programlisting>
</informalexample>
</para>
@@ -386,8 +386,7 @@
<informalexample>
<programlisting>
kif1;
-while (kif2)
-{
+while (kif2) {
utas�t�s;
kif3;
}
@@ -429,34 +428,34 @@
<![CDATA[
/* t�ma */
- for ($i = 1; $i <= 10; $i++) {
- print $i;
- }
+for ($i = 1; $i <= 10; $i++) {
+ print $i;
+}
- /* 1. vari�ci� */
+/* 1. vari�ci� */
- for ($i = 1;;$i++) {
- if ($i > 10) {
- break;
- }
- print $i;
- }
+for ($i = 1;;$i++) {
+ if ($i > 10) {
+ break;
+ }
+ print $i;
+}
- /* 2. vari�ci� */
+/* 2. vari�ci� */
- $i = 1;
- for (;;) {
- if ($i > 10) {
- break;
- }
- print $i;
- $i++;
- }
+$i = 1;
+for (;;) {
+ if ($i > 10) {
+ break;
+ }
+ print $i;
+ $i++;
+}
- /* 3. vari�ci� - Coda :-) */
+/* 3. vari�ci� - Coda :-) */
- for ($i = 1; $i <= 10; print $i, $i++) ;
- ]]>
+for ($i = 1; $i <= 10; print $i, $i++);
+]]>
</programlisting>
</informalexample>
</para>
@@ -487,8 +486,8 @@
N�zd meg e f�ggv�nyeknek a dokument�ci�j�t, ha szeretn�l p�ld�kat
is l�tni.
</para>
-
</sect1>
+
<sect1 id="control-structures.foreach">
<title><literal>foreach</literal></title>
<para>
@@ -628,7 +627,6 @@
foreach(array(1, 2, 3, 4, 5) as $ertek) {
print "$ertek\n";
}
-
</programlisting>
</informalexample>
</para>
@@ -941,7 +939,8 @@
<pre>
<?php
// Ez a f�ggv�ny megjegyzi a h�v�sa id�pontjait
-function idopontok ($visszaadni = FALSE) {
+function idopontok ($visszaadni = FALSE)
+{
static $idopontok;
@@ -1189,7 +1188,7 @@
if ($feltetel) {
include($file);
} else {
- include($other);
+ include($other);
}
]]>
</programlisting>
@@ -1367,8 +1366,9 @@
<?php
define("PHPVERSION", floor(phpversion()));
echo "A GLOB�LIS V�LTOZ�K J�K\n";
-function joTea() {
- return "Az Oolong tea j� �z�!";
+function joTea()
+{
+ return "Az Oolong tea j� �z�!";
}
?>
]]>
@@ -1380,12 +1380,13 @@
<![CDATA[
<?php
require ("eszkozok.inc");
-function valtozoMegjelenites($valtozo) {
- if (PHPVERSION == 4) {
- print_r($valtozo);
- } else {
- var_dump($valtozo);
- }
+function valtozoMegjelenites($valtozo)
+{
+ if (PHPVERSION == 4) {
+ print_r($valtozo);
+ } else {
+ var_dump($valtozo);
+ }
}
// m�s f�ggv�nyek ...
Index: phpdoc/hu/language/expressions.xml
diff -u phpdoc/hu/language/expressions.xml:1.5 phpdoc/hu/language/expressions.xml:1.6
--- phpdoc/hu/language/expressions.xml:1.5 Sun Aug 19 10:21:30 2001
+++ phpdoc/hu/language/expressions.xml Mon Aug 20 10:01:26 2001
@@ -33,7 +33,8 @@
<informalexample>
<programlisting>
<![CDATA[
-function foo () {
+function foo ()
+{
return 5;
}
]]>
@@ -177,7 +178,8 @@
<informalexample>
<programlisting>
-function duplaz($i) {
+function duplaz($i)
+{
return $i*2;
}
$b = $a = 5; /*�t�t rendel�nk $a �s $b v�ltoz�khoz */
Index: phpdoc/hu/language/functions.xml
diff -u phpdoc/hu/language/functions.xml:1.7 phpdoc/hu/language/functions.xml:1.8
--- phpdoc/hu/language/functions.xml:1.7 Sun Aug 19 10:21:30 2001
+++ phpdoc/hu/language/functions.xml Mon Aug 20 10:01:26 2001
@@ -10,7 +10,8 @@
F�ggv�nyeket a k�vetkez� szintaxis szerint defini�lhatod: <informalexample>
<programlisting role="php">
<![CDATA[
-function foo ($arg_1, $arg_2, ..., $arg_n) {
+function foo ($arg_1, $arg_2, ..., $arg_n)
+{
echo "P�lda f�ggv�ny.\n";
return $retval;
}
@@ -67,7 +68,8 @@
<informalexample>
<programlisting role="php">
<![CDATA[
-function tombot_kezel($input) {
+function tombot_kezel($input)
+{
echo "$input[0] + $input[1] = ", $input[0]+$input[1];
}
]]>
@@ -91,7 +93,8 @@
<informalexample>
<programlisting role="php">
<![CDATA[
-function fgv_extrakkal(&$string) {
+function fgv_extrakkal(&$string)
+{
$string .= '�s a sz�ks�ges plusssz.';
}
$str = 'Ez egy karakterf�z�r, ';
@@ -110,7 +113,8 @@
<informalexample>
<programlisting role="php">
<![CDATA[
-function foo ($bar) {
+function foo ($bar)
+{
$bar .= 'makk';
}
$str = 'Bikk';
@@ -134,7 +138,8 @@
<informalexample>
<programlisting role="php">
<![CDATA[
-function kavet_csinal ($tipus = "cappucino") {
+function kavet_csinal ($tipus = "cappucino")
+{
return "Csin�lok egy poh�r " . $tipus . "t.\n";
}
echo kavet_csinal ();
@@ -164,7 +169,8 @@
<informalexample>
<programlisting role="php">
<![CDATA[
-function joghurtot_keszit ($type = "acidophilus", $flavour) {
+function joghurtot_keszit ($type = "acidophilus", $flavour)
+{
return "K�sz�tek egy k�cs�g $flavour �z� $type-t.\n";
}
@@ -189,7 +195,8 @@
<informalexample>
<programlisting role="php">
<![CDATA[
-function joghurtot_keszit ($flavour, $type = "acidophilus") {
+function joghurtot_keszit ($flavour, $type = "acidophilus")
+{
return "K�sz�tek egy k�cs�g $flavour �z� $type-ot.\n";
}
@@ -252,7 +259,8 @@
<informalexample>
<programlisting role="php">
<![CDATA[
-function negyzete ($num) {
+function negyzete ($num)
+{
return $num * $num;
}
echo negyzete (4); // ki�rja '16'.
@@ -272,7 +280,8 @@
<informalexample>
<programlisting role="php">
<![CDATA[
-function kis_szamok() {
+function kis_szamok()
+{
return array (0, 1, 2);
}
list ($nulla, $egy, $ketto) = kis_szamok();
@@ -288,7 +297,8 @@
<informalexample>
<programlisting role="php">
<![CDATA[
-function &referenciat_ad_vissza() {
+function &referenciat_ad_vissza()
+{
return &$valtozo;
}
@@ -350,18 +360,20 @@
<programlisting role="php">
<![CDATA[
<?php
-function ize() {
+function ize()
+{
echo "Az ize()-ben<br>\n";
}
-function bigyo( $param = '' ) {
+function bigyo($param = '')
+{
echo "A bigyo()-ban; az argumentum:'$param'.<br>\n";
}
$func = 'ize';
$func();
$func = 'bigyo';
-$func( 'Stex van Boeven' );
+$func('Stex van Boeven');
?>
]]>
</programlisting>
Index: phpdoc/hu/language/references.xml
diff -u phpdoc/hu/language/references.xml:1.5 phpdoc/hu/language/references.xml:1.6
--- phpdoc/hu/language/references.xml:1.5 Sun Aug 19 14:58:03 2001
+++ phpdoc/hu/language/references.xml Mon Aug 20 10:01:26 2001
@@ -175,8 +175,8 @@
<programlisting role="php">
function &valami()
{
- $a = 5;
- return $a;
+ $a = 5;
+ return $a;
}
ize(valami());
</programlisting>
@@ -197,8 +197,8 @@
<![VDATA[
function valami() // Figyeld meg a hi�nyz� & jelet
{
- $a = 5;
- return $a;
+ $a = 5;
+ return $a;
}
ize(valami());
Index: phpdoc/hu/language/types.xml
diff -u phpdoc/hu/language/types.xml:1.10 phpdoc/hu/language/types.xml:1.11
--- phpdoc/hu/language/types.xml:1.10 Sun Aug 19 10:21:30 2001
+++ phpdoc/hu/language/types.xml Mon Aug 20 10:01:26 2001
@@ -145,20 +145,17 @@
szerkezetben</link> fel tudsz haszn�lni.
<informalexample>
<programlisting role="php">
-if ($akcio == "verzio_kiirasa") // a == <link
linkend="language.operators">oper�tor</link> <type>boolean</type> �rt�kkel t�r vissza
-{
+if ($akcio == "verzio_kiirasa") { // a == <link
+linkend="language.operators">oper�tor</link> <type>boolean</type> �rt�kkel t�r vissza
echo "Ez az 1.23-as v�ltozat";
}
// ez nem sz�ks�ges
-if ($elvalaszto_kiirasa == true)
-{
+if ($elvalaszto_kiirasa == true) {
echo "<hr>\n";
}
// mivel egyszer�en ez is m�k�dik
-if ($elvalaszto_kiirasa)
-{
+if ($elvalaszto_kiirasa) {
echo "<hr>\n";
}
</programlisting>
@@ -295,7 +292,7 @@
// ez m�k�dik hexadecim�lisan megadott eg�szekre is:
var_dump( 0x80000000 );
-// output: float(2147483648)
+// kimenete: float(2147483648)
</programlisting>
</informalexample>
@@ -677,11 +674,13 @@
VAS;
/* Komplexebb p�lda, v�ltoz�kkal. */
-class ize {
+class ize
+{
var $ize;
var $valami;
- function ize() {
+ function ize()
+ {
$this->ize = 'Valami';
$this->valami = array('elso', 'masodik', 'harmadik');
}
@@ -760,7 +759,7 @@
<informalexample>
<programlisting role="php">
$gyumolcsok = array( 'eper' => 'piros' , 'alma' => 'z�ld' );
-echo "Az alma $gyumolcsok[alma].";
+echo "Az alma $gyumolcsok[alma]."; // ez m�k�dik, de nem helyes, <link
+linkend="language.types.array.foo-bar">l�sd a magyar�zatot</link>
echo "A n�gyzet $negyzet->szelesseg m�ter sz�les.";
echo "A n�gyzet $negyzet->szelesseg00 centim�ter sz�les."; // nem m�k�dik
// a megold�s �rdek�ben l�sd a <link
linkend="language.types.string.parsing.complex">komplex szintaxist</link>.
@@ -1247,8 +1246,7 @@
<programlisting role="php">
$szinek = array('piros','k�k','z�ld','s�rga');
-foreach ( $szinek as $szin )
-{
+foreach ( $szinek as $szin ) {
echo "Szereted a(z) $szin sz�nt?\n";
}
@@ -1314,8 +1312,7 @@
<programlisting role="php">
// egy t�mb fel�lt�se a <link linkend="ref.dir">k�nyvt�rban</link> tal�lhat�
filenevekkel
$konyvtar = <link linkend="function.opendir">opendir</link>('.');
-while ( $filenev = <link linkend="function.readdir">readdir</link>($konyvtar) )
-{
+while ($filenev = <link linkend="function.readdir">readdir</link>($konyvtar)) {
$filenevek[] = $filenev;
}
<link linkend="function.closedir">closedir</link>($konyvtar);
@@ -1565,8 +1562,10 @@
<programlisting role="php">
<![CDATA[
<?php
-class semmi { #egy objektumoszt�ly l�trehoz�sa, semmi az oszt�ly neve
- function do_semmi () {
+class semmi #egy objektumoszt�ly l�trehoz�sa, semmi az oszt�ly neve
+{
+ function do_semmi ()
+ {
echo "Csin�lom a semmit.";
}
}
Index: phpdoc/hu/language/variables.xml
diff -u phpdoc/hu/language/variables.xml:1.11 phpdoc/hu/language/variables.xml:1.12
--- phpdoc/hu/language/variables.xml:1.11 Sun Aug 19 10:21:30 2001
+++ phpdoc/hu/language/variables.xml Mon Aug 20 10:01:27 2001
@@ -98,7 +98,8 @@
$bar = &$foo; // Ez egy �rv�nyes hozz�rendel�s.
$bar = &(24 * 7); // �rv�nytelen; referencia egy n�vtelen kifejez�sre.
-function test() {
+function test()
+{
return 25;
}
@@ -629,11 +630,12 @@
<![CDATA[
$a = 1; /* glob�lis hat�sk�r */
-Function Test () {
+function Test ()
+{
echo $a; /* egy helyi v�ltoz�t v�r */
}
-Test ();
+Test();
]]>
</programlisting>
</informalexample>
@@ -659,13 +661,14 @@
$a = 1;
$b = 2;
-Function Osszead () {
+function Osszead()
+{
global $a, $b;
$b = $a + $b;
}
-Ossszead ();
+Ossszead();
echo $b;
]]>
</programlisting>
@@ -692,11 +695,12 @@
$a = 1;
$b = 2;
-Function Osszead () {
+function Osszead()
+{
$GLOBALS["b"] = $GLOBALS["a"] + $GLOBALS["b"];
}
-Osszead ();
+Osszead();
echo $b;
]]>
</programlisting>
@@ -719,7 +723,8 @@
<informalexample>
<programlisting role="php">
<![CDATA[
-Function Test () { #ezt nem Function Body-b�l ford�tottam...
+function Test()
+{
$a = 0;
echo $a;
$a++;
@@ -743,7 +748,8 @@
<informalexample>
<programlisting role="php">
<![CDATA[
-Function Test () {
+function Test()
+{
static $a = 0;
echo $a;
$a++;
@@ -775,7 +781,8 @@
<informalexample>
<programlisting role="php">
<![CDATA[
-Function Test () {
+function Test()
+{
static $count = 0;
$count++;
@@ -956,7 +963,7 @@
<informalexample>
<programlisting role="php">
<![CDATA[
-<input type=image src="image.gif" name="sub">
+<input type="image" src="image.gif" name="sub">
]]>
</programlisting>
</informalexample>
@@ -999,7 +1006,7 @@
<informalexample>
<programlisting role="php">
<![CDATA[
-SetCookie ("MyCookie[]", "Testing", time()+3600);
+setcookie("MyCookie[]", "Testing", time()+3600);
]]>
</programlisting>
</informalexample>
@@ -1015,8 +1022,8 @@
<programlisting role="php">
<![CDATA[
$Count++;
-SetCookie ("Count", $Count, time()+3600);
-SetCookie ("Cart[$Count]", $item, time()+3600);
+setcookie("Count", $Count, time()+3600);
+setcookie("Cart[$Count]", $item, time()+3600);
]]>
</programlisting>
</example>