[Solar-talk] Small bug + patch for Solar_Cli_MakeModel

Andreas Ravnestad andreas.ravnestad at gmail.com
Sun Feb 17 16:59:41 CST 2008


I discovered a small bug in the make-model command this evening while
working out a small tutorial on generating models from existing
tables. In short, for "namespaced" classes (such as A_B_C) the
make-model command would give an error and skip writing the model
class if the target directory A/B didn't already exist. The error
could be something like this:

  Warning: file_put_contents(/home/andreas/projects/MyBookmarks/A/B/C.php):
failed to open stream: No such file or directory in
/usr/share/php/Solar/Cli/MakeModel.php on line 106

This is a icky problem since it makes it rather tedious to make models
in a typical Vendor/Model namespace.

Attached is a diff which fixes the problem. It might also burn down
your house and kill your kittens, for which I assume no
responsibility.

-Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MakeModel.php.diff
Type: application/octet-stream
Size: 675 bytes
Desc: not available
Url : http://mailman-mail3.webfaction.com/pipermail/solar-talk/attachments/20080217/fa9c98f4/MakeModel.php.obj


More information about the Solar-talk mailing list