Development

#205 (sfYaml and syck)

You must first sign up to be able to contribute.

Ticket #205 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

sfYaml and syck

Reported by: mabs29 Assigned to:
Priority: critical Milestone:
Component: Version: 0.7.X
Keywords: yaml, syck, 0.7 Cc:
Qualification:

Description

I sometimes found syck was returning false and making the configuration process choke at its foreach() loops. So I've forced the return value of syck to always be an array.

Diff to follow.

Attachments

sfYaml-for-syck-0.55.diff (439 bytes) - added by mabs29 on 02/12/06 12:11:38.
This fix may well be for my version of syck (0.55) and not something below. It is worth checking.

Change History

02/12/06 12:11:38 changed by mabs29

  • attachment sfYaml-for-syck-0.55.diff added.

This fix may well be for my version of syck (0.55) and not something below. It is worth checking.

02/12/06 12:15:57 changed by mabs29

Correction. gettype(syck_load("")) returns 'unknown type'. But it's the same effect: it is not an array, which is what we want, right?

02/12/06 21:58:11 changed by RoVeRT <symfony@rovert.net>

after looking into this a bit its spyc thats it incorrect as an empty document should be null or undefined

02/26/06 18:41:46 changed by mabs29

  • priority changed from major to critical.

Currently, symfony's configuration process relies on the way spyc works. For example, many of the ConfigHandlers? rely on yamls and, without checking for null, they immediately use a foreach(). I agree that my patch is moving in the opposite direction to what should be the normal behaviour, but it definitely fixes the foreach() errors which result from this difference between syck and spyc.

Here are the locations of all sfYaml::load calls which are not treated as RoVeRT suggests:

addon/propel/sfPropelData.class.php, line 63
         Comment: no checking done
addon/propel/sfPropelData.class.php, line 152
         Comment: immediately uses array_keys on sfYaml::load output
config/sfYamlConfigHandler.class.php, line 57
         Comment: only checks for false. This causes the most trouble.

I suppose there are two solutions.

  • Apply the original patch
  • Change the behaviour of the above situations and use if ($yaml) after sfYaml::load

I've been told some people are waiting on this patch before using syck, so I have raised the priority by a notch.

02/26/06 19:41:24 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

fixed in r894.

02/27/06 10:12:09 changed by fabien

initial patch applied in r896.

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.