Thread: CVS: phpweather/docs/src/latex databases.tex,1.1,1.2 installation.tex...
Brought to you by:
iridium
From: Martin G. <gim...@us...> - 2002-03-29 15:18:34
|
Update of /cvsroot/phpweather/phpweather/docs/src/latex In directory usw-pr-cvs1:/tmp/cvs-serv2784 Modified Files: databases.tex installation.tex intro.tex main.tex translation.tex Log Message: Various updated. Index: databases.tex =================================================================== RCS file: /cvsroot/phpweather/phpweather/docs/src/latex/databases.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- databases.tex 11 Mar 2002 16:50:08 -0000 1.1 +++ databases.tex 29 Mar 2002 15:18:31 -0000 1.2 @@ -1,53 +1,53 @@ % -*- mode: latex; tex-main-file: "phpweather-a4" -*- \chapter{Database Backends} -As it takes about a second to retreive a \metar, \phpw supports -caching. \phpw supports several different database backends and it's +As it takes about a second to retreive a METAR, \pw supports +caching. \pw supports several different database backends and it's easy to write support for a new one. \section{What's In a Database Backend?} Each database backend is implemented through a separate class which -extends \class{pw\_db\_common}. This is convenient, as -\class{db\_common} has some properties needed by almost every back -end, most notably \variable{\$}{link\_id}. +extends \class{pw_db_common}. This is convenient, as +\class{db_common} has some properties needed by almost every back +end, most notably \var{$}{link_id}. It is up to the backend to decide how it will implement the functions -needed by \phpw, but it is required that each back-end has the +needed by \pw, but it is required that each back-end has the following methods: \begin{description} -\item[\function{connect}] This will be called whenever the script +\item[\func{connect}] This will be called whenever the script needs to make sure that we're connected. It must return true if a connection is established, and false otherwise. -\item[\function{insert\_metar}] This is called when a new \metar should +\item[\func{insert_metar}] This is called when a new METAR should be inserted into the cache. -\item[\function{update\_metar}] If the \metar is already in the cache, -this function will be called instead of \function{insert\_metar}. +\item[\func{update_metar}] If the METAR is already in the cache, +this function will be called instead of \func{insert_metar}. -\item[\function{get\_metar}] This function should return the \metar -report for a given \icao. If the \metar isn't found in the cache, it +\item[\func{get_metar}] This function should return the METAR +report for a given \icao. If the METAR isn't found in the cache, it should just return an empty string. -\item[\function{get\_countries}] This function returns a list of all -countries that have airports producing \metar reports. +\item[\func{get_countries}] This function returns a list of all +countries that have airports producing METAR reports. -\item[\function{get\_icaos}] Once you've selected a country, you'll +\item[\func{get_icaos}] Once you've selected a country, you'll use this function to get a list of all airports in that country. \end{description} \section{Writing a New Back-end} -If you use \phpw on a system where you don't have access to one of the +If you use \pw on a system where you don't have access to one of the databases already supported, you could write support for your own database. You should start by taking one of the existing back-ends, and use that as a template. If your database understands SQL, then use a back-end -like \class{db\_mysql} as your template, as it also uses SQL. +like \class{db_mysql} as your template, as it also uses SQL. Then go through the file, and adopt the functions to your database. When you're done, send your file to Index: installation.tex =================================================================== RCS file: /cvsroot/phpweather/phpweather/docs/src/latex/installation.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- installation.tex 11 Mar 2002 16:50:08 -0000 1.2 +++ installation.tex 29 Mar 2002 15:18:31 -0000 1.3 @@ -1,27 +1,28 @@ +% -*- mode: latex; tex-main-file: "phpweather-a4" -*- \chapter{Installation} -It's quite easy to install \phpw. You have to start by going to -\url{http://www.sourceforge.net/phpweather/} and downloading \phpw. -Decompress the file in a directory on the webserver then load the file +It's quite easy to install \pw. You have to start by going to +\url{http://www.phpweather.net} and downloading \pw. Decompress the +file in a directory on the webserver then load the file \filename{demo.php} in your favorite browser. That's it. You should see a page that lets you chose a country with an airport -that makes a \metar. There is about 3,000 airports in 192 countries -that make a \metar each hour so the chance of finding one near your is +that makes a METAR. There is about 3,000 airports in 192 countries +that make a METAR each hour so the chance of finding one near your is rather good. \section{Further Tweaking} -What you've just seen is \phpw in it's default form. You can (and +What you've just seen is \pw in it's default form. You can (and should) change a couple of things. You use the Configurator to do the configuration. So load the file called \filename{configurator.php} and see what happens. You should be presented with a page with a lot of drop-down boxed that let you choose numerous things. If you can, you should use the -Configurator to configure \phpw as it will ensure that you select -valid options. +Configurator to configure \pw as it will ensure that you select valid +options. Index: intro.tex =================================================================== RCS file: /cvsroot/phpweather/phpweather/docs/src/latex/intro.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- intro.tex 18 Jul 2001 10:39:28 -0000 1.2 +++ intro.tex 29 Mar 2002 15:18:31 -0000 1.3 @@ -1,12 +1,12 @@ -\chapter*{Introduction} - -This is a guide as to how you should use \phpw. +% -*- mode: latex; tex-main-file: "phpweather-a4" -*- +\chapter*{Introduction} +This is a guide as to how you should use \pw. -\section*{What is \phpw?} +\section*{What is \pw?} -\phpw is script written in PHP that can decode a METAR. The +\pw is script written in PHP that can decode a METAR. The METAR is fetched from the web and cached, so that the script runs faster the second time someone asks for that particular METAR. About 3000 airports from around the world makes these @@ -20,8 +20,8 @@ \section*{Output} - \phpw produces a special kind of output known as \emph{pretty - print}. It looks roughly like this: +\pw produces a special kind of output known as \emph{pretty + print}. It looks roughly like this: \begin{quote} This is a report for \emph{Aalborg, Denmark}. The report was made Index: main.tex =================================================================== RCS file: /cvsroot/phpweather/phpweather/docs/src/latex/main.tex,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- main.tex 11 Mar 2002 16:50:08 -0000 1.5 +++ main.tex 29 Mar 2002 15:18:31 -0000 1.6 @@ -5,6 +5,7 @@ % This sets the font to Palatino. %\renewcommand{\rmdefault}{ppl} %\usepackage{palatcm} +%\usepackage{palatino} \usepackage{xspace,graphicx} \usepackage[bf]{caption2} @@ -16,9 +17,11 @@ \newcommand{\Email}{\begingroup \urlstyle{rm}\Url} \newcommand{\email}[1]{\Email{<#1>}} -\newcommand{\function}[1]{\textsf{#1(~)}% - \index{#1@\textsf{#1(~)}}% - \index{Functions!#1@\textsf{#1(~)}} } +\newcommand{\Func}{\begingroup \urlstyle{sf}\Url} +\newcommand{\func}[1]{\Func{#1()}% + \index{#1@\protect\Func{#1()}}% + \index{Functions!#1@\protect\Func{#1()}}% +} %\newcommand{\functiondef}[1]{\textsf{#1}} %\newcommand{\funcdesclabel}[1]{\emph{#1:}} @@ -35,22 +38,25 @@ %} %\newcommand{\classdef}[1]{\textsf{#1}} -\newcommand{\class}[1]{\textsf{#1}% - \index{#1@\textsf{#1}}% - \index{Classes!#1@\textsf{#1}}} +\newcommand{\Class}{\begingroup \urlstyle{sf}\Url} +\newcommand{\class}[1]{\Class{#1}% + \index{#1@\protect\Class{#1}}% + \index{Classes!#1@\protect\Class{#1}}% +} -\newcommand{\variable}[2]{\textsf{\textbf{#1#2}}% - \index{#2@\textsf{\textbf{\protect\makebox[0cm][r]{#1}#2}}}% - \index{Variables!#2@\textsf{\textbf{\protect\makebox[0cm][r]{#1}#2}}}} +\newcommand{\Var}{\begingroup \urlstyle{tt}\Url} +\newcommand{\var}[2]{\Var{#1#2}% + \index{#2@\protect\makebox[0cm][r]{\protect\Var{#1}}\protect\Var{#2}}% + \index{Variables!#2@\protect\makebox[0cm][r]{\protect\Var{#1}}\protect\Var{#2}}% +} %\newcommand{\icao}[1]{\textsf{#1}} -\newcommand{\code}[1]{\texttt{#1}} +%\newcommand{\code}[1]{\textsf{#1}} +\newcommand{\code}{\begingroup \urlstyle{sf}\Url} \newcommand{\filename}{\begingroup \urlstyle{tt}\Url} -\newcommand{\phpw}{PHP Weather\xspace} -\newcommand{\metar}{\textsc{metar}\xspace} -\newcommand{\icao}{\textsc{icao}\xspace} +\newcommand{\pw}{PHP Weather\xspace} %\usepackage[colorlinks, % linkcolor=blue, @@ -61,10 +67,10 @@ \hyphenation{mail-ling-list pre-ci-pi-ta-ti-on sto-red} -\title{\phpw Usage Guide} +\title{\pw Usage Guide} \author{Martin Geisler \email{gim...@gi...}\thanks{I would -like to thank all the people who have helped me make \phpw. See the +like to thank all the people who have helped me make \pw. See the file \texttt{AUTHORS} for a list.}} \begin{document} @@ -75,16 +81,16 @@ \begin{quote} - Copyright \copyright\ 2001 Martin Geisler. - - Permission is granted to copy, distribute and/or modify this - document under the terms of the GNU Free Documentation License, - Version 1.1 or any later version published by the Free Software - Foundation; with no Invariant Sections, no Front-Cover Texts and - no Back-Cover Texts. A copy of the license is included in the - section entitled ``GNU Free Documentation License'' on - page~\pageref{chap:fdl}. - + Copyright \copyright\ 2001 Martin Geisler. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.1 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts and no + Back-Cover Texts. A copy of the license is included in the section + entitled ``GNU Free Documentation License'' on + page~\pageref{chap:fdl}. + \end{quote} \tableofcontents @@ -99,6 +105,8 @@ \include{databases} \include{translation} + +\include{decoded} %\include{apidoc} Index: translation.tex =================================================================== RCS file: /cvsroot/phpweather/phpweather/docs/src/latex/translation.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- translation.tex 11 Mar 2002 16:50:08 -0000 1.2 +++ translation.tex 29 Mar 2002 15:18:31 -0000 1.3 @@ -1,12 +1,12 @@ % -*- mode: latex; tex-main-file: "phpweather-a4" -*- \chapter{Translation} -It is quite easy to translate \phpw into another language. This chaper +It is quite easy to translate \pw into another language. This chaper will teach you how. \section{The Locales} -All the words and sentences used by \phpw is stored in special files +All the words and sentences used by \pw is stored in special files called \emph{locales}. You'll find these files in the directory \filename{PHPWEATHER_BASE_DIR/locales}. Each file is named after a scheme like this \filename{locale_xx.php} where \filename{xx} @@ -17,7 +17,7 @@ \section{Making a New Locale} -To translation \phpw into a new language you have to make a new +To translation \pw into a new language you have to make a new locale. This is done by following these steps: \begin{enumerate} @@ -35,8 +35,8 @@ This involves the following steps: \begin{enumerate} -\item Changing the lines that defines the constant \code{LOCALE\_EN} so -that it defines \code{LOCALE\_XX} instead. +\item Changing the lines that defines the constant \code{LOCALE_EN} so +that it defines \code{LOCALE_XX} instead. \item Changing the comment from talking about English output to your native tounge. @@ -50,20 +50,20 @@ \item You can leave the line with \code{@version} intact. It will be updated automatically when the file is put under version control. -\item Changing the line with \code{class locale\_en} into \code{class -locale\_xx} instead. +\item Changing the line with \code{class locale_en} into \code{class +locale_xx} instead. \end{enumerate} \item Here comes the difficult part: Translate every string in the file, but leave all occurrences of \code{\%s} intact. It is these codes that will be replaced by the actual numbers and strings when -\phpw is executed. +\pw is executed. Here's an example: \code{\%s mm (\%s inches)} becomes ``12.7 mm (0.5 -inches)''. This string is then used in the next piece: \code{There was -\%s of precipitation}, which then becomes ``There was 12.7 mm (0.5 -inches) of precipitation''. I hope you get the idea. +inches)''. This string is used in the next piece: \code{There was \%s +of precipitation}, which then becomes ``There was 12.7 mm (0.5 inches) +of precipitation''. I hope you get the idea. \item Remember to translate all special charecters (things like \ae, \'e, \aa, \"o, etc) to their HTML-entities. Use my list of @@ -78,7 +78,7 @@ \end{enumerate} -That's it --- you've now translated \phpw! +That's it --- you've now translated \pw! \section{Going Further} @@ -87,10 +87,10 @@ might not have been easy for you to make a good translation. But what if you could change the strings completely? -The good news is: ``You can!'' Now that \phpw uses objects it's +The good news is: ``You can!'' Now that \pw uses objects it's possible for the translator to change almost every aspect of the translation. This can be done, because the translation you've made is -the definition of a class called \class{locale\_xx} +the definition of a class called \class{locale_xx} where \code{xx} is the country-code. To be continued\ldots |