Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Delicious Brains:
Our Struggles to Stay Healthy While Working From Home Part 2
Feb 03, 2017 @ 16:43:18

The Delicious Brains blog has an interesting post, the second part of a series, talking about staying healthy - both mentally and physically - while working from home. In this new article several people share their own ideas, habits and experiences that have helped them keep up while being a part of a remote team.

It’s been just over a year since we posted about our struggles to stay healthy whilst working from home in a remote team. In that time we’ve had two new members join the team, one full company meetup and one regional, one new baby, two engagements and three home moves, so I thought it was about time we give an update on where we are with our health. Ian did promise an update 6 months after the last, but don’t hold it against him.

He post shares thoughts and comments from eight different people, each with their own unique experiences and recommendations (what works for some doesn't for others). Most of the suggestions include recommendations of regular exercise, making mental health a priority and better sleep habits.

tagged: health remote working team recommendation exercise sleep mentalhealth

Link: https://deliciousbrains.com/struggles-stay-healthy-working-from-home-part-2/

PHPUgly Podcast:
Episode 29 - Merlin Magical Sleep Sack
Sep 28, 2016 @ 14:47:20

The PHPUgly podcast, hosted by Eric Van Johnson, Tom Rideout and John Congdon, has posted their latest episode today: Episode #29: Merlin Magical Sleep Sack.

In this latest show the hosts talk about a wide range of topics including:

  • Troubleshooting Laravel Valet on macOS Sierra link
  • DesignPatternsPHP
  • Microsoft’s the top open-source contributor on GitHublink
  • Github Octoverse 2016
  • Calyx 30GB/month 4G Hotspot for $400/year link

You can find the full show notes (with links) here. If you enjoy the show, be sure to subscribe to their feed and follow them on Twitter for updates when future shows are released.

tagged: phpugly podcast ep29 merlin magical sleep sack ericvanjohnson tomrideout johncongdon

Link: https://soundcloud.com/phpugly/episode29

DZone.com:
How to correctly work with PHP serialization
Aug 29, 2012 @ 13:19:37

In this new post to DZone.com today Giorgio Sironi takes a look at the serializing functionality in PHP and how it works with both regular variables and objects.

PHP is able to automatically serialize most of its variables to strings - letting you save them into storage like $_SESSION. However, there are some tweaks you have to know to avoid exploding .php scripts and performance problems.

He gives some code snippets showing the serialization of variables and objects and points out a few things that can't be effectively serialized (like resources and closures). The mentions the "__sleep" and "__wakeup" magic methods for automatic class serialization and mentions the Serializable interface that comes built in to PHP.

tagged: serialize variable object tutorial sleep wakeup serializable interface

Link:

Justin Carmony's Blog:
PHP, Sessions, __sleep, and Exceptions
Mar 27, 2012 @ 17:25:02

Justin Carmony has a recent post to his blog about a problem he came across where his exception was being thrown with a line number of zero - cause for some investigation.

Today I ran into a problem where my PHP Application would throw this fatal error: "Fatal error: Exception thrown without a stack frame in Unknown on line 0". Which is so much fun, because it doesn’t have a line number, so I had no direction as to what exactly was causing the problem.

He found a blog post that helped him track down the issue that, as it turns out, with serializing objects into the session and an error in the __sleep method.

tagged: exception problem sleep serialization error handler

Link:

Dave Gardner's Blog:
Caching dependency-injected objects
Mar 25, 2010 @ 16:49:57

Dave Gardner has posted about a method he uses to cache objects that have dependency injection needs in something like a memcached server.

The objects themselves have a number of injected dependencies. It includes using the PHP magic methods __sleep and __wakeup to manage serialisation. It also discusses mechanisms for re-injecting dependencies on wakeup via a method that maintains Inversion of Control (IoC).

He uses a user object based example that has an injection needed to load in the user's usage history. He includes the code to define the classes, create the objects via a dependency injection container and performing the sleep/wakeup actions with the dependencies coming out intact on the other side.

tagged: tutorial cache dependency injection object sleep wakeup

Link:

DevShed:
The Sleep and Wakeup Magic Functions in PHP 5
Jun 17, 2009 @ 13:49:19

DevShed has posted the next part of their series looking at the "magic functions" that PHP5+ has to offer you in your development. They've already looked at ones like __call, __clone and __isset/__unset and now, with this new tutorial they've added __sleep and __wake.

Magic functions are an important part of the numerous improvements and additions that were introduced originally in PHP 5. They can be extremely handy when it comes to simplifying the execution of complex tasks. [...] In this fourth chapter I'm going to examine closely the "__sleep()" and "__wakeup()" functions, which are called automatically when an object is serialized and unserialized respectively.

In their example code they add the __sleep and __wake functions to the class they've been developing to output a string when the object is manipulated. These methods are automatically called when a serialize/unserialize function call is made on the object.

tagged: tutorial function magic wakeup sleep

Link:

Stubbles Blog:
Some remarks to serialization without pity
Mar 22, 2007 @ 15:39:00

In response to Terry Chay's response about his previous blog post, Frank Kleine has posted a few more comments on the topic of object serialization and some of the assertions Terry made.

Terry Chay made some remarks to my last blog entry about a solution for lazy class loading without using __autoload(). Some of his statements seem like I explained my implementation not good enough leading to wrong interpretations. In this blog entry I'll use some of his statements to take a deeper look into my implementation and show that he has drawed some conclusions which I want to disprove.

He goes back and corrects some of what Terry has said in his response, including showing a more detailed version of him implementation. Be sure to check out the comments for the post, though - Terry comes back and clarifies some of the comments he'd made including the framework talk and changes of perspective having seen the new code snippet/information.

tagged: serialized pity autoload object sleep wakeup detail serialized pity autoload object sleep wakeup detail

Link:

Stubbles Blog:
Some remarks to serialization without pity
Mar 22, 2007 @ 15:39:00

In response to Terry Chay's response about his previous blog post, Frank Kleine has posted a few more comments on the topic of object serialization and some of the assertions Terry made.

Terry Chay made some remarks to my last blog entry about a solution for lazy class loading without using __autoload(). Some of his statements seem like I explained my implementation not good enough leading to wrong interpretations. In this blog entry I'll use some of his statements to take a deeper look into my implementation and show that he has drawed some conclusions which I want to disprove.

He goes back and corrects some of what Terry has said in his response, including showing a more detailed version of him implementation. Be sure to check out the comments for the post, though - Terry comes back and clarifies some of the comments he'd made including the framework talk and changes of perspective having seen the new code snippet/information.

tagged: serialized pity autoload object sleep wakeup detail serialized pity autoload object sleep wakeup detail

Link:

DevShed:
Using the Sleep and Wakeup Functions to Serialize Objects in PHP (Part 2)
Jun 13, 2006 @ 13:11:34

DevShed continues their "serializing objects" series today with part two of the series, highlighting the use of the sleep and wakeup functionality of PHP to help with the serialization.

After refreshing the concepts that I deployed in the first part of this series, it's time to focus on the topics that I'll cover in this article, so you'll know what to expect before you continue reading. In this second part, I'll explain how to use objects in conjunction with the "__sleep()" and "__wakeup() magic functions respectively, in order to get the most out of them.

They start with a look at defining self-saving objects with their ObjectSaver class developed earlier. Building on that reminder, they integrate the "__sleep()" and "__wakeup()" functionality to handle calls immediately before and immediately after the handling of the object. They then use this new functionality to create persistent objects, capable of maintaining values across page requests.

tagged: serialize object persist sleep wakeup save serialize object persist sleep wakeup save

Link:

DevShed:
Using the Sleep and Wakeup Functions to Serialize Objects in PHP (Part 2)
Jun 13, 2006 @ 13:11:34

DevShed continues their "serializing objects" series today with part two of the series, highlighting the use of the sleep and wakeup functionality of PHP to help with the serialization.

After refreshing the concepts that I deployed in the first part of this series, it's time to focus on the topics that I'll cover in this article, so you'll know what to expect before you continue reading. In this second part, I'll explain how to use objects in conjunction with the "__sleep()" and "__wakeup() magic functions respectively, in order to get the most out of them.

They start with a look at defining self-saving objects with their ObjectSaver class developed earlier. Building on that reminder, they integrate the "__sleep()" and "__wakeup()" functionality to handle calls immediately before and immediately after the handling of the object. They then use this new functionality to create persistent objects, capable of maintaining values across page requests.

tagged: serialize object persist sleep wakeup save serialize object persist sleep wakeup save

Link:


Trending Topics: