<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Portalbit</title>
	
	<link>http://www.portalbit.com</link>
	<description>Aplicaciones Android,Programación,Aplicaciones iPhone,Videojuegos,Diseño web,Noticias</description>
	<lastBuildDate>Fri, 19 Apr 2013 20:58:20 +0000</lastBuildDate>
	<language>es-ES</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/feed_portalbit" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="feed_portalbit" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">feed_portalbit</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Crear formulario de contacto con Silex y Swiftmailer</title>
		<link>http://www.portalbit.com/crear-formulario-de-contacto-con-silex-y-swiftmailer/2013-04</link>
		<comments>http://www.portalbit.com/crear-formulario-de-contacto-con-silex-y-swiftmailer/2013-04#comments</comments>
		<pubDate>Fri, 19 Apr 2013 20:52:12 +0000</pubDate>
		<dc:creator>Jaime</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Silex]]></category>
		<category><![CDATA[Swiftmailer]]></category>
		<category><![CDATA[Symfony2]]></category>

		<guid isPermaLink="false">http://www.portalbit.com/?p=3015</guid>
		<description><![CDATA[Vamos a ver como crear un formulario de contacto usando Silex y la librería Swiftmailer que nos permitirá enviar emails a una dirección de correo con el contenido del formulario. Es muy fácil de implementar y en unas pocas líneas de código lo tendremos completamente operativo, en este caso usaremos gmail para el envío de [...]]]></description>
				<content:encoded><![CDATA[<p>Vamos a ver como crear un formulario de contacto usando <strong>Silex</strong> y la librería <strong>Swiftmailer</strong> que nos permitirá enviar emails a una dirección de correo con el contenido del formulario. Es muy fácil de implementar y en unas pocas líneas de código lo tendremos completamente operativo, en este caso usaremos gmail para el envío de emails.</p>
<p><strong>1 -</strong> Registramos y configuramos SwiftmailerServiceProvider en el archivo <em>app.php</em></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000088;">$app</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">register</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Silex\Provider\SwiftmailerServiceProvider<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #000088;">$app</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">register</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> SwiftmailerServiceProvider<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'swiftmailer.options'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'host'</span>          <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'smtp.gmail.com'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'port'</span>          <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'465'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'username'</span>      <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'tu dirección de gmail'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'password'</span>      <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'contraseña de gmail'</span>
    <span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>en caso de que no tengas instalado swiftmailer, el proceso es tan sencillo como agregar la siguiente línea a tu composer.json:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="json" style="font-family:monospace;">&quot;require&quot;: {
    &quot;swiftmailer/swiftmailer&quot;: &quot;&gt;=4.1.2,&lt;4.2-dev&quot;
}</pre></td></tr></table></div>

<p>Abrimos una consola y ejecutamos:</p>
<blockquote><p>$ php composer.phar install</p></blockquote>
<p><span id="more-3015"></span></p>
<p><strong>2 -</strong> Ahora creamos la ruta con el controlador</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #000088;">$app</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/contacto'</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>Application <span style="color: #000088;">$app</span><span style="color: #339933;">,</span> Request <span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #666666; font-style: italic;">//creamos los campos del formulario   </span>
        <span style="color: #000088;">$form</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$app</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'form.factory'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createBuilder</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'form'</span><span style="color: #009900;">&#41;</span>
                <span style="color: #339933;">-&gt;</span><span style="color: #004000;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'nombre'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'text'</span><span style="color: #009900;">&#41;</span>
                <span style="color: #339933;">-&gt;</span><span style="color: #004000;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'email'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#41;</span>
                <span style="color: #339933;">-&gt;</span><span style="color: #004000;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mensaje'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'textarea'</span><span style="color: #009900;">&#41;</span>
                <span style="color: #339933;">-&gt;</span><span style="color: #004000;">getForm</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'POST'</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$request</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMethod</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
                <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isValid</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                        <span style="color: #666666; font-style: italic;">//Obtenemos los datos del formulario</span>
                        <span style="color: #000088;">$datos</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                        <span style="color: #000088;">$contenido_email</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Email: %s \n\n Remitente: %s \n\n Mensaje: $s '</span><span style="color: #339933;">,</span>
                        <span style="color: #000088;">$datos</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
                        <span style="color: #000088;">$datos</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'nombre'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
                        <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$datos</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'mensaje'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                        <span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> \Swift_Message<span style="color: #339933;">::</span><span style="color: #004000;">newInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
                                  <span style="color: #339933;">-&gt;</span><span style="color: #004000;">setSubject</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Contacto'</span><span style="color: #009900;">&#41;</span>
                                  <span style="color: #339933;">-&gt;</span><span style="color: #004000;">setFrom</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$datos</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                                  <span style="color: #339933;">-&gt;</span><span style="color: #004000;">setTo</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tu@email.com'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                                  <span style="color: #339933;">-&gt;</span><span style="color: #004000;">setBody</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$datos</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'mensaje'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                              <span style="color: #000088;">$app</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'mailer'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">send</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
&nbsp;
                           <span style="color: #b1b100;">return</span> <span style="color: #000088;">$app</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">redirect</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$app</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'url_generator'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">generate</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'contacto'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                        <span style="color: #009900;">&#125;</span>           
            <span style="color: #009900;">&#125;</span>
&nbsp;
       <span style="color: #b1b100;">return</span> <span style="color: #000088;">$app</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'twig'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">render</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'contacto.html.twig'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
           <span style="color: #0000ff;">'form'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createView</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Si tu aplicación es muy pequeña puedes hacerlo de esta forma pero si tu aplicación va a ser mas grande, es mejor que definas todos los controladores en clases, si quieres saber más lee la <a href="http://silex.sensiolabs.org/doc/usage.html" title="Silex documentación enrutamiento">documentación</a> o también puedes utilizar los <a href="http://silex.sensiolabs.org/doc/providers/service_controller.html" title="Controllers as services-Silex" target="_blank">controladores como servicios</a>.</p>
<p><strong>3 &#8211; </strong>Ahora creamos la plantilla <em>contacto.html.twig</em> para imprimir el formulario de contacto:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&nbsp;
&lt;h2&gt;Contacto&lt;/h2&gt;
&nbsp;
&lt;form action=&quot;{{ path('contacto') }}&quot; method=&quot;post&quot; {{ form_enctype(form) }}&gt;
&nbsp;
{{ form_errors(form) }}
&nbsp;
        {{ form_label(form.nombre) }}  
        {{ form_errors(form.nombre) }}
        {{ form_widget(form.nombre) }}
&nbsp;
&nbsp;
        {{ form_label(form.email) }}   
        {{ form_errors(form.email) }}
        {{ form_widget(form.email) }}
&nbsp;
        {{ form_label(form.mensaje) }}   
        {{ form_errors(form.mensaje) }}
        {{ form_widget(form.mensaje) }}
&nbsp;
{{ form_rest(form) }}
        &lt;br/&gt;
        &lt;input  type=&quot;submit&quot; value=&quot;Enviar&quot; /&gt;
    &lt;/form&gt;</pre></td></tr></table></div>

<p><strong>Enlace:</strong> <a title="Documentación Silex" href="http://silex.sensiolabs.org/" target="_blank">Silex Framework</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.portalbit.com/crear-formulario-de-contacto-con-silex-y-swiftmailer/2013-04/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Carrusel circular en Jquery</title>
		<link>http://www.portalbit.com/carrusel-circular-en-jquery/2013-04</link>
		<comments>http://www.portalbit.com/carrusel-circular-en-jquery/2013-04#comments</comments>
		<pubDate>Fri, 12 Apr 2013 21:29:43 +0000</pubDate>
		<dc:creator>Jaime</dc:creator>
				<category><![CDATA[Descargas]]></category>
		<category><![CDATA[Diseño web]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[Carrusel]]></category>
		<category><![CDATA[Jquery]]></category>

		<guid isPermaLink="false">http://www.portalbit.com/?p=3007</guid>
		<description><![CDATA[Tiny Circleslider es un carrusel  desarrollado en Jquery con el que podrás dar un curioso efecto a tus imágenes. Es fácil de implementar y si quieres modificarlo tampoco te supondrá mucho esfuerzo. Como curiosidad también es compatible con iPhone, iPad y Android por lo que los usuarios de tu web podrán deslizar con la pantalla [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;"><a title="Tiny circle slider" href="http://baijs.nl/tinycircleslider/" target="_blank">Tiny Circleslider</a> es un carrusel  desarrollado en <strong>Jquery</strong> con el que podrás dar un curioso efecto a tus imágenes. Es fácil de implementar y si quieres modificarlo tampoco te supondrá mucho esfuerzo. Como curiosidad también es compatible con iPhone, iPad y Android por lo que los usuarios de tu web podrán deslizar con la pantalla táctil.</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/04/Captura-de-pantalla-de-2013-04-12-231233.png"><img class="aligncenter size-full wp-image-3024" alt="circle-slider" src="http://www.portalbit.com/wp-content/uploads/2013/04/Captura-de-pantalla-de-2013-04-12-231233.png" width="323" height="317" /></a></p>
<h3><span>Características</span></h3>
<ul>
<li>Compatible con iPhone, iPad y Android</li>
<li><span>Soporta deslizamiento con el pulgar</span></li>
<li><span>Establecer un intervalo( en milisegundos) para realizar la transición </span></li>
<li><span>Ajustar tamaño (radio) de la barra</span></li>
<li><span>Fácil personalizable</span></li>
<li><span><span>Ligero con sólo 130 líneas de código. </span><span>minified  de 4 kb</span></span></li>
</ul>
<p><strong>Enlace:</strong> <a title="Tiny Circle Slider Demo" href="http://baijs.nl/tinycircleslider/" target="_blank">Demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.portalbit.com/carrusel-circular-en-jquery/2013-04/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silex y Doctrine 2 ORM</title>
		<link>http://www.portalbit.com/silex-y-doctrine-2-orm/2013-04</link>
		<comments>http://www.portalbit.com/silex-y-doctrine-2-orm/2013-04#comments</comments>
		<pubDate>Mon, 01 Apr 2013 04:16:44 +0000</pubDate>
		<dc:creator>Jaime</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[Doctrine 2]]></category>
		<category><![CDATA[Microframework]]></category>
		<category><![CDATA[ORM]]></category>
		<category><![CDATA[Silex]]></category>
		<category><![CDATA[Symfony2]]></category>

		<guid isPermaLink="false">http://www.portalbit.com/?p=2996</guid>
		<description><![CDATA[Silex está genial porque es muy simple y con el puedes crear aplicaciones pequeñas en muy poco tiempo, pero a veces se queda corto y si quieres utilizarlo para aplicaciones algo más grandes es interesante disponer de un  ORM como el de Doctrine 2 y, aunque silex incorpora Doctrine Dbal no incorpora el ORM. Por suerte es fácil implementarlo en Silex [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;"><a title="Silex" href="http://silex.sensiolabs.org/" target="_blank">Silex</a> está genial porque es muy simple y con el puedes crear aplicaciones pequeñas en muy poco tiempo, pero a veces se queda corto y si quieres utilizarlo para aplicaciones algo más grandes es interesante disponer de un  ORM como el de Doctrine 2 y, aunque silex incorpora <a title="Doctrine Dbal" href="http://www.doctrine-project.org/projects/dbal.html" target="_blank">Doctrine Dbal </a>no incorpora el ORM. Por suerte es fácil implementarlo en Silex gracias a <a title="Doctrine 2 ORM priovider" href="https://github.com/Taluu/nutwerk-orm-extension" target="_blank">este proveedor </a>mantenido por <a title="Github" href="https://github.com/Taluu" target="_blank">Taluu</a> en Github.</p>
<p style="text-align: justify;">Utilizarlo es muy sencillo:</p>
<p style="text-align: justify;">1 - Añadimos el siguiente código a nuestro composer.json e instalarlo:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="json" style="font-family:monospace;">{
    &quot;require&quot;: {
        &quot;silex/silex&quot;: &quot;1.0.*&quot;,
        &quot;taluu/doctrine-orm-provider&quot;: &quot;1.0.*&quot;
    },
    &quot;minimum-stability&quot;: &quot;dev&quot;
}</pre></td></tr></table></div>

<p>&nbsp;</p>
<blockquote><p>composer update</p></blockquote>
<p>2 &#8211; Lo registramos en Silex en app.php:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">use</span> \Doctrine\Common\Cache\ApcCache<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> \Doctrine\Common\Cache\ArrayCache<span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #000088;">$app</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">register</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Silex\Provider\DoctrineServiceProvider<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #666666; font-style: italic;">// Doctrine DBAL settings goes here</span>
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #000088;">$app</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">register</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Nutwerk\Provider\DoctrineORMServiceProvider<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'db.orm.proxies_dir'</span>           <span style="color: #339933;">=&gt;</span> __DIR__ <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/cache/doctrine/proxy'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'db.orm.proxies_namespace'</span>     <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'DoctrineProxy'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'db.orm.cache'</span>                 <span style="color: #339933;">=&gt;</span> 
        <span style="color: #339933;">!</span><span style="color: #000088;">$app</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'debug'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">extension_loaded</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'apc'</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000000; font-weight: bold;">new</span> ApcCache<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">new</span> ArrayCache<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'db.orm.auto_generate_proxies'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'db.orm.entities'</span>              <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'type'</span>      <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'annotation'</span><span style="color: #339933;">,</span>       <span style="color: #666666; font-style: italic;">// tipo de definición de entidades</span>
        <span style="color: #0000ff;">'path'</span>      <span style="color: #339933;">=&gt;</span> __DIR__ <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/src'</span><span style="color: #339933;">,</span>   <span style="color: #666666; font-style: italic;">// ruta a tus clases</span>
        <span style="color: #0000ff;">'namespace'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'MiWeb\Entity'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// el namespace de tus clases</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Para llamar al entity manager en Silex:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$app</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'db.orm.em'</span><span style="color: #009900;">&#93;</span></pre></td></tr></table></div>

<p>El funcionamiento es practicamente igual que en Symfony2 pero si quieres saber más, revisa este <a href="http://martinsikora.com/silex-doctrine2-orm" title="Post sobre Doctrine en Silex" target="_blank">post(Ingles)</a></p>
<p><strong>Enlace:</strong> <a title="Doctrine 2 ORM for Silex" href="https://github.com/Taluu/nutwerk-orm-extension" target="_blank">Doctrine 2 ORM for Silex</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.portalbit.com/silex-y-doctrine-2-orm/2013-04/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Autenticación en Silex con Mysql y Doctrine dbal</title>
		<link>http://www.portalbit.com/autenticacion-en-silex-con-mysql-y-doctrine-dbal/2013-03</link>
		<comments>http://www.portalbit.com/autenticacion-en-silex-con-mysql-y-doctrine-dbal/2013-03#comments</comments>
		<pubDate>Tue, 19 Mar 2013 03:14:23 +0000</pubDate>
		<dc:creator>Jaime</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[Seguridad]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[dbal]]></category>
		<category><![CDATA[Doctrine]]></category>
		<category><![CDATA[Doctrine2]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Silex]]></category>
		<category><![CDATA[Symfony2]]></category>

		<guid isPermaLink="false">http://www.portalbit.com/?p=2976</guid>
		<description><![CDATA[Silex es ideal para proyectos pequeños ya que con el puedes desarrollar muy rápido, y en poco tiempo puedes tener una aplicación totalmente funcional con pocas líneas de código.Silex al estar basado en Symfony2 utiliza muchos de sus componentes y puedes extender su funcionalidad fácilmente. Hoy vamos a ver como loguearse con un usuario usando el SecurityServiceProvider que incorpora el framework para [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Silex</strong> es ideal para proyectos pequeños ya que con el puedes desarrollar muy rápido, y en poco tiempo puedes tener una aplicación totalmente funcional con pocas líneas de código.<strong>Silex</strong> al estar basado en<strong> Symfony2</strong> utiliza muchos de sus componentes y puedes extender su funcionalidad fácilmente.</p>
<p>Hoy vamos a ver como loguearse con un usuario usando el <a title="Provider Silex" href="http://silex.sensiolabs.org/doc/providers/security.html" target="_blank"><strong>SecurityServiceProvider</strong></a> que incorpora el framework para añadir los firewalls necesarios a la aplicación.</p>
<p>Antes de nada tenemos que registrar el proveedor de doctrine y</p>
<p><strong>1) </strong>Antes de nada tenemos que registrar el proveedor de doctrine y configurar la conexión con nuestra base de datos en nuestro app.php:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$app</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">register</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Silex\Provider\DoctrineServiceProvider<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'db.options'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'driver'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'pdo_mysql'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'dbhost'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'localhost'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'dbname'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'dbname'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'user'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'root'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'password'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'contraseña'</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>2)</strong> También es necesario el SessionServiceProvider para manejar las sesiones de la aplicación:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$app</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">register</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Silex\Provider\SessionServiceProvider<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>3)</strong>Ahora añadimos las dependencias del SecurityServiceProvider a nuestro archivo composer.json y lo instalamos:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #0000ff;">&quot;require&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #0000ff;">&quot;symfony/security&quot;</span><span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;~2.1&quot;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<blockquote><p>$ php composer.phar update</p></blockquote>
<p><strong>4)</strong> Registramos el <strong>SecurityServiceProvider</strong>  y configuramos los firewalls de la aplicación:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">register<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Silex\Provider\SecurityServiceProvider<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'security.firewalls'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'anonimo'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pattern'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'^/anonimo'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> 
        <span style="color: #0000ff;">'segura'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">'pattern'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'^.*$'</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'anonymous'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">//Es necesario si el login path está dentro de una zona segura                          </span>
            <span style="color: #0000ff;">'form'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'login_path'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'check_path'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'login_check'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'logout'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'logout_path'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/logout'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// para cerrar sesión</span>
            <span style="color: #0000ff;">'users'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$app</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">share</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">use</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$app</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #666666; font-style: italic;">//El proveedor de usuarios:</span>
                <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">new</span> App\User\UserProvider<span style="color: #009900;">&#40;</span><span style="color: #000088;">$app</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'db'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'security.access_rules'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #666666; font-style: italic;">// Puede ser el rol que tu quieras </span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'^/.+$'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ROLE_USER'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<pre><strong>5)</strong>Ahora creamos la clase UserProvider:</pre>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// app/src/User/UserProvider.php o donde tu quieras</span>
<span style="color: #000000; font-weight: bold;">namespace</span> App\User<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> Symfony\Component\Security\Core\User\UserProviderInterface<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Symfony\Component\Security\Core\User\UserInterface<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Symfony\Component\Security\Core\User\User<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Symfony\Component\Security\Core\Exception\UsernameNotFoundException<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Symfony\Component\Security\Core\Exception\UnsupportedUserException<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Doctrine\DBAL\Connection<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> UserProvider implements UserProviderInterface
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$conn</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span>Connection <span style="color: #000088;">$conn</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">conn</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$conn</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> loadUserByUsername<span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$stmt</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">conn</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">executeQuery</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SELECT * FROM users WHERE username = ?'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$stmt</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetch</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> UsernameNotFoundException<span style="color: #009900;">&#40;</span><span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Username &quot;%s&quot; does not exist.'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$username</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">new</span> User<span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'roles'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> refreshUser<span style="color: #009900;">&#40;</span>UserInterface <span style="color: #000088;">$user</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$user</span> instanceof User<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> UnsupportedUserException<span style="color: #009900;">&#40;</span><span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Instances of &quot;%s&quot; are not supported.'</span><span style="color: #339933;">,</span> <span style="color: #990000;">get_class</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">loadUserByUsername</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getUsername</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> supportsClass<span style="color: #009900;">&#40;</span><span style="color: #000088;">$class</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">===</span> <span style="color: #0000ff;">'Symfony\Component\Security\Core\User\User'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><span id="more-2976"></span></p>
<pre><strong>6)</strong>Tabla de la base de datos</pre>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`users`</span> <span style="color: #66cc66;">&#40;</span>
  <span style="color: #ff0000;">`id`</span> <span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">11</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">UNSIGNED</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`username`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`password`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`roles`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`id`</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  <span style="color: #993333; font-weight: bold;">UNIQUE</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #ff0000;">`unique_username`</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`username`</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span> ENGINE<span style="color: #66cc66;">=</span>InnoDB <span style="color: #993333; font-weight: bold;">DEFAULT</span> CHARSET<span style="color: #66cc66;">=</span>utf8;</pre></td></tr></table></div>

<pre><strong>7) </strong>Usuario de prueba(contraseña = password)</pre>

<div class="wp_syntax"><table><tr><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #ff0000;">`users`</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`username`</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">`password`</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">`roles`</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'usuario'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'BFEQkknI/c+Nd7BaG7AaiyTfUFby/pkMHy3UsYqKqDcmvHoPRX/ame9TnVuOV2GrBH0JK9g4koW+CgTYI9mK+w=='</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'ROLE_USER'</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<pre><strong>8)</strong>Ejemplo de uso:</pre>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">use</span> Symfony\Component\HttpFoundation\Request<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$app</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>Request <span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">use</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$app</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$app</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'twig'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">render</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'index.twig'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'error'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$app</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'security.last_error'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'last_username'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$app</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'session'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'_security.last_username'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<pre><strong> 9)</strong>Formulario usando Twig:</pre>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>form action<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{{ path('login_check') }}&quot;</span> method<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;post&quot;</span><span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;&lt;</span>label <span style="color: #b1b100;">for</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;username&quot;</span><span style="color: #339933;">&gt;</span>Username<span style="color: #339933;">:</span> <span style="color: #339933;">&lt;/</span>label<span style="color: #339933;">&gt;&lt;</span>input id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;username&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;_username&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{{ last_username }}&quot;</span><span style="color: #339933;">&gt;&lt;/</span>p<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;&lt;</span>label <span style="color: #b1b100;">for</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #339933;">&gt;</span>Password<span style="color: #339933;">:</span> <span style="color: #339933;">&lt;/</span>label<span style="color: #339933;">&gt;&lt;</span>input id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;password&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;password&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;_password&quot;</span><span style="color: #339933;">&gt;&lt;/</span>p<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;submit&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Log in&quot;</span><span style="color: #339933;">&gt;&lt;/</span>p<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Este tutorial está basado en este <a title="Bubbleco" href="http://bubbleco.de/en/2012/08/28/mysql-authentication-in-silex-the-php-micro-framework/#Introduction" target="_blank">Bubbleco.de</a> creado por <strong>Johann Reinke</strong> y en la <a title="Documentación Silex" href="http://silex.sensiolabs.org/" target="_blank">documentación de Silex</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.portalbit.com/autenticacion-en-silex-con-mysql-y-doctrine-dbal/2013-03/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instalación de OpenCMS en un servidor local</title>
		<link>http://www.portalbit.com/instalacion-de-opencms-en-un-servidor-local/2013-02</link>
		<comments>http://www.portalbit.com/instalacion-de-opencms-en-un-servidor-local/2013-02#comments</comments>
		<pubDate>Tue, 19 Feb 2013 23:28:36 +0000</pubDate>
		<dc:creator>Jaime</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Diseño web]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Apache Tomcat]]></category>
		<category><![CDATA[Gestores de contenido]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JDK]]></category>
		<category><![CDATA[OpenCMS]]></category>

		<guid isPermaLink="false">http://www.portalbit.com/?p=2918</guid>
		<description><![CDATA[OpenCMS es un CMS(Content Management System) de código abierto, escrito en java y que emplea ficheros de configuración XML y que habitualmente utiliza MySQL como gestor de bases de datos y Apache Tomcat como contenedor de servlets. Para poder utilizar OpenCMS necesitamos los siguientes componentes: Java SDK: para que nuestro servidor pueda compilar las aplicaciones [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;"><strong>OpenCMS</strong> es un CMS(Content Management System) de código abierto, escrito en java y que emplea ficheros de configuración XML y que habitualmente utiliza MySQL como gestor de bases de datos y <strong>Apache Tomcat</strong> como contenedor de servlets. Para poder utilizar OpenCMS necesitamos los siguientes componentes:</p>
<ul>
<li><strong>Java SDK:</strong> para que nuestro servidor pueda compilar las aplicaciones Java.</li>
<li><strong>Servidor web:</strong> Apache</li>
<li><strong>Contenedor de servlets:</strong> utilizaremos Apache Tomcat</li>
<li><strong>Sistema Gestor de Bases de Datos:</strong> Mysql</li>
<li><strong>Paquete de instalación de OpenCMS</strong></li>
</ul>
<p><strong><span style="font-size: large;">Pasos previos</span></strong></p>
<p style="text-align: justify;">Voy a realizar el tutorial en una maquina con Windows 7 y para facilitar el proceso usare <a title="XAMPP" href="http://es.wikipedia.org/wiki/XAMPP" target="_blank">XAMPP</a>. <strong>Si no tienes XAMPP instalado</strong> puedes <a title="Descargar XAMPP" href="http://www.apachefriends.org/es/xampp.html" target="_blank">descargarlo de aquí</a>, aunque también puedes utilizar <a title="Descargar Wamp Server" href="http://www.wampserver.com/en/" target="_blank">WAMP Server </a>o cualquier otra aplicación parecida.</p>
<p style="text-align: justify;">Una vez tengas descargado e instalado XAMPP tienes que descargar e instalar el <a title="Descargar SDK Java" href="http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html" target="_blank">SDK de Java</a>, y una vez lo tengas instalado hay que agregarlo al PATH de Windows(Equipo-&gt;Propiedades del sistema-&gt;Opciones Avanzadas-&gt;Variables de entorno) igual que se ve en la imagen. Ese es el directorio por defecto, si lo has instalado en otro directorio cambia la ruta.</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/1.jpg"><img class="aligncenter size-full wp-image-2921" alt="path-windows" src="http://www.portalbit.com/wp-content/uploads/2013/02/1.jpg" width="590" height="248" /></a></p>
<p>Cuando hayas hecho lo anterior, <a title="Descargar Apache Tomcat" href="http://tomcat.apache.org/download-70.cgi" target="_blank">descarga Apache Tomcat </a>de su web oficial e instálalo tal que así:</p>
<p style="padding-left: 30px;"><strong>1 -</strong> Cuando llegues a este paso asegúrate de que los puertos indicados no están e uso y establece un usuario y contraseña para administrar Tomcat.</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/3.jpg"><br />
</a> <a href="http://www.portalbit.com/wp-content/uploads/2013/02/4.jpg"><img class="aligncenter size-full wp-image-2923" alt="4" src="http://www.portalbit.com/wp-content/uploads/2013/02/4.jpg" width="492" height="357" /></a></p>
<p style="padding-left: 30px;"><strong>2 -</strong> Otro paso importante de la instalación es indicar la ruta del JRE(<em>Java Runtime Enviroment</em>)</p>
<p>&nbsp;</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/5.jpg"><img class="aligncenter size-full wp-image-2924" alt="5" src="http://www.portalbit.com/wp-content/uploads/2013/02/5.jpg" width="492" height="361" /><span id="more-2918"></span></a></p>
<p style="padding-left: 30px;"><strong>3 -</strong> La ruta de instalación de Tomcat:</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/6.jpg"><img class="aligncenter size-full wp-image-2925" alt="6" src="http://www.portalbit.com/wp-content/uploads/2013/02/6.jpg" width="499" height="381" /></a></p>
<p>&nbsp;</p>
<p>Una vez finalizada la instalación <strong>Tomcat</strong> intentará arrancar el servicio automáticamente.</p>
<p>&nbsp;</p>
<p><strong><span style="font-size: large;">Instalación de OpenCMS</span></strong></p>
<p>Ahora que instalamos todos los componentes necesarios para el funcionamiento de OpenCMS, procederemos a la instalación.</p>
<p>&nbsp;</p>
<p><strong>1 &#8211; </strong><a title="Descargar OpenCMS" href="http://www.opencms.org/en/download/opencms.html" target="_blank">Descarga OpenCMS</a> y descomprímelo</p>
<p><img class="aligncenter size-full wp-image-2926" alt="opencms.war" src="http://www.portalbit.com/wp-content/uploads/2013/02/7.jpg" width="553" height="216" /></p>
<p><strong>2 -</strong> Ahora copia el fichero <strong>opencms.war</strong> a la carpeta <strong>webapps</strong> de Tomcat. Después reinicia Tomcat y el servidor se encargará de descomprimir y desplegar los ficheros de instalación contenidos en <strong>opencms.war.</strong></p>
<p>&nbsp;</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/8.jpg"><img class="aligncenter size-full wp-image-2927" alt="8" src="http://www.portalbit.com/wp-content/uploads/2013/02/8.jpg" width="590" height="241" /></a></p>
<p>&nbsp;</p>
<p><strong>3 &#8211; </strong>Abre un navegador y accede a la dirección<strong> http://localhost:8080/opencms/setup </strong>para comenzar el proceso de instalación, en la primera pantalla aceptamos el contrato de licencia.</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/9.jpg"><img class="aligncenter size-full wp-image-2928" alt="9" src="http://www.portalbit.com/wp-content/uploads/2013/02/9.jpg" width="590" height="344" /></a></p>
<p><strong>4 -</strong> En la siguiente pantalla se mostrarán los test realizados automáticamente sobre los componentes necesarios. En mi caso da una advertencia para Tomcat pues es una versión muy reciente y no la reconoce.</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/10.jpg"><img class="aligncenter size-full wp-image-2929" alt="10" src="http://www.portalbit.com/wp-content/uploads/2013/02/10.jpg" width="590" height="315" /></a></p>
<p><strong>5 -</strong> Ahora le toca el turno a la conexión con la base de datos, tendrás que introducir tu usuario y contraseña de MySQL.</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/11.jpg"><img class="aligncenter size-full wp-image-2930" alt="11" src="http://www.portalbit.com/wp-content/uploads/2013/02/11.jpg" width="590" height="312" /></a></p>
<p><strong>6 -</strong> La base de datos se creó satisfactoriamente.</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/12.jpg"><img class="aligncenter size-full wp-image-2931" alt="12" src="http://www.portalbit.com/wp-content/uploads/2013/02/12.jpg" width="449" height="307" /></a></p>
<p><strong>7 -</strong> Ahora escogemos los módulos que queremos instalar:</p>
<ul>
<li><strong>OpenCMS Workplace:</strong> es necesario, incluye las interfaces de acceso a OpenCMS.</li>
<li><strong>OpenCMS Release Notes:</strong> documentación de la versión.</li>
<li><strong>OpenCMS TemplateTwo:</strong> plantilla de demostración sobre la que hacer pruebas.</li>
<li><strong>OpenCMS Demo Content for TemplateTwo:</strong> contenido adicional de la plantilla de demostración.</li>
<li><strong>OpenCMS Documentation from Alkacon:</strong> documentación de desarrollo para OpenCMS.</li>
<li><strong>OpenCMS TemplateOne and Demo Content:</strong> plantilla de pruebas de las versiones anteriores de OpenCMS.</li>
</ul>
<p>&nbsp;</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/13.jpg"><img class="aligncenter size-full wp-image-2932" alt="13" src="http://www.portalbit.com/wp-content/uploads/2013/02/13.jpg" width="590" height="381" /></a></p>
<p><strong>8 -</strong> En la siguiente vista podemos configurar características propias del servidor:</p>
<ul>
<li><strong>Dirección Mac:</strong> para evitar ataques por MAC Spoofing.</li>
<li><strong>URL de Acceso:</strong> ruta de acceso interno a nuestro servidor.</li>
<li><strong>Nombre del servidor:</strong> nombre de acceso(sin espacios) que irá a continuación de la ruta anterior para dar acceso al servidor.</li>
</ul>
<p>&nbsp;</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/14.jpg"><img class="aligncenter size-full wp-image-2933" alt="14" src="http://www.portalbit.com/wp-content/uploads/2013/02/14.jpg" width="590" height="380" /></a></p>
<p>&nbsp;</p>
<p>Comienza la importación de módulos:</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/15.jpg"><img class="aligncenter size-full wp-image-2934" alt="15" src="http://www.portalbit.com/wp-content/uploads/2013/02/15.jpg" width="590" height="378" /></a></p>
<p><strong>8 -</strong> Finaliza la instalación con una página de información sobre como configurar el navegador en caso de encontrar problemas:</p>
<p>&nbsp;</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/16.jpg"><img class="aligncenter size-full wp-image-2935" alt="16" src="http://www.portalbit.com/wp-content/uploads/2013/02/16.jpg" width="590" height="377" /></a></p>
<p><strong>9 -</strong> La última ventana muestra que la instalación se ha completado satisfactoriamente y que deberíamos borrar la carpeta <strong>/setup</strong></p>
<p>&nbsp;</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/17.jpg"><img class="aligncenter size-full wp-image-2936" alt="17" src="http://www.portalbit.com/wp-content/uploads/2013/02/17.jpg" width="590" height="378" /></a></p>
<p><strong>10 -</strong> Ahora si accedes a la dirección <a href="http://localhost:8080/opencms/opencms/index.jsp " target="_blank">http://localhost:8080/opencms/opencms/index.jsp </a>deberías ver la página de bienvenida de OpenCMS.</p>
<p>&nbsp;</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/18.jpg"><img class="aligncenter size-full wp-image-2937" alt="18" src="http://www.portalbit.com/wp-content/uploads/2013/02/18.jpg" width="590" height="396" /></a></p>
<p>&nbsp;</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/19.jpg"><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.portalbit.com/instalacion-de-opencms-en-un-servidor-local/2013-02/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instalar Moodle en Ubuntu paso a paso</title>
		<link>http://www.portalbit.com/instalar-moodle-en-ubuntu-paso-a-paso/2013-02</link>
		<comments>http://www.portalbit.com/instalar-moodle-en-ubuntu-paso-a-paso/2013-02#comments</comments>
		<pubDate>Sun, 17 Feb 2013 22:25:09 +0000</pubDate>
		<dc:creator>Jaime</dc:creator>
				<category><![CDATA[Descargas]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[Apache 2]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[LMS]]></category>
		<category><![CDATA[Moodle]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.portalbit.com/?p=2888</guid>
		<description><![CDATA[Moodle es el LMS (Learning Management System) más utilizado del mundo, prácticamente todas las Universidades o centros de formación lo utilizan para crear cursos online de una manera rápida y flexible. Moodle está escrito en PHP y utiliza MySQL como gestor de base de datos, aunque también se pueden utilizar otros como PostgreSQL, SQL Server, SQLLite y casi siempre se instala [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;"><strong>Moodle</strong> es el <a title="LMS (Learning Management System)" href="http://es.wikipedia.org/wiki/LMS_(Learning_Management_System)">LMS (Learning Management System)</a> más utilizado del mundo, prácticamente todas las Universidades o centros de formación lo utilizan para crear cursos online de una manera rápida y flexible. <strong>Moodle</strong> está escrito en <a title="PHP Wikipedia" href="http://es.wikipedia.org/wiki/PHP" target="_blank"><strong>PHP</strong></a> y utiliza<a title="MySQL" href="http://es.wikipedia.org/wiki/Mysql" target="_blank"> MySQL</a> como gestor de base de datos, aunque también se pueden utilizar otros como <strong>PostgreSQL, SQL Server, SQLLite</strong> y casi siempre se instala conjuntamente con un servidor <strong>Apache HTTP Server</strong>.</p>
<p>Instalar Moodle en Linux es muy sencillo, pero antes de nada, tenemos que <strong>instalar un servidor LAMP</strong> para que pueda funcionar:</p>
<p>- Abrimos una terminal e instalamos el servidor Apache:</p>
<blockquote><p>$ sudo apt-get install apache2</p></blockquote>
<p>- Acto seguido instalamos un servidor MySQL:</p>
<blockquote><p>$ sudo apt-get install mysql-server</p></blockquote>
<p>Comenzará el proceso de instalación y nos pedirá que <strong>indiquemos un nombre de usuario</strong>(por defecto root &#8211; administrador) <strong>y contraseña</strong>.</p>
<p>- Instalamos un cliente MySQL para facilitar la administración del servidor.</p>
<blockquote><p>$ sudo apt-get install mysql-client</p></blockquote>
<p>- Instalamos PHP mediante el siguiente comando:</p>
<blockquote><p>$ sudo apt-get install php5</p></blockquote>
<p>- Para completar la instalación tenemos que instalar unos módulos adicionales de PHP  que requiere Moodle para su funcionamiento:</p>
<blockquote><p>$ sudo apt-get install php5-gd php5-mysql php5-curl php5-xmlrpc php5-intl php5-cli</p></blockquote>
<p>- Una vez acabe de instalar reiniciamos el servidor apache con la siguiente orden:</p>
<blockquote><p>$ sudo /etc/init.d/apache2 restart</p></blockquote>
<p>- Creamos un directorio para los datos de Moodle:</p>
<blockquote><p>$ sudo mkdir /var/moodledata</p></blockquote>
<p>- Modificamos los permisos de acceso:</p>
<blockquote><p>$ sudo chmod 777 /var/moodledata</p></blockquote>
<p>- Ahora accedemos a <strong>phpMyAdmin(<a href="http://localhost/phpmyadmin" target="_blank">http://localhost/phpmyadmin</a>)</strong> y creamos la base de datos para Moodle y un usuario para la misma:</p>
<ul>
<li>Si no tienes phpmyadmin instalado sigue este<a title="Instalación phpmyadmin en Ubuntu" href="http://www.portalbit.com/instalar-y-configurar-phpmyadmin-en-lamp/2012-07" target="_blank"> tutorial</a>.</li>
<li>Para evitar problemas durante la instalación con el idioma, lo ideal es elegir cotejamiento <strong>utf8_spanish-ci.</strong></li>
</ul>
<p>&nbsp;</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/crear-base-utf8-spanish.png"><img class="aligncenter size-full wp-image-2899" alt="crear-base-utf8-spanish" src="http://www.portalbit.com/wp-content/uploads/2013/02/crear-base-utf8-spanish.png" width="544" height="141" /></a></p>
<p>&nbsp;</p>
<p>Creamos un usuario nuevo para la base de datos:</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/crear-usuario-moodle.png"><img class="aligncenter size-full wp-image-2900" alt="crear-usuario-moodle" src="http://www.portalbit.com/wp-content/uploads/2013/02/crear-usuario-moodle.png" width="569" height="295" /></a></p>
<p><span id="more-2888"></span></p>
<p>Editamos los privilegios del usuario:</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/permisos-base.png"><img class="aligncenter size-full wp-image-2901" alt="permisos-base" src="http://www.portalbit.com/wp-content/uploads/2013/02/permisos-base.png" width="352" height="413" /></a></p>
<p>Una vez tenemos la base de datos creada y su usuario procedemos a instalar <a title="Descargar Moodle" href="http://download.moodle.org/" target="_blank">Moodle</a>. Lo primero es <a title="Descargar Moodle de repositorio oficial" href="http://download.moodle.org/" target="_blank">descargarlo desde el sitio oficial</a> de Moodle y lo descomprimimos dentro de la carpeta <strong><em>/var/www</em></strong> de Apache:</p>
<blockquote><p>$ sudo tar xzvf moodle-version.tgz -C /var/www</p></blockquote>
<p>Cuando acabe de descomprimir tenemos que otorgar permiso de escritura al servidor en el directorio creado:</p>
<blockquote><p>$ sudo chown www-data /var/www/moodle</p></blockquote>
<p>Ahora reiniciamos el servidor Apache:</p>
<blockquote><p>$ sudo /etc/init.d/apache2 restart</p></blockquote>
<p>&nbsp;</p>
<p><span style="font-size: large;"><strong>Instalación de Moodle</strong></span></p>
<p>Como Moodle es una aplicación web se instala desde el navegador accediendo a nuestro servidor local(<strong><a title="Instalación Moodle" href="http://localhost/moodle" target="_blank">http://localhost/moodle</a></strong>)</p>
<p><strong>1 -</strong> Al acceder a la dirección anterior se nos mostrará una página para escoger el idioma tanto para la instalación como para el propio Moodle:</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/moodle-idioma.jpg"><img class="aligncenter size-full wp-image-2889" alt="idioma-moodle" src="http://www.portalbit.com/wp-content/uploads/2013/02/moodle-idioma.jpg" width="590" height="215" /></a></p>
<p><strong>2 -</strong> A continuación se indican las rutas de acceso de Moodle vía web, los ficheros de la aplicación de Moodle y el directorio de contenidos:</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/confirme-rutas.jpg"><img class="aligncenter size-full wp-image-2890" alt="moodle-rutas" src="http://www.portalbit.com/wp-content/uploads/2013/02/confirme-rutas.jpg" width="546" height="213" /></a></p>
<p>&nbsp;</p>
<p><strong>3 -</strong> A continuación elegimos el controlador de la base de datos. Como usamos MySQL viene por defecto mysqli:</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/controlador-base-datos.jpg"><img class="aligncenter size-full wp-image-2891" alt="controlador-base-datos" src="http://www.portalbit.com/wp-content/uploads/2013/02/controlador-base-datos.jpg" width="546" height="270" /></a></p>
<p>&nbsp;</p>
<p><strong>4 -</strong> Ahora configuramos el acceso a la base de datos, indicamos la ubicación del servidor (en este caso localhost pues estamos utilizando un servidor local), el nombre de la base de datos( el nombre de la base de datos que creamos en phpmyadmin), el usuario de la base de datos( el que creamos para la base de datos), la contraseña, el prefijo de las tablas de la base de datos(opcional).</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/ajustes-base-datos.jpg"><img class="aligncenter size-full wp-image-2892" alt="ajustes-base-datos" src="http://www.portalbit.com/wp-content/uploads/2013/02/ajustes-base-datos.jpg" width="590" height="408" /></a></p>
<p>&nbsp;</p>
<p><strong>5 -</strong> Aceptamos el contrato de licencia:</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/aceptar-terminos-uso.jpg"><img class="aligncenter size-full wp-image-2893" alt="aceptar-terminos-uso" src="http://www.portalbit.com/wp-content/uploads/2013/02/aceptar-terminos-uso.jpg" width="590" height="274" /></a></p>
<p>&nbsp;</p>
<p><strong>6 -</strong> En el siguiente paso vemos el estado de las extensiones, módulos y servidores auxiliares:</p>
<ul>
<li><span style="color: #ff0000;"><strong>El rojo</strong></span> indica que la instalación no puede continuar hasta que se resuelva el problema.</li>
<li><span style="color: #ffcc00;">El amarillo</span> indica que la instalación puede continuar pero recomienda resolverlo antes de continuar.</li>
<li><span style="color: #008000;">El verde</span> indica que todo está correcto.</li>
</ul>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/comprobaciones.jpg"><img class="aligncenter size-full wp-image-2894" alt="comprobaciones" src="http://www.portalbit.com/wp-content/uploads/2013/02/comprobaciones.jpg" width="590" height="267" /></a></p>
<p>&nbsp;</p>
<p><strong>7 -</strong> Acto seguido comienza el proceso de instalación de todos los módulos que componen <strong>Moodle</strong>:</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/instalando.jpg"><img class="aligncenter size-full wp-image-2895" alt="instalando" src="http://www.portalbit.com/wp-content/uploads/2013/02/instalando.jpg" width="402" height="509" /></a></p>
<p>&nbsp;</p>
<p><strong>8 -</strong> Ahora hay que introducir los datos del administrador de <strong>Moodle</strong>, nombre de usuario, contraseña, nombre etc:</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/datos-instalacion-usuario.jpg"><img class="aligncenter size-full wp-image-2896" alt="datos-instalacion-usuario" src="http://www.portalbit.com/wp-content/uploads/2013/02/datos-instalacion-usuario.jpg" width="545" height="682" /></a></p>
<p>&nbsp;</p>
<p><strong>9 -</strong> Ahora definimos las características básicas de <strong>Moodle</strong>:</p>
<ul>
<li><strong>Nombre completo del sitio:</strong> El que se mostrará en la barra del título del navegador.</li>
<li><strong>Nombre corto para el sitio:</strong> comunicaciones y configuración interna.</li>
<li><strong>Descripción de la página:</strong> orientado al indexado de contenido, como bots etc.</li>
<li><b>Registrarse</b><strong> a sí mismo:</strong> habilita el módulo <em>registerauth</em> que obliga a los usuarios a registrarse para poder acceder al sitio.</li>
</ul>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/ajustes-pagina-principal.jpg"><img class="aligncenter size-full wp-image-2897" alt="ajustes-basicos" src="http://www.portalbit.com/wp-content/uploads/2013/02/ajustes-pagina-principal.jpg" width="443" height="680" /></a></p>
<p>&nbsp;</p>
<p><strong>10 -</strong> Página principal de Moodle:</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/02/inicio-moodle.jpg"><img class="aligncenter size-full wp-image-2898" alt="principal-moodle" src="http://www.portalbit.com/wp-content/uploads/2013/02/inicio-moodle.jpg" width="590" height="291" /></a></p>
<p>La instalación no tiene ninguna complicación pero son bastantes pasos si no tienes ya montado un servidor LAMP. Ahora ya solo te queda  crear cursos e ir probando su funcionamiento pues es muy completo y tiene cientos de módulos para aumentar sus funcionalidades.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.portalbit.com/instalar-moodle-en-ubuntu-paso-a-paso/2013-02/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Documentación en castellano de Silex</title>
		<link>http://www.portalbit.com/documentacion-en-castellano-de-silex/2013-02</link>
		<comments>http://www.portalbit.com/documentacion-en-castellano-de-silex/2013-02#comments</comments>
		<pubDate>Mon, 04 Feb 2013 23:58:41 +0000</pubDate>
		<dc:creator>Jaime</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Microframework]]></category>
		<category><![CDATA[Silex]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Symfony2]]></category>

		<guid isPermaLink="false">http://www.portalbit.com/?p=2874</guid>
		<description><![CDATA[Silex es un microframework PHP creado por los mismos desarrolladores de Symfony2 y está basado en el mismo pues comparte buena parte de sus componentes. Podriamos decir que Silex es la versión ligera de Symfony2, pues ocupa 5 MB frente a los 8 MB de Symfony2. La gran diferencia con Symfony2 es su facilidad de [...]]]></description>
				<content:encoded><![CDATA[<div id="attachment_2875" class="wp-caption alignright" style="width: 242px"><img class="wp-image-2875 " alt="Silex" src="http://www.portalbit.com/wp-content/uploads/2013/02/Silex.png" width="232" height="190" /><p class="wp-caption-text">Silex</p></div>
<p style="text-align: left;"><strong>Silex</strong> es un <strong>microframework PHP</strong> creado por los mismos desarrolladores de <strong>Symfony2</strong> y está basado en el mismo pues comparte buena parte de sus componentes. Podriamos decir que Silex es la versión ligera de Symfony2, pues ocupa 5 MB frente a los 8 MB de Symfony2. La gran diferencia con Symfony2 es su facilidad de uso pues en poco tiempo podrás dominarlo, eso si no es apto para proyectos web demasiado grandes pero tiene mucho potencial.</p>
<p style="text-align: left;">La documentación de Silex está totalmente en inglés y puede que a muchos les eche para atrás, pero por suerte <a title="Nacho Pacheco" href="https://twitter.com/esymfony" target="_blank">Nacho Pacheco</a> ha traducido toda la documentación al español y puedes <a title="Documentación Silex" href="http://gitnacho.github.com/Silex/index.html" target="_blank">consultarla online</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.portalbit.com/documentacion-en-castellano-de-silex/2013-02/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instalar Webmin en Ubuntu</title>
		<link>http://www.portalbit.com/instalar-webmin-en-ubuntu/2013-02</link>
		<comments>http://www.portalbit.com/instalar-webmin-en-ubuntu/2013-02#comments</comments>
		<pubDate>Mon, 04 Feb 2013 23:15:11 +0000</pubDate>
		<dc:creator>Jaime</dc:creator>
				<category><![CDATA[Sistemas Operativos]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Webmin]]></category>

		<guid isPermaLink="false">http://www.portalbit.com/?p=2871</guid>
		<description><![CDATA[Webmin es una interfaz multipropósito vía web que permite gestionar el sistema operativo y muchas otras aplicaciones que corren bajo el mismo. Es muy útil para aplicaciones como Apache que no poseen una GUI nativa o MySql ya que nos facilita la tarea de administración. 1 &#8211; El primer paso es descargar el archivo de [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Webmin</strong> es una interfaz multipropósito vía web que permite gestionar el sistema operativo y muchas otras aplicaciones que corren bajo el mismo. Es muy útil para aplicaciones como Apache que no poseen una GUI nativa o MySql ya que nos facilita la tarea de administración.</p>
<p>1 &#8211; El primer paso es descargar el <a title="Descargar Webmin" href="http://prdownloads.sourceforge.net/webadmin/webmin_1.610_all.deb" target="_blank">archivo de instalación de Webmin</a> a nuestro ordenador.</p>
<p>2 &#8211; Después nos situamos en el directorio donde descargamos el archivo y ejecutamos el siguiente comando en la terminal:</p>
<blockquote><p>sudo dpkg -i webmin_1.610_all.deb</p></blockquote>
<p>3 &#8211; A continuación abrimos un explorador y escribimos la dirección( si el nombre de tu equipo no es ubuntu cambialo por el que tienes):</p>
<blockquote><p>https://ubuntu:10000</p></blockquote>
<p>Tendremos que aceptar el certificado y acto seguido se mostrará una pantalla de login con la que acceder a la aplicación. El usuario y la contraseña son los mismos que los de tu usuario de Ubuntu.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.portalbit.com/instalar-webmin-en-ubuntu/2013-02/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instalar WhatsApp en Ubuntu</title>
		<link>http://www.portalbit.com/instalar-whatsapp-en-ubuntu/2013-01</link>
		<comments>http://www.portalbit.com/instalar-whatsapp-en-ubuntu/2013-01#comments</comments>
		<pubDate>Tue, 22 Jan 2013 22:50:34 +0000</pubDate>
		<dc:creator>Jaime</dc:creator>
				<category><![CDATA[Sistemas Operativos]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Telefonía móvil]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Whatsapp]]></category>

		<guid isPermaLink="false">http://www.portalbit.com/?p=2854</guid>
		<description><![CDATA[Ya vimos como instalar el SDK de Android en Linux, ahora toca instalar una aplicación desde el Kit de desarrollo y probarla. Es un proceso más rápido que instalar el SDK y en realidad no difiere demasiado de lo que haríamos en un terminal móvil real. En esta ocasión vamos a instalar WhatsApp probablemente una [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">Ya vimos como <a title="Instalar SDK Android en Ubuntu" href="http://www.portalbit.com/instalar-android-en-linux-ubuntu/2013-01" target="_blank"><strong>instalar el SDK de Android en Linux</strong></a>, ahora toca instalar una aplicación desde el Kit de desarrollo y probarla. Es un proceso más rápido que instalar el SDK y en realidad no difiere demasiado de lo que haríamos en un terminal móvil real. En esta ocasión vamos a instalar <strong>WhatsApp</strong> probablemente una de la aplicaciones más populares y conocidas de mensajería instantánea en teléfonos móviles.</p>
<p style="text-align: justify;">1 -El primer paso es abrir el <strong>SDK de Android</strong> y encender el teléfono. Si no lo has hecho ya, hay que agregar una tarjeta SD al dispositivo virtual. Para ello solo tienes que acceder a tu dispositivo y pulsar &#8220;Edit&#8221; para editar su configuración y en &#8220;SD Card&#8221; establece el espacio que consideres oportuno. Después arranca el dispositivo.</p>
<p style="text-align: justify;"><img class="aligncenter size-full wp-image-2858" alt="whatsapp-1" src="http://www.portalbit.com/wp-content/uploads/2013/01/11.png" width="590" height="359" /></p>
<p style="text-align: justify;"><span id="more-2854"></span></p>
<p style="text-align: justify;"><img class="aligncenter size-full wp-image-2859" alt="2" src="http://www.portalbit.com/wp-content/uploads/2013/01/21.png" width="480" height="704" /></p>
<p style="text-align: justify;">2 - Hecho lo anterior, abrimos el explorador y accedemos a <a href="http://www.whatsapp.com/android/">http://www.whatsapp.com/android/</a> y descargamos el archivo .apk</p>
<p style="text-align: justify;"><a href="http://www.portalbit.com/wp-content/uploads/2013/01/61.png"><img class="aligncenter size-full wp-image-2860" alt="6" src="http://www.portalbit.com/wp-content/uploads/2013/01/61.png" width="475" height="822" /></a></p>
<p>&nbsp;</p>
<p style="text-align: justify;">3 &#8211; Ejecutamos el archivo apk descargado y se iniciará la instalación</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/01/3.png"><img class="aligncenter size-full wp-image-2861" alt="whatsapp-3" src="http://www.portalbit.com/wp-content/uploads/2013/01/3.png" width="474" height="417" /></a></p>
<p>3 &#8211; A partir de aquí tienes que introducir un número de teléfono y agregar los contactos que quieras, al igual que en tu teléfono móvil</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/01/4.png"><img class="aligncenter size-full wp-image-2862" alt="whatsapp-4" src="http://www.portalbit.com/wp-content/uploads/2013/01/4.png" width="481" height="819" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.portalbit.com/instalar-whatsapp-en-ubuntu/2013-01/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instalar Android en Linux Ubuntu</title>
		<link>http://www.portalbit.com/instalar-android-en-linux-ubuntu/2013-01</link>
		<comments>http://www.portalbit.com/instalar-android-en-linux-ubuntu/2013-01#comments</comments>
		<pubDate>Tue, 22 Jan 2013 22:02:12 +0000</pubDate>
		<dc:creator>Jaime</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Sistemas Operativos]]></category>
		<category><![CDATA[Telefonía móvil]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[SDK Android]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.portalbit.com/?p=2845</guid>
		<description><![CDATA[Vamos a ver como instalar el SDK(Software development kit) de Android en su versión 4.2 en un equipo con Ubuntu 12.10. Puedes utilizarlo si quieres aprender a desarrollar aplicaciones para Android o incluso para instalarte aplicaciones en tu ordenador como puede ser WhatsApp. 1 &#8211; El primer paso es descargar la última versión del SDK en su [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">Vamos a ver como instalar el<strong> SDK(Software development kit) de Android</strong> en su versión 4.2 en un equipo con <strong>Ubuntu 12.10</strong>. Puedes utilizarlo si quieres aprender a desarrollar aplicaciones para <strong>Android</strong> o incluso para instalarte aplicaciones en tu ordenador como puede ser <strong>WhatsApp</strong>.</p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/01/ANDROID.jpg"><img class="aligncenter size-full wp-image-2847" alt="instalar-android-sdk" src="http://www.portalbit.com/wp-content/uploads/2013/01/ANDROID.jpg" width="590" height="332" /></a></p>
<p>1 &#8211; El primer paso es descargar la <a title="SDK Android" href="http://developer.android.com/sdk/index.html" target="_blank">última versión del SDK</a> en su web oficial.</p>
<blockquote><p>adt-bundle-linux-x86_64.zip</p></blockquote>
<p>Puede ser tanto la versión de 32 bits como de 64 bits en mi caso seleccione la versión de 64 bits</p>
<p>2 &#8211; El siguiente paso es descomprimir el archivo</p>
<p>3 &#8211; Abrimos una terminal y nos situamos en la carpeta <strong>adt-bundle-linux-x86_64/sdk. </strong>Ejemplo:</p>
<blockquote><p>cd <strong>adt-bundle-linux-x86_64/sdk</strong></p></blockquote>
<p>4 &#8211; Ejecutamos lo siguiente en la terminal:</p>
<blockquote><p>sudo  <b>tools/android</b></p></blockquote>
<p>5 &#8211; Se abrirá una pantalla gráfica donde seleccionamos los archivos que queremos instalar y marcamos todo.</p>
<p>6 &#8211; Una vez esté todo instalado, tenemos que crear un dispositivo virtual, para lo cual accedemos igual que antes con el comando <strong>tools/android</strong> y en el menú<b> </b>seleccionamos<b> Tools -&gt; </b><b>Manage AVDs -&gt; New</b> y escribimos un nombre para el nuevo dispositivo virtual, en mi caso AvdPortalbit, un dispositivo(el que tenga las características que mas te interesen) y la versión de Android:</p>
<p><b> </b></p>
<p><a href="http://www.portalbit.com/wp-content/uploads/2013/01/Captura-de-pantalla-de-2013-01-22-221433.png"><img class="aligncenter size-full wp-image-2846" alt="android-sdk" src="http://www.portalbit.com/wp-content/uploads/2013/01/Captura-de-pantalla-de-2013-01-22-221433.png" width="483" height="687" /></a></p>
<p>&nbsp;</p>
<p><span id="more-2845"></span>7 &#8211; El siguiente paso es seleccionar el dispositivo virtual y arrancarlo(start):</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="http://www.portalbit.com/wp-content/uploads/2013/01/Captura-de-pantalla-de-2013-01-22-224416.png"><img class="aligncenter  wp-image-2848" title="sdk-android-1" alt="sdk-android-1" src="http://www.portalbit.com/wp-content/uploads/2013/01/Captura-de-pantalla-de-2013-01-22-224416.png" width="697" height="496" /></a></p>
<p>8 &#8211; Nos dará la opción de seleccionar un tamaño para mostrar la pantalla de la aplicación, establece el que mas te interese:</p>
<p style="text-align: center;"><a href="http://www.portalbit.com/wp-content/uploads/2013/01/Captura-de-pantalla-de-2013-01-22-224717.png"><img class="aligncenter  wp-image-2849" title="sdk-android-2" alt="sdk-android-2" src="http://www.portalbit.com/wp-content/uploads/2013/01/Captura-de-pantalla-de-2013-01-22-224717.png" width="257" height="406" /></a></p>
<p style="text-align: left;">9 &#8211; Arrancará el dispositivo y nos mostrará la pantalla de un smartphone con la versión de<strong> Android</strong> que hayamos seleccionado(<strong>hay que pulsar el botón de encendido</strong>):</p>
<p style="text-align: center;"><a href="http://www.portalbit.com/wp-content/uploads/2013/01/Captura-de-pantalla-de-2013-01-22-224746.png"><img class="aligncenter size-full wp-image-2850" title="sdk-android-3" alt="sdk-android-3" src="http://www.portalbit.com/wp-content/uploads/2013/01/Captura-de-pantalla-de-2013-01-22-224746.png" width="590" height="400" /></a></p>
<p style="text-align: center;"><a href="http://www.portalbit.com/wp-content/uploads/2013/01/Captura-de-pantalla-de-2013-01-22-225951.png"><img class="aligncenter size-full wp-image-2851" alt="android-sdk-5" src="http://www.portalbit.com/wp-content/uploads/2013/01/Captura-de-pantalla-de-2013-01-22-225951.png" width="710" height="818" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.portalbit.com/instalar-android-en-linux-ubuntu/2013-01/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Object Caching 2142/2372 objects using disk: basic

 Served from: www.portalbit.com @ 2013-06-19 13:42:31 by W3 Total Cache -->
