SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Member
    Join Date
    May 2005
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP Components - does it exists?

    Is it possible in PHP to make control or component, like in ASP.NET?

    And then use that component in web applications?
    Can PHP load any kind of some thing like dll?

    Classic ASP could load ActiveX dll, and use its functionallity.

    How this problem is solved in PHP?

  2. #2
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mostarac
    How this problem is solved in PHP?
    What problem?

  3. #3
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dl

  4. #4
    SitePoint Member
    Join Date
    May 2005
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ezku
    What problem?
    Well, if some company wants to deploy some nice feature (e. g. HTML editor, charting component or datagrid) so other PHP developers can use that "something" in their web sites to make their project better, faster and easier, is it possible and how that could be done?

  5. #5
    SitePoint Addict
    Join Date
    May 2003
    Location
    The Netherlands
    Posts
    391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want to try a PHP framework PRADO is component based.

  6. #6
    SitePoint Member
    Join Date
    May 2005
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kyberfabrikken
    hi kyberfabrikken,

    I looked at your link, this part is interesting:

    if (!extension_loaded('sqlite')) {
    if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
    dl('php_sqlite.dll');
    } else {
    dl('sqlite.so');
    }
    }


    So, if platform is Windows, PHP could load common Windows dll, right?

    On Linux, it must be .so extension?

  7. #7
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hm ... my post was probably misleading. dl() loads an extension. PHP has a number of extensions which kind of equals ASP's components. Extensions are purely serverside. At windows, extensions are dll's and at linux they are so's. client-side components don't exist in php. This is because PHP work at a different level than ASP does. In PHP, you would need to use a framework (prado has been suggested, but there exist a lot out there). In ASP on the other hand, the framework is part of the language.

    You could btw. you .NET components from PHP (if the dotnet extension is installed)
    http://docs.php.net/en/class.dotnet.html

  8. #8
    SitePoint Addict mx2k's Avatar
    Join Date
    Jan 2005
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    except that classic asp is not a part of the dot net framework. its mostly vbscript

    and why in the world do you want to use activex on the web, most of it is now blocked from being used.

    php isn't a framework like dot net. php does as forementioned has a lot of frameworks, but i haven't seen one that has really topped everyone's list that a company could really benefit from creating components for those frameworks as of yet. i know that there is datagrid for wact thats similar to the dot net type.

    if you go to build something thats easy to use, you would be better off to rely on the php language and not a framework. and personally i would not rely on pear packages or obscure modules
    Last edited by mx2k; Jul 29, 2005 at 09:49.

  9. #9
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you go to build something thats easy to use, you will have rely on the php language and not a framework.
    Just roll your own I say. Start small and simple, put some fly time behind it and let it grow from there. At the end of the day, it's yours - you own it. So you'll benifit most from it, and others will benifit if the interest is there.

  10. #10
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mostarac
    Well, if some company wants to deploy some nice feature (e. g. HTML editor, charting component or datagrid) so other PHP developers can use that "something" in their web sites to make their project better, faster and easier, is it possible and how that could be done?
    Simple, they release the source as a .php file or group of .php files and allow users to include/require their code.

    PHP is interpreted remember, there's no mechanism to compile code. If you wish to "secure" code from changes, look into the Zend SafeGuard Suite. There are alternatives, such as IonCube Encoder which has good press.

    Hope this helps, remember, PHP != ASP (.NET)

  11. #11
    SitePoint Addict
    Join Date
    Apr 2002
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mostarac
    Is it possible in PHP to make control or component, like in ASP.NET?

    And then use that component in web applications?
    Yes, this popular forms generation and validation class provides means to develop custom inputs in the form of plug-in classes that can be optionally used to provide special behaviors.

    The main class provides general behavior for all kinds of HTML form inputs and then you can use plug-ins that can create composite inputs with more advanced features.

    There are more on the way but you can develop your own custom plug-in input classes.

    <advisor edit>Removed self promotional links</advisor edit>
    Last edited by Helge; Feb 16, 2006 at 08:56.
    Manuel Lemos

    Metastorage - Data object relational mapping layer generator
    PHP Classes - Free ready to use OOP components in PHP

  12. #12
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Melbourne
    Posts
    362
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mostarac
    Is it possible in PHP to make control or component, like in ASP.NET?

    And then use that component in web applications?
    As someone said earlier, PRADO is designed after ASP.NET. As an example:

    Code:
    <html>
    <head>
    <title>Hello, world!</title>
    </head>
    <body>
      <com:TForm>
        <com:TButton Text="Click me" OnClick="clickMe" />
      </com:TForm>
    </body>
    </html>
    Then the code to react to this:
    PHP Code:
    <?php
    class HomePage extends TPage
    {
       function 
    clickMe($sender,$param)
       {
           
    $sender->Text="Hello, world!";
       }
    }
    ?>
    You'll find the layout of PRADO very similar to ASP.NET

  13. #13
    SitePoint Member
    Join Date
    May 2005
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Huh, there is a lot of answers...

    Thank you all for responses, I want to make pure server side class (hope PHP has classes? ) , all functionallity will be on the server side.

    So, I can do that with pure PHP code, obfuscated with some tool to protect work, like Zend,

    or provide two or more platform dependent compiled components( .dll for Windows and .so for Linux). Probably both .dll and .so could be made with the same c++ source code? In that case, PHP must be able to run .NET dll exposed to COM as .tlb? I must try that

  14. #14
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Classes? OOP? Nah, PHP does not have them...

    Zend Encoder is good, but it can be expensive. Their Decoder is at times buggy on a number of platforms as well (depending on the setup), so I'd do some background first, as there are alternatives out there


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •