-
Posts
1,731 -
Joined
-
Last visited
-
Days Won
5
Content Type
Profiles
Forums
Events
Everything posted by Spudinski
-
The best, currently released one, would be ezRPG.
-
I'm glad you dug that up, basically the same as I said. But please, try not to quote previous versions of MySQL. Things changed, a lot.
-
Not really a forum, but StackOverflow and related.
-
I prefer my method: $ vi random.txt $ mv random.txt $ENV_PATH And when I need something, I simply use grep.
-
It doesn't even have a debugging or documenting feature. So it's just a little program, with syntax highlighting?
-
Oh, for the love of... Actually, you know what? I've got better things to waste my time on.
-
I thought I'd share this with you lot. It's basically a drop-in function for any interval based tasks. It was designed to be used in an OOP application, but I've [slightly] rewritten this to be used within a procedural environment. The function has PHPDoc, so I won't be dissecting the internals of it step by step, just read it. It uses JSON for the crontab file, as it's one of my New Year's goals to get away from XML. Though, another reason I made this was to perform automated tasks with inner classes and functions. So, with security in mind, I'd suggest transforming the "call" to a function somewhere, and add call_user_func(). See below for the script, and an example JSON crontab file. Feel free to comment, but do not spam this thread with "help me" messages. PHP: /** * crontab() * <p> * A <i>very</i> simple replacement for the crontab found on *nix systems. * <br /> * It has the ability to run a single cron multiple times, so it should * handle all the crons within the crontab effectively. * </p> * @param string $crontab_file An absolute path to the crontab file. * @return boolean Returns true if any crons were executed, false if not. * @example * <code> * <?php * * crontab(); * // your usual scripting * * ?> * </code> * @author Spudinski<br /> * You can contact me at me[]spudinski.tk with any queries or suggestions. * @license http://creativecommons.org/licenses/by-sa/3.0/<br /> * Just, say thanks. */ function crontab($crontab_file) { $cron_file = file_get_contents($crontab_file); $crontab = json_decode($cron_file, true); $crontab_restruct = array(); $crons_ran = 0; foreach ($crontab as $cron_key => $cron) { $cron_runtime = (time() - $cron['last_run']); if ($cron_runtime > $cron['interval']) { $run_times = $cron_runtime / $cron['interval']; if (!file_exists($cron['call'])) return false; for ($i = 1; $i <= floor($run_times); $i++) { require($cron['call']); $cron['last_run'] = time(); $crons_ran++; } } else continue; $crontab_restruct[$cron_key] = $cron; } if ($crons_ran > 0) { $json_restruct = json_encode($crontab_restruct); file_put_contents($crontab_file, $json_restruct); } return ($crons_ran > 0) ? true : false; } JSON example: {"update_stats":{"last_run":1329002545,"interval":60,"call":"/path/to/update_stats.php"}} Ps. "interval" is in seconds, not minutes. That's it for now, 'cause I'm lè tired.
-
Bah, MySQL Ref. says it should revert AUTO_INCREMENT to 1 with TRUNCATE syntax. Never did for me, but ah well. I actually plan to keep my data integrity.
-
MySQL trigger on INSERT, that should do.
-
1. Why doesn't it? 2. What did you do? 3. How did you do it? 4. What should it do?
-
Why on earth would you need a DBMS for calculations, when you have PHP?
-
It doesn't. I pick fun at people who are literate enough to ask for help, but fail to research their question.
-
It's plain English. :confused: Though, in translation it sounds very posh. Actually, very proper usage of the language.
-
Link #3. -tooshort-
-
With or without OAuth 2.0/SSL? Just asking.
-
Step 1: Run this in phpMyAdmin. TRUNCATE `users` Click yes, wada wada. Step 2: And then, ALTER TABLE `users` AUTO_INCREMENT = 0; [left] [/left] Please note: Step 2 is NOT advised.
-
No, it's not just you. I noticed that as well. I think it's because they are running out of ideas, especially with Barney.
-
Family Guy is an American animated sitcom created by Seth MacFarlane for the Fox Broadcasting Company. The series centers on theGriffins, a dysfunctional family consisting of parents Peter and Lois; their children Meg, Chris, and Stewie; and their anthropomorphic pet dogBrian. The show is set in the fictional city of Quahog, Rhode Island, and exhibits much of its humor in the form of cutaway gags that often lampoon American culture. I quite like this, never watched it before a few weeks ago. But it's good because, there's something in there everyone can relate to.
-
Some preliminary screenshots of the New Worlds Engine
Spudinski replied to a_bertrand's topic in Other Game Engines
I guess you are right, extensions are pretty easily done in javascript(eg. jQuery.fn) I wouldn't mind. -
Yes, smarty is the most popular, so I'm pretty sure it will win. But, there are plenty of other options(some better) available. So which template engine do you rely on the most, and why? My choice is RainTPL. It's very compact, just over 1,000 lines in one file, and supports the things I use most in template engines, like caching. It's also very efficient to work with for me, as it's very flexible. I can generate an infinite amount of templates in one go. The draw back, is the caching. It's not very, "timely". And thus, creates a bottleneck in your script, where it appears the application is lagging behind. Sample template: <p>Hello there, {function="ucwords($name)"}!</p> Sample construct: // setup templating require_once($c['paths']['vendor'] . 'raintpl/rain.tpl.class.php'); raintpl::configure( array( 'base_url' => null, 'tpl_dir' => ($c['paths']['tpl'] . $c['tpl']['cur']), 'cache_dir' => ($c['paths']['tpl'] . $c['paths']['tmp']) ) ); if(!$cache = $tpl_main->cache($page, 60, 1)) { $tpl_main->assign('name', $user_name); $content = $tpl_main->draw('template', true); } else $content = $cache; // $content is the template, ready to be buffered out. Quite easy.
-
Some preliminary screenshots of the New Worlds Engine
Spudinski replied to a_bertrand's topic in Other Game Engines
I totally agree with you on that. But on a side note, experienced developers do need engines/frameworks/etc.. It makes our lives a lot easier(you know why). So you just might need to bargain in the "aspects" of your engine that would be appealing to the more experienced group of developers. -
Unless you have a patent for it, it doesn't really matter, does it.
-
Template syntax != PHP. It's Pseudocode. Ref: http://en.wikipedia.org/wiki/Pseudocode
-
Because it doesn't contain or manage any actual content. CMS, n. : http://en.wikipedia.org/wiki/Content_management_system
-
Click me, or die.