RobA
asked on
Error: Call-time pass-by-reference
You got all the points I've got (as posted) if you can help me with this error message.
PHP Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of fsockopen(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_refer ence to true in your INI file. However, future versions may not support this any longer. in d:\debug.php on line 41 PHP Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of fsockopen(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_refer ence to true in your INI file. However, future versions may not support this any longer. in d:\debug.php on line 56
Here's the code for debug.php
<?
/*
Barcode Render Class for PHP using the GD graphics library
Copyright (C) 2001 Karim Mribti
Version 0.0.7a 2001-04-01
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Copy of GNU Lesser General Public License at: http://www.gnu.org/copyleft/lesser.txt
Source code home page: http://www.mribti.com/barcode/
Contact author at: barcode@mribti.com
*/
define(__DEBUG_HOST__, "localhost");
define(__DEBUG_PORT__, "9999");
define(__TRACE_HOST__, "localhost");
define(__TRACE_PORT__, "9999");
define(__TIMEOUT__, 3);
function __TRACE__ ($str) {
if (__TRACE_ENABLED__) {
$errno = 0;
$errstr = "no error";
$fp = @fsockopen(__TRACE_HOST__, __TRACE_PORT__, &$errno, &$errstr, __TIMEOUT__);
if ($fp)
{
@fputs($fp, $str);
@fclose($fp);
}
}
}
function __DEBUG__ ($str) {
if (__DEBUG_ENABLED__) {
$errno = 0;
$errstr = "no error";
$fp = @fsockopen(__DEBUG_HOST__, __DEGUB_PORT__, &$errno, &$errstr, __TIMEOUT__);
if ($fp)
{
@fputs($fp, $str);
@fclose($fp);
}
}
}
PHP Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of fsockopen(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_refer
Here's the code for debug.php
<?
/*
Barcode Render Class for PHP using the GD graphics library
Copyright (C) 2001 Karim Mribti
Version 0.0.7a 2001-04-01
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Copy of GNU Lesser General Public License at: http://www.gnu.org/copyleft/lesser.txt
Source code home page: http://www.mribti.com/barcode/
Contact author at: barcode@mribti.com
*/
define(__DEBUG_HOST__, "localhost");
define(__DEBUG_PORT__, "9999");
define(__TRACE_HOST__, "localhost");
define(__TRACE_PORT__, "9999");
define(__TIMEOUT__, 3);
function __TRACE__ ($str) {
if (__TRACE_ENABLED__) {
$errno = 0;
$errstr = "no error";
$fp = @fsockopen(__TRACE_HOST__,
if ($fp)
{
@fputs($fp, $str);
@fclose($fp);
}
}
}
function __DEBUG__ ($str) {
if (__DEBUG_ENABLED__) {
$errno = 0;
$errstr = "no error";
$fp = @fsockopen(__DEBUG_HOST__,
if ($fp)
{
@fputs($fp, $str);
@fclose($fp);
}
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
NOw, if I could just get this damn thing to work!
ASKER
<?php
/*
Barcode Render Class for PHP using the GD graphics library
Copyright (C) 2001 Karim Mribti
Version 0.0.7a 2001-04-01
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Copy of GNU Lesser General Public License at: http://www.gnu.org/copyleft/lesser.txt
Source code home page: http://www.mribti.com/barcode/
Contact author at: barcode@mribti.com
*/
require("debug.php");
/*************************
/** NB: all GD call's is here **/
/* Styles */
/* Global */
define("BCS_BORDER" , 1);
define("BCS_TRANSPARENT" , 2);
define("BCS_ALIGN_CENTER" , 4);
define("BCS_ALIGN_LEFT" , 8);
define("BCS_ALIGN_RIGHT" , 16);
define("BCS_IMAGE_JPEG" , 32);
define("BCS_IMAGE_PNG" , 64);
define("BCS_DRAW_TEXT" , 128);
define("BCS_STRETCH_TEXT" , 256);
define("BCS_REVERSE_COLOR"
/* For the I25 Only */
define("BCS_I25_DRAW_CHECK
/* Default values */
/* Global */
define("BCD_DEFAULT_BACKGR
define("BCD_DEFAULT_FOREGR
define("BCD_DEFAULT_STYLE"
define("BCD_DEFAULT_WIDTH"
define("BCD_DEFAULT_HEIGHT
define("BCD_DEFAULT_FONT" , 5);
define("BCD_DEFAULT_XRES" , 2);
/* Margins */
define("BCD_DEFAULT_MAR_Y1
define("BCD_DEFAULT_MAR_Y2
define("BCD_DEFAULT_TEXT_O
/* For the I25 Only */
define("BCD_I25_NARROW_BAR
define("BCD_I25_WIDE_BAR" , 2);
/* For the C39 Only */
define("BCD_C39_NARROW_BAR
define("BCD_C39_WIDE_BAR" , 2);
/* For Code 128 */
define("BCD_C128_BAR_1" , 1);
define("BCD_C128_BAR_2" , 2);
define("BCD_C128_BAR_3" , 3);
define("BCD_C128_BAR_4" , 4);
class BarcodeObject {
var $mWidth, $mHeight, $mStyle, $mBgcolor, $mBrush;
var $mImg, $mFont;
var $mError;
function BarcodeObject ($Width = BCD_DEFAULT_Width, $Height = BCD_DEFAULT_HEIGHT, $Style = BCD_DEFAULT_STYLE) {
$this->mWidth = $Width;
$this->mHeight = $Height;
$this->mStyle = $Style;
$this->mFont = BCD_DEFAULT_FONT;
$this->mImg = ImageCreate($this->mWidth,
$dbColor = $this->mStyle & BCS_REVERSE_COLOR ? BCD_DEFAULT_FOREGROUND_COL
$dfColor = $this->mStyle & BCS_REVERSE_COLOR ? BCD_DEFAULT_BACKGROUND_COL
$this->mBgcolor = ImageColorAllocate($this->
($dbColor & 0x00FF00) >> 8 , $dbColor & 0x0000FF);
$this->mBrush = ImageColorAllocate($this->
($dfColor & 0x00FF00) >> 8 , $dfColor & 0x0000FF);
if (!($this->mStyle & BCS_TRANSPARENT)) {
ImageFill($this->mImg, $this->mWidth, $this->mHeight, $this->mBgcolor);
}
__TRACE__("OBJECT CONSTRUCTION: ".$this->mWidth." ".$this->mHeight." ".$this->mStyle);
}
function DrawObject ($xres) {
/* there is not implementation neded, is simply the asbsract function. */
__TRACE__("OBJECT DRAW: NEED VIRTUAL FUNCTION IMPLEMENTATION");
return false;
}
function DrawBorder () {
ImageRectangle($this->mImg
__TRACE__("DRAWING BORDER");
}
function DrawChar ($Font, $xPos, $yPos, $Char) {
ImageString($this->mImg,$F
}
function DrawText ($Font, $xPos, $yPos, $Char) {
ImageString($this->mImg,$F
}
function DrawSingleBar($xPos, $yPos, $xSize, $ySize) {
if ($xPos>=0 && $xPos<=$this->mWidth && ($xPos+$xSize)<=$this->mWi
$yPos>=0 && $yPos<=$this->mHeight && ($yPos+$ySize)<=$this->mHe
for ($i=0;$i<$xSize;$i++) {
ImageLine($this->mImg, $xPos+$i, $yPos, $xPos+$i, $yPos+$ySize, $this->mBrush);
}
return true;
}
__DEBUG__("DrawSingleBar: Out of range");
return false;
}
function GetError() {
return $this->mError;
}
function GetFontHeight($font) {
return ImageFontHeight($font);
}
function GetFontWidth($font) {
return ImageFontWidth($font);
}
function SetFont($font) {
$this->mFont = $font;
}
function GetStyle () {
return $this->mStyle;
}
function SetStyle ($Style) {
__TRACE__("CHANGING STYLE");
$this->mStyle = $Style;
}
function FlushObject () {
if (($this->mStyle & BCS_BORDER)) {
$this->DrawBorder();
}
if ($this->mStyle & BCS_IMAGE_PNG) {
Header("Content-Type: image/png");
ImagePng($this->mImg);
} else if ($this->mStyle & BCS_IMAGE_JPEG) {
Header("Content-Type: image/jpeg");
ImageJpeg($this->mImg);
} else __DEBUG__("FlushObject: No output type");
}
function DestroyObject () {
ImageDestroy($obj->mImg);
}
}
?>