View Full Version : Scripting in SKINS : PHP, Perl etc.
DirectAdmin Support
12-30-2003, 12:12 PM
Just a note, we now have scripting in the skins. Php, perl or any other interpreter can be used. Should greatly increase the flexibility of skins.
LINK (http://www.directadmin.com/forum/showthread.php?s=&postid=8754#post8754)
John
Zachary
12-30-2003, 08:26 PM
DA is supposed to be designed to run *fast* using C. will adding php and perl interpretation capabilities cause it to end up slower?
ProWebUK
12-30-2003, 10:02 PM
Originally posted by Zachary
DA is supposed to be designed to run *fast* using C. will adding php and perl interpretation capabilities cause it to end up slower?
It will add the time it would usually take to process
if you add
<?php
echo "test";
?>
would add 0.0000000001seconds to your current loading time* (totally inaccurate but u get my idea!)
basically it depends on the code you use, and what you are doing.
Chris
Zachary
12-30-2003, 10:15 PM
i was thinking of replacing html code generated by DA tokens.
like,
$pop = |POPACCOUNTS|;
eregi_replace(
'<input type="submit" ',
'<input type="button" class ="button" ',
$pop
);
if i have like 120 pop accounts on that particular domain, will the slowdown be significant?
ProWebUK
12-30-2003, 10:19 PM
Best way to find out would be check the page processing time before and then again after the chnages.
Shouldnt make to much difference at all, but as i said, check it.
Chris
Zachary
12-30-2003, 10:26 PM
errrr.... how do i check the load time?
ProWebUK
12-30-2003, 11:19 PM
Not sure how it would be done in JS, with php you could try:
add the following to the top of the page:
<?php
$time=explode(' ', microtime());
$timetaken=$time[1]+$time[0];
?>
Then this at the end:
<?php
$time=explode(' ',microtime());
$time=$time[1]+$time[0];
$loadtime=($time-$timetaken);
echo "loading time: $loadtime seconds";
?>
Chris
loopforever
12-31-2003, 08:09 AM
Originally posted by Zachary
i was thinking of replacing html code generated by DA tokens.
like,
$pop = |POPACCOUNTS|;
eregi_replace(
'<input type="submit" ',
'<input type="button" class ="button" ',
$pop
);
if i have like 120 pop accounts on that particular domain, will the slowdown be significant?
Something like this would take less than half a second, if that. You'd be surprised how quickly each iteration is processed. But, just a bit of advice, don't use eregi_replace, use str_replace instead. It's faster for what you're intending to do. You should only use ereg_replace/eregi_replace when you're doing complex search-replaces with regular expressions.
Zachary
12-31-2003, 08:21 AM
thanks guys, point taken :)
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.