Jeśli jesteś właścicielem tej strony, możesz wyłączyć reklamę poniżej zmieniając pakiet na PRO lub VIP w panelu naszego hostingu już od 4zł!

Archive for Maj, 2012

Reddit.com: Symfony2… to Twig or not to Twig…

Reddit.com: Symfony2… to Twig or not to Twig…

In this recent post on Reddit.com a developer of a Symfony2 application asks, “to Twig or not to Twig for templating in his views.

Hey there… long time Symfony 1.x enthusiast here, finally getting my feed wet with Symfony2. I pose this question to the Symfony2 developers out there: Who’s using Twig for templating? Why or why not?

The answers tange from the obvious “yes” and “no” options out to suggestions that even using templating languages are a bad idea. A few point out that the “separation of concerns” as a valid reason while others discount them by dismissing the “designers don’t have to learn a language” myth that seems to still be so popular. There’s also a few mentions of other templating projects like Smarty and Savant.

Source: http://www.phpdeveloper.org/news/18024

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Reddit.com: Symfony2… to Twig or not to Twig…

Reddit.com: Symfony2… to Twig or not to Twig…

In this recent post on Reddit.com a developer of a Symfony2 application asks, “to Twig or not to Twig for templating in his views.

Hey there… long time Symfony 1.x enthusiast here, finally getting my feed wet with Symfony2. I pose this question to the Symfony2 developers out there: Who’s using Twig for templating? Why or why not?

The answers tange from the obvious “yes” and “no” options out to suggestions that even using templating languages are a bad idea. A few point out that the “separation of concerns” as a valid reason while others discount them by dismissing the “designers don’t have to learn a language” myth that seems to still be so popular. There’s also a few mentions of other templating projects like Smarty and Savant.

Source: http://www.phpdeveloper.org/news/18024

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

PHP Tip-a-Day: PHP Tutorial: Convoluted Code – Combining Ternary Operators and Anonymous Functions

PHP Tip-a-Day: PHP Tutorial: Convoluted Code – Combining Ternary Operators and Anonymous Functions

On the PHP Tip-a-Day site Greg Bulmash shares a bit of “convoluted code” that could potentially cause confusion in the future maintenance of your application – combining ternary with anonymous functions.

Following on yesterday’s post about chaining if statements without brackets on a single line, I tried to explore other ways to perform this “test if the variable is set, then do a comparison if it is” logic. I created one of the most convoluted lines of code I’ve ever written. It’s no SQL join that spans 5 whiteboards, but it’s pretty unreadable.

His example uses not just one ternary comparison, but nested ones with the anonymous function as the first condition. He points out that, if you’re not careful with this method and make both sides anonymous functions, you could be in for a “cannot be converted to string” error on the closure side.

I’m sure there might be a very good reason to put two anonymous functions in a ternary operator, but I can’t think of one at the moment. It’s a fairly ugly proposition.

Source: http://www.phpdeveloper.org/news/18023

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

PHP Tip-a-Day: PHP Tutorial: Convoluted Code – Combining Ternary Operators and Anonymous Functions

PHP Tip-a-Day: PHP Tutorial: Convoluted Code – Combining Ternary Operators and Anonymous Functions

On the PHP Tip-a-Day site Greg Bulmash shares a bit of “convoluted code” that could potentially cause confusion in the future maintenance of your application – combining ternary with anonymous functions.

Following on yesterday’s post about chaining if statements without brackets on a single line, I tried to explore other ways to perform this “test if the variable is set, then do a comparison if it is” logic. I created one of the most convoluted lines of code I’ve ever written. It’s no SQL join that spans 5 whiteboards, but it’s pretty unreadable.

His example uses not just one ternary comparison, but nested ones with the anonymous function as the first condition. He points out that, if you’re not careful with this method and make both sides anonymous functions, you could be in for a “cannot be converted to string” error on the closure side.

I’m sure there might be a very good reason to put two anonymous functions in a ternary operator, but I can’t think of one at the moment. It’s a fairly ugly proposition.

Source: http://www.phpdeveloper.org/news/18023

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

PHP Tip-a-Day: PHP Tutorial: Convoluted Code – Combining Ternary Operators and Anonymous Functions

PHP Tip-a-Day: PHP Tutorial: Convoluted Code – Combining Ternary Operators and Anonymous Functions

On the PHP Tip-a-Day site Greg Bulmash shares a bit of “convoluted code” that could potentially cause confusion in the future maintenance of your application – combining ternary with anonymous functions.

Following on yesterday’s post about chaining if statements without brackets on a single line, I tried to explore other ways to perform this “test if the variable is set, then do a comparison if it is” logic. I created one of the most convoluted lines of code I’ve ever written. It’s no SQL join that spans 5 whiteboards, but it’s pretty unreadable.

His example uses not just one ternary comparison, but nested ones with the anonymous function as the first condition. He points out that, if you’re not careful with this method and make both sides anonymous functions, you could be in for a “cannot be converted to string” error on the closure side.

I’m sure there might be a very good reason to put two anonymous functions in a ternary operator, but I can’t think of one at the moment. It’s a fairly ugly proposition.

