Jump to content

448191

Staff Alumni
  • Content Count

    3,544
  • Joined

  • Last visited

  • Days Won

    4

448191 last won the day on November 23 2017

448191 had the most liked content!

Community Reputation

25 Good

About 448191

  • Rank
    Prolific Member
  • Birthday 03/02/1981

Contact Methods

  • Website URL
    http://blog.kleijnweb.nl

Profile Information

  • Gender
    Male
  • Location
    Netherlands
  1. 448191

    New forum software

    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? 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.kleijnweb.nl/3-layer-directed-graph-dependency-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.
  2. My apologies, clearly Vim has a plenitude of features I'm not utilizing. But as far as auto-complete goes, I find it indispensable. But perhaps my ability to memorize an absurd number of API's is sub-par
  3. Wow, I'm suprised Dreamweaver got this many votes, even if the topic is almost 4 years old. Didn't even realize they still make it. From my experience you're better off with Vim (which I do use for quick edits of config files but find lacking as an IDE). That said, the single feature I find most useful in an IDE is code completion. I suffer from what we Dutch refer to as "geheugen als een goudvis", which compares one's short term memory to the proposed 3 seconds of retention a goldfish possesses. Unfortunately this is also the feature that provides the biggest challenge to IDE developers in terms of performance when library size approaches he gigabyte. I've tried quite a few. PHPStorm seems perform best right now. ZSfE was awesome featurewise, I might give it another try to see if it performs better now
  4. The polls probably needs Aptana as an option. I know at least three people that use that.
  5. 448191

    PHPFreaks Tutorials Wishlist

    I'll take that one. Expect a "Getting started with TDD" within a couple of weeks. The examples will be using PHPUnit though.
  6. Hey C_V, c'mon give us Franky back, we wanna play some more..
  7. ArrayAccess is an SPL interface, it's build-in into 5.1+ Edit: Don't use this code as an example to learn OOP, PLEASE. It's structure is at fault, I just threw something together quickly. Consider that the disclaimer.
  8. Don't worry about it, it's meant to be a little jibberish, right? It's not like what I added is "solid code", by any standard!
  9. You cheated a little C_V... You made $h->meet('Jesus'); into $h->meet($_POST['name']); ! The way I understand your rules, we can only add to the scenario, not replace anything. Anyway, you're the boss, so I guess we're keeping it.. As for using php5, I don't think it would be a real Frankenstein if it wasn't a complete and utter chaos of different styles and fashions. Meaning if you can't do php5, you can still add. You won't be able to run Franky unless you have php5 installed, obviously, but I will be happy to display the fruits of the works of those that don't! Speaking of chaos, I added some intestants to Franky starting with his stomach. Turns out Franky has quite the appetite: LOL, "Web 2.0 giraffes"? Chaos code: <?php $relatives = array('mother', 'father', 'sister', 'brother','uncle', 'auntie'); $verbs = array('dislikes', 'sits on', 'licks', 'sucks', 'looks like', 'does', 'discusses the pros and cons of Web 2.0', 'loves', 'caresses', 'slides onto', 'hates', 'kisses', 'learns PHP with', 'has an AJAX interface with'); $animals = array('dogs', 'cats', 'horses', 'birds', 'giraffes', 'elephants', 'hippos', 'hamsters', 'gerbils', 'monkeys'); function insult($secondary_person) { global $relatives; global $verbs; global $animals; $r_size = sizeof($relatives) - 1; $v_size = sizeof($verbs) - 1; $a_size = sizeof($animals) - 1; $r_rand = rand(0, $r_size); $v_rand1 = rand(0, $v_size); $v_rand2 = rand(0, $v_size); $a_rand = rand(0, $a_size); $insult = "Your {$relatives[$r_rand]} {$verbs[$v_rand1]} $secondary_person and {$verbs[$v_rand1]} {$animals[$a_rand]}"; return $insult; } class Greeting { function Greeting() { echo "Hello World!"; } } interface Singleton { public static function getInstance(); } interface Actor { public function speak(); public function meet($person); public function eat($animalArr); } abstract class Intestant_Abstract { abstract public function input($input); abstract public function output(); } class Stomach extends Intestant_Abstract implements Singleton { private static $instance; public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new self; } return self::$instance; } private function __construct(){ } public $kilosOfFood; public function input($input){ $this->kilosOfFood += strlen($input); echo 'Franky liky to eats '.$input.'..<br />'; if($this->kilosOfFood > (strlen(implode('',$GLOBALS['animals']))/1.5)){ $this->output(); } } public function output(){ echo '<br />Bhaarf..<br />'; } } class Guts implements ArrayAccess, Singleton { private static $instance; public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new self; } return self::$instance; } private function __construct(){ } private $intestants; public function add($name){ $this->intestants[$name] = call_user_func(array($name, 'getInstance')); } public function remove($key) { unset($this->intestants[$key]); } public function offsetExists($offset) { return isset($this->intestants[$offset]); } public function offsetGet($offset) { return $this->intestants[$offset]; } public function offsetSet($name, $value) { $this->add($name); } public function offsetUnset($offset) { unset($this->intestants[$offset]); } } class Franky implements Actor { private $person; public function meet($person){ $this->person = $person; } function eat($animals){ shuffle($animals); $guts = Guts::getInstance(); $guts->add('Stomach'); $guts['Stomach']->input(next($animals)); } public function speak($insult_them = false){ if($this->person == null){ $greet = new Greeting(); echo '<br />'; } else { echo 'Hello '.$this->person.'!<br />'; if ($insult_them) { echo insult($this->person) . '<br />'; } } } } if (isset($_POST['name'])) { $h = new Franky; $h->speak(); $h->meet($_POST['name']); $h->speak(true); $h->eat($animals); $h->eat($animals); $h->eat($animals); $h->eat($animals); $h->eat($animals); $h->eat($animals); $h->eat($animals); $h->eat($animals); } else { echo <<<FORMINT What's your best friend's name?<br/> <form action = '{$_SERVER['PHP_SELF']}' method = 'post'> <input type = 'text' name = 'name' size = '10'> <input type = 'submit' value = 'submit'> </form> FORMINT; } ?>
  10. Ouch, franky learned some new phrases..
  11. <?php class Greeting { function Greeting() { echo "Hello World!"; } } interface Actor { public function speak(); public function meet($person); } class Franky implements Actor { private $person; public function meet($person){ $this->person = $person; } public function speak(){ if($this->person == null){ $greet = new Greeting(); echo '<br />'; } else { echo 'Hello '.$this->person.'!<br />'; } } } $h = new Franky; $h->speak(); $h->meet('Jesus'); $h->speak(); ?> Ha! I've forced php5 upon you. Franky is born..
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.