3

Hello I am new to PHP programming. Sorry if my question seems silly. I already know I have to use a version control.

My doubts about the source code protection.

How can I work with other programmers in a php script without the risk of the code being stolen?

Is there a development method that helps at this point?

When someone goes to work in these large sites done in PHP or another language, they have access to all the application code or is there any work methodology to avoid this?

Thanks to anyone who can help

The answer recommends talking to install spy program to monitor. That's not what I want and that's not what I'm talking about.

I want to know if there is a structure of creation that allows developers to work in modules without having access to the full code.

1

Honestly, do you need to limit your employees exposure to the code in other modules? I'd actually advise that you let them have full access!

Here's the thing, when you bring on a new developer you want to create a relationship based on trust. You limiting their access just hinders that. Plus, you want your devs to be able to gather as much context as possible about the system and ensure that they can something that fulfills what you need and fits in with the overall system.

If your concerned about someone stealing your code, include an NDA in the employment agreement, and just go from there.

0

I want to know if there is a structure of creation that allows developers to work in modules without having access to the full code

Use the modulino pattern to run the code in one of two modes dynamically:

  • As a command-line program which accepts arguments for local development

    <?php
    function meaning_of_life() {
      return 42;
    }
    
    function main($args) {
      echo "Main: The meaning of life is " . meaning_of_life() . "\n";
    }
    
    if (preg_match("/modulino/", $_SERVER["SCRIPT_NAME"])) {
      main($argv);
    }
    ?>
    
  • As a module for integration

    <?php
    require_once "modulino.php";
    echo "Test: The meaning of life is " . meaning_of_life() . "\n";
    ?>
    

A modulino is code that can be run as a script or loaded as a module (or as a library). Thus functionality that is created in developing one script can be easily used in other scripts later.

References

  • 4
    Is "modulino" really a well-known software pattern? I've never heard the term before. – Robert Harvey Jan 26 '18 at 19:19
  • @robertharvey I never heard of the term myself until I recently stumbled upon it on Rosetta Code. It's basically the equivalent of an executable JAR, or a module with an embedded CLI that can be integrated as .dll file or run as an .exe file. – Paul Sweatte Jan 26 '18 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.