PHP: Peridot and Propel

Wanted to share a little configuration I just finished making for some Peridot and Leo -based tests which work with Propel models.

A bunch of these tests write data to the database using the Propel models, and I need a clean slate DB before each test. I also need a clean slate HTTP session. Here’s some code ( from peridot.php ) that uses transactions to achieve that:

class MyScope extends Scope {
  function __construct( $emitter ) {
    $emitter->on( 'peridot.execute', function() {
      $this->conn = Propel::getConnection();
    } );

    $emitter->on( 'test.start', function() {
      // have to rollback and begin here.
      // it was unreliable when I rolled back on test.end
    } );
  private static function destroySession() {
    $_SESSION =[];

    // If it's desired to kill the session, also delete the session cookie.
    // Note: This will destroy the session, and not just the session data!
    if (ini_get("session.use_cookies")) {
      $params = session_get_cookie_params();
      setcookie(session_name(), '', time() - 42000,
        $params["path"], $params["domain"],
        $params["secure"], $params["httponly"]


return function($emitter) {
  $gmsScope = new GmsScope( $emitter );

  //add this scope into every suite
  $emitter->on('suite.start', function($test) use ($gmsScope) {

Start learning to become a web developer with the Flatiron School Prework

I ran across the Flatiron School of programming a while back, and I thought it was pretty cool. They have a “pre-work” list of resources for their web development course. I expect it is quite good.

I ran across Flatiron school when I listened to a podcast the founder of the school did. I think it is pretty inspiring.

OK, enjoy learning to program. I’m pretty excited for you!

p.s. This post was based on an email reply I wrote to a reader of this blog who asked me for some resources to start learning Ruby on Rails.

“CSS for Beginners: How to style your website using CSS” – this Saturday

If you’ve been looking to learn how to use CSS, and you’re in Winnipeg, come out to a workshop that will teach you just that, this Saturday.

The workshop is put on by the great people behind Ladies Learning Code, so you can be sure that the atmosphere will be great, and your teachers and peers supportive.

Let me know what you learned if you go.

Job Search Update

Since the last post I made, I’ve done a few things as part of being unemployed. Here’s a selection.

I got in touch with a recruiter in Ontario who hires nationally, through a developer friend who lives in Ontario, and based on our conversation, I told the recruiter that I am not as concerned about the technology used or that they match dollar for dollar my previous salary, but rather that I am willing to take a chance with a company & team which is willing to go the extra mile to make their customers and employees happy. I also mentioned that my preferred technology stack at the moment is not PHP & WordPress, but rather full-stack JavaScript, and HTML5 hybrid mobile apps.

I met with a local recruiter, who pretty quickly came to the conclusion that I am probably often misunderstood by people, and offered to me some advice around maneurisms. Simple things like even maintaining eye contact. I asked him a bit about transitioning to a different technology stack, like .NET, and he said that it can be done, but there would initially probably be a salary penalty. I’ll keep it in mind for now.

I went to the orientation for the self-employment program offered by the YMCA-YWCA, where I got the application for joining the program. I think that program looks amazing, and I’ve already filled out the application, just didn’t get a chance to bring it in today, since I didn’t know whether the right person will be in the office, and they didn’t return my voice mail.

I also attended an orientation session at Opportunities for Employment. This is also pretty cool, and I even got a free suit there! Check me out:


Then there was the Ramp up Year Ender last night. Always a great and friendly group of people. I made sure to tell everyone I spoke with that I was unemployed and to keep me in mind for any opportunities they hear about. One person asked me to send them my resume, one asked to set up an appointment to explore what work we can do together, and another to email them my contact info so they can introduce me to people who might be interested in speaking with me. And all around good wishes and kind friends, and that means a lot.

Today I put up a WordPress plugin up on GitHub, and actually got contacted by someone looking for a developer! ( message me if you also wanna be considered for this job, and I will share the ad for the opportunity with you ). The CEO of the company who contacted me seems very cool, based on a video interview I found on-line.

Thanks for reading. Have a good one.

Today’s Job Search Efforts

I still plan to try to set up my computer further for work on WordPress websites, an initiative I’m hoping will provide lucrative self-employment opportunities, and perhaps even a product with passive income opportunities.