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

Make an object-oriented Frontend for pfSense

Scheduled Pinned Locked Moved Development
4 Posts 2 Posters 746 Views
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 Oct 31, 2018, 5:12 AM Oct 29, 2018, 11:10 AM

    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
    • J
      jimp Rebel Alliance Developer Netgate
      last edited by Oct 29, 2018, 3:44 PM

      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 Oct 29, 2018, 4:48 PM

        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
        • J
          jimp Rebel Alliance Developer Netgate
          last edited by Oct 29, 2018, 4:52 PM

          @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
          4 out of 4
          • First post
            4/4
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
            This community forum collects and processes your personal information.
            consent.not_received