Re: dynamically loadable php files



kishore.sainath@xxxxxxxxx wrote:
>
> I have created a set of classes in PHP for internal use in the company.
>
> Hence I don't explicitly want to "require" or "require_once" them
> whenever required.
>
> I want to make the library loadable on demand just like mysql or other
> libraries in php.

MySQL library usually is NOT loadable "on demand". It is loaded
at the server startup.

> I want people to use the classes in my library without "requiring"
> anything.

Then use the auto_prepend_file directive in php.ini. This way,
PHP will parse your file(s) every time it parses anything, and
your classes will be available to any PHP script on your server
without explicitly incluing/requiring them.

> In a nutshell, I want to make my PHP library a .so file in Linux
> and a .dll file in Windows.
>
> How do I achieve this?

You can't. If you want to use the extension mechanism, you have to
write your extension in C.

Cheers,
NC

.



Relevant Pages

  • Re: error: syntax error before "_X_SENTINEL"
    ... freefont-ttf-20060126 Free UCS Outline Fonts ... libmcrypt-2.5.7_2 Multi-cipher cryptographic library (used in PHP) ... php4-bcmath-4.4.2_2 The bcmath shared extension for php ... pkg-config-0.20_2 A utility to retrieve information about installed libraries ...
    (freebsd-stable)
  • Fwd: php extensions compile error
    ... Subject: php extensions compile error ... checking for C compiler default output file name... ... checking for PHP extension directory... ... libgnome-2.10.0_1 Libraries for GNOME, a GNU desktop environment ...
    (freebsd-hackers)
  • Fwd: php extensions compile error
    ... Subject: php extensions compile error ... checking for C compiler default output file name... ... checking for PHP extension directory... ... libgnome-2.10.0_1 Libraries for GNOME, a GNU desktop environment ...
    (freebsd-questions)
  • Upgrading 5.3 > 6.0 buildworld failure in libkrb5
    ... gnomelibs-1.4.2_3 Libraries for GNOME, a GNU desktop environment ... kdeaccessibility-3.4.3 Accessibility applications for KDE ... libmcrypt-2.5.7_1 Multi-cipher cryptographic library (used in PHP) ... php4-bcmath-4.4.1_3 The bcmath shared extension for php ...
    (freebsd-stable)
  • RE: apache13_modssl + mod_php4 + php4-extenstions +mysql323-*+myphpadmin = ...
    ... XFree86-libraries-4.4.0_3 XFree86-4 libraries and headers ... libmcrypt-2.5.7_1 Multi-cipher cryptographic library (used in PHP) ... pear-Archive_Tar-1.2 PEAR tar file management class ... php4-domxml-4.3.10_2 The domxml shared extension for php ...
    (freebsd-questions)