No announcement yet.

PHP Interpreter

  • Filter
  • Time
  • Show
Clear All
new posts

  • PHP Interpreter

    I've had an idea and wanted to run is buy everyone.

    At the moment we have a website with a SQL db and php pages.

    I'd like to create a server app that holds in ram the entire catalogue as static pages so I will need to read the files and include the php stuff like @extends('layouts.main')

    I wanted to know if anyone has written code to parse the php pages?

  • #2
    Not a PHP interpreter, but a BASIC engine that runs a little like PHP, and does exactly what you say and more.

    However, creating a PHP interpreter is easy. Lengthy, but easy.


    • #3
      Steve... im curious.. why do you want it to be a custom server?


      • #4
        The reason I'm thinking of a custom server is that Powerbasic is really good at data handling. Rather that the home page being rendered for each request and accessing the SQL DB, I can build the page and hold it in RAM and just deliver that. As the main CMS (written in PB Win) controls the content and when an action occurs that will change the contents of the page, I can send an update request to the customer server application which will rebuild the page in RAM again.

        IIS will need to be setup as to serve content is had like images, JS etc and when it cant find the content it will send the request to the custom server.


        • #5
          I'd like to create a server app that holds in ram the entire catalogue as static pages
          The database catalog?

          Considering any execution-time delay as being primarily due to the DB catalog access, it might make more sense to read the catalog once into something like a PowerCollection (the linked list collection?) , and build your output pages from that "as needed."

          I should think that would take far less resoirces than would replicating the catalog for multiple static pages.

          Size of catalog and number of static pages not specified.

          Michael Mattias
          Tal Systems Inc.
          Racine WI USA


          • #6
            It makes sense If you want to save server resources, and less access to the database.

            There are several ways to tackle that one, one of them being a custom web server made with PowerBASIC.
            But to be honest that is not the approach i would take.

            If you want to use PowerBASIC for that one, a simple PowerBASIC CGI script might do the job just fine, and
            the script is not necesarily big. Pretty small actually.

            For the catalogue update you can do it manually or, if your server supports it, a cron job should do. I Believe IIS
            does support cron jobs.

            Also, holding the entire catalogue in RAM can be good or bad, depending on the catalogue size. Generating
            static HTML pages and reading them from file doesnt add much overhead, while it reduces the DB access load.

            What is the size of the catalogue and how much RAM does the server have?


            • #7
              I am just trying to point out that given the specifications vacuum provided, the programmer may have resource considerations... Not that every programmer shouldn't ALWAYS consider resource usage when designing an application. .

              Also, I have a moral aversion to storing the same data in more than one place.

              Michael Mattias
              Tal Systems Inc.
              Racine WI USA


              • #8

                I did program an entire website using a pbcc cgi app.

                The entire site was driven with 404 redirect to the cgi. It read the parameters and returned the HTML. All of the data was in flat txt files so it had to read everything in to arrays. It was pretty fast even though every iteration loaded the entire catalogue (approx 7000 items)

                The new server is pretty industrial. Twin cpu's and 32gb RAM

                This is why I'm thinking of the custom server app.

                All I need to do now is to tell IIS to use for example and return the output. I'm still trying to figure that one out.