Revolution-NOTL Posted January 31, 2014 Share Posted January 31, 2014 (edited) Hello all, it's Revolution. I just want to say that I want to make my own custom engine. If there is anyone here, who can give me advice that will be great. If there's any good examples of how to make a custom engine. Can someone post the link? I also started of by creating the members database table. I haven't coded anything yet... --UPDATE-- I've just coded the database bit. Now I got to connect it. All I need is a good simple PDO system. <?php $databasename = "DB"; $databasehost = "localhost"; $databaseuser = "DBUSER"; $databasepassword = "DBPASS"; $code = "RANDMON"; $date = date("d-m-y", time()); ?> Edited January 31, 2014 by Revolution-NOTL Quote Link to comment Share on other sites More sharing options...
john. Posted January 31, 2014 Share Posted January 31, 2014 Depends entirely on you and your needs. What should your engine contain? Why do you even need to make your own? Learning purposes? You should divide your application in different layers. Some MVC-inspired architecture is usually a good approach. One of the important rules in writing good code is separation, and presentation logic and application logic should always be separated, below is a simple but yet flexible way to approach: app/ config.php bootstrap.php modules/ home/ home.php login/ login.php templates/ home.html index.html login.html index.php config.php - would contain configuration such as database details, base url, smtp for email, etc. bootstrap.php - would be responsible for bootstrapping the application, setting up error handling, database, some container to pass dependencies to modules, autoloading, etc. modules/ - would contain modules, modules would contain the application logic and busniess logic (a simple, but less separation of concerned application structure) here you would have database queries and loading templates depending on a user's request (etc, show a login form). a module would typically contain a game feature for simplicity, example you could have a module being responsible for logging in a user (setting a session). templates - contains presentation logic, html... You would pass data from your modules to the templates that can be displayed, etc if a user is logged in you would show a logged in template if not a login template, if you would list members of your "game", you could have a moudle "memberlist", that would pass an array of members to a memberlist.html template that would foreach the array and showing them in some nice table... Quote Link to comment Share on other sites More sharing options...
Revolution-NOTL Posted January 31, 2014 Author Share Posted January 31, 2014 Yes, I have sorted something out like that, so all i need is a bootstrap… Thanks John for the advice :) Quote Link to comment Share on other sites More sharing options...
Newbie Posted February 1, 2014 Share Posted February 1, 2014 hey here is some stuff that might help you. http://makewebgames.io/showthread.php/40869-MySQLi-Easy-class http://wiki.hashphp.org/PDO_Tutorial_for_MySQL_Developers Quote Link to comment Share on other sites More sharing options...
sniko Posted February 2, 2014 Share Posted February 2, 2014 And the only piece of code you've given doesn't even adopt a naming convention, or it does; but not a nice one. How about reading this. Also, not to be one of those guys, but it looks like you've taken McCodes v2 config.php file, removed the array and added the date (and renamed the variables). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.