Source: http://www.phpdeveloper.org/news/18023

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

PHP Tip-a-Day: PHP Tutorial: Convoluted Code – Combining Ternary Operators and Anonymous Functions

PHP Tip-a-Day: PHP Tutorial: Convoluted Code – Combining Ternary Operators and Anonymous Functions

On the PHP Tip-a-Day site Greg Bulmash shares a bit of “convoluted code” that could potentially cause confusion in the future maintenance of your application – combining ternary with anonymous functions.

Following on yesterday’s post about chaining if statements without brackets on a single line, I tried to explore other ways to perform this “test if the variable is set, then do a comparison if it is” logic. I created one of the most convoluted lines of code I’ve ever written. It’s no SQL join that spans 5 whiteboards, but it’s pretty unreadable.

His example uses not just one ternary comparison, but nested ones with the anonymous function as the first condition. He points out that, if you’re not careful with this method and make both sides anonymous functions, you could be in for a “cannot be converted to string” error on the closure side.

I’m sure there might be a very good reason to put two anonymous functions in a ternary operator, but I can’t think of one at the moment. It’s a fairly ugly proposition.

Source: http://www.phpdeveloper.org/news/18023

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

ServerGrove Blog: phpDay 2012 Report

ServerGrove Blog: phpDay 2012 Report

On the ServerGrove blog today Pablo Godel has posted his wrapup of this year’s phpDay/JsDay conferences that happened last week in Verona, Italy.

Last week I returned from Verona, Italy where I spent a full week with some of the best Javascript and PHP developers out there. I’ve been wanting to go to phpDay for a number of years so when I was invited to present a talk about Symfony2 and MongoDB, there were no more excuses, I had to be there!

Pablo talks about the sessions he attended (at both JsDay and phpDay) including Zeev Suraski’s (Zend) keynote, a talk from Lorenzo Alberton about “Taming the Twitter Firehose” and his own presentation about MongoDB and Symfony2. He also mentions the second day’s keynote from Rasmus Lerdorf and a workshop about building PHP extensions.

Source: http://www.phpdeveloper.org/news/18022

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

ServerGrove Blog: phpDay 2012 Report

ServerGrove Blog: phpDay 2012 Report

On the ServerGrove blog today Pablo Godel has posted his wrapup of this year’s phpDay/JsDay conferences that happened last week in Verona, Italy.

Last week I returned from Verona, Italy where I spent a full week with some of the best Javascript and PHP developers out there. I’ve been wanting to go to phpDay for a number of years so when I was invited to present a talk about Symfony2 and MongoDB, there were no more excuses, I had to be there!

Pablo talks about the sessions he attended (at both JsDay and phpDay) including Zeev Suraski’s (Zend) keynote, a talk from Lorenzo Alberton about “Taming the Twitter Firehose” and his own presentation about MongoDB and Symfony2. He also mentions the second day’s keynote from Rasmus Lerdorf and a workshop about building PHP extensions.

Source: http://www.phpdeveloper.org/news/18022

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Smashing Magazine: Replicating MySQL AES Encryption Methods With PHP

Smashing Magazine: Replicating MySQL AES Encryption Methods With PHP

On the Smashing Magazine site today there’s a new tutorial showing you how to replace your MySQL encryption methods for AES with their PHP equivalent.

At our company, we process a lot of requests on the leading gift cards and coupons websites in the world. The senior developers had a meeting in late October to discuss working on a solution to replicate the MySQL functions of AES_ENCRYPT and AES_DECRYPT in the language of PHP. This article centers on what was produced by senior developer Derek Woods and how to use it in your own applications.

He starts with a little bit of backstory – why to even bother using encryption, what AES encryption is and why you should probably avoid using the MySQL implementation of it in your apps. PHP’s mcrypt functions don’t return the same hashes as their MySQL counterparts (he includes the “why” of this) and includes some quick code to replicate the MySQL behavior. He also mentions some issues with the transformation, newlines and shows the source for their completed “aes_crypt” and “aes_decrypt” functions.

Source: http://www.phpdeveloper.org/news/18021

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Smashing Magazine: Replicating MySQL AES Encryption Methods With PHP

Smashing Magazine: Replicating MySQL AES Encryption Methods With PHP

On the Smashing Magazine site today there’s a new tutorial showing you how to replace your MySQL encryption methods for AES with their PHP equivalent.

At our company, we process a lot of requests on the leading gift cards and coupons websites in the world. The senior developers had a meeting in late October to discuss working on a solution to replicate the MySQL functions of AES_ENCRYPT and AES_DECRYPT in the language of PHP. This article centers on what was produced by senior developer Derek Woods and how to use it in your own applications.

He starts with a little bit of backstory – why to even bother using encryption, what AES encryption is and why you should probably avoid using the MySQL implementation of it in your apps. PHP’s mcrypt functions don’t return the same hashes as their MySQL counterparts (he includes the “why” of this) and includes some quick code to replicate the MySQL behavior. He also mentions some issues with the transformation, newlines and shows the source for their completed “aes_crypt” and “aes_decrypt” functions.

Source: http://www.phpdeveloper.org/news/18021

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>