cvs: smarty /docs/ru/programmers/caching caching-groups.xml caching-multiple-caches.xml caching-setting-up.xml
"Antony Dovgal" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.smarty |
|---|---|
| Message-ID | <cvstony20011086597465@cvsserver> |
tony2001 Mon Jun 7 04:37:45 2004 EDT
Modified files:
/smarty/docs/ru/programmers/caching caching-groups.xml
caching-multiple-caches.xml
caching-setting-up.xml
Log:
add new translations by nw [ at ] webdevel [ dot ] ru and EN-Revisions
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
tony2001-20040607043745.txt
(text/plain, 15.3 KB)
http://cvs.php.net/diff.php/smarty/docs/ru/programmers/caching/caching-groups.xml?r1=1.1&r2=1.2&ty=u
Index: smarty/docs/ru/programmers/caching/caching-groups.xml
diff -u smarty/docs/ru/programmers/caching/caching-groups.xml:1.1 smarty/docs/ru/programmers/caching/caching-groups.xml:1.2
--- smarty/docs/ru/programmers/caching/caching-groups.xml:1.1 Tue Apr 13 07:46:22 2004
+++ smarty/docs/ru/programmers/caching/caching-groups.xml Mon Jun 7 04:37:45 2004
@@ -1,58 +1,62 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
- <sect1 id="caching.groups">
- <title>Cache Groups</title>
- <para>
- You can do more elaborate grouping by setting up cache_id groups. This is
- accomplished by separating each sub-group with a vertical bar "|" in the
- cache_id value. You can have as many sub-groups as you like.
- </para>
- <example>
- <title>cache_id groups</title>
- <programlisting>
-require('Smarty.class.php');
-$smarty = new Smarty;
-
-$smarty->caching = true;
-
-// clear all caches with "sports|basketball" as the first two cache_id groups
-$smarty->clear_cache(null,"sports|basketball");
-
-// clear all caches with "sports" as the first cache_id group. This would
-// include "sports|basketball", or "sports|(anything)|(anything)|(anything)|..."
-$smarty->clear_cache(null,"sports");
-
-$smarty->display('index.tpl',"sports|basketball");</programlisting>
- </example>
- <note>
- <title>Technical Note</title>
- <para>
- The cache grouping does NOT use the path to the template as any part of the
- cache_id. For example, if you have display('themes/blue/index.tpl'), you
- cannot clear the cache for everything under the "themes/blue" directory. If
- you want to do that, you must group them in the cache_id, such as
- display('themes/blue/index.tpl','themes|blue'); Then you can clear the
- caches for the blue theme with clear_cache(null,'themes|blue');
- </para>
- </note>
-</sect1>
-<!-- Keep this comment at the end of the file
-Local variables:
-mode: sgml
-sgml-omittag:t
-sgml-shorttag:t
-sgml-minimize-attributes:nil
-sgml-always-quote-attributes:t
-sgml-indent-step:1
-sgml-indent-data:t
-indent-tabs-mode:nil
-sgml-parent-document:nil
-sgml-default-dtd-file:"../../../../manual.ced"
-sgml-exposed-tags:nil
-sgml-local-catalogs:nil
-sgml-local-ecat-files:nil
-End:
-vim600: syn=xml fen fdm=syntax fdl=2 si
-vim: et tw=78 syn=sgml
-vi: ts=1 sw=1
--->
\ No newline at end of file
+<?xml version="1.0" encoding="windows-1251"?>
+<!-- $Revision: 1.2 $ -->
+<!-- En-Revision: 1.2 -->
+<sect1 id="caching.groups">
+ <title>Ãðóïïîâîå êýøèðîâàíèå</title>
+ <para>
+ Âû ìîæåòå ñäåëàòü ãðóïïèðîâêó áîëåå ïðîäóìàííîé, èñïîëüçóÿ ãðóïïîâûå çíà÷åíèÿ cache_id.
+  òàêîì ñëó÷àå, êàæäàÿ ïîäãðóïïà îòäåëÿåòñÿ çíàêîì âåðòèêàëüíîé ÷åðòû "|" â
+ çíà÷åíèè cache_id. Âîçìîæíî ñîçäàâàòü ëþáîå êîëè÷åñòâî ïîäãðóïï.
+ </para>
+ <example>
+ <title>Ãðóïïû â cache_id</title>
+ <programlisting>
+<![CDATA[
+require('Smarty.class.php');
+$smarty = new Smarty;
+
+$smarty->caching = true;
+
+// Óäàëèòü âñå êýøèðîâàííûå êîïèè ïîäãðóïïû "sports|basketball"
+$smarty->clear_cache(null,"sports|basketball");
+
+// Óäàëèòü âñå êýøèðîâàííûå êîïèè ãðóïïû "sports",
+// âêëþ÷àÿ "sports|basketball", èëè "sports|(anything)|(anything)|(anything)|..."
+$smarty->clear_cache(null,"sports");
+
+$smarty->display('index.tpl',"sports|basketball");
+]]>
+ </programlisting>
+ </example>
+ <note>
+ <title>Òåõíè÷åñêîå çàìå÷àíèå</title>
+ <para>
+ Ïðè ãðóïïîâîì êýøèðîâàíèè, ïóòü ê øàáëîíó ÍÅ èñïîëüçóåòñÿ êàê ÷àñòü
+ cache_id. Ê ïðèìåðó, åñëè ïðîèçâîäèòñÿ âûçîâ display('themes/blue/index.tpl'), âû
+ íå ìîæåòå î÷èñòèòü êýø äëÿ âñåõ ôàéëîâ, íàõîäÿùèõñÿ â äèðåêòîðèè "themes/blue". Åñëè
+ ó âàñ âîçíèêëà òàêàÿ íåîáõîäèìîñòü, íóæíî ñãðóïïèðîâàòü èõ â cache_id, íàïðèìåð òàê -
+ display('themes/blue/index.tpl','themes|blue'); È òåïåðü âû ìîæåòå î÷èñòèòü êýø
+ òåìû blue, èñïîëüçóÿ clear_cache(null,'themes|blue');
+ </para>
+ </note>
+</sect1>
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+indent-tabs-mode:nil
+sgml-parent-document:nil
+sgml-default-dtd-file:"../../../../manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+vim600: syn=xml fen fdm=syntax fdl=2 si
+vim: et tw=78 syn=sgml
+vi: ts=1 sw=1
+-->
http://cvs.php.net/diff.php/smarty/docs/ru/programmers/caching/caching-multiple-caches.xml?r1=1.1&r2=1.2&ty=u
Index: smarty/docs/ru/programmers/caching/caching-multiple-caches.xml
diff -u smarty/docs/ru/programmers/caching/caching-multiple-caches.xml:1.1 smarty/docs/ru/programmers/caching/caching-multiple-caches.xml:1.2
--- smarty/docs/ru/programmers/caching/caching-multiple-caches.xml:1.1 Tue Apr 13 07:46:22 2004
+++ smarty/docs/ru/programmers/caching/caching-multiple-caches.xml Mon Jun 7 04:37:45 2004
@@ -1,109 +1,123 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
- <sect1 id="caching.multiple.caches">
- <title>Multiple Caches Per Page</title>
- <para>
- You can have multiple cache files for a single call to display() or
- fetch(). Let's say that a call to display('index.tpl') may have several
- different output contents depending on some condition, and you want
- separate caches for each one. You can do this by passing a cache_id as the
- second parameter to the function call.
- </para>
- <example>
- <title>passing a cache_id to display()</title>
- <programlisting>
-require('Smarty.class.php');
-$smarty = new Smarty;
-
-$smarty->caching = true;
-
-$my_cache_id = $_GET['article_id'];
-
-$smarty->display('index.tpl',$my_cache_id);</programlisting>
- </example>
- <para>
- Above, we are passing the variable $my_cache_id to display() as the
- cache_id. For each unique value of $my_cache_id, a separate cache will be
- generated for index.tpl. In this example, "article_id" was passed in the
- URL and is used as the cache_id.
- </para>
- <note>
- <title>Technical Note</title>
- <para>
- Be very cautious when passing values from a client (web browser) into
- Smarty (or any PHP application.) Although the above example of using the
- article_id from the URL looks handy, it could have bad consequences. The
- cache_id is used to create a directory on the file system, so if the user
- decided to pass an extremely large value for article_id, or write a script
- that sends random article_ids at a rapid pace, this could possibly cause
- problems at the server level. Be sure to sanitize any data passed in before
- using it. In this instance, maybe you know the article_id has a length of
- 10 characters and is made up of alpha-numerics only, and must be a valid
- article_id in the database. Check for this!
- </para>
- </note>
- <para>
- Be sure to pass the same cache_id as the
- second parameter to <link linkend="api.is.cached">is_cached()</link> and
- <link linkend="api.clear.cache">clear_cache()</link>.
- </para>
- <example>
- <title>passing a cache_id to is_cached()</title>
- <programlisting>
-require('Smarty.class.php');
-$smarty = new Smarty;
-
-$smarty->caching = true;
-
-$my_cache_id = $_GET['article_id'];
-
-if(!$smarty->is_cached('index.tpl',$my_cache_id)) {
- // No cache available, do variable assignments here.
- $contents = get_database_contents();
- $smarty->assign($contents);
-}
-
-$smarty->display('index.tpl',$my_cache_id);</programlisting>
- </example>
- <para>
- You can clear all caches for a particular cache_id by passing null as the
- first parameter to clear_cache().
- </para>
- <example>
- <title>clearing all caches for a particular cache_id</title>
- <programlisting>
-require('Smarty.class.php');
-$smarty = new Smarty;
-
-$smarty->caching = true;
-
-// clear all caches with "sports" as the cache_id
-$smarty->clear_cache(null,"sports");
-
-$smarty->display('index.tpl',"sports");</programlisting>
- </example>
- <para>
- In this manner, you can "group" your caches together by giving them the
- same cache_id.
- </para>
-</sect1>
-<!-- Keep this comment at the end of the file
-Local variables:
-mode: sgml
-sgml-omittag:t
-sgml-shorttag:t
-sgml-minimize-attributes:nil
-sgml-always-quote-attributes:t
-sgml-indent-step:1
-sgml-indent-data:t
-indent-tabs-mode:nil
-sgml-parent-document:nil
-sgml-default-dtd-file:"../../../../manual.ced"
-sgml-exposed-tags:nil
-sgml-local-catalogs:nil
-sgml-local-ecat-files:nil
-End:
-vim600: syn=xml fen fdm=syntax fdl=2 si
-vim: et tw=78 syn=sgml
-vi: ts=1 sw=1
--->
\ No newline at end of file
+<?xml version="1.0" encoding="windows-1251"?>
+<!-- $Revision: 1.2 $ -->
+<!-- En-Revision: 1.1 -->
+<sect1 id="caching.multiple.caches">
+ <title>Ìíîæåñòâåííîå êýøèðîâàíèå ñòðàíèö</title>
+ <para>
+ Âû ìîæåòå ñîçäàâàòü íåñêîëüêî êýøèðîâàííûõ êîïèé äëÿ îäíîãî âûçîâà ôóíêöèè display() èëè
+ fetch(). Ïðåäïîëîæèì, ÷òî ïî âûçîâó display('index.tpl') äîëæíû îòîáðàæàòüñÿ äàííûå,
+ ñîäåðæèìîå êîòîðûõ çàâèñèò îò îïðåäåëåííûõ óñëîâèé, è âû õîòèòå èìåòü íåñêîëüêî âàðèàíòîâ
+ ñîîòâåòñòâóþùèõ êýøèðîâàííûõ êîïèé. Äëÿ ýòîãî íåîáõîäèìî ïåðåäàòü â ôóíêöèþ èäåíòèôèêàòîð
+ êýøà (cache_id) â êà÷åñòâå âòîðîãî ïàðàìåòðà.
+ </para>
+ <example>
+ <title>Âûçîâ display() ñ èäåíòèôèêàòîðîì êýøà</title>
+ <programlisting>
+<![CDATA[
+require('Smarty.class.php');
+$smarty = new Smarty;
+
+$smarty->caching = true;
+
+$my_cache_id = $_GET['article_id'];
+
+$smarty->display('index.tpl',$my_cache_id);
+]]>
+ </programlisting>
+ </example>
+ <para>
+ Â ïðèìåðå ìû ïåðåäàëè ïåðåìåííóþ $my_cache_id â ôóíêöèþ display()
+ â êà÷åñòâå cache_id. Äëÿ êàæäîãî óíèêàëüíîãî çíà÷åíèÿ $my_cache_id áóäåò ñîçäàíà
+ êýøèðîâàííàÿ êîïèÿ âûâîäà index.tpl. Çäåñü, çíà÷åíèå "article_id" áûëî ïåðåäàíî â ñêðèïò
+ ÷åðåç URL, ïðèñâîåíî ïåðåìåííîé $my_cache_id è èñïîëüçîâàíî êàê cache_id.
+ </para>
+ <note>
+ <title>Òåõíè÷åñêîå çàìå÷àíèå</title>
+ <para>
+ Áóäüòå î÷åíü îñòîðîæíûìè ïðè ïåðåäà÷å çíà÷åíèé îò êëèåíòà (áðàóçåðà)
+ â Smarty (êàê è â ëþáîå PHP-ïðèëîæåíèå). Õîòÿ ïðèâåäåííûé ïðèìåð
+ ôàêòè÷åñêîãî èñïîëüçîâàíèÿ article_id ïðÿìî èç URL âûãëÿäèò íîðìàëüíî,
+ îí ìîæåò èìåòü íåïðèÿòíûå ïîñëåäñòâèÿ. Çíà÷åíèå cache_id èñïîëüçóåòñÿ äëÿ
+ ñîçäàíèÿ äèðåêòîðèè â ôàéëîâîé ñèñòåìå, ïîýòîìó, åñëè ïîëüçîâàòåëü ðåøèò
+ ïåðåäàòü êðàéíå áîëüøîå çíà÷åíèå article_id èëè íàïèñàòü ñêðèïò,
+ êîòîðûé ïîñûëàåò ñëó÷àéíûå article_id ñ îãðîìíîé ÷àñòîòîé, ýòî ìîæåò âûçâàòü
+ ïðîáëåìû íà óðîâíå ñåðâåðà. Ïîýòîìó âàì íåîáõîäèìî â îáÿçàòåëüíîì ïîðÿäêå
+ ïðîâåðÿòü äàííûå èç ôîðì, ïåðåä òåì êàê èñïîëüçîâàòü èõ.  íàøåì ñëó÷àå,
+ ìû çàðàíåå çíàåì, ÷òî çíà÷åíèå article_id èìååò äëèíó â 10 ñèìâîëîâ, ñîñòîèò
+ òîëüêî èç áóêâ è öèôð, à òàê æå äîëæíî ÿâëÿòüñÿ ðåàëüíûì
+ èäåíòèôèêàòîðîì â áàçå äàííûõ. Âñå ýòî íåîáõîäèìî ïðîâåðèòü!
+ </para>
+ </note>
+ <para>
+ Èìåéòå ââèäó, ÷òî òîæå ñàìîå çíà÷åíèå cache_id íåîáõîäèìî èñïîëüçîâàòü
+ êàê âòîðîé ïàðàìåòð
+ â ôóíêöèÿõ <link linkend="api.is.cached">is_cached()</link> è
+ <link linkend="api.clear.cache">clear_cache()</link>, åñëè âû õîòèòå ïðèìåíèòü
+ èõ ê êîíêðåòíîìó êýøó.
+ </para>
+ <example>
+ <title>Ïåðåäà÷à cache_id â is_cached()</title>
+ <programlisting>
+<![CDATA[
+require('Smarty.class.php');
+$smarty = new Smarty;
+
+$smarty->caching = true;
+
+$my_cache_id = $_GET['article_id'];
+
+if(!$smarty->is_cached('index.tpl',$my_cache_id)) {
+ // Êýøà íåò, ïîýòîìó ïðèñâàèâàåì çíà÷åíèå ïåðåìåííûì.
+ $contents = get_database_contents();
+ $smarty->assign($contents);
+}
+
+$smarty->display('index.tpl',$my_cache_id);
+]]>
+ </programlisting>
+ </example>
+ <para>
+ Âû ìîæåòå óäàëèòü âñå êýøèðîâàííûå êîïèè ñ êîíêðåòíûì cache_id, ïåðåäàâ null â êà÷åñòâå
+ ïåðâîãî ïàðàìåòðà clear_cache().
+ </para>
+ <example>
+ <title>Óäàëåíèå âñåõ êýøèðîâàííûõ êîïèé ñ êîíêðåòíûì cache_id</title>
+ <programlisting>
+<![CDATA[
+require('Smarty.class.php');
+$smarty = new Smarty;
+
+$smarty->caching = true;
+
+// óäàëÿåì âñå êýøèðîâàííûå êîïèè ñî çíà÷åíèåì "sports" â êà÷åñòâå cache_id
+$smarty->clear_cache(null,"sports");
+
+$smarty->display('index.tpl',"sports");
+]]>
+ </programlisting>
+ </example>
+ <para>
+ Òàêèì îáðàçîì, âû ìîæåòå ãðóïïèðîâàòü âàøè êýøèðîâàííûå êîïèè, íàçíà÷àÿ èì
+ îäèíàêîâûå cache_id.
+ </para>
+</sect1>
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+indent-tabs-mode:nil
+sgml-parent-document:nil
+sgml-default-dtd-file:"../../../../manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+vim600: syn=xml fen fdm=syntax fdl=2 si
+vim: et tw=78 syn=sgml
+vi: ts=1 sw=1
+-->
http://cvs.php.net/diff.php/smarty/docs/ru/programmers/caching/caching-setting-up.xml?r1=1.2&r2=1.3&ty=u
Index: smarty/docs/ru/programmers/caching/caching-setting-up.xml
diff -u smarty/docs/ru/programmers/caching/caching-setting-up.xml:1.2 smarty/docs/ru/programmers/caching/caching-setting-up.xml:1.3
--- smarty/docs/ru/programmers/caching/caching-setting-up.xml:1.2 Fri Jun 4 06:24:41 2004
+++ smarty/docs/ru/programmers/caching/caching-setting-up.xml Mon Jun 7 04:37:45 2004
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="windows-1251"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
+<!-- En-Revision: 1.2 -->
<sect1 id="caching.setting.up">
<title>Íàñòðîéêà êýøèðîâàíèÿ</title>
<para>