Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Pessoal.
Tenho um sistema de e-mail em php4 e preciso converter para php5.
Como devo fazer?
Existe algum programa para isso?
Exemplo, tenho este código:
<?
error_reporting(0);
$sess_save_path = "./tmp/";
function open ($save_path, $session_name) {
global $sess_save_path, $sess_session_name;
$sess_save_path = $save_path;
$sess_session_name = $session_name;
return(true);
}
function close() {
return(true);
}
function read ($id) {
global $sess_save_path, $sess_session_name;
$sess_file = "$sess_save_path/sess_$id";
if ($fp = @fopen($sess_file, "r")) {
$sess_data = @fread($fp, @filesize($sess_file));
return($sess_data);
} else {
return("");
}
}
function write ($id, $sess_data) {
global $sess_save_path, $sess_session_name;
$sess_file = "$sess_save_path/sess_$id";
if ($fp = @fopen($sess_file, "w")) {
return(fwrite($fp, $sess_data));
} else {
return(false);
}
}
function destroy ($id) {
global $sess_save_path, $sess_session_name;
$sess_file = "$sess_save_path/sess_$id";
return(@unlink($sess_file));
}
function gc ($maxlifetime) {
return true;
}
session_set_save_handler ("open", "close", "read", "write", "destroy", "gc");
session_start();
session_start();
require_once _LIBPATH . "common.php";
require_once _LIBPATH . "xml.php";
require_once _LIBPATH . "template.php";
require_once _LIBPATH . "config.php";
require_once _LIBPATH . "html.php";
require_once _LIBPATH . "database.php";
require_once _LIBPATH . "vars.php";
require_once _LIBPATH . "library.php";
require_once _LIBPATH . "sqladmin.php";
require_once _LIBPATH . "forms.php";
require_once _LIBPATH . "sendmail.php"; var $html;
} var $admin;
var $html;
function CSite($xml , $admin = true) {
global $_CONF , $base;
$this->admin = $admin;
$tmp_config = new CConfig($xml);
$_CONF = $tmp_config->vars["config"];
if ($this->admin) {
if (is_array($_CONF["templates"]["admin"])) {
foreach ($_CONF["templates"]["admin"] as $key => $val) {
if ($key != "path")
$this->templates[$key] = new CTemplate($_CONF["templates"]["admin"]["path"] . $_CONF["templates"]["admin"][$key]);
}
}
} else {
if (is_array($_CONF["templates"])) {
foreach ($_CONF["templates"] as $key => $val) {
if (($key != "path" ) && ($key != "admin"))
$this->templates[$key] = new CTemplate($_CONF["templates"]["path"] . $_CONF["templates"][$key]);
}
}
}
$base = new CBase();
$base->html = new CHtml();
$this->html = &$base->html;
if (is_array($_CONF["database"])) {
$this->db = new CDatabase($_CONF["database"]);
if ($_CONF["tables"]["vars"]) {
$this->vars = new CVars($this->db , $_CONF["tables"]["vars"]);
$base->vars = &$this->vars;
}
$this->tables = &$_CONF["tables"];
}
}
function TableFiller($item) {
if (file_exists("pb_tf.php")) {
include("pb_tf.php");
}
}
function Run() {
global $_TSM , $_SITE_IDENTITY_CODE ;
if (file_exists("pb_events.php")) {
include("pb_events.php");
$_TSM["PB_EVENTS"] = @DoEvents($this);
}
if (is_object($this->templates["layout"])) {
echo $this->templates["layout"]->Replace($_TSM) . $_SITE_IDENTITY_CODE ;
}
}
}
?>
Preciso passar para PHP5
Att.
Henrique Flausino
Carregando comentários...