Re: cvs: php-master-web /fetch countries.php
| From: | Gabor Hojtsy | Date: | Tue, 28 Feb 2006 21:12:00 +0000 |
| Subject: | Re: cvs: php-master-web /fetch countries.php | ||
| References: | 1 | Groups: | php.mirrors |
| Request: | Send a blank email to php-mirrors+get-30734@lists.php.net to get a copy of this message | ||
\$ escaping is missing here.
Goba
Rasmus Lerdorf wrote:
> rasmus Tue Feb 28 21:05:24 2006 UTC
>
> Modified files:
> /php-master-web/fetch countries.php
> Log:
> Cache countries array as well
>
>
>
> http://cvs.php.net/viewcvs.cgi/php-master-web/fetch/countries.php?r1=1.6&r2=1.7&diff_format=u>žý¼\°M
> û»¹VÇK,
> Index: php-master-web/fetch/countries.php
> diff -u php-master-web/fetch/countries.php:1.6 php-master-web/fetch/countries.php:1.7
> --- php-master-web/fetch/countries.php:1.6 Fri Aug 6 08:54:58 2004
> +++ php-master-web/fetch/countries.php Tue Feb 28 21:05:24 2006
> @@ -9,11 +9,11 @@
> if (@mysql_select_db("phpmasterdb")) {
> $res = @mysql_query("SELECT * FROM country ORDER BY name");
> if ($res) {
> - echo "<?php\n\$COUNTRIES = array(\n";
> + echo "<?php\nif(!$APC || ($APC &&
> !$COUNTRIES=apc_fetch('countries'))) {\n\$COUNTRIES = array(\n";
> while ($row = @mysql_fetch_array($res)) {
> echo "'$row[id]' => '",
> addslashes($row['name']), "',\n";
> }
> - echo ");\n";
> + echo ");if($APC) apc_store('countries',$COUNTRIES);\n}\n";
> }
> }
> }
>