Development

#3291 (inconsistent capitalization in various portions of symfony)

You must first sign up to be able to contribute.

Ticket #3291 (closed defect: fixed)

Opened 3 months ago

Last modified 2 weeks ago

inconsistent capitalization in various portions of symfony

Reported by: n7lyg Assigned to: fabien
Priority: major Milestone:
Component: plugins Version: 1.1.0 BETA2
Keywords: Cc:
Qualification: Unreviewed

Description

Most of symfony operates on a consistent method of moving between names with internal _ and use of CamelCaps?.

However, most of the plugins seem to rely on consistently starting with 'sf' which never gets capitalized.

Looking at sfGuardPlugin, the internal table names sf_guard_user, etc. get camelCapped with the 'sf' in lower case: sfGuardUser. This is carried out throughout both versions of sfGuardPlugin (1.0 and 1.1).

Recently, ticket #3210 purportedly fixed a problem with fixture data-load where the CamelCaps? were not working. The fix was to call ucfirst on the name being passed around for class loading. The indiscriminate use of ucfirst caused the symfony code to try to locate SfGuardUserPeer? instead of sfGuardUserPeer. Thus, this fix permanently broke the sfGuardAuth fixture.yml.

I fixed this problem by looking for the string 'sf' at the start of the class name being looked for. If the first two characters of the $class name are 'sf', then do not perform the ucfirst. This fix seems to allow both the traditional symfony CamelCaps? and the sfCamelCaps to coexist.

Another fix is to give up on the sfCamelCaps and go to SfCamelCaps?, but that will break all of the old usage with the new symfony and probably cannot be done for the 1.1 release.

Change History

06/23/08 06:38:13 changed by dwhittle

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

This is fixed except in the case of a few propel classes which break the convention.