<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ChristianGL.CoM &#187; Programación web</title>
	<atom:link href="http://www.christiangl.com/archivo/category/programacion-web/feed" rel="self" type="application/rss+xml" />
	<link>http://www.christiangl.com</link>
	<description>El rinconcito de Christian García</description>
	<lastBuildDate>Thu, 25 Feb 2010 12:13:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Algunos consejos de optimización para MySQL</title>
		<link>http://www.christiangl.com/archivo/algunos-consejos-de-optimizacion-para-mysql.xhtml</link>
		<comments>http://www.christiangl.com/archivo/algunos-consejos-de-optimizacion-para-mysql.xhtml#comments</comments>
		<pubDate>Sat, 15 Mar 2008 23:37:36 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[Manuales]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Optimización]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[Programación web]]></category>
		<category><![CDATA[optimizar mysql]]></category>

		<guid isPermaLink="false">http://www.christiangl.com/archivo/algunos-consejos-de-optimizacion-para-mysql.xhtml</guid>
		<description><![CDATA[
Revisando unos papeles he encontrado una vieja &#8220;chuleta&#8221; en la que se explica como optimizar nuestro código SQL para realizar las consultas rápidamente   .


 Búsqueda de palabras


/* Muy rápida */
SELECT * FROM tabla WHERE MATCH &#40;`campo`&#41; AGAINST &#40;'palabra'&#41;
/* Rápida */
SELECT * FROM tabla WHERE MATCH (`campo`) AGAINST (&#8216;+palabra&#8217; IN BOOLEAN MODE)
/* Lentas */
SELECT [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><img src="http://www.christiangl.com/wp-content/uploads/2008/03/logo-mysql.jpg" alt="MySQL" height="208" width="286" /></p>
<p>Revisando unos papeles he encontrado una vieja &#8220;chuleta&#8221; en la que se explica como optimizar nuestro código SQL para realizar las consultas rápidamente <img src='http://www.christiangl.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .</p>
<ul>
<li>
<h3> Búsqueda de palabras</h3>
</li>
</ul>
<p><pre class="php"><span style="color: #808080; font-style: italic;">/* Muy rápida */</span>
SELECT * FROM tabla WHERE MATCH <span style="color: #66cc66;">&#40;</span>`campo`<span style="color: #66cc66;">&#41;</span> AGAINST <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'palabra'</span><span style="color: #66cc66;">&#41;</span></pre></p>
<p>/* Rápida */<br />
SELECT * FROM tabla WHERE MATCH (`campo`) AGAINST (&#8216;+palabra&#8217; IN BOOLEAN MODE)</p>
<p>/* Lentas */<br />
SELECT * FROM tabla WHERE RLIKE &#8216;(^| +)palabra($| +)&#8217;<br />
/* o */<br />
SELECT * FROM tabla WHERE<br />
RLIKE &#8216;([[:space:]]|[[:&lt;:]])palabra([[:space:]]|[[:&gt;:]])&#8217;</p>
<ul>
<li>
<h3>Búsquedas contenidas</h3>
</li>
</ul>
<p><pre class="php"><span style="color: #808080; font-style: italic;">/* Muy rápida */</span>
SELECT * FROM tabla WHERE MATCH <span style="color: #66cc66;">&#40;</span>`campo`<span style="color: #66cc66;">&#41;</span> AGAINST <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'palabra*'</span> IN BOOLEAN MODE<span style="color: #66cc66;">&#41;</span></pre></p>
<p>/* Rápida */<br />
SELECT * FROM tabla WHERE FIELD LIKE &#8216;palabra%&#8217;</p>
<p>/* Lentas */<br />
SELECT * FROM tabla WHERE MATCH (`campo`) AGAINST (&#8216;*palabra*&#8217; IN BOOLEAN MODE)<br />
/* o */<br />
SELECT * FROM tabla WHERE campo LIKE &#8216;%palabra%&#8217;</p>
<ul>
<li>
<h3> Número de registros</h3>
</li>
</ul>
<p><pre class="php"><span style="color: #808080; font-style: italic;">/* Muy rápida */</span>
SELECT SQL_CALC_FOUND_ROWS * FROM tabla WHERE condición LIMIT <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">10</span>
SELECT FOUND_ROWS<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></pre></p>
<p>/* Rápido */<br />
SELECT * FROM tabla WHERE condición LIMIT 0, 10<br />
SELECT COUNT(clave) FROM TABLE WHERE condición</p>
<p>PD. No se la página de la que lo saqué en su momento, si alguien lo sabe que lo diga que se añade a la entrada <img src='http://www.christiangl.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christiangl.com/archivo/algunos-consejos-de-optimizacion-para-mysql.xhtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reparto del tiempo de un desarrollador web</title>
		<link>http://www.christiangl.com/archivo/reparto-del-tiempo-de-un-desarrollador-web.xhtml</link>
		<comments>http://www.christiangl.com/archivo/reparto-del-tiempo-de-un-desarrollador-web.xhtml#comments</comments>
		<pubDate>Sat, 15 Mar 2008 22:55:10 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[Humor]]></category>
		<category><![CDATA[Programación web]]></category>
		<category><![CDATA[diseño web]]></category>

		<guid isPermaLink="false">http://www.christiangl.com/archivo/reparto-del-tiempo-de-un-desarrollador-web.xhtml</guid>
		<description><![CDATA[Navegando por internet he visto un gráfico que nos ilustra con bastante precisión en que dedicamos el tiempo mientras desarrollamos una página web   .

]]></description>
			<content:encoded><![CDATA[<p>Navegando por internet he <a href="http://www.codigogeek.com/2008/03/15/como-ocupa-el-tiempo-un-disenador-web/" target="_blank">visto</a> un gráfico que nos ilustra con bastante precisión en que dedicamos el tiempo mientras desarrollamos una página web <img src='http://www.christiangl.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  .</p>
<p style="text-align: center"><img src="http://www.christiangl.com/wp-content/uploads/2008/03/webdesignpng.jpg" alt="Webdesign" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.christiangl.com/archivo/reparto-del-tiempo-de-un-desarrollador-web.xhtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS para formatear sitios por defecto</title>
		<link>http://www.christiangl.com/archivo/css-para-formatear-sitios-por-defecto.xhtml</link>
		<comments>http://www.christiangl.com/archivo/css-para-formatear-sitios-por-defecto.xhtml#comments</comments>
		<pubDate>Mon, 10 Mar 2008 00:01:25 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Manuales]]></category>
		<category><![CDATA[Programación web]]></category>
		<category><![CDATA[css reset]]></category>

		<guid isPermaLink="false">http://www.christiangl.com/archivo/css-para-formatear-sitios-por-defecto.xhtml</guid>
		<description><![CDATA[CSS Reset es un pequeño trozo de código que permite formatear todos los estilos por defecto, son muy útiles para evitar posibles problemas a la hora de maquetear un sitio web.
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>CSS Reset es un pequeño trozo de código que permite formatear todos los estilos por defecto</strong>, son muy útiles para evitar posibles problemas a la hora de maquetear un sitio web.</p>
<p><pre class="css">html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, <span style="color: #000000; font-weight: bold;">font</span>, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td <span style="color: #66cc66;">&#123;</span>
<span style="color: #000000; font-weight: bold;">margin</span>: <span style="color: #cc66cc;">0</span>;
<span style="color: #000000; font-weight: bold;">padding</span>: <span style="color: #cc66cc;">0</span>;
<span style="color: #000000; font-weight: bold;">border</span>: <span style="color: #cc66cc;">0</span>;
<span style="color: #000000; font-weight: bold;">outline</span>: <span style="color: #cc66cc;">0</span>;
<span style="color: #000000; font-weight: bold;">font-weight</span>: <span style="color: #993333;">inherit</span>;
<span style="color: #000000; font-weight: bold;">font-style</span>: <span style="color: #993333;">inherit</span>;
<span style="color: #000000; font-weight: bold;">font-size</span>: <span style="color: #cc66cc;">100</span>%;
<span style="color: #000000; font-weight: bold;">font-family</span>: <span style="color: #993333;">inherit</span>;
<span style="color: #000000; font-weight: bold;">vertical-align</span>: <span style="color: #993333;">baseline</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* remember to define focus styles! */</span>
<span style="color: #3333ff;">:focus </span><span style="color: #66cc66;">&#123;</span>
<span style="color: #000000; font-weight: bold;">outline</span>: <span style="color: #cc66cc;">0</span>;
<span style="color: #66cc66;">&#125;</span>
body <span style="color: #66cc66;">&#123;</span>
line-<span style="color: #000000; font-weight: bold;">height</span>: <span style="color: #cc66cc;">1</span>;
<span style="color: #000000; font-weight: bold;">color</span>: <span style="color: #000000; font-weight: bold;">black</span>;
<span style="color: #000000; font-weight: bold;">background</span>: <span style="color: #993333;">white</span>;
<span style="color: #66cc66;">&#125;</span>
ol, ul <span style="color: #66cc66;">&#123;</span>
<span style="color: #000000; font-weight: bold;">list-style</span>: <span style="color: #993333;">none</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* tables still need ‘cellspacing=”0″‘ in the markup */</span>
table <span style="color: #66cc66;">&#123;</span>
<span style="color: #000000; font-weight: bold;">border-collapse</span>: <span style="color: #993333;">separate</span>;
<span style="color: #000000; font-weight: bold;">border-spacing</span>: <span style="color: #cc66cc;">0</span>;
<span style="color: #66cc66;">&#125;</span>
caption, th, td <span style="color: #66cc66;">&#123;</span>
<span style="color: #000000; font-weight: bold;">text-align</span>: <span style="color: #000000; font-weight: bold;">left</span>;
<span style="color: #000000; font-weight: bold;">font-weight</span>: <span style="color: #993333;">normal</span>;
<span style="color: #66cc66;">&#125;</span>
blockquote:before, blockquote:after,
q:before, q<span style="color: #3333ff;">:after </span><span style="color: #66cc66;">&#123;</span>
<span style="color: #000000; font-weight: bold;">content</span>: “”;
<span style="color: #66cc66;">&#125;</span>
blockquote, q <span style="color: #66cc66;">&#123;</span>
<span style="color: #000000; font-weight: bold;">quotes</span>: “” “”;
<span style="color: #66cc66;">&#125;</span></pre></p>
<p>Leído en: <a href="http://www.kabytes.com/diseno/el-mejor-css-para-formatear-los-estilos-por-defecto/" target="_blank">Kabytes</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christiangl.com/archivo/css-para-formatear-sitios-por-defecto.xhtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 hacks CSS para que nuestras páginas se vean bien en varios navegadores</title>
		<link>http://www.christiangl.com/archivo/10-hacks-css-para-que-nuestras-paginas-se-vean-bien-en-varios-navegadores.xhtml</link>
		<comments>http://www.christiangl.com/archivo/10-hacks-css-para-que-nuestras-paginas-se-vean-bien-en-varios-navegadores.xhtml#comments</comments>
		<pubDate>Sun, 09 Mar 2008 01:48:58 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Programación web]]></category>
		<category><![CDATA[hacks]]></category>

		<guid isPermaLink="false">http://www.christiangl.com/archivo/10-hacks-css-para-que-nuestras-paginas-se-vean-bien-en-varios-navegadores.xhtml</guid>
		<description><![CDATA[Muchas veces cuando diseñamos una página web nos encontramos con el problema de que en algunos navegadores (el 99% de las veces es Internet Explorer) nuestro CSS no se ve correctamente. Para solucionar estos problemas stylizedweb ha publicado una lista de 10 hacks para que nuestros diseños se vean correctamente en varios navegadores   [...]]]></description>
			<content:encoded><![CDATA[<p>Muchas veces cuando diseñamos una página web nos encontramos con el problema de que en algunos navegadores (el 99% de las veces es Internet Explorer) nuestro CSS no se ve correctamente. Para solucionar estos problemas stylizedweb ha publicado una lista de 10 hacks para que nuestros diseños se vean correctamente en varios navegadores <img src='http://www.christiangl.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .</p>
<ul>
<li>Vertical align div</li>
<li>Min-Height</li>
<li>PNG transparency</li>
<li>Autoclear</li>
<li>Reset CSS</li>
<li>Scrolling Render IE</li>
<li>Opacity</li>
<li>PRE Tag</li>
<li>Li Background Repeat IE</li>
<li>Good to know</li>
</ul>
<p><a href="http://stylizedweb.com/2008/02/14/10-best-css-hacks/" target="_blank">Acceder a los hacks</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christiangl.com/archivo/10-hacks-css-para-que-nuestras-paginas-se-vean-bien-en-varios-navegadores.xhtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Una de chuletas informáticas&#8230;</title>
		<link>http://www.christiangl.com/archivo/una-de-chuletas-informaticas.xhtml</link>
		<comments>http://www.christiangl.com/archivo/una-de-chuletas-informaticas.xhtml#comments</comments>
		<pubDate>Mon, 18 Feb 2008 14:17:46 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Manuales]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[Programación web]]></category>

		<guid isPermaLink="false">http://www.christiangl.com/archivo/una-de-chuletas-informaticas.xhtml</guid>
		<description><![CDATA[Cheat-Sheets.org es un enorme recopilatorio de enlaces hacía chuletas, guías de información rápida, trucos y resúmenes para un montón de lenguajes de programación y otras utilidades. Tenemos desde información para .NET hasta información sobre Doctypes, ruby, sql, ubuntu y un largo etcétera. Un baúl de enlaces hacía información interesante que nos puede venir bien en [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cheat-sheets.org/">Cheat-Sheets.org</a> es un <strong>enorme recopilatorio de enlaces hacía chuletas, guías de información rápida, trucos y resúmenes</strong> para un montón de lenguajes de programación y otras utilidades. Tenemos desde información para .NET hasta información sobre Doctypes, ruby, sql, ubuntu y un largo etcétera. Un baúl de enlaces hacía información interesante que nos puede venir bien en cualquier momento.Enlace: <a href="http://cheat-sheets.org/">Cheat-Sheets.org</a></p>
<p>Vía: <a href="http://www.diariothc.com/index.php/2008/02/15/cheat-sheetsorg/" target="_blank">diarioTHC</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christiangl.com/archivo/una-de-chuletas-informaticas.xhtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gráficos web usando CSS</title>
		<link>http://www.christiangl.com/archivo/graficos-web-usando-css.xhtml</link>
		<comments>http://www.christiangl.com/archivo/graficos-web-usando-css.xhtml#comments</comments>
		<pubDate>Tue, 05 Feb 2008 00:22:11 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Diseño]]></category>
		<category><![CDATA[Programación web]]></category>

		<guid isPermaLink="false">http://www.christiangl.com/archivo/graficos-web-usando-css.xhtml</guid>
		<description><![CDATA[Para utilizar estos gráficos debemos descargar el css que tiene un peso aproximado de 5 KB y aplicarlo, las graficas pueden utilizar además de un color de plano imágenes, eso esta bueno para lograr efectos degradados, sombras, etc.

Web: Pure CSS Data Chart 
Vía: Kabytes.
]]></description>
			<content:encoded><![CDATA[<p>Para utilizar estos gráficos debemos descargar el css que tiene un peso aproximado de 5 KB y aplicarlo, las graficas pueden utilizar además de un color de plano imágenes, eso esta bueno para lograr efectos degradados, sombras, etc.</p>
<p style="text-align: center"><img src="http://www.christiangl.com/wp-content/uploads/2008/02/graficos-css.jpg" alt="Graficos CSS" /></p>
<p>Web: <a href="http://cssglobe.com/post/1272/pure-css-data-chart" title="Pure CSS Data Chart" onclick="javascript:urchinTracker('/outbound/cssglobe.com/post/1272/pure-css-data-chart');">Pure CSS Data Chart </a></p>
<p>Vía: <a href="http://www.kabytes.com/diseno/graficos-utilizando-solamente-css/" target="_blank">Kabytes</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christiangl.com/archivo/graficos-web-usando-css.xhtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Geany, ese gran pequeño editor</title>
		<link>http://www.christiangl.com/archivo/geany-ese-gran-pequeno-editor.xhtml</link>
		<comments>http://www.christiangl.com/archivo/geany-ese-gran-pequeno-editor.xhtml#comments</comments>
		<pubDate>Sat, 22 Dec 2007 00:42:39 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[Programación web]]></category>
		<category><![CDATA[Software Libre]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.christiangl.com/archivo/geany-ese-gran-pequeno-editor.xhtml</guid>
		<description><![CDATA[Geany es el perfecto termino medio entre un editor de textos y un IDE. Incluye las funciones básicas como númeración automática de las líneas, resaltado de código y autocompletado. Admite una amplia lista de tipos de ficheros, entre los que se incluyen C, C++, php, HTML, CSS Pero además posee funciones de compilación e incluso, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://geany.uvena.de/" target="_blank" title="Sitio Web de Geany">Geany</a> es el perfecto termino medio entre un <strong>editor de textos y un IDE</strong>. Incluye las funciones básicas como númeración automática de las líneas, resaltado de código y autocompletado. Admite una <a href="http://geany.uvena.de/Main/AllFiletypes" target="_blank" title="Geany: All Filetypes">amplia lista</a> de tipos de ficheros, entre los que se incluyen <strong>C, C++, php, HTML, CSS </strong>Pero además posee funciones de compilación e incluso, en la versión para Linux, <strong>podemos emular una terminal</strong> sin salir del Geany con el que compilar nuestro código y ejecutarlo. Así, sin más, podemos editar y probar el código sin salir de Geany con lo que es muy productivo y ligero de usar.</p>
<p>Existen <a href="http://geany.uvena.de/Download/Releases" target="_blank" title="Geany: Downloads">versiones para Linux y para Windows</a>, para este último es necesario instalar además las librerias <em>GTK</em>.</p>
<p>Leído en: <a href="http://bitelia.com/2007/12/21/descarga-del-dia-geany/" target="_blank">Bitelia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christiangl.com/archivo/geany-ese-gran-pequeno-editor.xhtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Animador contra animación</title>
		<link>http://www.christiangl.com/archivo/animador-contra-animacion.xhtml</link>
		<comments>http://www.christiangl.com/archivo/animador-contra-animacion.xhtml#comments</comments>
		<pubDate>Mon, 19 Nov 2007 12:26:10 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[Diseño]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[Humor]]></category>
		<category><![CDATA[Programación web]]></category>
		<category><![CDATA[animacion]]></category>
		<category><![CDATA[animador]]></category>
		<category><![CDATA[pelea]]></category>

		<guid isPermaLink="false">http://www.christiangl.com/archivo/animador-contra-animacion.xhtml</guid>
		<description><![CDATA[Para que luego digan que Flash es un lenguaje que no es revoltoso   .

]]></description>
			<content:encoded><![CDATA[<p>Para que luego digan que Flash es un lenguaje que no es revoltoso <img src='http://www.christiangl.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  .</p>
<p><center><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/qo1d6ttbAq8&#038;rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/qo1d6ttbAq8&#038;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.christiangl.com/archivo/animador-contra-animacion.xhtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crear archivos zip con PHP</title>
		<link>http://www.christiangl.com/archivo/crear-archivos-zip-con-php.xhtml</link>
		<comments>http://www.christiangl.com/archivo/crear-archivos-zip-con-php.xhtml#comments</comments>
		<pubDate>Wed, 31 Oct 2007 19:07:40 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[Manuales]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programación web]]></category>
		<category><![CDATA[Webmasters]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://www.christiangl.com/archivo/crear-archivos-zip-con-php.xhtml</guid>
		<description><![CDATA[En esta ocasión veremos la forma de crear archivos comprimidos en formato ZIP. Para este ejemplo utilizaremos la clase zipfile escrita por Eric Mueller y muy bien explicada en  Creating ZIP files with PHP.
Descargando la clase zipfile
Lo primero es descargar la clase zipfile desde zipfile.inc.txt y renombrarla a zipfile.php. Esta clase tiene dos metodos [...]]]></description>
			<content:encoded><![CDATA[<p>En esta ocasión veremos la forma de crear archivos comprimidos en formato ZIP. Para este ejemplo utilizaremos la clase <strong>zipfile</strong> escrita por <a href="http://www.themepark.com/" target="_blank">Eric Mueller</a> y muy bien explicada en  <a href="http://www.devco.net/archives/2005/05/24/creating_zip_files_with_php.php" target="_blank">Creating ZIP files with PHP</a>.</p>
<p><strong>Descargando la clase zipfile</strong></p>
<p>Lo primero es descargar la clase zipfile desde <a href="http://www.devco.net/code/zipfile.inc.txt" target="_blank">zipfile.inc.txt</a> y renombrarla a <em>zipfile.php</em>. Esta clase tiene dos metodos <em>add_dir()</em> y <em>add_file()</em> que permite agregar una carpeta o un archivo al zip que se esta creando.</p>
<p><strong>Creando nuestro primer ZIP</strong></p>
<p>Lo primero es incluir el archivo recién descargado, luego de ello creamos una instancia de la clase, para este ejemplo a la instancia lo llamamos <em>$zipfile</em>. Luego de ello agregamos un archivo  de la siguiente forma.</p>
<ol>
<li style="font-weight: normal; font-style: normal; font-size: 12px; color: #3a6a8b">
<p style="font-weight: normal; font-size: 12px"><span style="color: #616100">require</span> <span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;zipfile.php&#8221;</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
<li style="font-weight: bold; color: #26536a">
<p style="font-weight: normal; font-size: 12px"><span style="color: #0000ff">$zipfile</span> = <span style="color: #000000; font-weight: bold">new</span> zipfile<span style="color: #006600; font-weight: bold">(</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
<li style="font-weight: normal; font-style: normal; font-size: 12px; color: #3a6a8b">
<p style="font-weight: normal; font-size: 12px"><span style="color: #0000ff">$zipfile</span>-&gt;<span style="color: #006600">add_file</span><span style="color: #006600; font-weight: bold">(</span><a href="http://www.php.net/implode" target="_blank"><span style="color: #000066">implode</span></a><span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;&#8221;</span>,<a href="http://www.php.net/file" target="_blank"><span style="color: #000066">file</span></a><span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;img01.jpg&#8221;</span><span style="color: #006600; font-weight: bold">)</span><span style="color: #006600; font-weight: bold">)</span>, <span style="color: #ff0000">&#8220;foto.jpg&#8221;</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
</ol>
<p>Nótese que estamos agregando un archivo llamado <em>img01.jpg</em> y al momento de incluirlo en el zip lo estamos renombrando a <em>foto.jpg</em>. Hasta este punto hemos creado un archivo zip, el siguiente paso es enviarlo al cliente, para ello agregamos headers indicando el tipo de archivo y finalmente imprimimos el archivo:</p>
<ol>
<li style="font-weight: normal; font-style: normal; font-size: 12px; color: #3a6a8b">
<p style="font-weight: normal; font-size: 12px"><span style="color: #616100">require</span> <span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;zipfile.php&#8221;</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
<li style="font-weight: bold; color: #26536a">
<p style="font-weight: normal; font-size: 12px"><span style="color: #0000ff">$zipfile</span> = <span style="color: #000000; font-weight: bold">new</span> zipfile<span style="color: #006600; font-weight: bold">(</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
<li style="font-weight: normal; font-style: normal; font-size: 12px; color: #3a6a8b">
<p style="font-weight: normal; font-size: 12px"><span style="color: #0000ff">$zipfile</span>-&gt;<span style="color: #006600">add_file</span><span style="color: #006600; font-weight: bold">(</span><a href="http://www.php.net/implode" target="_blank"><span style="color: #000066">implode</span></a><span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;&#8221;</span>,<a href="http://www.php.net/file" target="_blank"><span style="color: #000066">file</span></a><span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;img01.jpg&#8221;</span><span style="color: #006600; font-weight: bold">)</span><span style="color: #006600; font-weight: bold">)</span>, <span style="color: #ff0000">&#8220;foto.jpg&#8221;</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
<li style="font-weight: bold; color: #26536a">
<p style="font-weight: normal; font-size: 12px">&nbsp;</p>
</li>
<li style="font-weight: normal; font-style: normal; font-size: 12px; color: #3a6a8b">
<p style="font-weight: normal; font-size: 12px"><a href="http://www.php.net/header" target="_blank"><span style="color: #000066">header</span></a><span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;Content-type: application/octet-stream&#8221;</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
<li style="font-weight: bold; color: #26536a">
<p style="font-weight: normal; font-size: 12px"><a href="http://www.php.net/header" target="_blank"><span style="color: #000066">header</span></a><span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;Content-disposition: attachment; filename=zipfile.zip&#8221;</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
<li style="font-weight: normal; font-style: normal; font-size: 12px; color: #3a6a8b">
<p style="font-weight: normal; font-size: 12px"><a href="http://www.php.net/echo" target="_blank"><span style="color: #000066">echo</span></a> <span style="color: #0000ff">$zipfile</span>-&gt;<span style="color: #006600">file</span><span style="color: #006600; font-weight: bold">(</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
</ol>
<p>El resultado del ejemplo lo pueden ver en <a href="http://samples.unijimpe.net/php-zip/index.php" target="_blank">http://samples.unijimpe.net/php-zip/</a>.</p>
<p><strong>Agregando carpetas al ZIP</strong><br />
En el caso que agregamos varios archivos y deseamos agruparlas en una carpeta, podemos utilizar el metodo add_folder. Luego de ello agregamos los archivos a la carpeta de la siguiente forma:</p>
<ol>
<li style="font-weight: normal; font-style: normal; font-size: 12px; color: #3a6a8b">
<p style="font-weight: normal; font-size: 12px"><span style="color: #616100">require</span> <span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;zipfile.php&#8221;</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
<li style="font-weight: bold; color: #26536a">
<p style="font-weight: normal; font-size: 12px"><span style="color: #0000ff">$zipfile</span> = <span style="color: #000000; font-weight: bold">new</span> zipfile<span style="color: #006600; font-weight: bold">(</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
<li style="font-weight: normal; font-style: normal; font-size: 12px; color: #3a6a8b">
<p style="font-weight: normal; font-size: 12px"><span style="color: #0000ff">$zipfile</span>-&gt;<span style="color: #006600">add_dir</span><span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;img/&#8221;</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
<li style="font-weight: bold; color: #26536a">
<p style="font-weight: normal; font-size: 12px"><span style="color: #0000ff">$zipfile</span>-&gt;<span style="color: #006600">add_file</span><span style="color: #006600; font-weight: bold">(</span><a href="http://www.php.net/implode" target="_blank"><span style="color: #000066">implode</span></a><span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;&#8221;</span>,<a href="http://www.php.net/file" target="_blank"><span style="color: #000066">file</span></a><span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;img01.jpg&#8221;</span><span style="color: #006600; font-weight: bold">)</span><span style="color: #006600; font-weight: bold">)</span>, <span style="color: #ff0000">&#8220;img/01.jpg&#8221;</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
<li style="font-weight: normal; font-style: normal; font-size: 12px; color: #3a6a8b">
<p style="font-weight: normal; font-size: 12px"><span style="color: #0000ff">$zipfile</span>-&gt;<span style="color: #006600">add_file</span><span style="color: #006600; font-weight: bold">(</span><a href="http://www.php.net/implode" target="_blank"><span style="color: #000066">implode</span></a><span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;&#8221;</span>,<a href="http://www.php.net/file" target="_blank"><span style="color: #000066">file</span></a><span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;img02.jpg&#8221;</span><span style="color: #006600; font-weight: bold">)</span><span style="color: #006600; font-weight: bold">)</span>, <span style="color: #ff0000">&#8220;img/02.jpg&#8221;</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
<li style="font-weight: bold; color: #26536a">
<p style="font-weight: normal; font-size: 12px"><span style="color: #0000ff">$zipfile</span>-&gt;<span style="color: #006600">add_file</span><span style="color: #006600; font-weight: bold">(</span><a href="http://www.php.net/implode" target="_blank"><span style="color: #000066">implode</span></a><span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;&#8221;</span>,<a href="http://www.php.net/file" target="_blank"><span style="color: #000066">file</span></a><span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;img03.jpg&#8221;</span><span style="color: #006600; font-weight: bold">)</span><span style="color: #006600; font-weight: bold">)</span>, <span style="color: #ff0000">&#8220;img/03.jpg&#8221;</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
<li style="font-weight: normal; font-style: normal; font-size: 12px; color: #3a6a8b">
<p style="font-weight: normal; font-size: 12px">&nbsp;</p>
</li>
<li style="font-weight: bold; color: #26536a">
<p style="font-weight: normal; font-size: 12px"><a href="http://www.php.net/header" target="_blank"><span style="color: #000066">header</span></a><span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;Content-type: application/octet-stream&#8221;</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
<li style="font-weight: normal; font-style: normal; font-size: 12px; color: #3a6a8b">
<p style="font-weight: normal; font-size: 12px"><a href="http://www.php.net/header" target="_blank"><span style="color: #000066">header</span></a><span style="color: #006600; font-weight: bold">(</span><span style="color: #ff0000">&#8220;Content-disposition: attachment; filename=fotos.zip&#8221;</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
<li style="font-weight: bold; color: #26536a">
<p style="font-weight: normal; font-size: 12px"><a href="http://www.php.net/echo" target="_blank"><span style="color: #000066">echo</span></a> <span style="color: #0000ff">$zipfile</span>-&gt;<span style="color: #006600">file</span><span style="color: #006600; font-weight: bold">(</span><span style="color: #006600; font-weight: bold">)</span>;</p>
</li>
</ol>
<p>Como ven agregar carpetas y multiples archivos es muy sencillo, incluso se pueden renombrar los archivos al momento de agregarlos al archivo zip. El resultado de este ejemplo lo pueden ver en: <a href="http://samples.unijimpe.net/php-zip/zipfolder.php" target="_blank">http://samples.unijimpe.net/php-zip/zipfolder.php</a>.</p>
<p>Leído en <a href="http://blog.unijimpe.net/crear-archivos-zip-con-php/" target="_blank">Unijimpe</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christiangl.com/archivo/crear-archivos-zip-con-php.xhtml/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Voz desde texto con PHP y Linux</title>
		<link>http://www.christiangl.com/archivo/voz-desde-texto-con-php-y-linux.xhtml</link>
		<comments>http://www.christiangl.com/archivo/voz-desde-texto-con-php-y-linux.xhtml#comments</comments>
		<pubDate>Tue, 02 Oct 2007 13:04:29 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Manuales]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programación web]]></category>
		<category><![CDATA[Webmasters]]></category>
		<category><![CDATA[Servidores]]></category>

		<guid isPermaLink="false">http://www.christiangl.com/archivo/voz-desde-texto-con-php-y-linux.xhtml</guid>
		<description><![CDATA[En este artículo vamos a explicar una forma de generar un archivo de audio a partir de un texto determinado con Linux (en este caso Ubuntu) y PHP.
1.-Instalamos Festival, que es el programa con el cual vamos a generar el fichero de audio a partir del texto:
apt-get install festival
2.-Una vez instalado, dispondremos de la utilidad [...]]]></description>
			<content:encoded><![CDATA[<p>En este artículo vamos a explicar una forma de generar un archivo de audio a partir de un texto determinado con Linux (en este caso Ubuntu) y PHP.</p>
<p>1.-Instalamos Festival, que es el programa con el cual vamos a generar el fichero de audio a partir del texto:</p>
<p><pre class="php">apt-get install festival</pre></p>
<p>2.-Una vez instalado, dispondremos de la utilidad de línea de comando text2wave que funciona de la siguiente manera:</p>
<p><pre class="php"><span style="color: #808080; font-style: italic;"># text2wave archivo.txt -o archivo.wav </span></pre></p>
<p>Para no tener que crear un archivo de texto cada vez utilicemos el programa usaremos tuberias:</p>
<p><pre class="php"><span style="color: #808080; font-style: italic;"># echo &quot;hola amigo&quot; | text2wave -o archivo.wav </span></pre></p>
<p><strong>El código PHP</strong></p>
<p>Ahora nuestro servidor está listo para generar archivos de voz desde un texto, lo único que tenemos que hacer es llamar al comando text2voice desde PHP con la función exec:<br />
<pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<a href="http://www.php.net/exec"><span style="color: #000066;">exec</span></a> <span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'echo &quot;hola amigo&quot; | text2wave -o file.wav'</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre><br />
Para que veais un ejemplo más complejo, voy a meterle un formulario y un enlace al archivo generado:<br />
<pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<a href="http://www.php.net/error_reporting"><span style="color: #000066;">error_reporting</span></a> <span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">E_ALL</span> <span style="color: #66cc66;">&#41;</span>;
<a href="http://www.php.net/ini_set"><span style="color: #000066;">ini_set</span></a> <span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'display_errors'</span>, <span style="color: #000000; font-weight: bold;">True</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <a href="http://www.php.net/isset"><span style="color: #000066;">isset</span></a> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$_REQUEST</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'text'</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0000ff;">$speechfile</span> = <span style="color: #ff0000;">&quot;speech/&quot;</span>.<a href="http://www.php.net/time"><span style="color: #000066;">time</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #ff0000;">&quot;.wav&quot;</span>;
<span style="color: #0000ff;">$curDir</span> = <span style="color: #ff0000;">'/var/www/speech/'</span>;
<a href="http://www.php.net/exec"><span style="color: #000066;">exec</span></a> <span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'echo &quot;'</span>. <a href="http://www.php.net/escapeshellarg"><span style="color: #000066;">escapeshellarg</span></a> <span style="color: #66cc66;">&#40;</span> <a href="http://www.php.net/utf8_decode"><span style="color: #000066;">utf8_decode</span></a> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$_REQUEST</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'text'</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> . <span style="color: #ff0000;">'&quot; | text2wave -o '</span> . <span style="color: #0000ff;">$curDir</span> . <span style="color: #0000ff;">$speechfile</span> <span style="color: #66cc66;">&#41;</span>;
?&gt;&lt;p&gt;El archivo generado se &lt;a href=<span style="color: #ff0000;">&quot;&lt;?php
echo $speechfile;
?&gt;&quot;</span>&gt;encuentra aquí&lt;/a&gt;&lt;/p&gt;&lt;?php
<span style="color: #66cc66;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;form method=<span style="color: #ff0000;">&quot;POST&quot;</span>&gt;
&lt;textarea name=<span style="color: #ff0000;">&quot;text&quot;</span> cols=<span style="color: #ff0000;">&quot;70&quot;</span>&gt;&lt;/textarea&gt;&lt;br /&gt;
&lt;input type=<span style="color: #ff0000;">&quot;submit&quot;</span>&gt;
&lt;/form&gt;</pre></p>
<p>Fuente original: ProgramacionWeb</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christiangl.com/archivo/voz-desde-texto-con-php-y-linux.xhtml/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
