Si vi la documentacion de pack, pero... eh aqui que tengo un monton de unsigned int's a escribir en little endian y pack contempla solo unsigned int en el order del servidor :S
Alguna sugerencia?
Saludos
Alguna sugerencia?
Saludos
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúCita de: Terranius en 9 Enero 2007, 14:56 PM
Para usar MySQL con PHP 5, necesitas MySQLi
Las funciones son las mismas, pero en vez de mysql_connect(), es mysqli_connect () y asi las demas.
Busca info sobre el tema, porque yo aun estoy verde, pero te aseguro que es asi. En php.net o en Mysql.org encontraras mas info.
Salu2
<?php
/* Check constants */
if(!defined('KERNELBASE')) trigger_error("KERNELBASE not defined.", E_USER_ERROR);
if(!defined('SELFLOC')) trigger_error("SELFLOC not defined.", E_USER_ERROR);
/* Include base API */
require_once(KERNELBASE.'core/Base.php');
require_once(KERNELBASE.'core/Library.php');
require_once(KERNELBASE.'core/KernelException.php');
/* Core class */
class TWS_Core extends TWS_Base
{
private $objects = array();
public $config;
/* Default constructor */
public function __construct()
{
/* Call TWS_Base constructor */
parent::__construct('TWS_Core');
/* Define kernel constants */
define('KERNELVERSION', '3.0');
define('KERNELSTATUS', '1');
}
private function __get($prop)
{
if(isset($this->objects[$prop]))
{
return $this->objects[$prop];
} else {
throw new KernelException("TWS_Core::__get", "Attemp to read from undefined property($prop).");
}
}
private function __set($prop, $value)
{
if(isset($this->objects[$prop]))
{
return $this->objects[$prop];
} else {
throw new KernelException("TWS_Core::__set", "Attemp to write to undefined property($prop).");
}
}
private function __isset($prop)
{
return isset($this->objects[$prop]);
}
private function __unset($prop)
{
if(isset($this->objects[$prop]))
{
unset($this->objects[$prop]);
} else {
throw new KernelException("TWS_Core::__unset", "Attemp to delete undefined property($prop).");
}
}
/* Kernel start-up routine */
public final function core_start()
{
/* Disable magic quotes */
set_magic_quotes_runtime(0);
/* Load config */
include(KERNELBASE.'config/core.conf.php');
$this->config = $core;
/* Load DataBaseEngine */
try {
$this->load_library('DataBaseEngine');
/* Start database engine */
$this->db->start_engine();
/* Load the other basic libraries */
$this->load_library('LoadableModule');
$this->load_library('LoadableTemplate');
$this->load_library('DynamicMenu');
} catch(KernelException $e) {
$e->printKernelPanic();
die();
}
}
public final function load_library($class, $instantiate = true)
{
if (isset($this->objects[$class]))
{
return;
}
if (file_exists(KERNELBASE.'core-libs/'.$class.'.lib.php'))
{
require(KERNELBASE.'core-libs/'.$class.'.lib.php');
}
else
{
if (file_exists(KERNELBASE.'libs/'.$class.'.lib.php'))
{
require(KERNELBASE.'libs/'.$class.'.lib.php');
}
else
{
throw new KernelException("TWS_Core::load_library", "Can't load the requested library(".$class."). The library doesn't exists.");
return;
}
}
if ($instantiate)
{
$class_name = 'TWS_'.$class;
if(class_exists($class_name))
{
$tmp =& new $class_name(&$this);
$this->objects[$tmp->get_kernel_var()] = $tmp;
} else {
throw new KernelException("TWS_Core::load_library", "Can't load the requested library(".$class."). The library is corrupted.");
}
}
return;
}
public final function get_loaded_libraries()
{
return $this->objects;
}
public final function install_library($location)
{
if(file_exists($location))
{
copy($location, KERNELBASE.'libs/');
}
return;
}
public final function uninstall_library($name)
{
if(file_exists(KERNELBASE.'libs/'.$name.'.lib.php'))
unlink(KERNELBASE.'libs/'.$name.'.lib.php');
}
}
?>
$core->nombre_libreria
$core->load_library("LoadableModule");
$core->modules->add_module($module_descriptor);
if ($instantiate)
{
$class_name = 'TWS_'.$class;
if(class_exists($class_name))
{
$this->objects[$class] =& new $class_name();
$kernel_var = $this->objects[$class]->get_kernel_var();
$this->$kernel_var = $this->objects[$class]; // ACA es el error!
} else {
trigger_error("Kernel panic: Can't load the requested library(".$class."). The library is corrupted.", E_USER_ERROR);
}
}