Jump to content


Photo

PHP Universal Classes


  • Please log in to reply
8 replies to this topic

#1 bholbrook

bholbrook
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 14 September 2006 - 09:29 PM

Is there a way to make a class universal to every site created on a server?

Example:

I have a DBA that I include into every site, but it'd be nice if it was just included into every site automatically.

Thanks in advance.

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,023 posts

Posted 14 September 2006 - 09:46 PM

The only way I can think to to do that would be to write it as a PHP extension dll (or .so for 'nix)
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 bholbrook

bholbrook
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 14 September 2006 - 09:50 PM

What lanuage is a .so file written in, C?

I'm unfamiliar with the actual PHP program.

I'm on a 'nix server.

#4 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,023 posts

Posted 14 September 2006 - 09:52 PM

As its OOP, C++ would be a good choice
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#5 bholbrook

bholbrook
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 14 September 2006 - 09:55 PM

Okay, thanks. Not quite what I'm looking for. This needs to be editable by PHP programmers, not C++ programmers (slight difference in salaries  ;) )

I worked on a site that had this ability, all of the classes where in a seperate folder that was available to all sites, and other classes extended them. I know it's possible, but I just dont know how.



#6 bholbrook

bholbrook
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 15 September 2006 - 05:38 PM

*** bump ***

Still unsolved, any help would be appreciated.

Barnard, could you post a link to an article re: .so files and such, thanks

#7 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,023 posts

Posted 15 September 2006 - 08:06 PM

http://www.zend.com/...on-writing1.php
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#8 bholbrook

bholbrook
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 29 September 2006 - 09:14 PM

Thanks Barand

For those interested, we used symblic linking to fic the problem.

Symbolic linking allows us to make one filder on the server for classes and then create SYMBOLIC folders in out sites. In a linux shell type:

ln -s [SOURCE DIRECTORY] [FOLDER NAME] and the folder will be created linking to the source.

#9 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,023 posts

Posted 30 September 2006 - 07:00 PM

This could be another (easier?) way

http://www.phpfreaks....html#msg443969
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users