Jump to content


Member Since 29 Apr 2004
Offline Last Active Nov 14 2017 06:41 AM

#1477215 New forum software

Posted by 448191 on 24 April 2014 - 11:51 PM

I scrolled through this thread pretty quickly so perhaps I overlooked something. 


If I did not, I cannot believe no one asked the obvious question:




Why, for whatever you value most, would you want to create a forum application? It has been done to death. Yes, it is fairly easy, yes it has been done before with success, even by latecomers. But as learning experience you've already gotten the best out of it, and probably did so before you even posted on this forum. You're not going to learn anything substantial by having some random dude post XSS vulnerabilities on some app that'll never take off. Codewise, all I need to see are some tiny signs in your code to know that you are way behind in the herd. Seriously, your code includes a statement "or die("whatever")". This was not acceptable 10 years ago, now it's nothing less of a sign of incompetence. I'm sure some popular OSS apps still use it after all this time, all the more reason to stay the fuck away.


With the intention of providing some usable advice, I had a look at your profile and found a topic where you made a small effort to attack Symfony, but gave up because you couldn't figure it out. I get that. Symfony uses way too much magic. I like it for the clean code and unbeatable completeness, but hate it for its (intentional) tendency to rely on "conventions", ie "magic". I can't count the times the DI config of a bundle wasn't picked up because the naming of a file/class was off slightly. I've since mastered the beast, but I can't fault you for hating on it.  Still, Symfony2 is currently the best framework for PHP, once you accept it's an ugly bitch, the bitch will work her ass off for you.


But you'd be smart not to commit to any infrastructure layer, be it from Sensio or from your own hand. This post may be of use to you: http://blog.kleijnwe...y-model-part-1/


To the point, you may want to abandon this hobby project to start fresh for the purposes of learning, and think of something more original. I would apologize for being blunt if I did not believe I'm doing you a favor.

#1477213 Place for product development methodologies

Posted by 448191 on 24 April 2014 - 10:20 PM

If this is something you would be able to discuss at your local watering hole, I want to move to wherever you live. You'd have to let me stay on your couch for a week or two until I get my own place though, as I wouldn't feel comfortable in this municipality of retards for longer than a day, knowing that somewhere, out there, is a place where everyone speaks the language of product development methodologies.


My kin, that'll use WIP as a euphemism for moving up and down in a manner that can only lead to a larger number of wenches being defloured through pure efficiency. My brothers, running from all directions to the center of a field, daily, locking arms in friendship only to beat each other senseless using packs of cards with a modified Fibonacci sequence tightly grasped moments later, under the influence of that poor excuse for beer that needs help to defy gravity to get into their glasses. 


Is that what you're saying?

#1434067 Top 10 Development Tools.

Posted by 448191 on 04 June 2013 - 05:39 PM

Nothing changes! How are you doing?


Haha, wel some things do, but apparently my tendency to produce rants isn't one of them ;)


I'm pretty good, thanks for asking. The past three years I've been the lead senior developer in a medium sized company. I learned a lot, but also had to compromise under extreme pressure from the business a lot, and currently I'm just re-evaluating where I stand. I might freelance as an interim lead / consultant for a couple years although nothing is decided just yet.


How are you doing? (we can move this to PM if mods object)


Edit: sorry I forgot to address you as sensei old man ;)

#1432299 Symfony

Posted by 448191 on 25 May 2013 - 11:00 PM

Even if you never go "big", understanding OO principles is a smart move. It's the quality that I find lacking in developers most often: they stop after learning syntax and language features, perhaps they'll keep in touch with with a public community but the PHP community is catching up too slowly and cling to practices that don't scale. Although, and I speak from experience, you might be tempted to overdo things once you do have a solid understanding of OO: bringing a sledgehammer to a game of midget-golf. But likely you'll start building stuff that justify the size of your hammer ;)


