<?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>Radio Levhita &#187; Web Development</title>
	<atom:link href="http://blog.levhita.net/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.levhita.net</link>
	<description>La radio que sólo se lee pero aún así se escucha...</description>
	<lastBuildDate>Tue, 22 Jun 2010 20:19:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>PDT: ohh la gloria!!</title>
		<link>http://blog.levhita.net/2008/03/16/pdt-ohh-la-gloria/</link>
		<comments>http://blog.levhita.net/2008/03/16/pdt-ohh-la-gloria/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 22:16:09 +0000</pubDate>
		<dc:creator>Argel Arias</dc:creator>
				<category><![CDATA[PlanetaLinux]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[PDT]]></category>
		<category><![CDATA[Zend debugger]]></category>

		<guid isPermaLink="false">http://blog.levhita.net/2008/03/16/pdt-ohh-la-gloria/</guid>
		<description><![CDATA[Este fin de semana por fin me instale el Eclipse PDT con el Zend Debugger y es la neta del planeta, algo complicado de entenderlo comparado con soluciones mas simples como jEdit (mi editor de planta durante 3 años). Más que nada por al contrario de JEdit que comienzas con nada y añades los plugins [...]]]></description>
			<content:encoded><![CDATA[<p>Este fin de semana por fin me instale el <a href="http://www.eclipse.org/pdt/">Eclipse PDT</a> con el <a href="http://www.zend.com/en/community/pdt#ws_debugger">Zend Debugger</a> y es la neta del planeta, algo complicado de entenderlo comparado con soluciones mas simples como jEdit (mi editor de planta durante 3 años).</p>
<p>Más que nada por al contrario de JEdit que comienzas con nada y añades los plugins que quieres(haciendo escalada la transición de newbie a experto), Eclipse  o mejor dicho PDT, ya viene de planta con mil cosas encima y son pocas las cosas que restan por añadir (en mi caso Subversion y el Zend WebServer Debugger), haciendo que la interfaz sea algo recargada y complicada para alguien con no haya usado antes el ZendStudio o alguna herramienta similar.</p>
<p>Unos consejos de lo poco que ví hoy:
<ul>
<li>Yo instale el All-In-One package de PDT desde la página de Zend: <a href="http://www.zend.com/en/community/pdt">http://www.zend.com/en/community/pdt</a></li>
</ul>
<p>Para ahorrarme pasos, también pueden instalarlo desde eclipse e instalar el Zend Debugger desde el sistema de paquetes.
<ul>
<li>También hay que instalar el Web Server Debugger, para que puedas debuggear en tu localhost o donde sea que necesites, las instrucciones son bastante sencillas.</li>
</ul>
<p>Funciona como un WebService, de forma que tienes que tener un Cliente(eclipse) y un Servidor(Apache configurado con el Zend Debugger) para poder debuggear.
<ul>
<li>Si vas a hacer un proyecto controlado desde svn, primero instala el paquete de Subversion <a href="http://subclipse.tigris.org/">SubEclipse</a>, y haz tu &#8220;nuevo proyecto desde SVN&#8221;, una vez descargado el Wizard te ayudara a crear tu &#8220;nuevo proyecto PHP&#8221;.</li>
</ul>
<p>Ahora con esta herramienta no me pasara lo que paso aquel día pasado:</p>
<p>El Jueves de la semana pasada estuve programando una pequeña modificación a un sistema que hice hace un buen rato en <a href="http://ld.com.mx/">Logística Dynamica</a>, la modificación era tan simple como añadir a una tabla la hora y fecha del acceso de los usuarios, así como el cliente el proyecto con el que iniciaron sesión.</p>
<p>Sólo fue cosa de crear una tabla nueva, escribir 4 lineas de código y hacer un <span style="font-style: italic;">commit</span> al repositorio.</p>
<p>En el servidor sólo fue necesario correrla consulta de modificación y hacer un <span style="font-style: italic;">update</span>.</p>
<p>Después de todo esta es una modificación extremadamente sencilla.</p>
<p>Pues bien&#8230; en servidor el código tronó como palomita y para acabarla el código tronaba antes de poder ejecutar el subsistema de <span style="font-style: italic;">debug</span> que me escribe los errores en una tabla de la base de datos.</p>
<p>Me tuve que dar una segunda vuelta a Logística para reparar el sistema, pelearme con mi Laptop que aun tiene Ubuntu 5.10(la tengo muy abandonada a la pobre) y pasarme media hora depurando capa tras capa de abstracción(Esto del módelo MVC es la onda hasta que te encuentras con un error en lo profundo del código).</p>
<p>El maldito error estaba en la ultima de todas la capas que puede tocar un desarrollador web sin meterse al código de la base de datos&#8230; en la base de datos, resulta que el usuario de la base de datos, no tenia permiso para escritura.</p>
<p>En un sistema normal, esto hubiera provocado solamente un error a pantalla, pero en mi código&#8230; al no poder insertar la fila, llama al sistema de debug, para escribir en la tabla que no puede escribir&#8230; pero al escribir también fallaba y llamaba al sistema de debug, para escribir en la tabla que no puede escribir&#8230; pero al escribir también fallaba y llamaba al sistema de debug, para escribir en la tabla que no puede escribir&#8230; pero al escribir también fallaba y llamaba al sistema de debug, para escribir en la tabla que no puede escribir&#8230; pero al escribir también fallaba y llamaba al sistema de debug, para escribir en la tabla que no puede escribir&#8230; pero al escribir también fallaba y llamaba al sistema de debug, para escribir en la tabla que no puede escribir&#8230; pero al escribir también fallaba y llamaba al sistema de debug, para escribir en la tabla que no puede escribir&#8230; pero al escribir también fallaba y llamaba al sistema de debug, para escribir en la tabla que no puede escribir&#8230; pero al escribir también fallaba y llamaba al sistema&#8230;..</p>
<p>Hasta que se llega al límite de recursión de PHP y el servidor truena el hilo&#8230; como resultado yo no veo al maldito error por ningún lado&#8230; demonios!!!</p>
<p>Al final tuve que volver a dejar todo el código modificado para debuggear el error justo como al inicio de todo el show y cambiar los permisos.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.levhita.net/2008/03/16/pdt-ohh-la-gloria/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Send email using Gmail and PHPMailer</title>
		<link>http://blog.levhita.net/2008/03/13/send-email-using-gmail-and-phpmailer/</link>
		<comments>http://blog.levhita.net/2008/03/13/send-email-using-gmail-and-phpmailer/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 16:59:20 +0000</pubDate>
		<dc:creator>Argel Arias</dc:creator>
				<category><![CDATA[PlanetaLinux]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpmailer]]></category>
		<category><![CDATA[pop]]></category>
		<category><![CDATA[smtp]]></category>

		<guid isPermaLink="false">http://blog.levhita.net/2008/03/13/send-email-using-gmail-and-phpmailer/</guid>
		<description><![CDATA[The new automatic update generator is ready, it has been a long time since OCRALight has been finished and little bit of this and that has been polished on the update generation. The process is fairly complex, it involves reverse-engineering, data-mining, packaging, distribution and a lot o fighting with our crappy Windows server that is [...]]]></description>
			<content:encoded><![CDATA[<p>The new automatic update generator is ready, it has been a long time since OCRALight has been finished and little bit of this and that has been polished on the update generation.</p>
<p>The process is fairly complex, it involves reverse-engineering, data-mining, packaging, distribution and a lot o fighting with our crappy Windows server that is between me and the final Linux liberation.</p>
<p>Every step in the road has been automatized, one by one, every problem has been solved and polished, now the final piece is in his place, the automatic email generation. Now the updates will be made and send everyday, even weekends and vacations.</p>
<p>If you are interested in the technical aspect keep reading:<br />
<span id="more-307"></span></p>
<p>How it has been done:</p>
<p>First of all, you need to have PHP with OpenSSL support, for Windows you&#8217;ll need to Install PHP and carefully select OpenSSL in the components list, if you already have PHP installed, don&#8217;t worry a re-install will keep your configuration, and you&#8217;ll be able to select OpenSSL.</p>
<p>Then download <a href="http://phpmailer.codeworxtech.com/">PHPMailer</a>,&amp;amp;nbsp; and extract it near your main php file.</p>
<p>You will need to have a Gmail account(obviously) I recommend you to make a new one just for this, mainly because the configuration need to be very precise, and you wouldn&#8217;t be able to use it freely without loosing functionality or risking to break the configuration.</p>
<p>Configure your Gmail account to use POP mail, but not IMAP, ONLY POP, just POP.</p>
<p>And now the code:</p>
<div class="blockcode" style="font-family: monospace; line-height:1.3em; width: 90%; height: 200px; border: 1px solid black; padding: 10px; white-space:nowrap; overflow:auto;"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<span style="color: #b1b100;">require</span><span style="color: #66cc66;">&#40;</span>”PHPMailer/<span style="color: #000000; font-weight: bold;">class</span>.phpmailer.php”<span style="color: #66cc66;">&#41;</span>;</p>
<p><span style="color: #0000ff;">$update_emails</span> = <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span><br />
&nbsp; &nbsp; ‘Juan Perez’ =&gt; ‘Juan_Perez@jalisco.gob.mx’,<br />
&nbsp; &nbsp; ‘Francisco Garcia’ =&gt; ‘fgarcia@hotmail.com’,<br />
&nbsp; &nbsp; ‘Diana la del Tunel’ =&gt; ‘diana@gmail.com’<br />
&nbsp; <span style="color: #66cc66;">&#41;</span>;</p>
<p><a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> “\nSending Update Email\n”;</p>
<p><span style="color: #0000ff;">$mail</span> = <span style="color: #000000; font-weight: bold;">new</span> PHPMailer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&nbsp; <span style="color: #808080; font-style: italic;">// Instantiate your new class</span><br />
<span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">IsSMTP</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// set mailer to use SMTP</span><br />
<span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">SMTPAuth</span> = <span style="color: #000000; font-weight: bold;">true</span>;&nbsp; &nbsp;<span style="color: #808080; font-style: italic;">// turn on SMTP authentication</span><br />
<span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">Host</span> = “smtp.gmail.com”; <span style="color: #808080; font-style: italic;">// specify main and backup server</span><br />
<span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">SMTPSecure</span>= ’ssl’; <span style="color: #808080; font-style: italic;">//&nbsp; Used instead of TLS when only POP mail is selected</span><br />
<span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">Port</span> = <span style="color: #cc66cc;">465</span>;&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//&nbsp; Used instead of 587 when only POP mail is selected</span></p>
<p><span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">Username</span> = “youremail@gmail.com”;&nbsp; <span style="color: #808080; font-style: italic;">// SMTP username, you could use your google apps address too.</span><br />
<span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">Password</span> = “yaourextremelynotlamepassword”; <span style="color: #808080; font-style: italic;">// SMTP password</span></p>
<p><span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">From</span> = “youremail@gmail.com”; <span style="color: #808080; font-style: italic;">//Aparently must be the same as the UserName</span><br />
<span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">FromName</span> = “Your name”;<br />
<span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">Subject</span> = ‘The subject’;<br />
<span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">Body</span> = “The body of your message”;</p>
<p><span style="color: #b1b100;">foreach</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$update_emails</span> <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$name</span> =&gt; <span style="color: #0000ff;">$email</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">AddBcc</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$email</span>, <span style="color: #0000ff;">$name</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span></p>
<p><span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>!<span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">Send</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> “There was an error sending the message:” . <span style="color: #0000ff;">$mail</span>-&gt;<span style="color: #006600;">ErrorInfo</span>;<br />
&nbsp; <a href="http://www.php.net/exit"><span style="color: #000066;">exit</span></a>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> “Done…\n”;<br />
<span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&nbsp;</div>
<p><br style="font-family: sans-serif;" /><span style="font-family: sans-serif;">In this code I send the email to a group of people, thus I use the &#8220;Bcc:&#8221; field instead of the &#8220;To:&#8221; one, to add a &#8220;To:&#8221; you would use <span style="font-family: Courier New;">AddAddress($email, $name)</span>.</p>
<p>A possible upgrade would be to use a MySQL database to store the addresses,&amp;amp;nbsp; and provide a web interface to add and remove them. for the moment, this is enough.</p>
<p>Soo remember:</p>
<p></span></span>
<ol>
<li>PHP with OpenSSL<br />
<span style="font-family: Courier New;"><span style="font-family: sans-serif;"></span></span></li>
<li><span style="font-family: Courier New;"><span style="font-family: sans-serif;">PHPMailer</span></span></li>
<li><span style="font-family: Courier New;"><span style="font-family: sans-serif;">Create a Gmail Account<br />
</span></span></li>
<li><span style="font-family: Courier New;"><span style="font-family: sans-serif;">Activate POP</span></span></li>
<li><span style="font-family: Courier New;"><span style="font-family: sans-serif;">Host: smtp.gmail.com</span></span></li>
<li><span style="font-family: Courier New;"><span style="font-family: sans-serif;">SMTPAuth=true</span></span></li>
<li><span style="font-family: Courier New;"><span style="font-family: sans-serif;">SMTPSEcure=ssl</span></span></li>
<li><span style="font-family: Courier New;"><span style="font-family: sans-serif;">Port: 465</span></span></li>
<li><span style="font-family: Courier New;"><span style="font-family: sans-serif;">User with Domain<br />
</span></span></li>
<li><span style="font-family: Courier New;"><span style="font-family: sans-serif;">Password</span></span></li>
<li><span style="font-family: Courier New;"><span style="font-family: sans-serif;">$Mail-&amp;amp;gt;send()</span></span></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.levhita.net/2008/03/13/send-email-using-gmail-and-phpmailer/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
