php-general Digest 7 Jan 2012 01:13:46 -0000 Issue 7638

Topics (messages 316198 through 316207):

Re: How to find where class is used?
        316198 by: Curtis Maurand
        316199 by: Nilesh Govindarajan
        316200 by: richard gray
        316201 by: Nilesh Govindarajan
        316205 by: Dotan Cohen

Re: Printing
        316202 by: Alejandro Michelin Salomon

passing variables to php script
        316203 by: David Savage
        316206 by: Ashley Sheridan

Re: PDF Printing instead?
        316204 by: Robert Williams

Non required argument
        316207 by: Donovan Brooke

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---

it will be somewhere in php's search path. you'd be better off trying search for a file of the same name.

cd /usr/lib/php5
find . -iname "vB_ProfileBlock*"

if you have locate installed, try: "locate vB_ProfileBlock"

Cheers,
Curtis

On 1/6/2012 6:11 AM, Dotan Cohen wrote:
In a large application that I am tasked with maintaining (vBulletin)
there is a particular class that is used:
vB_ProfileBlock_VisitorMessaging. I know the file that it is defined
in, but I cannot find the file that actually creates a
vB_ProfileBlock_VisitorMessaging object. I tried the brute-force grep
approach, but the only place where I see the class mentioned is in the
class declaration itself:
[dev@localhost forum]$ grep -ir "vB_ProfileBlock_VisitorMessaging" *
includes/class_profileblock.php:class vB_ProfileBlock_VisitorMessaging
extends vB_ProfileBlock

I know that this class is used as there is a page that is obviously
using it. I have tried playing be-the-PHP-parser with that file, but
it goes on to include() about a dozen other files, each of which
include() another dozen files! This server does not and cannot have a
debugger. What else can I do to find where this class object is
created?

Thanks.



--- End Message ---
--- Begin Message ---
On Fri, Jan 6, 2012 at 5:08 PM, Curtis Maurand <cur...@maurand.com> wrote:
>
> it will be somewhere in php's search path.  you'd be better off trying
> search for a file of the same name.
>
> cd /usr/lib/php5
> find . -iname "vB_ProfileBlock*"
>
> if you have locate installed, try: "locate vB_ProfileBlock"
>

This works if vBulletin was installed as a system package. No other
package directly installs in php include paths.

OP should try this: grep -ir 'class vb_profileblock' <path to root of
vBulletin installation>

-- 
Nilesh Govindarajan
http://nileshgr.com

--- End Message ---
--- Begin Message ---
On 06/01/2012 12:11, Dotan Cohen wrote:
In a large application that I am tasked with maintaining (vBulletin)
there is a particular class that is used:
vB_ProfileBlock_VisitorMessaging. I know the file that it is defined
in, but I cannot find the file that actually creates a
vB_ProfileBlock_VisitorMessaging object. I tried the brute-force grep
approach, but the only place where I see the class mentioned is in the
class declaration itself:
[dev@localhost forum]$ grep -ir "vB_ProfileBlock_VisitorMessaging" *
includes/class_profileblock.php:class vB_ProfileBlock_VisitorMessaging
extends vB_ProfileBlock

I know that this class is used as there is a page that is obviously
using it. I have tried playing be-the-PHP-parser with that file, but
it goes on to include() about a dozen other files, each of which
include() another dozen files! This server does not and cannot have a
debugger. What else can I do to find where this class object is
created?

Thanks.
Can you not put a debug_print_backtrace() in the class constructor?


--- End Message ---
--- Begin Message ---
On Fri, Jan 6, 2012 at 6:35 PM, richard gray <r...@richgray.com> wrote:
> On 06/01/2012 12:11, Dotan Cohen wrote:
>>
>> In a large application that I am tasked with maintaining (vBulletin)
>> there is a particular class that is used:
>> vB_ProfileBlock_VisitorMessaging. I know the file that it is defined
>> in, but I cannot find the file that actually creates a
>> vB_ProfileBlock_VisitorMessaging object. I tried the brute-force grep
>> approach, but the only place where I see the class mentioned is in the
>> class declaration itself:
>> [dev@localhost forum]$ grep -ir "vB_ProfileBlock_VisitorMessaging" *
>> includes/class_profileblock.php:class vB_ProfileBlock_VisitorMessaging
>> extends vB_ProfileBlock
>>
>> I know that this class is used as there is a page that is obviously
>> using it. I have tried playing be-the-PHP-parser with that file, but
>> it goes on to include() about a dozen other files, each of which
>> include() another dozen files! This server does not and cannot have a
>> debugger. What else can I do to find where this class object is
>> created?
>>
>> Thanks.
>
> Can you not put a debug_print_backtrace() in the class constructor?
>
>
>

That should do the job IMO.
Btw, ignore my earlier reply. I thought the task was to find where the
class was defined.

-- 
Nilesh Govindarajan
http://nileshgr.com

--- End Message ---
--- Begin Message ---
On Fri, Jan 6, 2012 at 15:05, richard gray <r...@richgray.com> wrote:
> Can you not put a debug_print_backtrace() in the class constructor?
>

