[PHP] PHP class question

2009-05-21 Thread Peter van der Does
I have the following situation.

I wrote some software and split it up into functionality:

class core {
  function go{
  }
}

class A extends core {
  // PHP4 constructor
  function A {
$this->go();
  }

}

class B extends core {
}

In core I define functions and variables that are to be used
through out my program and to address those functions/variables I just
use $this-> .

Now I ran into a situation where class A needs to be extended with
another class. This is not my choice, it's part of a framework I have
to use.

Currently I solved this by doing this:

class A extends framework_class {
  $var core;

  // PHP4 constructor
  function A {
$this->core = new core();
$this->core->go();
  }
}

The question I have, is this a good solution, is it the only solution
or are there different ways to tackle this?
As you might see it needs to run in PHP4.

-- 
Peter van der Does

GPG key: E77E8E98
IRC: Ganseki on irc.freenode.net
Blog: http://blog.avirtualhome.com
Forums: http://forums.avirtualhome.com
Jabber ID: pvanderd...@gmail.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP class or functions to manipulate PDF metadata?

2009-04-03 Thread O. Lavell
Hi group,

I am looking for an easy way to manipulate (read, write) the metadata 
(title, subject, keywords, author) in PDF files through PHP.

Most PHP/PDF solutions I have found so far (through Google) are aimed at 
constructing PDFs from text and graphics, with lots of fancy features, 
but most of them omit metadata functions altogether.

I would also prefer something extremely lightweight that I could just 
include_once() into my script, i.e. not a module or external program. I 
am currently using pdfinfo from xpdf-utils, but it has to go.

My use case is I want to build a database with the metadata of a bunch 
(many hundreds, perhaps thousands) of PDF files in a directory on the 
server for easy search, statistics and retrieval. I also want users to be 
able to make edits to any PDF's metadata from the web.

If it can be at all avoided, I would rather not have to invent the wheel 
myself here. I have looked at the Adobe PDF specification a bit and it 
looks quite... challenging. Or should I say daunting.

Any and all suggestions are welcome. Thank you in advance.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php class that allow quick row ordering

2005-05-02 Thread Jochem Maas
Graham Anderson wrote:
Hi
I am allready using a 'rank' field now... with 1 to N :)  There are just 
so damned many of them to order manually

the up/down button solution...is there a tutorial or php class out there 
I could take a look at...
where you:
give the class a query...
the up and down links need to include the id of the item your moving
and possibly a direction value (depending on how you set your scripts up)
in order to move something up the list you have to find the item 'above' it
on the list (use sql for this). then you have to take the rank of the found item
and the requested item and swap the id (update with sql)
... alternatively you can use the fact that a select box can be multi-select
and that the order of the listed items in replicated in the GET/POST (and inside
php)  i.e. use javscript to allow a user to move items up and down a select 
box
(drag'n'drop or using up/down buttons), (warning - when your form submits all
the items in the multi-selectlist must be selected, a javascript
can be used for this.) and then on the server use the order of the list returned
from the page to re-order/rank the given users list.
get a found set back as html with these up/down buttons in each row
start ordering away with wild abandon
does this allready exist somewhere ?
g
On Apr 26, 2005, at 9:59 PM, Richard Lynch wrote:
On Tue, April 26, 2005 7:05 pm, Graham Anderson said:
lately, I'm finding myself reordering large amounts of rows populated
from a database query ...with an order_id field
this is a bit tedious re-entering every order_id  for a found set :(

Do different users get to order differently, or is there some "master"
order that all shall use?
If it's a "master" order, just put a "rank" field on the records, and 
then
make sure it's always 1 to N for the order you want.

You can create "up" and "down" buttons to alter the order fairly easily.
If each user gets to have their own order, then you're looking at a
playlist for each user, so I'd have a different table with just "ID" and
"rank" (and userID) in it and do the same sort of thing.
--
Like Music?
http://l-i-e.com/artists.htm
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php class that allow quick row ordering

2005-04-26 Thread Graham Anderson
Hi
I am allready using a 'rank' field now... with 1 to N :)  There are 
just so damned many of them to order manually