PHP has a bad rep as a platform for Enterprise development, you should see the faces when I tell people it's all written in PHP after I tell them what we do.  :tease-03:  In any case, a better understanding of OO will benefit you using pretty much every common language. You can learn the syntax and facilities of 10 languages and that conceptual knowledge will be useful in all 10 cases.

#1432283 Real world application of Traits

Posted by 448191 on 25 May 2013 - 08:32 PM

We're finally upgrading to PHP 5.4 coming release, and probably it's most prominent addition is that of traits (strictly mixins, but whatever).


Mxins in Ruby have always seemed a quick way to get you in a lot of shit, but 5.4 forces me to take another look at them, so I can formulate some guidelines for additions to our codebase. In other words, to make sure they are used without violating a truckload of design principles. Specifically SRP, or more generally cohesion look like a likely victim.


One possible application I see is reducing duplication, especially of boilerplate. In a way, a less complete solution to the problem solved by AOP, so the main Use Case I see is adding system/supporting features such as logging and access control. Example:


require 'vendor/autoload.php';

use Psr\Log\LoggerInterface;

trait UsesLogging
    private $logger;

    public function setLogger(LoggerInterface $logger)
        $this->logger = $logger;

    public function getLogger()
        return $this->logger;

    protected function log($level, $message, $context = array())
        $this->logger->log($level, $message, $context);


use Psr\Log\LogLevel;

class SomeService
    use UsesLogging;
    public function doSomething()
        $this->log(LogLevel::DEBUG, "I did something worth logging");

How do you use traits?

#1432282 Netbeans/Editor for cake php

Posted by 448191 on 25 May 2013 - 08:23 PM

You don't need a specific IDE for a specific framework, Cake or otherwise. While some IDEs include "support" for libraries and frameworks, after a decade I've yet to come across a framework that makes those features a significant accelerator. Pick your IDE based on your workflow. Just give a couple a good try, it's 90% preference when choosing between full-featured IDEs. 

#1432281 Symfony

Posted by 448191 on 25 May 2013 - 08:21 PM

Unit testing is probably the hardest to get used to, because it means programming in a different way.


Actually, TDD is a paradigm, Unit Testing by itself is not. I'm not trying to undervalue it but strictly it just refers to testing a small subcomponent, and doesn't dictate a development process like TDD does. Unit Tests are written to ensure predictable behavior of existing code as well, despite Kent Beck's explicitly advice worded "don't bother". Symfony also provides facilities for headless functional testing (or Integration Testing), very useful to ensure your components don't just work but work together.

#1432279 Symfony

Posted by 448191 on 25 May 2013 - 08:09 PM

Everyone working in a large-scale professional environment was where you're at now at some point. Assuming you've mastered the syntax and features of at least one language with OO support, you'd do well to explore OO principles. Start with reading about the concepts of coupling and cohesion. This allows you to understand SOLID principles and design patterns. Also get comfortable with the de-facto standard deployment platform: Linux. I always say a good programmer is half a system admin. 

#1432272 Symfony

Posted by 448191 on 25 May 2013 - 07:21 PM

Should you want to look at it after it becomes obsolete, look in the repo history. If you're not using a VCS that's an even bigger issue (even the smallest projects should), but if you are, there's no reason to keep code not being used and plenty in favor of removing it. If you need to temporary disable something (a situation to be avoided like the plague btw), remove it and restore the file afterwards using your VCS or IDE. There is no valid reason for commenting out code, seriously. You'll end up committing/pushing that crap at some point, even if you're vigilant. And then your crap it not just your problem anymore. Instead of flushing, you picked up your feces and spread it all over your teammates' faces, to keep with the metaphor :P


Not on topic so I am going to leave it at this, but it annoys the hell out of me especially because it's such a widespread bad habit. 

#1432260 Symfony

Posted by 448191 on 25 May 2013 - 05:43 PM

IMO S2 is by far the best PHP framework right now. Granted it has a learning curve, especially for less experienced developers, but it's well designed (or well "borrowed" from other frameworks like Spring) and much more mature / complete than the alternatives. I didn't like S1 and opted for ZF1, but I like S2 a lot better than ZF2.