Thanks, that might have worked.

In the end, I found it by grepping for VisitorMessaging instead of
vB_ProfileBlock_VisitorMessaging. It turns out that there is an array
of the vB_ProfileBlock_* classes and they are called by
vB_ProfileBlock_$className. I personally consider that terrible coding
practice, but then again if vBulletin were well-coded then I would
probably be made redundant so I cannot complain!

Thanks for the help and for the ideas!

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

--- End Message ---
--- Begin Message ---
Jim:

The TCPDF software library does not need php pdf functions. Is 100% php
code.
To use only put a require_once '/tcpdf/tcpdf.php'; lik this.

Create a new instance:
$pdf = new TCPDF( 'P', 'mm', 'A4', true, 'UTF-8', false);

And call the methods.

The library has a folder with a lot of examples.

Alejandro MS

-----Mensagem original-----
De: Jim Giner [mailto:jim.gi...@albanyhandball.com] 
Enviada em: quinta-feira, 5 de janeiro de 2012 17:13
Para: Alejandro Michelin Salomon
Assunto: Re: [PHP] Printing

I don't know what you mean.  How do I create a pdf with php?  Do I have to
have my host install a package or something?
----- Original Message -----
From: "Alejandro Michelin Salomon" <amichel...@hotmail.com>
To: "'Jim Giner'" <jim.gi...@albanyhandball.com>
Sent: Thursday, January 05, 2012 2:01 PM
Subject: RES: [PHP] Printing


> Jim:
>
> You do not need PDF printer drivers.
>
> This lib create a PDF file with 100% PHP code.
>
> When the creation is done, you chose what to do:
>
> Save a file to download or send directly to the browser.
>
> Example;
>
> // reset pointer to the last page
> $pdf->lastPage();
>
> //Close and output PDF document
>
> if ( trim( $sFile ) != '' )
>    $pdf->Output( $sFile, 'F' ); // Save to file else
>    $pdf->Output(); // Send to browser directly
>
>
> Alejandro MS
> -----Mensagem original-----
> De: Jim Giner [mailto:jim.gi...@albanyhandball.com]
> Enviada em: quinta-feira, 5 de janeiro de 2012 16:55
> Para: Alejandro Michelin Salomon
> Assunto: Re: [PHP] Printing
>
> I have several pdf printer drivers.  HOw do I use them in a hosted php
> script?
> ----- Original Message -----
> From: "Alejandro Michelin Salomon" <amichel...@hotmail.com>
> To: "'Jim Giner'" <jim.gi...@albanyhandball.com>
> Cc: "Pgsql-General" <pgsql-gene...@postgresql.org>
> Sent: Thursday, January 05, 2012 1:50 PM
> Subject: RES: [PHP] Printing
>
>
>> Jim :
>>
>> TCPDF software library has excellent examples to teach you how to do
>> the work
>>
>> http://www.tcpdf.org/
>>
>> My legal documents mix images, barcode, etc. All the problems printing
>> go to space!!!!
>>
>> Alejandro MS
>>
>>
>> -----Mensagem original-----
>> De: Jim Giner [mailto:jim.gi...@albanyhandball.com]
>> Enviada em: quinta-feira, 5 de janeiro de 2012 16:46
>> Para: Alejandro Michelin Salomon
>> Assunto: Re: [PHP] Printing
>>
>> a pdf would solve the problem.
>> ----- Original Message -----
>> From: "Alejandro Michelin Salomon" <amichel...@hotmail.com>
>> To: "'Jim Giner'" <jim.gi...@albanyhandball.com>
>> Cc: "Pgsql-General" <pgsql-gene...@postgresql.org>
>> Sent: Thursday, January 05, 2012 1:43 PM
>> Subject: RES: [PHP] Printing
>>
>>
>>> Jim:
>>>
>>> I think the problems is that trying to print directly from PHP is not
>>> a good idea.
>>>
>>> Example:
>>> My system is in a host that is located in other city, so the printer
>>> is near my, but the PHP code is running in other place almost 1800kms
>>> between the printer and the PHP system.
>>>
>>> My customer use the system a prints from html page generated. When a
>>> need specific printing, I create a PDF file on the fly with TCPDF
>>> software library.
>>> I use this lib to create a printable version of a legal document as
>>> PDF on the fly, open directly in the Firefox o IE
>>>
>>> Is your server running near the printer?
>>>
>>> Is so specific that create a PDF file does not resolve the problem?
>>>
>>> Alejandro MS
>>>
>>> -----Mensagem original-----
>>> De: Jim Giner [mailto:jim.gi...@albanyhandball.com]
>>> Enviada em: quinta-feira, 5 de janeiro de 2012 13:55
>>> Para: php-gene...@lists.php.net
>>> Assunto: Re: [PHP] Printing
>>>
>>>>
>>>
>>> I can't tell you much on this, because I don't use windows. You have
>>> to get the source at http://pecl.php.net/printer and compile it. I
>>> don't know the procedure, etc.
>>>
>>> --
>>> Nilesh Govindarajan
>>> http://nileshgr.com
>>>
>>> That was a short trip.  Clicked on the link for documentation and it
>>> takes me right back to the php manual pages that I'd already read.
>>> Clicked on the link to download the latest and it's a dead link.
>>>
>>> Does anyone print from their php websites??
>>>
>>>
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
>>> http://www.php.net/unsub.php
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>
>
>
>
>
> 




