OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-meta Date: 12-Mar-2006 18:49:03 Branch: HEAD Handle: 2006031217490300 Modified files: openpkg-meta meta.php Log: more comments for glue code and a fallback HTML page Summary: Revision Changes Path 1.2 +35 -2 openpkg-meta/meta.php ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-meta/meta.php ============================================================================ $ cvs diff -u -r1.1 -r1.2 meta.php --- openpkg-meta/meta.php 12 Mar 2006 17:44:52 -0000 1.1 +++ openpkg-meta/meta.php 12 Mar 2006 17:49:03 -0000 1.2 @@ -1,4 +1,28 @@ <script language="php"> +## +## Copyright (c) 2005-2006 OpenPKG Foundation e.V. <http://openpkg.net/> +## Copyright (c) 2005-2006 Ralf S. Engelschall <http://engelschall.com/> +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## +## meta.php: meta consumer glue code +## # diversion support $div = array(); @@ -50,7 +74,7 @@ echo $html; } -# URL fetching +# URL fetching with local caching function fetch_url($url, $max_caching) { $content = null; @@ -74,7 +98,15 @@ curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $content = curl_exec($curl); if (curl_errno($curl)) - $content = "cURL" . curl_error($curl); + $content = "<html>\n" . + " <head>\n" . + " <!-- CANVAS: HEAD -->\n" . + " </head>\n" . + " <body>\n" . + " <!-- ERROR: cURL: " . curl_error($curl) . " -->\n" . + " <!-- CANVAS: BODY -->\n" . + " </body>\n" . + "</html>\n"; curl_close($curl); # store content into cache @@ -131,4 +163,5 @@ header(sprintf("Content-Length: %d", strlen($content))); print $content; } + </script> @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org