NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
errorhandler.php example ?


Joined: 10 Jan 2010
Posts: 1
Reply with quote
I'm trying to setup my custom error handler for my encoded scripts.

what is the main function it MUST contains ?

eg:
<?php
//Contents of my erroandler.php

function pe_error_handler($errcode, $errmessage, $licfilename){
// manage my function
// is this the function required ??
echo $errcode;
}
?>

if i encode my file with:

./nu-coder --eh ./erroandler.php --licfile /license.pem mainlib.php mainencoded.php

when i try to run:
php-cgi ./mainencoded.php

i get:
license error handler not found, failed to load file (./erroandler.php) .....

obvious erroandler.php is there, changing to a full path eg: /var/www/erroandler.php doesent changes the result.



Thanks in advance for a working examples.
Francesco
View user's profileFind all posts by francgSend private messageAIM Address
Re: errorhandler.php example ?


Joined: 19 Jun 2010
Posts: 2
Reply with quote
francg wrote:
I'm trying to setup my custom error handler for my encoded scripts.

what is the main function it MUST contains ?

eg:
<?php
//Contents of my erroandler.php

function pe_error_handler($errcode, $errmessage, $licfilename){
// manage my function
// is this the function required ??
echo $errcode;
}
?>

if i encode my file with:

./nu-coder --eh ./erroandler.php --licfile /license.pem mainlib.php mainencoded.php

when i try to run:
php-cgi ./mainencoded.php

i get:
license error handler not found, failed to load file (./erroandler.php) .....

obvious erroandler.php is there, changing to a full path eg: /var/www/erroandler.php doesent changes the result.



Thanks in advance for a working examples.
Francesco


Hi Francesco....are you italian?
here an example:
function pe_handle_error( $Errcode, $Err_msg, $Lic_file){
echo "<html><head>

<title>ERROR LICENSING (".$Lic_file.")</title>

</head>";
error_reporting (0);
switch ($Errcode){
case 3:
$Errmsg= "Licenza scaduta" ;
$msg='<li class=Stile3>Contattare lo sviluppatore per ottenere una licenza.</li>';

break;
case 4:
$Errmsg ='Licenza non valida COPIA ILLEGALE!';
break;
case 1:
$Errmsg ='Licenza non trovata';
break;
case 2:
$Errmsg ='Licenza non valida COPIA ILLEGALE!';
$msg='<li class=Stile3>Contattare lo sviluppatore per ottenere una licenza.</li>';
break;
case 5:
$Errmsg ='Licenza non valida COPIA ILLEGALE!';
$msg='<li class=Stile3>Contattare lo sviluppatore per ottenere una licenza.</li>';
break;
default:
$Errmsg='Errore ('.$Errcode.') non gestito ';
}
echo "$Errmsg";
echo "$msg"
echo "$Err_msg"
echo"</body></html>";
}

Spero di esserti stato utile
View user's profileFind all posts by picmauroy2kSend private message
Re: errorhandler.php example ?


Joined: 19 Jun 2010
Posts: 2
Reply with quote
picmauroy2k wrote:
francg wrote:
I'm trying to setup my custom error handler for my encoded scripts.

what is the main function it MUST contains ?

eg:
<?php
//Contents of my erroandler.php

function pe_error_handler($errcode, $errmessage, $licfilename){
// manage my function
// is this the function required ??
echo $errcode;
}
?>

if i encode my file with:

./nu-coder --eh ./erroandler.php --licfile /license.pem mainlib.php mainencoded.php

when i try to run:
php-cgi ./mainencoded.php

i get:
license error handler not found, failed to load file (./erroandler.php) .....

obvious erroandler.php is there, changing to a full path eg: /var/www/erroandler.php doesent changes the result.



Thanks in advance for a working examples.
Francesco


Hi Francesco....are you italian?
here an example:
function pe_handle_error( $Errcode, $Err_msg, $Lic_file){
echo "<html><head>

<title>ERROR LICENSING (".$Lic_file.")</title>

</head>";
error_reporting (0);
switch ($Errcode){
case 3:
$Errmsg= "Licenza scaduta" ;
$msg='<li class=Stile3>Contattare lo sviluppatore per ottenere una licenza.</li>';

break;
case 4:
$Errmsg ='Licenza non valida COPIA ILLEGALE!';
break;
case 1:
$Errmsg ='Licenza non trovata';
break;
case 2:
$Errmsg ='Licenza non valida COPIA ILLEGALE!';
$msg='<li class=Stile3>Contattare lo sviluppatore per ottenere una licenza.</li>';
break;
case 5:
$Errmsg ='Licenza non valida COPIA ILLEGALE!';
$msg='<li class=Stile3>Contattare lo sviluppatore per ottenere una licenza.</li>';
break;
default:
$Errmsg='Errore ('.$Errcode.') non gestito ';
}
echo "$Errmsg";
echo "$msg"
echo "$Err_msg"
echo"</body></html>";
}

Spero di esserti stato utile

un 'altra cosa....
devi escludere dalla licenza il file erroandler.php con il parametro --excludelic
View user's profileFind all posts by picmauroy2kSend private message
errorhandler.php example ?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic