Scripting in SKINS : PHP, Perl etc.

DirectAdmin Support

Administrator
Staff member
Joined
Feb 27, 2003
Messages
9,158
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

John
 
DA is supposed to be designed to run *fast* using C. will adding php and perl interpretation capabilities cause it to end up slower?
 
Zachary said:
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:
<?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
 
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?
 
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
 
Not sure how it would be done in JS, with php you could try:

add the following to the top of the page:

PHP:
<?php 
$time=explode(' ', microtime()); 
$timetaken=$time[1]+$time[0]; 
?>

Then this at the end:

PHP:
<?php 
$time=explode(' ',microtime()); 
$time=$time[1]+$time[0]; 
$loadtime=($time-$timetaken); 
echo "loading time: $loadtime seconds"; 
?>

Chris
 
Zachary said:
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.
 
Back
Top