|
Post by echnaret on Oct 25, 2011 5:03:25 GMT
I recently made a log-in script to demonstrate some of the ideas/concepts I use on my website (without throwing the whole code at you all at once). It was made using object-oriented programming, and was coded in PHP. A MySQL database will be required to run it. I also went a little crazy with comments, so a text editor with syntax highlight would be helpful for visually separating the code from the comments. Some of the features/points of interest are: - Classes are divided into Model, Controller, Data, and View packages - Forms have been broken down into parts and pieces and abstract concepts - A simple logger class included - Documentation (generated by phpDocumetor) is included. It can also be viewed here. To check out the code, click here. Feel free to check it out, tweak it, and build off of it. My only request is that, if you make any money off of it, you'll send some my way. Just to warn you, it's around 1500 lines of code, so it's a bit of a beast. If you have any questions/comments/bug reports, please post them here. I would also love any reviews that anyone would be willing to share. Thanks in advance!
|
|
|
Post by echnaret on Oct 27, 2011 3:26:06 GMT
I went and added a demo to my website, just so you can see what the final product looks like. I warn you, the demo is deceiving (the code is a lot more complex than it appears). Demo location: echnaretspage.com/login/demo/
|
|
Nick
VIP
v5 Beta Tester[M:5000]
Philadelphia Eagles: 8-8
Posts: 2,239
|
Post by Nick on Oct 27, 2011 3:45:42 GMT
Nice job on that! You wouldn't mind explaining to me how phpDocumentor works. I've never used it, and I was trying to look into it however I couldn't find any good articles on it.
|
|
|
Post by echnaret on Oct 27, 2011 4:12:20 GMT
Nice job on that! You wouldn't mind explaining to me how phpDocumentor works. I've never used it, and I was trying to look into it however I couldn't find any good articles on it. Are you wondering how to install it, or how to write code/comments that produce useful output?
|
|
Nick
VIP
v5 Beta Tester[M:5000]
Philadelphia Eagles: 8-8
Posts: 2,239
|
Post by Nick on Oct 27, 2011 4:26:43 GMT
Just how it works. I could install it, I'm just not sure exactly how it works or what it does
|
|
|
Post by echnaret on Oct 27, 2011 4:39:25 GMT
<?php
/** * This is a sample class. I am using it to illustrate * how phpDocumentor works. * * @author Stephen Cornelius * @version 1.0 */ Class Sample { private $variable_name;
/** * This is the class constructor. It takes one parameter of * type "string." * * @param string $the_variable_name This is the variable description */ public function __construct($the_variable_name) { $this->variable_name = $the_variable_name; }
/** * Use this function to get the variable. * * @return string This is a description of what will be returned. */ public function get_variable_name() { return $this->variable_name; } }
?> The above code will output two pages. The first page gives the file information (which isn't much, considering all of the code is located in the class. If you have any includes(), those will be listed on this page). The second page gives all of the class/function information, and looks simething like this (and yes, I did have to paste two screenshots together to get that picture):
|
|
Nick
VIP
v5 Beta Tester[M:5000]
Philadelphia Eagles: 8-8
Posts: 2,239
|
Post by Nick on Oct 27, 2011 4:42:54 GMT
Hey, that's kinda neat! Thanks for taking the time to explain that ;D
|
|
|
Post by echnaret on Oct 27, 2011 5:09:18 GMT
Hey, that's kinda neat! Thanks for taking the time to explain that ;D It is indeed. I would much rather use something like that than have to go digging through my code to try and figure out what parameters x function took. I'm glad I could help. Let me know if you have any other questions.
|
|
|
Post by (/iPokemon/) on Jun 11, 2012 4:05:01 GMT
Whenever an error happens, an infinite redirect loop happens. Just so you know.
|
|