[TEP-COMMIT] [CVS admin] clear the languages cache when updating the languages database table

hpdl-OfajU3CKLf1/[email protected] 29 Nov 2004 00:14:17 -0000
Newsgroups gmane.comp.web.oscommerce.cvs
Message-ID <[email protected]>
<html>
<head>
<style><!--
  body {background-color:#ffffff;}
  .file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
  .pathname {font-family:monospace; float:right;}
  .fileheader {margin-bottom:.5em;}
  .diff {margin:0;}
  .tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
  .tasklist ul {margin-top:0;margin-bottom:0;}
  tr.alt {background-color:#eeeeee}
  #added {background-color:#ddffdd;}
  #addedchars {background-color:#99ff99;font-weight:bolder;}
  tr.alt #added {background-color:#ccf7cc;}
  #removed {background-color:#ffdddd;}
  #removedchars {background-color:#ff9999;font-weight:bolder;}
  tr.alt #removed {background-color:#f7cccc;}
  #info {color:#888888;}
  #context {background-color:#eeeeee;}
  td {padding-left:.3em;padding-right:.3em;}
  tr.head {border-bottom-width:1px;border-bottom-style:solid;}
  tr.head td {padding:0;padding-top:.2em;}
  .task {background-color:#ffff00;}
  .comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
  .error {color:red;}
  hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>admin/admin</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1">languages.php</a></tt></td><td align="right" id="added">+11</td><td align="right" id="removed">-9</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/languages.php?rev=1.37&amp;content-type=text/vnd.viewcvs-markup">1.37</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/languages.php.diff?r1=1.37&amp;r2=1.38">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/languages.php?rev=1.38&amp;content-type=text/vnd.viewcvs-markup">1.38</a></td></tr>
</table>
<pre class="comment">
clear the languages cache when updating the languages database table
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin">admin</a><br /></span>
<div class="fileheader"><big><b>languages.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/languages.php?rev=1.37&amp;content-type=text/vnd.viewcvs-markup">1.37</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/languages.php.diff?r1=1.37&amp;r2=1.38">-&gt;</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/languages.php?rev=1.38&amp;content-type=text/vnd.viewcvs-markup">1.38</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.37 -r1.38
--- languages.php	2004/10/28 18:59:49	1.37
+++ languages.php	2004/11/29 00:14:16	1.38
@@ -46,14 +46,12 @@
</small></pre><pre class="diff" id="context">             $language_id = $_GET['lID'];
           } else {
             $language_id = $osC_Database-&gt;nextID();
</pre><pre class="diff" id="added">+            $default_language = $osC_Language-&gt;get(DEFAULT_LANGUAGE);
</pre><pre class="diff" id="context"> 
</pre><pre class="diff" id="removed">-            include('../includes/classes/language.php');
-            $osC_Language = new language();
-
</pre><pre class="diff" id="context"> // create additional categories_description records
             $Qcategories = $osC_Database-&gt;query('select categories_id, categories_name from :table_categories_description where language_id = :language_id');
             $Qcategories-&gt;bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);
</pre><pre class="diff" id="removed">-            $Qcategories-&gt;bindInt(':language_id', $osC_Language-&gt;catalog_languages[DEFAULT_LANGUAGE]['id']);
</pre><pre class="diff" id="added">+            $Qcategories-&gt;bindInt(':language_id', $default_language['id']);
</pre><pre class="diff" id="context">             $Qcategories-&gt;execute();
 
             while ($Qcategories-&gt;next()) {
</pre><pre class="diff"><small id="info">@@ -74,7 +72,7 @@
</small></pre><pre class="diff" id="context"> // create additional products_description records
               $Qproducts = $osC_Database-&gt;query('select products_id, products_name, products_description, products_url from :table_products_description where language_id = :language_id');
               $Qproducts-&gt;bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
</pre><pre class="diff" id="removed">-              $Qproducts-&gt;bindInt(':language_id', $osC_Language-&gt;catalog_languages[DEFAULT_LANGUAGE]['id']);
</pre><pre class="diff" id="added">+              $Qproducts-&gt;bindInt(':language_id', $default_language['id']);
</pre><pre class="diff" id="context">               $Qproducts-&gt;execute();
 
               while ($Qproducts-&gt;next()) {
</pre><pre class="diff"><small id="info">@@ -98,7 +96,7 @@
</small></pre><pre class="diff" id="context"> // create additional products_options records
               $Qoptions = $osC_Database-&gt;query('select products_options_id, products_options_name from :table_products_options where language_id = :language_id');
               $Qoptions-&gt;bindTable(':table_products_options', TABLE_PRODUCTS_OPTIONS);
</pre><pre class="diff" id="removed">-              $Qoptions-&gt;bindInt(':language_id', $osC_Language-&gt;catalog_languages[DEFAULT_LANGUAGE]['id']);
</pre><pre class="diff" id="added">+              $Qoptions-&gt;bindInt(':language_id', $default_language['id']);
</pre><pre class="diff" id="context">               $Qoptions-&gt;execute();
 
               while ($Qoptions-&gt;next()) {
</pre><pre class="diff"><small id="info">@@ -120,7 +118,7 @@
</small></pre><pre class="diff" id="context"> // create additional products_options_values records
               $Qvalues = $osC_Database-&gt;query('select products_options_values_id, products_options_values_name from :table_products_options_values where language_id = :language_id');
               $Qvalues-&gt;bindTable(':table_products_options_values', TABLE_PRODUCTS_OPTIONS_VALUES);
</pre><pre class="diff" id="removed">-              $Qvalues-&gt;bindInt(':language_id', $osC_Language-&gt;catalog_languages[DEFAULT_LANGUAGE]['id']);
</pre><pre class="diff" id="added">+              $Qvalues-&gt;bindInt(':language_id', $default_language['id']);
</pre><pre class="diff" id="context">               $Qvalues-&gt;execute();
 
               while ($Qvalues-&gt;next()) {
</pre><pre class="diff"><small id="info">@@ -142,7 +140,7 @@
</small></pre><pre class="diff" id="context"> // create additional manufacturers_info records
               $Qmanufacturers = $osC_Database-&gt;query('select manufacturers_id, manufacturers_url from :table_manufacturers_info where languages_id = :languages_id');
               $Qmanufacturers-&gt;bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO);
</pre><pre class="diff" id="removed">-              $Qmanufacturers-&gt;bindInt(':languages_id', $osC_Language-&gt;catalog_languages[DEFAULT_LANGUAGE]['id']);
</pre><pre class="diff" id="added">+              $Qmanufacturers-&gt;bindInt(':languages_id', $default_language['id']);
</pre><pre class="diff" id="context">               $Qmanufacturers-&gt;execute();
 
               while ($Qmanufacturers-&gt;next()) {
</pre><pre class="diff"><small id="info">@@ -164,7 +162,7 @@
</small></pre><pre class="diff" id="context"> // create additional orders_status records
               $Qstatus = $osC_Database-&gt;query('select orders_status_id, orders_status_name from :table_orders_status where language_id = :language_id');
               $Qstatus-&gt;bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
</pre><pre class="diff" id="removed">-              $Qstatus-&gt;bindInt(':language_id', $osC_Language-&gt;catalog_languages[DEFAULT_LANGUAGE]['id']);
</pre><pre class="diff" id="added">+              $Qstatus-&gt;bindInt(':language_id', $default_language['id']);
</pre><pre class="diff" id="context">               $Qstatus-&gt;execute();
 
               while ($Qstatus-&gt;next()) {
</pre><pre class="diff"><small id="info">@@ -207,6 +205,8 @@
</small></pre><pre class="diff" id="context">         if ($error === false) {
           $osC_Database-&gt;commitTransaction();
 
</pre><pre class="diff" id="added">+          osC_Cache::clear('languages');
+
</pre><pre class="diff" id="context">           $osC_MessageStack-&gt;add_session('header', SUCCESS_DB_ROWS_UPDATED, 'success');
         } else {
           $osC_Database-&gt;rollbackTransaction();
</pre><pre class="diff"><small id="info">@@ -305,6 +305,8 @@
</small></pre><pre class="diff" id="context"> 
             if ($error === false) {
               $osC_Database-&gt;commitTransaction();
</pre><pre class="diff" id="added">+
+              osC_Cache::clear('languages');
</pre><pre class="diff" id="context"> 
               $osC_MessageStack-&gt;add_session('header', SUCCESS_DB_ROWS_UPDATED, 'success');
             } else {
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -&gt; email">CVSspam</a> 0.2.9</small></center>
</body></html>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/