the up/down button solution...is there a tutorial or php class out 
there I could take a look at...
where you:
give the class a query...
get a found set back as html with these up/down buttons in each row
start ordering away with wild abandon

does this allready exist somewhere ?
g
On Apr 26, 2005, at 9:59 PM, Richard Lynch wrote:
On Tue, April 26, 2005 7:05 pm, Graham Anderson said:
lately, I'm finding myself reordering large amounts of rows populated
from a database query ...with an order_id field
this is a bit tedious re-entering every order_id  for a found set :(
Do different users get to order differently, or is there some "master"
order that all shall use?
If it's a "master" order, just put a "rank" field on the records, and 
then
make sure it's always 1 to N for the order you want.

You can create "up" and "down" buttons to alter the order fairly 
easily.

If each user gets to have their own order, then you're looking at a
playlist for each user, so I'd have a different table with just "ID" 
and
"rank" (and userID) in it and do the same sort of thing.

--
Like Music?
http://l-i-e.com/artists.htm
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php class that allow quick row ordering

2005-04-26 Thread Richard Lynch
On Tue, April 26, 2005 7:05 pm, Graham Anderson said:
> lately, I'm finding myself reordering large amounts of rows populated
> from a database query ...with an order_id field
> this is a bit tedious re-entering every order_id  for a found set :(

Do different users get to order differently, or is there some "master"
order that all shall use?

If it's a "master" order, just put a "rank" field on the records, and then
make sure it's always 1 to N for the order you want.

You can create "up" and "down" buttons to alter the order fairly easily.

If each user gets to have their own order, then you're looking at a
playlist for each user, so I'd have a different table with just "ID" and
"rank" (and userID) in it and do the same sort of thing.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] php class that allow quick row ordering

2005-04-26 Thread Graham Anderson
hi
lately, I'm finding myself reordering large amounts of rows populated 
from a database query ...with an order_id field
this is a bit tedious re-entering every order_id  for a found set :(

Is there a php class out there that allows you to arbitrarily order 
rows in a found setgraphically ?

 I need to arbitrarily order a simple found set like:
order_idtrack_name
1joe's track
2   jim's track
3   selwyn's track
and I need to change the order to something like:
order_idtrack_name
1   jim's track  [was order_id=2]
2joe's track [was order_id =1]
3   selwyn's track
normally, I have been entering  in an order_id field for every row in 
the found set :(

is there a class that will let me speed up reordering ?
many thanks :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP Class

2004-10-12 Thread Brent Clements
GD is your friend for images with php. If your asking how to access java
classes from PHP you may want to visit
http://www.php.net/manual/en/ref.java.php

-Brent

- Original Message - 
From: "Mulley, Nikhil" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 12, 2004 11:28 PM
Subject: [PHP] PHP Class


Hi All ,
I do not know whether to post here or not , but it always happens that I
always get the crispy answers from here.

I have JDK 1.4.2 Installed on my machine, Now I externally downloaded a Jimi
Package and I wanted to know how to install/deploy/put this Jimi ( java
Extension )in which folder.

Jimi is a Java Class for Images, I need this because I wanted to use it in
PHP.


Please any soon relevant reply  will be appreciated.

--Nikhil.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP Class

2004-10-12 Thread Mulley, Nikhil
Hi All , 
I do not know whether to post here or not , but it always happens that I always get 
the crispy answers from here.
 
I have JDK 1.4.2 Installed on my machine, Now I externally downloaded a Jimi Package 
and I wanted to know how to install/deploy/put this Jimi ( java Extension )in which 
folder.
 
Jimi is a Java Class for Images, I need this because I wanted to use it in PHP.
 
 
Please any soon relevant reply  will be appreciated.
 
--Nikhil.


[PHP] PHP class for XSL transformations?

2004-02-20 Thread memoimyself
Hello all,

I'm looking for an alternative to PHP's XSLT extension. Does anyone 
know of a good PHP class capable of performing XSL transformations?

Thanks for your time,

Erik

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Class ArrayQueue (2)

2003-10-16 Thread Marek Kilimajer
You need to read manual section about object oriented programing in php:
http://www.php.net/oop
Antonio Bologna wrote:

Sorry, here it is the code:





/* Trying to use queues in PHP, let
 * see if that works.
 */
class ArrayQueue {

var $theArray = array();
var $currentSize;
var $front;
var $back;
var $DEFAULT_CAPACITY = 10;
function increment($x) {
  if(++$x == $theArray.length)
$x = 0;
  return $x;
}
function ArrayQueue() {
  $theArray = ($DEFAULT_CAPACITY);
  ArrayQueue::makeEmpty();
}
function isEmpty() {
  return $currentSize = 0;
}
function enqueue($Obj) {
  if($currentSize == $theArray.length)
ArrayQueue::doubleQueue();
  $back = ArrayQueue::increment($back);
  $theArray[$back] = $Obj;
  $currentSize++;
}
function makeEmpty() {
  $currentSize = 0;
  $front = 0;
  $back = -1;
}
function objReturn() {
 return $front;
}
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP Class ArrayQueue (2)

2003-10-16 Thread Antonio Bologna
Sorry, here it is the code:



http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP Class ArrayQueue

2003-10-16 Thread Antonio Bologna
Hello everyone, I'm just curious, I implemented a Array Queue in php, but
not sure why is not working, this ArrayQueue is missing some functions like
doubleQueue and dequeue, but anyway I'm trying to implmeneted in php, does
anyone knows what's wrong? Thanks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP class and extends

2003-09-24 Thread Burhan Khalid
BENARD Jean-philippe wrote:

[ snip ]

Is there something to do in order that when I use
xxx_cl_app->ExecuteQuery(), there's a function ExecuteQuery() in
xxx_cl_app that do something like this :
(xxx_cl_app.php)
function ExecuteQuery(x,y) {
$tmpResult = [herited_class]->ExecuteQuery(x,y);
return array($tmpResult[1], $tmpResult[0]);
}
This might work :

$tmpResult = parent::ExecuteQuery($x,$y);

(you forgot the $)

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] PHP class and extends

2003-09-23 Thread Golawala, Moiz M (IndSys, GE Interlogix)
You can do one of 2 things. 

1. You can comment out the ExecuteQuery Function in the child class. 
2. When you call the function in the child class simply call it as 
Parent::ExecuteQuery. This way php will know what function you are trying to call. 

cheers
Moiz


-Original Message-
From: BENARD Jean-philippe
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 23, 2003 7:59 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP class and extends


Hi !

I've got a problem with class extends. I've a "top" class which
name is cl_app. xxx_cl_app is an extend of cl_app. Cl_app define a
function called "ExecuteQuery". xxx_cl_app define this function too but
this one is obsolete. Now, I want to use the cl_app "ExecuteQuery"
function in my app but there is a problem :

In the cl_app class, "ExecuteQuery" function return 2 object : 
$return = array($nb_lines, $array_results)
and the xxx_cl_app defined this function as :
$return = array($array_results, $nb_lines)

I don't want to recode all others scripts and I don't want to put the
new function code in xxx_cl_app. So here is my question :

Is there something to do in order that when I use
xxx_cl_app->ExecuteQuery(), there's a function ExecuteQuery() in
xxx_cl_app that do something like this :

(xxx_cl_app.php)
function ExecuteQuery(x,y) {
$tmpResult = [herited_class]->ExecuteQuery(x,y);
return array($tmpResult[1], $tmpResult[0]);
}

Thanks in advance !

(o_   BENARD Jean-Philippe - Consultant STERIA Infogérance
(o_   (o_   //\ RENAULT DTSI/ODPS/[EMAIL PROTECTED] * ALO * API : MLB 02C 1 14
(/)_  (\)_  V_/_   2 Av du vieil étang * 78181 MONTIGNY-LE-BRETONNEUX
   Tél : +33 1-30-03-47-83 * Fax : +33 1-30-03-42-10

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP class and extends

2003-09-23 Thread BENARD Jean-philippe
Hi !

I've got a problem with class extends. I've a "top" class which
name is cl_app. xxx_cl_app is an extend of cl_app. Cl_app define a
function called "ExecuteQuery". xxx_cl_app define this function too but
this one is obsolete. Now, I want to use the cl_app "ExecuteQuery"
function in my app but there is a problem :

In the cl_app class, "ExecuteQuery" function return 2 object : 
$return = array($nb_lines, $array_results)
and the xxx_cl_app defined this function as :
$return = array($array_results, $nb_lines)

I don't want to recode all others scripts and I don't want to put the
new function code in xxx_cl_app. So here is my question :

Is there something to do in order that when I use
xxx_cl_app->ExecuteQuery(), there's a function ExecuteQuery() in
xxx_cl_app that do something like this :

(xxx_cl_app.php)
function ExecuteQuery(x,y) {
$tmpResult = [herited_class]->ExecuteQuery(x,y);
return array($tmpResult[1], $tmpResult[0]);
}

Thanks in advance !

(o_   BENARD Jean-Philippe - Consultant STERIA Infogérance
(o_   (o_   //\ RENAULT DTSI/ODPS/[EMAIL PROTECTED] * ALO * API : MLB 02C 1 14
(/)_  (\)_  V_/_   2 Av du vieil étang * 78181 MONTIGNY-LE-BRETONNEUX
   Tél : +33 1-30-03-47-83 * Fax : +33 1-30-03-42-10

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Class for IP CIDR notation

2003-06-06 Thread Mark
Here's a quick function of the top of my head. I'm not sure if
x.x.0.x or x.0.x.x are valid IP addresses. Adjust as necessary.

255) {
  echo "First octet of IP address cannot exceed 255";
  return false;
}
$ip_list[]=implode(".",$octet);

  }
  return $ip_list;

}

$arr=cidr("192.168.1.0",23);
echo "";
print_r($arr);
echo "";


?>



--- Rob Lacey <[EMAIL PROTECTED]> wrote:
> does anyone know of a class that is able to extrapolate a list of
> IPs given an 
> address in cidr notation. I have used the Net::Netmask module in
> perl, so I 
> was just wondering if there was a PHP equivalent.
> 
> Thanks
> 
> Rob
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP Class for IP CIDR notation

2003-06-05 Thread Rob Lacey
does anyone know of a class that is able to extrapolate a list of IPs given an 
address in cidr notation. I have used the Net::Netmask module in perl, so I 
was just wondering if there was a PHP equivalent.

Thanks

Rob

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] PHP - class question

2002-08-14 Thread Tom Rogers

Hi,

Thursday, August 15, 2002, 5:17:00 AM, you wrote:
MA> Well, I actually have a full db class which has a connect  and close method
MA> as well as query, fetch_array, etc... What I really want to know is how to
MA> use the methods in my db class from another class (myclass for example)..

MA> Do I include the db class from the myclass constructor and then set a
MA> myclass variable = to the db object?

MA> ie.

MA> class my_class {
MA> var $db;

MA> function my_class() {
MA> include('class_database.php');

MA> $this->db = new database;
MA> }

MA> ...
MA> }

MA> or is there a differnet or better way?

I set up interclass communication by having a global array for
references like this:
t;
  }
}

class b {
  var $a; //class a holder
  //constructor
  function b(){
   global $classes;
   //if the class already exists use it...
   if(is_object($classes['a'])){
  $this->a =& $classes['a'];
   }
   //otherwise create it...
   else{
  $this->a = new a();
   }
   $this->a->test();
  }
}
$a1 =& new a();
$a1->t = 'This is a test';
$b1 = new b();
?>
whether it is better depends on usage, but it should be good for a db
class so you only make the one connection :)



-- 
regards,
Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP - class question

2002-08-14 Thread Mark Armendariz

Do you know where I can find more info on how to use the  scope resolution
operator?

My searches aren't giving much (at leant not mcuh regarding php) and in the
manual, it only shows up momentarily as a note in the operators section...

Mark


"Nick Oostveen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> If you are just trying to access a classes functions without creating an
> instance of it you're probably looking to use the scope resolution
operator
> ::.  For this to work all you have to do is ensure that the definition for
> the class you wish to use is included into the file containing the class
> you are trying to call the functions from.
>
> You would then call the functions as follows:
>
> ClassName::FunctionName();
>
> At 02:43 PM 8/14/2002 -0400, you wrote:
> >Hello,  To begin.. i'm new to the list...
> >
> >I'm trying to learn good practices in OOP based PHP.  I'm actually a bit
new
> >to OOP in general, but I've done quite a bit of reading and playing
around
> >with it in the past couple of months.
> >
> >What I'm trying to figure out is the proper way to call a class from a
> >class.  I dont mean by extending the class, but actaully just getting the
> >functions...
> >
> >For instance...
> >
> >I'm trying to connect to a Database (database class) from my gen_XML
class.
> >Do I include the database class in the gen_XML constructor?  Do I set a
> >gen_XML variable as a database object (i.e. $this->mydb)?
> >
> >I hope my question makes some sense...
> >
> >Your help is appreciated...
> >
> >Mark Armendariz
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP - class question

2002-08-14 Thread Mark Armendariz

That seems more like what I'm looking for..

Thank you, Nick...

Mark



"Nick Oostveen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> If you are just trying to access a classes functions without creating an
> instance of it you're probably looking to use the scope resolution
operator
> ::.  For this to work all you have to do is ensure that the definition for
> the class you wish to use is included into the file containing the class
> you are trying to call the functions from.
>
> You would then call the functions as follows:
>
> ClassName::FunctionName();
>
> At 02:43 PM 8/14/2002 -0400, you wrote:
> >Hello,  To begin.. i'm new to the list...
> >
> >I'm trying to learn good practices in OOP based PHP.  I'm actually a bit
new
> >to OOP in general, but I've done quite a bit of reading and playing
around
> >with it in the past couple of months.
> >
> >What I'm trying to figure out is the proper way to call a class from a
> >class.  I dont mean by extending the class, but actaully just getting the
> >functions...
> >
> >For instance...
> >
> >I'm trying to connect to a Database (database class) from my gen_XML
class.
> >Do I include the database class in the gen_XML constructor?  Do I set a
> >gen_XML variable as a database object (i.e. $this->mydb)?
> >
> >I hope my question makes some sense...
> >
> >Your help is appreciated...
> >
> >Mark Armendariz
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP - class question

2002-08-14 Thread Mark Armendariz

Well, I actually have a full db class which has a connect  and close method
as well as query, fetch_array, etc... What I really want to know is how to
use the methods in my db class from another class (myclass for example)..

Do I include the db class from the myclass constructor and then set a
myclass variable = to the db object?

ie.

class my_class {
var $db;

function my_class() {
include('class_database.php');

$this->db = new database;
}

...
}

or is there a differnet or better way?

Thanks

Mark

"Steve Bradwell" <[EMAIL PROTECTED]> wrote in message
57A1618E7109D311A97D0008C7EBB3A10119EF03@KITCHENER">news:57A1618E7109D311A97D0008C7EBB3A10119EF03@KITCHENER...
> I would suggest you write a method (called mydb() for example) that
connects
> to your database, and if needed, call it from your constructor like:
> $this->mydb(); This way you can always reuse the method from other code.
>
> hth,
> Steve.
>
> -Original Message-
> From: Mark Armendariz [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 14, 2002 2:44 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP - class question
>
>
> Hello,  To begin.. i'm new to the list...
>
> I'm trying to learn good practices in OOP based PHP.  I'm actually a bit
new
> to OOP in general, but I've done quite a bit of reading and playing around
> with it in the past couple of months.
>
> What I'm trying to figure out is the proper way to call a class from a
> class.  I dont mean by extending the class, but actaully just getting the
> functions...
>
> For instance...
>
> I'm trying to connect to a Database (database class) from my gen_XML
class.
> Do I include the database class in the gen_XML constructor?  Do I set a
> gen_XML variable as a database object (i.e. $this->mydb)?
>
> I hope my question makes some sense...
>
> Your help is appreciated...
>
> Mark Armendariz
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP - class question

2002-08-14 Thread Nick Oostveen

If you are just trying to access a classes functions without creating an 
instance of it you're probably looking to use the scope resolution operator 
::.  For this to work all you have to do is ensure that the definition for 
the class you wish to use is included into the file containing the class 
you are trying to call the functions from.

You would then call the functions as follows:

ClassName::FunctionName();

At 02:43 PM 8/14/2002 -0400, you wrote:
>Hello,  To begin.. i'm new to the list...
>
>I'm trying to learn good practices in OOP based PHP.  I'm actually a bit new
>to OOP in general, but I've done quite a bit of reading and playing around
>with it in the past couple of months.
>
>What I'm trying to figure out is the proper way to call a class from a
>class.  I dont mean by extending the class, but actaully just getting the
>functions...
>
>For instance...
>
>I'm trying to connect to a Database (database class) from my gen_XML class.
>Do I include the database class in the gen_XML constructor?  Do I set a
>gen_XML variable as a database object (i.e. $this->mydb)?
>
>I hope my question makes some sense...
>
>Your help is appreciated...
>
>Mark Armendariz
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] PHP - class question

2002-08-14 Thread Steve Bradwell

I would suggest you write a method (called mydb() for example) that connects
to your database, and if needed, call it from your constructor like:
$this->mydb(); This way you can always reuse the method from other code.

hth,
Steve.

-Original Message-
From: Mark Armendariz [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 14, 2002 2:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP - class question


Hello,  To begin.. i'm new to the list...

I'm trying to learn good practices in OOP based PHP.  I'm actually a bit new
to OOP in general, but I've done quite a bit of reading and playing around
with it in the past couple of months.

What I'm trying to figure out is the proper way to call a class from a
class.  I dont mean by extending the class, but actaully just getting the
functions...

For instance...

I'm trying to connect to a Database (database class) from my gen_XML class.
Do I include the database class in the gen_XML constructor?  Do I set a
gen_XML variable as a database object (i.e. $this->mydb)?

I hope my question makes some sense...

Your help is appreciated...

Mark Armendariz



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP - class question

2002-08-14 Thread Mark Armendariz

Hello,  To begin.. i'm new to the list...

I'm trying to learn good practices in OOP based PHP.  I'm actually a bit new
to OOP in general, but I've done quite a bit of reading and playing around
with it in the past couple of months.

What I'm trying to figure out is the proper way to call a class from a
class.  I dont mean by extending the class, but actaully just getting the
functions...

For instance...

I'm trying to connect to a Database (database class) from my gen_XML class.
Do I include the database class in the gen_XML constructor?  Do I set a
gen_XML variable as a database object (i.e. $this->mydb)?

I hope my question makes some sense...

Your help is appreciated...

Mark Armendariz



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP class

2001-06-20 Thread Chris Lee

I havent used them in php/pear but here is some more info

http://www.php.net/manual/en/class.pear.php

--

  Chris Lee
  [EMAIL PROTECTED]


"Martín Marqués" <[EMAIL PROTECTED]> wrote in message
01062015390800.12018@bugs">news:01062015390800.12018@bugs...
> Can we dream of having destructors in class definition some day when
> programing in PHP?
>
> Saludos... ;-)
>
> --
> Cualquiera administra un NT.
> Ese es el problema, que cualquiera administre.
> -
> Martin Marques  |[EMAIL PROTECTED]
> Programador, Administrador  |   Centro de Telematica
>Universidad Nacional
> del Litoral
> -
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP class

2001-06-20 Thread Martín Marqués

Can we dream of having destructors in class definition some day when 
programing in PHP?

Saludos... ;-)

-- 
Cualquiera administra un NT.
Ese es el problema, que cualquiera administre.
-
Martin Marques  |[EMAIL PROTECTED]
Programador, Administrador  |   Centro de Telematica
   Universidad Nacional
del Litoral
-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]