Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Make an object-oriented Frontend for pfSense

    Development
    2
    4
    742
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      msdisatis
      last edited by msdisatis

      Hi guys.
      I have 2 questions about pfSense front end.
      I was wondering if we can make the pfSense front end (PHP side) object-oriented. Is it possible? What's your opinion?
      I have been read some of the front end code and I guess its possible to change the code architecture to OOP. But I am not sure.
      The second question is about /etc/inc/ folder. Is there any technical reason to place the inc files there? Why front end files separated this way?

      Thank you!

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        It could, but if someone is putting that kind of effort into rewriting the UI, why stay with PHP?

        Not everything fits the MVC style either, and some things can be made much more complex in the process than they need to be. Frameworks come and go and deprecate things right and left as they progress, so keeping something like that updated can also lead to increased ongoing maintenance.

        The reasons for using /etc/inc/ are purely historical. They should probably be in a place that respects hier(7) better, but there has not been a large motivation to move them over time.

        tl;dr: Can it be done? Yes. Should it be done? Ehhh.

        Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 2
        • M
          msdisatis
          last edited by

          Thank you for your attention jimp.

          Actually I have been think about rewriting UI in python, too! But what about extensions? How do I port pfSense PHP extensions into python?
          I don't want to use any framework, and I don't think MVC will make the code style better. I am focusing on OOP aspects, for code clearance. I want the code being clear, rather than using frameworks or MVC arch.

          1 Reply Last reply Reply Quote 0
          • jimpJ
            jimp Rebel Alliance Developer Netgate
            last edited by

            @msdisatis said in Make a PHP MVC Frontend for pfSense:

            How do I port pfSense PHP extensions into python

            Depends on what you mean by extensions. If you mean the PHP modules, you wouldn't. You'd find equivalent python libraries. If you mean the pfSense PHP module, that would have to be rewritten in something compatible with Python. If you mean packages, then that would be like rewriting any other part in another language.

            Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            1 Reply Last reply Reply Quote 2
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.