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

<channel>
	<title>symfonybr</title>
	<atom:link href="http://www.symfonybr.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.symfonybr.com</link>
	<description>um framework bizarro</description>
	<lastBuildDate>Sun, 14 Aug 2011 15:08:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Symfony2 Exception &#8211; DateTime::__construct(): It is not safe to rely on the system&#8217;s timezone settings.</title>
		<link>http://www.symfonybr.com/2011/08/14/symfony2-exception-datetime__construct-it-is-not-safe-to-rely-on-the-systems-timezone-settings/</link>
		<comments>http://www.symfonybr.com/2011/08/14/symfony2-exception-datetime__construct-it-is-not-safe-to-rely-on-the-systems-timezone-settings/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 15:08:51 +0000</pubDate>
		<dc:creator>pedro casado</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[symfony2]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[exception]]></category>
		<category><![CDATA[mamp]]></category>
		<category><![CDATA[php5.3]]></category>

		<guid isPermaLink="false">http://www.symfonybr.com/?p=159</guid>
		<description><![CDATA[Dando os primeiros passos com o Symfony2, acabei batendo de frente com um erro que provavelmente veio da configuração do MAMP. DateTime::__construct(): It is not safe to rely on the system&#8217;s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you [...]]]></description>
			<content:encoded><![CDATA[	<p>Dando os primeiros passos com o Symfony2, acabei batendo de frente com um erro que provavelmente veio da configuração do <span class="caps">MAMP</span>.</p>

	<p>DateTime::__construct(): It is not safe to rely on the system&#8217;s timezone settings. You are <strong>required</strong> to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected &#8216;America/Sao_Paulo&#8217; for &#8216;BRT/-3.0/no DST&#8217; instead</p>

	<p>O php que eu estou chamando fica no /usr/bin/php.</p>

	<p>Para solucionar o problema eu passei o arquivo de configuração pela linha de comando.</p>

<pre class="shell">
$ php -c /Applications/MAMP/bin/php/php5.3.6/conf/ app/console
Symfony version 2.0.0 &#8211; app/dev/debug
Usage:
  [options] command [arguments]
(...)
</pre>

	<p>Criei um alias para melhorar mais ainda:</p>

<pre class="shell">
$ alias sf2=&#8220;php -c /Applications/MAMP/bin/php/php5.3.6/conf/&#8221;
$ sf2 app/console
Symfony version 2.0.0 &#8211; app/dev/debug
Usage:
  [options] command [arguments]<br />

(...)
</pre>]]></content:encoded>
			<wfw:commentRss>http://www.symfonybr.com/2011/08/14/symfony2-exception-datetime__construct-it-is-not-safe-to-rely-on-the-systems-timezone-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compilando e instalando a extensão intl no OS X 10.6.8 &#8211; Symfony2</title>
		<link>http://www.symfonybr.com/2011/08/06/compilando-e-instalando-a-extensao-intl-no-os-x-10-6-8-symfony2/</link>
		<comments>http://www.symfonybr.com/2011/08/06/compilando-e-instalando-a-extensao-intl-no-os-x-10-6-8-symfony2/#comments</comments>
		<pubDate>Sat, 06 Aug 2011 20:03:42 +0000</pubDate>
		<dc:creator>pedro casado</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[symfony2]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[php 5]]></category>

		<guid isPermaLink="false">http://www.symfonybr.com/?p=141</guid>
		<description><![CDATA[Um dos requisitos da instalação do Symfony2 é a extensão intl.so do PHP. Vou mostrar aqui todos os passos que executei para compilar e instalar. $ uname -a Darwin pedrocasado.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 &#215;86_64 1 &#8211; Fiz o download do MAMP 2.0 e instalei. 2 &#8211; [...]]]></description>
			<content:encoded><![CDATA[	<p>Um dos requisitos da instalação do <strong>Symfony2</strong> é a extensão <strong>intl.so</strong> do <span class="caps">PHP</span>.<br />
Vou mostrar aqui todos os passos que executei para compilar e instalar.</p>

<div class="shell">
$ uname -a<br />

Darwin pedrocasado.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:32:41 <span class="caps">PDT</span> 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 &#215;86_64
</div>

	<p>1 &#8211; Fiz o download do <a href="http://www.mamp.info/en/downloads/index.html"><span class="caps">MAMP</span> 2.0</a> e instalei.</p>

	<p>2 &#8211; É necessário termos instalado uma lib chamada <strong>ICU</strong>. Suponho que você já tenha o <a href="https://distfiles.macports.org/MacPorts/MacPorts-2.0.1-10.6-SnowLeopard.dmg">MacPorts instalado</a> para efetuar esse próximo passo:</p>

<div class="shell">
$ sudo port install icu <br />

Password: <br />

&#8212;->  Fetching archive for icu <br />

&#8212;->  Attempting to fetch icu-4.6.1_0.darwin_10.x86_64.tbz2 from http://packages.macports.org/icu <br />

&#8212;->  Attempting to fetch icu-4.6.1_0.darwin_10.x86_64.tbz2.rmd160 from http://packages.macports.org/icu<br />

&#8212;->  Installing icu <code>4.6.1_0&#60;br /&#62;
---&#62;  Activating icu </code>4.6.1_0<br />

&#8212;->  Cleaning icu<br />

$ icu-config<br />

usage: icu-config  [ &#8212;noverify ] [ &#8212;bindir ] [ &#8212;cc ] [ &#8212;cflags ] [ &#8212;cflags-dynamic ] [ ] [ &#8212;cppflags ] [ &#8212;cppflags-dynamic ] [ ] [ &#8212;cppflags-searchpath ] [ &#8212;cxx ] [ &#8212;cxxflags ] [ &#8212;cxxflags-dynamic ] [ ] [ &#8212;detect-prefix ] [ &#8212;exec-prefix ] [ &#8212;exists ] [ &#8212;help, -?, &#8212;usage ] [ &#8212;icudata ] [ &#8212;icudata-install-dir ] [ &#8212;icudata-mode ] [ &#8212;icudatadir ] [ &#8212;invoke ] [ &#8212;invoke=<prog> ] [ &#8212;ldflags ] [ &#8212;ldflags-layout ] [ &#8212;ldflags-libsonly ] [ &#8212;ldflags-searchpath ] [ &#8212;ldflags-system ] [ &#8212;ldflags-icuio ] [ &#8212;ldflags-obsolete ] [ &#8212;mandir ] [ &#8212;prefix ] [ &#8212;prefix=<span class="caps">XXX</span> ] [ &#8212;sbindir ] [ &#8212;shared-datadir ] [ &#8212;shlib-c ] [ &#8212;shlib-cc ] [ &#8212;sysconfdir ] [ &#8212;unicode-version ] [ &#8212;version ] [ &#8212;incfile ] [ &#8212;incpkgdatafile ] [ &#8212;install ] [ &#8212;mkinstalldirs ] <br/>
$ <br />

</div>

	<p>Você terá problemas se efetuar os próximos passos sem ter o <span class="caps">ICU</span> instalado: <strong>configure: error: Unable to detect <span class="caps">ICU</span> prefix or /usr/bin/icu-config failed. Please verify <span class="caps">ICU</span> install prefix and make sure icu-config works</strong>.</p>

	<p>3 &#8211; Vá até o diretório /Applications/XAMPP/xamppfiles/lib/php/php-5.3.4/ext/intl e execute os comandos abaixo:</p>

	<p><div class="shell"><br />
$ cd /Applications/XAMPP//xamppfiles/lib/php/php-5.3.4/ext/intl                                                                                     <br />

$ phpize                                                                                                                                            <br />

Configuring for:                                                                                                                                    <br />

<span class="caps">PHP</span> Api Version:         20090626                                                                                                                   <br />

Zend Module Api No:      20090626                                                                                                                   <br />

Zend Extension Api No:   220090626                                                                                                                  <br />

<br />

$ ./configure &#8212;enable-intl                                                                                                                         <br />

checking for grep that handles long lines and -e&#8230; /usr/bin/grep                                                                                   <br />

checking for egrep&#8230; /usr/bin/grep -E                                                                                                              <br />

checking for a sed that does not truncate output&#8230; /usr/bin/sed                                                                                    <br />

checking for cc&#8230; cc                                                                                                                               <br />

checking for C compiler default output file name&#8230; a.out                                                                                           <br />

(&#8230;)                                                                                                                                               <br />

checking for icu-config&#8230; /opt/local/bin/icu-config                                                                                                <br />

checking for location of <span class="caps">ICU</span> headers and libraries&#8230; /opt/local                                                                                    <br />

checking for <span class="caps">ICU</span> 3.4 or greater&#8230; found 4.6.1                                                                                                      <br />

checking for g++&#8230; g++                                                                                                                             <br />

(&#8230;)                                                                                                                                               <br />

configure: creating ./config.status                                                                                                                 <br />

config.status: creating config.h                                                                                                                    <br />

<br />

$ make test                                                                                                                                         <br />

(&#8230;)                                                                                                                                               <br />
</p>

	<p></div></p>

	<p>4 &#8211; Agora vamos compilar e copiar a extensão para o diretório do <span class="caps">MAMP</span>.</p>

<div class="shell">
$ sudo make install                                                                                                                                 <br />

Installing shared extensions:     /usr/lib/php/extensions/no-debug-non-zts-20090626/                                                                <br />

$ ls -l /usr/lib/php/extensions/no-debug-non-zts-20090626/                                                                                          <br />

total 480                                                                                                                                           <br />

-rwxr-xr-x  1 root  wheel  223864 Aug  6 16:13 intl.so                                                                                              <br />

$ cp /usr/lib/php/extensions/no-debug-non-zts-20090626/intl.so /Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/    <br />

$                                                                                                                                                   <br />

</div>

	<p>5 &#8211; Sua extensão já está compilada e pronta para ser utilizada. Vamos adicionar a linha extension=intl.so no php.ini:</p>

<div class="shell">
$ echo &#8216;extension=intl.so&#8217; >> /Applications/MAMP//bin/php/php5.3.6/conf/php.ini <br/>
</div>

	<p>Estou disponibilizando aqui o link do <a href="http://www.symfonybr.com/wp-content/uploads/2011/08/intl.so_.zip">intl.so</a> caso alguém queira tentar utilizar.</p>

	<p>É isso ai.<br />
Valeu!</p>

]]></content:encoded>
			<wfw:commentRss>http://www.symfonybr.com/2011/08/06/compilando-e-instalando-a-extensao-intl-no-os-x-10-6-8-symfony2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instalando o Symfony2</title>
		<link>http://www.symfonybr.com/2011/07/29/instalando-o-symfony2/</link>
		<comments>http://www.symfonybr.com/2011/07/29/instalando-o-symfony2/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 20:25:54 +0000</pubDate>
		<dc:creator>Bernardo</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.symfonybr.com/?p=128</guid>
		<description><![CDATA[Fala galera blz? Como vocês sabem, dia 28/07 foi lançada a versão 2 do Symfony. E claro, não pudemos deixar de instalar e ver as suas mudanças! Para começar, seguiremos o passo-a-passo do próprio site do symfony, que agora é symfony.com Baixe o sandbox (http://symfony.com/download) e descompacte na pasta root de seu webserver. De cara [...]]]></description>
			<content:encoded><![CDATA[	<p>Fala galera blz?</p>

	<p>Como vocês sabem, dia 28/07 foi lançada a versão 2 do Symfony. E claro, não pudemos deixar de instalar e ver as suas mudanças!<br />
Para começar, seguiremos o passo-a-passo do próprio site do <a title="Passo-a-Passo da instalação do SF2" href="http://symfony.com/doc/current/quick_tour/the_big_picture.html">symfony</a>, que agora é symfony.com <img src='http://www.symfonybr.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>

	<p>Baixe o sandbox (<a href="http://symfony.com/download" target="_blank">http://symfony.com/download</a>) e descompacte na pasta root de seu webserver. De cara notamos que a estrutura de diretórios mudou um pouco. Para ver as diferenças da versão 1, vá em <a href="http://symfony.com/doc/current/cookbook/symfony1.html" target="_blank">http://symfony.com/doc/current/cookbook/symfony1.html</a>.<br />
Depois de descompactado, começa uma parte nova e interessante: a configuração via browser.</p>

	<p><em>&#8220;Symfony2 comes with a visual server configuration tester to help avoid some headaches that come from Web server or <span class="caps">PHP</span> misconfiguration.&#8221;</em></p>

	<p>Ou seja, agora ele detectará erros nas configurações do seu <span class="caps">PHP</span> e no seu webserver! Basta entrar na URL<em> http://localhost/Symfony/web/config.php </em>para identificá-los.<em><br />
</em></p>

	<p>Nesta página você verá erros que <strong>deverá </strong>corrigir, e alguns <strong>warnings</strong> que corrige se quiser. Abaixo os erros que apareceu para mim:<br />
<ol>
	<li> <em>You are running <span class="caps">PHP</span> version &#8220;<strong>5.2.17</strong>&#8220;, but Symfony         needs at least <span class="caps">PHP</span> &#8220;<strong>5.3.2</strong>&#8220; to run. Before using Symfony, install         <span class="caps">PHP</span> &#8220;<strong>5.3.2</strong>&#8220; or newer.</em></li>
	<li><em>Change the permissions of the &#8220;<strong>app/cache/</strong>&#8220;         directory so that the web server can write into it.</em></li>
	<li><em>Change the permissions of the &#8220;<strong>app/logs/</strong>&#8220;         directory so that the web server can write into it.</em></li>
	<li><em>Upgrade your <strong>APC</strong> extension (3.0.17+)</em></li><br />
</ol><br />
Os passos 1, 2 e 3 foram tranquilos. Bastando dar permissões nas pastas e atualizar a versão do <span class="caps">PHP</span> (estou usando a versão antiga pois estou no trabalho rs).<br />
No passo 4, tive que instalar uma versão nova do <span class="caps">APC</span> (Alternate <span class="caps">PHP</span> Cache), um framework para otimizar o cache do <span class="caps">PHP</span>.<br />
Para quem usa o Linux é mais fácil, basta baixar o pacote em <a href="http://pecl.php.net/package/APC" target="_blank">http://pecl.php.net/package/APC</a>.<br />
Para quem usa o Windows, achei um ótimo tutorial: <a href="http://candidosalesg.wordpress.com/2011/03/07/como-habilitar-cache-apc-php-no-windows/" target="_blank">http://candidosalesg.wordpress.com/2011/03/07/como-habilitar-cache-apc-php-no-windows/</a></p>

	<p>Depois de corrigido os problemas que o SF2 encontrou, você pode já configurar via browser sua aplicação, como selecionar o tipo de banco de dados (MySQL, PostgreSQL, Oracle), login, senha etc&#8230; ou pode pular essa parte e ir direto pra Welcome Page.</p>

	<p>Pronto! Sua instalação está concluida. Qualquer dúvida, deixe nos comentários. Em breve postaremos mais coisas sobre a versão 2 desse framework bizarro!</p>

	<p>Abs</p>]]></content:encoded>
			<wfw:commentRss>http://www.symfonybr.com/2011/07/29/instalando-o-symfony2/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Snippet to get the youtube id from an url in PHP</title>
		<link>http://www.symfonybr.com/2011/05/10/snippet-to-get-the-youtube-id-from-an-url-in-php/</link>
		<comments>http://www.symfonybr.com/2011/05/10/snippet-to-get-the-youtube-id-from-an-url-in-php/#comments</comments>
		<pubDate>Tue, 10 May 2011 22:43:50 +0000</pubDate>
		<dc:creator>pedro casado</dc:creator>
				<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.symfonybr.com/?p=118</guid>
		<description><![CDATA[Snippet to get the youtube id from an url in PHP public static function parseYouTube&#40;$str&#41; &#123; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $youtube_id_length = 11; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; if &#40;preg_match&#40;&#8216;#((\?&#124;\&#038;)v\=&#124;/embed/&#124;/v/&#124;/youtu&#46;be/&#124;\#././.+?/)(.{&#8217;.$youtube_id_length.&#8216;})#i&#8217;, $str, $matches&#41;&#41; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[	<p>Snippet to get the youtube id from an url in <span class="caps">PHP</span></p>

<div class="dean_ch" style="white-space: wrap;"><br />

<span class="kw2">public</span> <a href="http://www.php.net/static"><span class="kw3">static</span></a> <span class="kw2">function</span> parseYouTube<span class="br0">&#40;</span><span class="re0">$str</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$youtube_id_length</span> = <span class="nu0">11</span>;<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/preg_match"><span class="kw3">preg_match</span></a><span class="br0">&#40;</span><span class="st0">&#8216;#((<span class="es0">\?</span>|<span class="es0">\&#038;</span>)v<span class="es0">\=</span>|/embed/|/v/|/youtu<span class="es0">&#46;</span>be/|<span class="es0">\#</span>././.+?/)(.{&#8217;</span>.<span class="re0">$youtube_id_length</span>.<span class="st0">&#8216;})#i&#8217;</span>, <span class="re0">$str</span>, <span class="re0">$matches</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$matches</span><span class="br0">&#91;</span><span class="nu0">3</span><span class="br0">&#93;</span>;<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span> <span class="br0">&#123;</span><br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/mb_strpos"><span class="kw3">mb_strpos</span></a><span class="br0">&#40;</span><span class="re0">$str</span>,<span class="st0">&#8216;/user/&#8217;</span><span class="br0">&#41;</span> !== <span class="kw2">false</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <a href="http://www.php.net/mb_substr"><span class="kw3">mb_substr</span></a><span class="br0">&#40;</span><span class="re0">$str</span>,<a href="http://www.php.net/strlen"><span class="kw3">strlen</span></a><span class="br0">&#40;</span><span class="re0">$str</span><span class="br0">&#41;</span><span class="nu0">-11</span>,<span class="nu0">11</span><span class="br0">&#41;</span>;<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$str</span>;<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>;<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/*<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Currently works for the following url formats.<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://youtu.be/7-luJRn6u9c<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://youtube.com/embed/7-luJRn6u9c<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://youtube.com/v/7-luJRn6u9c<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://youtube.com?v=7-luJRn6u9c<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://youtube.com/watch?v=7-luJRn6u9c<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://www.youtube.com/HuskyStarcraft#p/u/5/7-luJRn6u9c<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://www.youtube.com/user/HuskyStarcraft#p/u/1/7-luJRn6u9c<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />

&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />

&nbsp;</div>

	<p>Credits for Ramsez Stamper</p>]]></content:encoded>
			<wfw:commentRss>http://www.symfonybr.com/2011/05/10/snippet-to-get-the-youtube-id-from-an-url-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to remove/unset the filters in an admin module. [symfony 1.4]</title>
		<link>http://www.symfonybr.com/2011/05/07/how-to-removeunset-the-filters-in-an-admin-module-symfony-1-4/</link>
		<comments>http://www.symfonybr.com/2011/05/07/how-to-removeunset-the-filters-in-an-admin-module-symfony-1-4/#comments</comments>
		<pubDate>Sat, 07 May 2011 22:04:37 +0000</pubDate>
		<dc:creator>pedro casado</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.symfonybr.com/?p=113</guid>
		<description><![CDATA[In your generator.yml use class: false for the filter: config: &#160; &#160; &#160; actions: ~ &#160; &#160; &#160; fields: &#160;~ &#160; &#160; &#160; list: &#160; &#160;~ &#160; &#160; &#160; filter: &#160; &#160; &#160; &#160; class: false &#160; &#160; &#160; form: &#160; &#160;~ &#160; &#160; &#160; edit: &#160; &#160;~ &#160; &#160; &#160; new: &#160; &#160; ~ [...]]]></description>
			<content:encoded><![CDATA[	<p>In your generator.yml use class: false for the filter:</p>

<div class="dean_ch" style="white-space: wrap;"><br />

config:<br />

&nbsp; &nbsp; &nbsp; actions: ~<br />

&nbsp; &nbsp; &nbsp; fields: &nbsp;~<br />

&nbsp; &nbsp; &nbsp; <a href="http://www.php.net/list"><span class="kw3">list</span></a>: &nbsp; &nbsp;~<br />

&nbsp; &nbsp; &nbsp; filter:<br />

&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">class</span>: <span class="kw2">false</span><br />

&nbsp; &nbsp; &nbsp; form: &nbsp; &nbsp;~<br />

&nbsp; &nbsp; &nbsp; edit: &nbsp; &nbsp;~<br />

&nbsp; &nbsp; &nbsp; <span class="kw2">new</span>: &nbsp; &nbsp; ~<br />

&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.symfonybr.com/2011/05/07/how-to-removeunset-the-filters-in-an-admin-module-symfony-1-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Projeto QuemLiga</title>
		<link>http://www.symfonybr.com/2011/02/11/projeto-quemliga/</link>
		<comments>http://www.symfonybr.com/2011/02/11/projeto-quemliga/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 18:40:36 +0000</pubDate>
		<dc:creator>pedro casado</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[propel]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[números desconhecidos]]></category>
		<category><![CDATA[projeto]]></category>
		<category><![CDATA[quem liga]]></category>
		<category><![CDATA[telefones desconhecidos]]></category>

		<guid isPermaLink="false">http://www.symfonybr.com/?p=102</guid>
		<description><![CDATA[Eu (Pedro Casado) e meu amigo Bernardo Alves criamos um projeto chamado Quem Liga feito com symfony 1.4 e propel 1.4. O projeto &#8216;Quem liga&#8217; é um banco de dados que armazena telefones de pessoas/empresas que incomodam nosso dia-a-dia oferecendo produtos, cobrando contas, se passando por outras pessoas, etc. Se você recebeu uma ligação, uma [...]]]></description>
			<content:encoded><![CDATA[	<p>Eu (Pedro Casado) e meu amigo Bernardo Alves criamos um projeto chamado <a href="http://www.quemliga.com.br">Quem Liga</a> feito com <a href="http://www.symfony-project.org/installation/1_4">symfony 1.4</a> e <a href="http://www.propelorm.org/wiki/Documentation/1.4">propel 1.4</a>.</p>

	<p>O projeto &#8216;Quem liga&#8217; é um banco de dados que armazena telefones de pessoas/empresas que incomodam nosso dia-a-dia oferecendo produtos, cobrando contas, se passando por outras pessoas, etc. </p>

	<p>Se você recebeu uma ligação, uma mensagem ou é apenas um número desconhecido e quer saber mais sobre ele, você não é o único. Faça uma busca pelo telefone em nossa base e veja o comentário de outras pessoas. </p>

	<p>Se ainda não houver comentários, seja o primeiro e deixe seu recado.</p>

	<p>Estamos abertos para sugestões e comentários.</p>

	<p><a href="http://www.quemliga.com.br">www.quemliga.com.br</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.symfonybr.com/2011/02/11/projeto-quemliga/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selectbox para escolher cidade de acordo com o estado utilizando widgets e symfony 1.4 (Propel/Doctrine)</title>
		<link>http://www.symfonybr.com/2010/11/09/selectbox-para-escolher-cidade-de-acordo-com-o-estado-utilizando-widgets-e-symfony-1-4-propeldoctrine/</link>
		<comments>http://www.symfonybr.com/2010/11/09/selectbox-para-escolher-cidade-de-acordo-com-o-estado-utilizando-widgets-e-symfony-1-4-propeldoctrine/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 12:07:58 +0000</pubDate>
		<dc:creator>pedro casado</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[doctrine]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[propel]]></category>

		<guid isPermaLink="false">http://www.symfonybr.com/?p=61</guid>
		<description><![CDATA[Nesse post vou explicar como fazer um selectbox que só mostra as cidades referentes ao respectivo estado selecionado anteriormente. Vamos considerar a seguinte modelagem (config/schema.yml): propel: &#160; estado: &#160; &#160; id: &#160; &#160; uf: &#160; varchar&#40;2&#41; &#160; &#160; nome: varchar&#40;60&#41; &#160; cidade: &#160; &#160; id: &#160; &#160; nome: &#160; &#160; &#160; varchar&#40;40&#41; &#160; &#160; estado_id: [...]]]></description>
			<content:encoded><![CDATA[	<p>Nesse post vou explicar como fazer um selectbox que só mostra as cidades referentes ao respectivo estado selecionado anteriormente.</p>

	<p><img src="http://www.symfonybr.com/wp-content/uploads/2010/11/estado_cidade_sfDependentPlugin1.jpg" alt="stado_cidade_sfDependentPlugin1.jpg" title="stado_cidade_sfDependentPlugin1.jpg" /></p>

	<p>Vamos considerar a seguinte modelagem (<strong>config/schema.yml</strong>):</p>

<div class="dean_ch" style="white-space: wrap;"><br />

propel:<br />

&nbsp; estado:<br />

&nbsp; &nbsp; id:<br />

&nbsp; &nbsp; uf: &nbsp; varchar<span class="br0">&#40;</span><span class="nu0">2</span><span class="br0">&#41;</span><br />

&nbsp; &nbsp; nome: varchar<span class="br0">&#40;</span><span class="nu0">60</span><span class="br0">&#41;</span><br />

<br />

&nbsp; cidade:<br />

&nbsp; &nbsp; id:<br />

&nbsp; &nbsp; nome: &nbsp; &nbsp; &nbsp; varchar<span class="br0">&#40;</span><span class="nu0">40</span><span class="br0">&#41;</span><br />

&nbsp; &nbsp; estado_id: &nbsp;<span class="br0">&#123;</span> type: integer, foreignTable: estado, foreignReference: id, onDelete: cascade <span class="br0">&#125;</span><br />

&nbsp; &nbsp; capital: &nbsp; &nbsp;varchar<span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span><br />

&nbsp; &nbsp; created_at:<br />

&nbsp; &nbsp; updated_at:<br />

<br />

&nbsp; usuario:<br />

&nbsp; &nbsp; id:<br />

&nbsp; &nbsp; nome: &nbsp; &nbsp; &nbsp; &nbsp;varchar<span class="br0">&#40;</span><span class="nu0">100</span><span class="br0">&#41;</span><br />

&nbsp; &nbsp; cidade_id: &nbsp;<span class="br0">&#123;</span> type: integer, foreignTable: cidade, foreignReference: id, onDelete: cascade <span class="br0">&#125;</span><br />

&nbsp;</div>

	<p>Para preencher as tabelas estado e cidade, utilizei o seguinte <span class="caps">SQL</span> com dados do Brasil. <a href="http://www.symfonybr.com/wp-content/uploads/2010/11/CARGA_CIDADES_E_ESTADOS_BRASIL.zip">CARGA_CIDADES_E_ESTADOS_BRASIL.zip</a></p>

	<p>O próximo passo é instalar o plugin <strong>sfDependentSelectPlugin </strong> em nosso projeto. Baixe o arquivo <a href="http://plugins.symfony-project.org/get/sfDependentSelectPlugin/sfDependentSelectPlugin-0.1.5.tgz">sfDependentSelectPlugin-0.1.5.tgz</a> e descompacte na pasta plugins/ de seu projeto. Eu renomeei a pasta de <strong>plugins/sfDependentSelectPlugin-0.1.5/</strong> para <strong>plugins/sfDependentSelectPlugin/</strong>.</p>

	<p>Habilite o plugin no seu projeto <strong>(config/ProjectConfiguration.class.php)</strong><br />
<div class="dean_ch" style="white-space: wrap;"><span class="re0">$this</span>-&gt;<span class="me1">enablePlugins</span><span class="br0">&#40;</span>&#8230;, <span class="st0">&#8216;sfDependentSelectPlugin&#8217;</span><span class="br0">&#41;</span>;</div><br />
Limpe o cache do seu projeto:<br />
<div class="shell">$ php symfony cc</div><br />
Publique o javascript do plugin com o comando:<br />
<div class="shell">$ php symfony plugin:publish-assets</div><br />
Crie o <span class="caps">CRUD</span> para o usuário:<br />
<div class="shell">$ php symfony propel:generate-module frontend usuario Usuario</div><br />
Agora vamos alterar o form do usuário: <strong>lib/form/UsuarioForm.class.php</strong>:<br />
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">class</span> UsuarioForm <span class="kw2">extends</span> BaseUsuarioForm<br />

<span class="br0">&#123;</span><br />

&nbsp; <span class="kw2">public</span> <span class="kw2">function</span> configure<span class="br0">&#40;</span><span class="br0">&#41;</span><br />

&nbsp; <span class="br0">&#123;</span><br />

&nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">widgetSchema</span><span class="br0">&#91;</span><span class="st0">&#8216;estado_id&#8217;</span><span class="br0">&#93;</span> = <span class="kw2">new</span> sfWidgetFormPropelChoice<span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#8216;model&#8217;</span> &nbsp; &nbsp; =&gt; <span class="st0">&#8216;Estado&#8217;</span>,<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#8216;add_empty&#8217;</span> =&gt; <span class="kw2">true</span><br />

&nbsp; &nbsp; &nbsp;<span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />

<br />

&nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">widgetSchema</span><span class="br0">&#91;</span><span class="st0">&#8216;cidade_id&#8217;</span><span class="br0">&#93;</span> = <span class="kw2">new</span> sfWidgetFormPropelDependentSelect <span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#8216;model&#8217;</span> &nbsp; &nbsp; =&gt; <span class="st0">&#8216;Cidade&#8217;</span>,<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#8216;depends&#8217;</span> &nbsp; =&gt; <span class="st0">&#8216;Estado&#8217;</span>,<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#8216;add_empty&#8217;</span> =&gt; <span class="st0">&#8216;Selecione a cidade&#8217;</span><br />

&nbsp; &nbsp; <span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />

<br />

&nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">validatorSchema</span><span class="br0">&#91;</span><span class="st0">&#8216;estado_id&#8217;</span><span class="br0">&#93;</span> = <span class="kw2">new</span> sfValidatorPropelChoice<span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><br />

&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#8216;model&#8217;</span> =&gt; <span class="st0">&#8216;Estado&#8217;</span>,<br />

&nbsp; &nbsp; <span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />

<br />

&nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">validatorSchema</span><span class="br0">&#91;</span><span class="st0">&#8216;cidade_id&#8217;</span><span class="br0">&#93;</span> = <span class="kw2">new</span> sfValidatorPropelChoice<span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><br />

&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#8216;model&#8217;</span> =&gt; <span class="st0">&#8216;Cidade&#8217;</span>,<br />

&nbsp; &nbsp; <span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />

&nbsp; <span class="br0">&#125;</span><br />

<span class="br0">&#125;</span></div><br />
Vale lembrar que você pode utilizar o <strong>sfWidgetFormDoctrineDependentSelect </strong>ao invés do <strong>sfWidgetFormPropelDependentSelect</strong>.</p>

	<p>Agora vamos alterar o template para receber o widget do estado também (\apps\APLICACAO\modules\usuario\templates\_form.php)<br />
<div class="dean_ch" style="white-space: wrap;"><br />

&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />

&nbsp; &nbsp; &nbsp; &nbsp; &lt;th&gt;&lt;?php <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="re0">$form</span><span class="br0">&#91;</span><span class="st0">&#8216;estado_id&#8217;</span><span class="br0">&#93;</span>-&gt;<span class="me1">renderLabel</span><span class="br0">&#40;</span><span class="br0">&#41;</span> ?&gt;&lt;/th&gt;<br />

&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">&lt;?php</span> <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="re0">$form</span><span class="br0">&#91;</span><span class="st0">&#8216;estado_id&#8217;</span><span class="br0">&#93;</span>-&gt;<span class="me1">renderError</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw2">?&gt;</span><br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">&lt;?php</span> <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="re0">$form</span><span class="br0">&#91;</span><span class="st0">&#8216;estado_id&#8217;</span><span class="br0">&#93;</span> <span class="kw2">?&gt;</span><br />

&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />

&nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />

&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />

&nbsp; &nbsp; &nbsp; &nbsp; &lt;th&gt;&lt;?php <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="re0">$form</span><span class="br0">&#91;</span><span class="st0">&#8216;cidade_id&#8217;</span><span class="br0">&#93;</span>-&gt;<span class="me1">renderLabel</span><span class="br0">&#40;</span><span class="br0">&#41;</span> ?&gt;&lt;/th&gt;<br />

&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">&lt;?php</span> <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="re0">$form</span><span class="br0">&#91;</span><span class="st0">&#8216;cidade_id&#8217;</span><span class="br0">&#93;</span>-&gt;<span class="me1">renderError</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw2">?&gt;</span><br />

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">&lt;?php</span> <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="re0">$form</span><span class="br0">&#91;</span><span class="st0">&#8216;cidade_id&#8217;</span><span class="br0">&#93;</span> <span class="kw2">?&gt;</span><br />

&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />

&nbsp; &nbsp; &nbsp; &lt;/tr&gt;</div><br />
Pronto! Acesse a página do módulo e veja o select da cidade dependente do select do estado.</p>

	<p>Esse plugin faz um pouco mais do que isso como dependência infinita, utilização de ajax, etc.. Para ver a documentação completa acesse: <a href="http://www.symfony-project.org/plugins/sfDependentSelectPlugin">http://www.symfony-project.org/plugins/sfDependentSelectPlugin</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.symfonybr.com/2010/11/09/selectbox-para-escolher-cidade-de-acordo-com-o-estado-utilizando-widgets-e-symfony-1-4-propeldoctrine/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>[smtp] 421 too many messages in this connection</title>
		<link>http://www.symfonybr.com/2010/08/19/smtp-421-too-many-messages-in-this-connection/</link>
		<comments>http://www.symfonybr.com/2010/08/19/smtp-421-too-many-messages-in-this-connection/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 03:10:32 +0000</pubDate>
		<dc:creator>pedro casado</dc:creator>
				<category><![CDATA[swift]]></category>
		<category><![CDATA[swift email smtp error 421 250]]></category>

		<guid isPermaLink="false">http://www.symfonybr.com/?p=69</guid>
		<description><![CDATA[Depois de bastante tempo com meu sistema de newsletter redondo.. tive hoje o seguinte erro: Expected response code 250 but got code 421, with message 421 too many messages in this connection &#160; Não sei qual foi o motivo disso acontecer assim de um dia para o outro.. Dei uma lida na documentação do Swift [...]]]></description>
			<content:encoded><![CDATA[	<p>
Depois de bastante tempo com meu sistema de newsletter redondo.. tive hoje o seguinte erro:</p>

<div class="dean_ch" style="white-space: wrap;"><br />

Expected response code <span class="nu0">250</span> but got code <span class="nu0">421</span>, with message <span class="nu0">421</span> too many messages in this connection<br />

&nbsp;</div>

	<p>Não sei qual foi o motivo disso acontecer assim de um dia para o outro.. Dei uma lida na documentação do Swift (<a href="http://swiftmailer.org/docs/antiflood-plugin-howto">http://swiftmailer.org/docs/antiflood-plugin-howto</a>) e passei a utilizar o antiflood-plugin.</p>

	<p>Foi bem simples. Utilizei da seguinte forma:</p>

<div class="dean_ch" style="white-space: wrap;"><br />

&#8230;<br />

<span class="re0">$mailer</span>-&gt;<span class="me1">registerPlugin</span><span class="br0">&#40;</span><span class="kw2">new</span> Swift_Plugins_AntiFloodPlugin<span class="br0">&#40;</span><span class="nu0">200</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />

&#8230;<br />

&nbsp;</div>

	<p>Com esse plugin a cada 200 emails é feito uma nova conexão. Isso é o que estava acusando no erro (421 too many messages in this connection).</p>

	<p>valeu</p>]]></content:encoded>
			<wfw:commentRss>http://www.symfonybr.com/2010/08/19/smtp-421-too-many-messages-in-this-connection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utilizando Swift numa task (symfony 1.3/1.4)</title>
		<link>http://www.symfonybr.com/2010/06/15/utilizando-swift-numa-task-symfony-1314/</link>
		<comments>http://www.symfonybr.com/2010/06/15/utilizando-swift-numa-task-symfony-1314/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 14:10:41 +0000</pubDate>
		<dc:creator>pedro casado</dc:creator>
				<category><![CDATA[cli]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[swift]]></category>

		<guid isPermaLink="false">http://www.symfonybr.com/?p=68</guid>
		<description><![CDATA[Ao utilizar esse código na task: $message = Swift_Message::newInstance&#40;&#41;; Tive o seguinte erro: PHP Fatal error: Class &#8216;Swift_Message&#8217; not found in [&#8230;] Solução: $message = $this&#45;&#62;getMailer&#40;&#41;&#45;&#62;compose&#40;&#34;from@mail&#34;,&#34;to@mail&#34;,&#34;subject&#34;,&#34;body&#34;&#41;;]]></description>
			<content:encoded><![CDATA[	<p>Ao utilizar esse código na task:</p>

<div class="dean_ch" style="white-space: wrap;"><span class="re0">$message</span> = Swift_Message::<span class="me2">newInstance</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>

	<p>Tive o seguinte erro:</p>

<div class="shell"><span class="caps">PHP</span> Fatal error: Class &#8216;Swift_Message&#8217; not found in [&#8230;]</div>

	<p>Solução:</p>

<div class="dean_ch" style="white-space: wrap;"><span class="re0">$message</span> = <span class="re0">$this</span>&#45;&gt;<span class="me1">getMailer</span><span class="br0">&#40;</span><span class="br0">&#41;</span>&#45;&gt;<span class="me1">compose</span><span class="br0">&#40;</span><span class="st0">&quot;from@mail&quot;</span>,<span class="st0">&quot;to@mail&quot;</span>,<span class="st0">&quot;subject&quot;</span>,<span class="st0">&quot;body&quot;</span><span class="br0">&#41;</span>;</div>

]]></content:encoded>
			<wfw:commentRss>http://www.symfonybr.com/2010/06/15/utilizando-swift-numa-task-symfony-1314/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>symfony 1.0 e Swift 4</title>
		<link>http://www.symfonybr.com/2010/06/09/symfony-10-e-swift-4/</link>
		<comments>http://www.symfonybr.com/2010/06/09/symfony-10-e-swift-4/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 09:29:14 +0000</pubDate>
		<dc:creator>pedro casado</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[swift]]></category>

		<guid isPermaLink="false">http://www.symfonybr.com/?p=67</guid>
		<description><![CDATA[Ao utilizar o Swift 4 com o symfony 1.0, tive o seguinte erro: Fatal error: Cannot instantiate abstract class Swift in /[&#8230;]/apps/frontend/modules/[&#8230;]/actions/actions.class.php on line 40 Não sei porque o autoload do symfony não funcionou. Só consigo utilizar a classe incluindo o swift_required.php require_once&#40;dirname&#40;FILE&#41;.&#8216;/../lib/swift/lib/swift_required.php&#8217;&#41;; Se estiver tendo problemas de tela branca com o Swift, utilize: error_reporting&#40;E_ALL&#41;; [...]]]></description>
			<content:encoded><![CDATA[	<p>Ao utilizar o Swift 4 com o symfony 1.0, tive o seguinte erro:</p>

<div class="shell"> Fatal error: Cannot instantiate abstract class Swift in /[&#8230;]/apps/frontend/modules/[&#8230;]/actions/actions.class.php on line 40</div>

	<p>Não sei porque o autoload do symfony não funcionou. Só consigo utilizar a classe incluindo o swift_required.php</p>

<div class="dean_ch" style="white-space: wrap;"><span class="kw1">require_once</span><span class="br0">&#40;</span><a href="http://www.php.net/dirname"><span class="kw3">dirname</span></a><span class="br0">&#40;</span><span class="kw2"><i>FILE</i></span><span class="br0">&#41;</span>.<span class="st0">&#8216;/../lib/swift/lib/swift_required.php&#8217;</span><span class="br0">&#41;</span>;</div>

	<p>Se estiver tendo problemas de tela branca com o Swift, utilize:</p>

<div class="dean_ch" style="white-space: wrap;"><br />

<a href="http://www.php.net/error_reporting"><span class="kw3">error_reporting</span></a><span class="br0">&#40;</span><span class="kw2">E_ALL</span><span class="br0">&#41;</span>;<br />

<a href="http://www.php.net/ini_set"><span class="kw3">ini_set</span></a><span class="br0">&#40;</span><span class="st0">&#8216;display_errors&#8217;</span>, <span class="st0">&#8216;1&#8217;</span><span class="br0">&#41;</span>;<br />

&nbsp;</div>

	<p>Aqui vai um exemplo completo:</p>

<div class="dean_ch" style="white-space: wrap;"><br />

<span class="co1">// swift 4.0.6</span><br />

<span class="kw1">require_once</span><span class="br0">&#40;</span><a href="http://www.php.net/dirname"><span class="kw3">dirname</span></a><span class="br0">&#40;</span><span class="kw2"><i>FILE</i></span><span class="br0">&#41;</span>.<span class="st0">&#8216;/../lib/swift/lib/swift_required.php&#8217;</span><span class="br0">&#41;</span>;<br />

<br />

<span class="re0">$transport</span> = Swift_SmtpTransport::<span class="me2">newInstance</span><span class="br0">&#40;</span><span class="st0">&#8216;smtp.servidor.com.br&#8217;</span>, <span class="nu0">25</span><span class="br0">&#41;</span><br />

&nbsp; -&gt;<span class="me1">setUsername</span><span class="br0">&#40;</span><span class="st0">&#8216;usuario&#8217;</span><span class="br0">&#41;</span><br />

&nbsp; -&gt;<span class="me1">setPassword</span><span class="br0">&#40;</span><span class="st0">&#8216;senha&#8217;</span><span class="br0">&#41;</span><br />

&nbsp; -&gt;<span class="me1">setTimeout</span><span class="br0">&#40;</span><span class="nu0">60</span><span class="br0">&#41;</span>;<br />

<br />

<span class="re0">$mailer</span> = Swift_Mailer::<span class="me2">newInstance</span><span class="br0">&#40;</span><span class="re0">$transport</span><span class="br0">&#41;</span>;<br />

<span class="re0">$message</span> = Swift_Message::<span class="me2">newInstance</span><span class="br0">&#40;</span><span class="st0">&quot;Titulo&quot;</span><span class="br0">&#41;</span><br />

&nbsp; -&gt;<span class="me1">setFrom</span><span class="br0">&#40;</span><span class="st0">&quot;from@email.com&quot;</span><span class="br0">&#41;</span><br />

&nbsp; -&gt;<span class="me1">setTo</span><span class="br0">&#40;</span><span class="st0">&quot;para@email.com&quot;</span><span class="br0">&#41;</span><br />

&nbsp; -&gt;<span class="me1">setBody</span><span class="br0">&#40;</span><span class="st0">&quot;Mensagem&quot;</span>, <span class="st0">&#8216;text/html&#8217;</span><span class="br0">&#41;</span>;<br />

<br />

<span class="re0">$mailer</span>-&gt;<span class="me1">send</span><span class="br0">&#40;</span><span class="re0">$message</span><span class="br0">&#41;</span>;<br />

&nbsp;</div>

	<p>Aqui fala um pouco sobre esse assunto: <a href="http://forum.symfony-project.org/index.php/m/77609/">http://forum.symfony-project.org/index.php/m/77609/</a></p>

]]></content:encoded>
			<wfw:commentRss>http://www.symfonybr.com/2010/06/09/symfony-10-e-swift-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