--- End Message ---
--- Begin Message ---
OK...I admit I'm new at this....I have this html file:
<html>
<head>
<title>Generate pdf file of LD, Toll Free, and Directory Assistance calls</titl
</head>
<body>
<form action="Q:\ASTERISK\callrecs.php" method="post">
 <p>Account Number: <input type="text" name="acctnum" ></p>
 <p>Year (4 digit): <input type="text" name="billyear" ></p>
 <p>Month (2 digit): <input type="text" name="billmonth" ></p>
 <p><input type="submit" /></p>
</form>
</body>
</html>

to which I would input an account number, 4 digit year, then 2 digit month.
Then click Submit.
 
What I see in the error log is:
[06-Jan-2012 11:42:21] PHP Notice:  Undefined index:  acctnum 
[06-Jan-2012 11:42:21] PHP Notice:  Undefined index:  billyear
[06-Jan-2012 11:42:21] PHP Notice:  Undefined index:  billmonth
 
where line numbers point othe the following php lines:
$who=$_POST["acctnum"];
$year_to_process=$_POST["billyear"]; ;
$month_to_process= $_POST["billmonth"];
 
 
WHAT AM I DOING WRONG ?
David
 

--- End Message ---
--- Begin Message ---
On Fri, 2012-01-06 at 11:53 -0600, David Savage wrote:

> OK...I admit I'm new at this....I have this html file:
> <html>
> <head>
> <title>Generate pdf file of LD, Toll Free, and Directory Assistance 
> calls</titl
> </head>
> <body>
> <form action="Q:\ASTERISK\callrecs.php" method="post">
>  <p>Account Number: <input type="text" name="acctnum" ></p>
>  <p>Year (4 digit): <input type="text" name="billyear" ></p>
>  <p>Month (2 digit): <input type="text" name="billmonth" ></p>
>  <p><input type="submit" /></p>
> </form>
> </body>
> </html>
> 
> to which I would input an account number, 4 digit year, then 2 digit month.
> Then click Submit.
>  
> What I see in the error log is:
> [06-Jan-2012 11:42:21] PHP Notice:  Undefined index:  acctnum 
> [06-Jan-2012 11:42:21] PHP Notice:  Undefined index:  billyear
> [06-Jan-2012 11:42:21] PHP Notice:  Undefined index:  billmonth
>  
> where line numbers point othe the following php lines:
> $who=$_POST["acctnum"];
> $year_to_process=$_POST["billyear"]; ;
> $month_to_process= $_POST["billmonth"];
>  
> 
> WHAT AM I DOING WRONG ?
> David
>  


PHP must be run on a server, it looks like you're attempting to run it
on your local drive without one. Try installing either Xampp or EasyPHP,
which will install the Apache server with PHP for you, and then you can
run your scripts over http://localhost or http://127.0.0.1 
-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On 1/5/12 14:40, "Paul M Foster" <pa...@quillandmouse.com> wrote:


>The fpdf and/or tcpdf libraries are the standard answers to this.

Depending on requirements, another good option may be Pdftk. Where TCPDF
is focused on document creation, Pdftk is focused on document
manipulation, and because it's a compiled binary that you install, it's
very fast (and easily used from PHP via exec() and family).


Regards,
Bob
--
Robert E. Williams, Jr.
Associate Vice President of Software Development
Newtek Businesss Services, Inc. -- The Small Business Authority
https://www.newtekreferrals.com/rewjr
http://www.thesba.com/







Notice: This communication, including attachments, may contain information that 
is confidential. It constitutes non-public information intended to be conveyed 
only to the designated recipient(s). If the reader or recipient of this 
communication is not the intended recipient, an employee or agent of the 
intended recipient who is responsible for delivering it to the intended 
recipient, or if you believe that you have received this communication in 
error, please notify the sender immediately by return e-mail and promptly 
delete this e-mail, including attachments without reading or saving them in any 
manner. The unauthorized use, dissemination, distribution, or reproduction of 
this e-mail, including attachments, is prohibited and may be unlawful. If you 
have received this email in error, please notify us immediately by e-mail or 
telephone and delete the e-mail and the attachments (if any).

--- End Message ---
--- Begin Message ---
Hello,

I have a simple function that contains an argument that is not required, ie:

function list_formvars($pmatch) {...


However, if I call the function without the argument, I get a warning (I'm having the app show all warnings for development):

"Warning: Missing argument 1 for list_formvars(), called in ..."

Though the function works fine, how would I go about then making argument not required. I've tried using an if statement with an isset() condition, but perhaps I don't have the syntax correct?

Anyway,
TIA for your comments.

Donovan




--
D Brooke

--- End Message ---

Reply via email to