Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
If Mr. Nix is interested he will respond, thanks for posting your opinions on his code but it was merely an example likely based on a common template (in his mind or otherwise) he uses to demonstrate the more advanced features in the Zend-2 engine (OOP in PHP5) and everyone has their own naming conventions. Since it's a child class that extends another, conceptually, using an underscore is understandable to distinguish the parent_child relationship. I see your point on that, but I also fully comprehended Mr. Nix's concept based solely on his code without any guesswork or confusion. I'm not saying it could not be improved, that process could go on forever, of course.

-jim
 
Honestly, I haven't used PHP in eight years. As a result, I'm sure I'm a little rusty. I have no issues writing the class in a different language, though.

I'll comment on why I don't like certain aspects. Some are small (personal preference), while others are larger.

- I don't like class names that contain an underscore.
- Is this really a model class? It feels like a class designed after a data access pattern, such as gateway or mapper.

The class Model_Post feels empty. There are no properties, and no methods (outside of the create). Not only that, but you have to pass in an array/hash of data and magic strings to insert something into the database. You're not even using anything related to a model. You're essentially creating a class to turn an array of data into a database record. If you had passed in an instance of post into the create method, you could have used a property, or method, to set the id. Since objects are passed by reference in PHP5 (like Java, C#, etc..), you wouldn't have had to return a value.

- I also don't like having the word model in the class name. Post should be good enough. To me it's just being redundant. You might as well put class in there too.

- BBCode class needs a new name. Based off of it's parse method, I'm assuming it's a parser. It could have been a writer, parser, or a custom bbcode element implementation. In a larger system, that may not be as clear.

I already knew that it was because of your Ruby and C background. This is from an actual forum app the company I work for is building. I pulled all of the code out to only show what was related to the OP.

The underscores are how Zend does name spacing with autoloading.

Since this is really just going to be about how you hate PHP, there is no point talking to you anymore about this.
 
I already knew that it was because of your Ruby and C background.
It really has little to do with my language-specific background. I'm just talking about general software design concepts.

The underscores are how Zend does name spacing with autoloading.
OK. Wasn't aware of that.

Since this is really just going to be about how you hate PHP, there is no point talking to you anymore about this.

Did I say anywhere in this thread that I hated PHP? If you remove my comments about naming conventions, all of my comments have absolutely nothing to do with PHP specific code. Every point that I have made is based off of general software design ideas. In the past have I made my preference known in previous threads? Yes, I have. Those threads, however, were called Rails vs PHP.
 
That exchange made me smile! Hoping the OP hasn't gone to sleep on us!

:D

-jim

ps: I coulda sworn I posted here earlier, now its suddenly gone - did someone request to a mod my post be deleted? PM me if so.
 
That exchange made me smile! Hoping the OP hasn't gone to sleep on us!

:D

-jim

ps: I coulda sworn I posted here earlier, now its suddenly gone - did someone request to a mod my post be deleted? PM me if so.

Oh i am still here poking around.
 
Out of interest so far for my .htaccess file i have made so far.



HTML:
ErrorDocument 400 /htaccess/400_BAD_REQUEST.html
ErrorDocument 401 /htaccess/401_UNAUTHORIZED.html
ErrorDocument 403 /htaccess/403_FORBIDDEN.html
ErrorDocument 404 /htaccess/index.php?error=404
ErrorDocument 502 /htaccess/502_BAD_GATEWAY.html
ErrorDocument 503 /htaccess/503_SERVICE_UNAVAILABLE.html
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?page=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?page=$1
Options -Indexes
<Files include/>
  order allow,deny
  deny from all
</Files>

And progress on the CMS is going well. So far i have one index file that works for the entire site, a cache folder, and a include folder i can put before the htdocs directory which will hopefully make it very secure having all of the modules, functions, db stuff. Completely hidden from the browser.

Looks a bit dull still and is only static text and no database connections just yet. Working on a logo and considering my options for a login system i thinking of using the one i know as i am not confident in coding my own yet. The one written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC) i feel is very good though for a open source project i am wondering if he will be ok for me to use it.

http://development.abcomforts.com/
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.