The standard distribution just contains some stuff to get a sandbox setup quickly: the contents of app_dev.php are just illustrative. As gizmola suggests, just tweak it to your needs. Same goes for the config files that come with it. There's a distinction between an example sandbox setup and library code.


Anyway, I highly recommend S2 and you might not want to give up on it before you understand why things are the way they are.

#1432179 Smarty

Posted by 448191 on 25 May 2013 - 01:58 AM

Well, if your UI is complex enough to get confused about organizing files (which doesn't take much), templating isn't your main concern, probably. Depends on the purpose and potential scope of your application I guess but I would be much more worried about my service layer and domain model. Again, depends on your project but personally I tend to focus on those and have the UI be a logical consequence of that that design (actually IRL there are some other people involved). But that might be skipping a few steps for you, or not, no idea.

#1432167 Smarty

Posted by 448191 on 25 May 2013 - 01:09 AM

We use Twig. I've worked with Smarty and plain HTML/PHP in ZF but Twig provides a good balance between flexibility and enforcement of SoC. It is somewhat complex, as is Smarty, but our front-enders are very enthusiastic about it. And based on what little work I've done using it, I already like it better than those two alternatives as well.


So on the question whether or not to learn Smarty: don't bother. Some years ago Smarty was a de-facto standard for templating in a professional environment, but unless you expect a lot of exposure to legacy systems I really wouldn't bother.

#728729 Rules - Must Read Before Posting

Posted by 448191 on 03 January 2009 - 04:51 PM

Conditions for Testing Requests

In order to post in this forum, the following conditions must be met:

  • You must have at least 10 posts, from posting in other forums on this site.  Do not "spam" your way to 10 posts just to post here.
  • You are only allowed to request testing of your own website or websites you are otherwise authorized to manage. In order to verify this you must:
  • Create a regular .txt file containing a full URL link to your profile here on PHP Freaks (see details below), and place it on the same domain(s) as your script(s). The text file must be in the root directory of your site. 
    URL: http://www.yoursite.com/phpfreaks.txt
    Text in file: http://forums.phpfre.../user/1-philip/ (but to your profile link)
  • You must then notify us with the URL of the .txt file by placing a link to it in your post or report your post to moderator with the link in the report details.

Profile Link

In my experience, the one thing that people fail to do most of the time, is properly post a link to their profile in the text file. 

The following is not a valid profile link:



That link only works for you, based off of the main menu link and your browser&#039;s session.  Below is what a valid profile link looks like:


You can easily get your profile link by:
  • Clicking on your own name in one of your own posts
  • Clicking on your own name at the top right of the screen
  • Putting [member=your username here] in a test post and hitting the preview button and getting the URL generated from the link.  For example, [member=.josh] will generate .josh.
  • Going to Members > Search For Members and searching for yourself and clicking on that link.

Failure to follow these rules and instructions may result in actions from locking or deleting your topic or even having your account banned depending on the severity and at the discretion of the staff member handling the incident. There are no exceptions and this rule is in effect of immediately meaning that all topics created after this topic will have to abide by this rule.

Waiting for Approval

It generally takes 1-3 days for someone to approve your post.  Normally we will not respond if you are not approved, because of failing to follow the instructions above (we will usually respond if it&#039;s for some other reason).  If after 3 days your post has not been approved and you have not received a response, you can resubmit your site, however, more than likely you were not approved because you failed to follow the rules/instructions! So please re-read the rules and follow the instructions carefully

Someone posted my site!

If someone posted your site here without your authorization then you may use the report to moderator link within the topic and verify your status as owner or representative of the website in the same way as outlined above.  Note that we cannot be held responsible for any damage that may have occurred because of this! If someone had the ability to create the text file on your site to prove ownership/access, they hacked or otherwise gained access to your site independently and prior to whatever thread you are reporting!