undefined
31-03-2004, 19:36
Also ich bin mir jetzt nicht mer sicher aber mein Code Stimmt soweit, Ich bekomme auch keine Fehler Meldung, jedoch schreibt er mir statt die 140 Zeilen nur die Hälft ins File. Kann bitte jemand mal Testen und mir sagen was bei im herauskommt, ich vermute so langsam das es sich um einen Bug handelt :(
class phpcodes {
private $TMPDIR;
function __construct()
{
// JB_CODES_DIR = Arbeitsverzeichnis
if ( defined( "JB_CODES_DIR" ) && is_writable( JB_CODES_DIR ) ) {
$this->TMPDIR = JB_CODES_DIR;
}
}
private function phc_read_dir()
{
$tmp = scandir( $this->TMPDIR );
if ( is_array( $tmp ) ) {
$buff = array();
foreach ( $tmp AS $fi ) {
if ( preg_match( "/^\\d+\\.[gz|bz2]$/" , $fi ) ) {
$buff[] = chop( $fi );
}
}
return $buff;
}
}
private function phc_write_files($str)
{
if ( is_string( $str ) ) {
$key = time();
$fiz = chop($this->TMPDIR . $key . ".bz2");
if ( !file_exists( $fiz ) ) {
$si = (int)strlen($str);
$fbz = bzopen( $fiz, "w" );
bzwrite( $fbz, $str, (int)$si );
$debug = bzerror ( $fbz );
bzclose( $fbz );
print_r( $debug );
return $key;
}
}
}
private function phc_read_file($in)
{
$fi = $this->TMPDIR . $in . ".bz2";
if ( file_exists( $fi ) ) {
$bz = bzopen( $fi, "r" );
$dec = bzread( $bz, filesize( $fi ) );
bzclose( $bz );
return highlight_string( stripslashes( $dec ) );
}
}
public function phc_testit($str)
{
$k = $this->phc_write_files($str);
return $this->phc_read_file($k);
}
}
?>
$codes = &new phpcodes();
echo "<pre>";
$file = preg_replace("/\\'{2,}/", "'", file_get_contents("TEST", filesize("TEST")));
print_r( $codes->phc_testit( $file ) );
echo "</pre>";
merci ;)
class phpcodes {
private $TMPDIR;
function __construct()
{
// JB_CODES_DIR = Arbeitsverzeichnis
if ( defined( "JB_CODES_DIR" ) && is_writable( JB_CODES_DIR ) ) {
$this->TMPDIR = JB_CODES_DIR;
}
}
private function phc_read_dir()
{
$tmp = scandir( $this->TMPDIR );
if ( is_array( $tmp ) ) {
$buff = array();
foreach ( $tmp AS $fi ) {
if ( preg_match( "/^\\d+\\.[gz|bz2]$/" , $fi ) ) {
$buff[] = chop( $fi );
}
}
return $buff;
}
}
private function phc_write_files($str)
{
if ( is_string( $str ) ) {
$key = time();
$fiz = chop($this->TMPDIR . $key . ".bz2");
if ( !file_exists( $fiz ) ) {
$si = (int)strlen($str);
$fbz = bzopen( $fiz, "w" );
bzwrite( $fbz, $str, (int)$si );
$debug = bzerror ( $fbz );
bzclose( $fbz );
print_r( $debug );
return $key;
}
}
}
private function phc_read_file($in)
{
$fi = $this->TMPDIR . $in . ".bz2";
if ( file_exists( $fi ) ) {
$bz = bzopen( $fi, "r" );
$dec = bzread( $bz, filesize( $fi ) );
bzclose( $bz );
return highlight_string( stripslashes( $dec ) );
}
}
public function phc_testit($str)
{
$k = $this->phc_write_files($str);
return $this->phc_read_file($k);
}
}
?>
$codes = &new phpcodes();
echo "<pre>";
$file = preg_replace("/\\'{2,}/", "'", file_get_contents("TEST", filesize("TEST")));
print_r( $codes->phc_testit( $file ) );
echo "</pre>";
merci ;)