
Vali
Members-
Posts
150 -
Joined
-
Last visited
Never
Vali's Achievements
Newbie (1/14)
0
Reputation
-
I used java for websites for a bit more than one year . For websites, it sux big time. It takes 1 week to do something you would o in php in 1 day. BUT, it has a few good things, so if you use it for your chat server, and other things like that, then it's good for that, NOT for websites. Used java/struts/hibernate/catalina/etc.
-
Most these things send in fake traffic. So minimum 600$ to TEST and see if it brings in correct traffic would be a waste... Even if you make 2k from your game a month, 600$ just to see if it works is not worth it. (since out of 10 sites like this, 9 are fake)
-
hey Can we see the ingame screenshot for this template: http://ishmell.deviantart.com/art/Solar-Battles-Login-140750735
-
You can't just spam 100k users like that... #1 read the php mail function manual (not for mass mailings) #2 chances are your on a shared server, so they only allow a few hundred emails an hour. #3 if just start sending 100k emails at once from a new server, 1% of them will make it to the inbox, 1% to junk folder, and 98% will be blocked. You need to "worm up" the server ip, and up the volume 5% per day. (start at like 1k-2k to be safe).
-
Re: New Game. Blow your mind's away. Hey, check out MemcacheD or APC, if you use them right, you can cut your queries by 90% (equivalent of running 9 times more :p)
-
Re: Next Generation Browser Game Engine - Input Request that looks like jSon (can be used to transfer data from php to js)
-
Re: How to use JSON for configuration settings so, {"constants":{"ONE":1,"TWO":2,"THREE":3},"setting_1":true,"setting_2":false,"setting_3":"\/home\/blah\/public_html\/","setting_4":false,"setting_5":"http:\/\/www.example.com\/","extracts":{"dog":"Spot","cat":"Skittles"}} Is easier to edit than: $siteConf = array( 'constants' => array ( 'ONE' => 1, 'TWO' => 2, 'THREE' => 3 ), 'setting_1' => true, 'setting_2' =>false, 'setting_3' =>'/home/blah/public_html/', 'setting_4' => false, 'setting_5' => 'http://www.example.com/', 'extracts' => array ('dog', 'Spot', 'cat'. 'Skittles') ); or the ini file: ; This is a sample configuration file ; Comments start with ';', as in php.ini [first_section] setting_1 = true setting_2 = false setting_3 = '/home/blah/public_html/' setting_4 = false setting_5 = 'http://www.example.com/' [second_section] extracts[] = 'dog' extracts[] = 'Spot' extracts[] = 'cat' extracts[] = 'Skittles' ... ???
-
Re: Database class for PHP 5+ and MySQL (Help) If the variable is public, your getting that variable back... or what you put in it. If your putting a blob in your counter, it's your fault for messing it up. There's no need to recheck all your variables all the time, just in case the programmer decided to do: $counter = 'five'; instead of $counter = 5;
-
Re: Database class for PHP 5+ and MySQL (Help) The DTO class is just an object, that can be passed around. So you always know what your getting / setting. As for the singleton, in this case, making it all static is WAY less code / faster to do, giving the same result. Also, if all you have is one variable, it's just plain retarded to add 'increment()', 'get()' or 'reset()'... I mean what's the point? If you REALLY want to go out your way and waste your time, then I guess you can do it like that. It's only ~50 times slower and 20 times the code.
-
Re: Database class for PHP 5+ and MySQL (Help) Here you go: <?php /** * This is your DTO that holds your counters (can be used by more than one class) */ class myCounterDTO { public static $count = 0; } /** * This class does stuff */ class myClass { public static function doStuff() { myCounterDTO::$count ++; echo "Doing stuff!\n"; } } /** * This class does other stuff */ class myOtherClass { public static function doOtherStuff() { myCounterDTO::$count ++; echo "Doing stuff!\n"; } } // Do some stuff and other stuff myClass::doStuff (); myOtherClass::doOtherStuff (); myOtherClass::doOtherStuff (); // See how many times we did stuff echo "Did stuff: " . myCounterDTO::$count . " times.\n"; ?> Usually, 'myCounterDTO' should be a friend class of 'myClass' and 'myOtherClass', but PHP doesn't have that... The idea is that you can have multiple classes that increase your 'query' count.
-
Re: Database class for PHP 5+ and MySQL (Help) There is nothing private or protected that you need for a DB class...
-
Re: Database class for PHP 5+ and MySQL (Help) Depends on what you need. And if you don't need $this, you should use STATIC methods, since they are about 4 times faster than normal ones.
-
Re: Database class for PHP 5+ and MySQL (Help) Your class is useless... it's just a wrapper for the normal PHP functions, and to use it, it would be harder than to use normal PHP function calls... Here are a few suggestions: - try not to use @, that's the slowest thing in PHP - instead of "die", throw an exception (do you really want to show that warning to the user for everyone using your class?) - split up your SELECT, UPDATE, INSERT, DELETE in different functions, that way, you can do more things depending on what query the user does (ex: count the number of selects vs updates) - use '__deconstruct", if you really want to kill the connection once your done (or store the class stats in the session, so the next refresh can use them) - you could probably make every function in there STATIC, depending on how you plan to use your class (ex: if you always use it with the same DB) - etc... hope that helps.
-
Re: FlameSpark - Test us now in BETA! Error: "Oh. Looks like you've got cookies disabled." And they are ON