PHP PHP basics of interviewing eleven (development environment and related configuration)

Development environment and configuration

   Version control software
      Centralized and distributed

        Centralized: When working from a central server to download the code, modify each individual person centralized version control tools, centralized storage repository on a central server, where the team members and then submitted to a central server

        Distributed: Distributed version control tool, there is no central server, each developer by clone, a complete copy of the local warehouse.

      Git and Svn

        Svn features (centralized)

          1, each repository has a unique URL, each user code and data acquired from this address

          2, obtain the updated code, and can only connect to this single repository to get the latest data synchronization

          3, submitted must have a network connection (non-local repository)

          4, submit authorization is required, if no write permissions, commit will fail

          5, submitted not succeed every time. If the other person to submit to you, you will be prompted based on an outdated version, then submit the first update.

          6, submitted to a contest of speed when conflict resolution: the fast chips, the first submission, without incident; hand Hold on, after the submission, conflicts may arise.

        Git features (distributed)

          1, Git repository in each clone are equal. You can create a repository from clone any of your own repository, and your repository can also be provided to others as the source, if you want.

          2, Git every extraction operation, is really a full backup of all the data. Submit entirely done locally, without having someone give you license your repository you call the shots, and submitted to always be successful.

          3, even based on the old version of the changes can be submitted successfully submitted will create a new branch based on the old version

          4, Git submission will not be interrupted, know your job completely satisfied, to others or others PUSH PULL your repository, the merger will happen again and PUSH PULL process, can not automatically resolve conflicts by hand you will be prompted to complete .

          5, such as conflict resolution submitted no longer SVN same race, but only to merge and conflict resolution when needed.

        Git and Svn advantages and disadvantages

          Svn advantages:

            1, easy management, logic clear, in line with the general thinking habits.

            2, easy to manage, centralized server to better ensure security.

            3, the code consistency is very high

            4, for the development of the small number of project development

          Disadvantages:

            1, the server too much pressure, database capacity surge.

            2, if not connected to the server, can not work substantially

            3, is not suitable for open source development.

 

          Git advantages:

            1, suitable for distributed development, emphasizing the individual

            2, public pressure and the amount of data the server will not be too big

            3, fast, flexible

            4, can easily resolve any conflict between two developers

            5, work offline

          Disadvantages:

            1, the learning curve is relatively long

            2, unconventional thinking

            3, poor security codes.

   Operational mechanisms and operating principles of PHP

      First talk about running PHP mechanism, saying give us a presentation of PHP modules, PHP before a total of three modules: Core, Zend engine, and extended layer; PHP core to handle requests, file streams, error handling, and other related operations; Zend engine to convert the source file into a machine language, and then run it on a virtual machine; spreading layer is a set of functions, and libraries flow, PHP use them to perform certain operations. For example, we need to connect to the MySQL database MySQL extension; Zend when executing the program might need to connect several extensions, Zend will then hand over control of expansion, and other post-processing to accomplish specific tasks back to the Zend; the final result of the program will return Zend PHP to the kernel, which then transmits the result to the SAPI layer, the final output to the browser.

      Design concepts and features of PHP

      Multi-process model: Because PHP is a multi-process model, non-interference between different requests, thus ensuring a request to hang up will not affect the overall server, of course, with the development of the times, PHP also already supports multi-threading model.

      Weakly typed language: and C / C ++, Java, C # and other languages ​​different, PHP is a weakly typed language. A type of a variable is not fixed at the beginning, the operation will determine the implicit or explicit type conversion can occur, the flexibility of this mechanism for a further web development is very convenient and efficient.

      Ext + mode Zend engine components to reduce the internal coupling

      Sapi interlayer insulating web server and php

      The syntax is simple and flexible, there are too many off specification. Style mixed results in the disadvantage, however bad programmers do not write too much out of harm global program

      

      PHP four-layer system

      Zend Engine: Zend integrally implemented in pure C, PHP is a core part, it will PHP code translation (lexical, and a series of parsing the compilation process) and a process to perform opcode implement corresponding processing methods to achieve the basic data structures (such as hashtable, oo), memory allocation and management, to provide the corresponding api method for external calls, the core of everything, all the peripheral functions are around the Zend implementation.

      Extensions: around the Zend engine, extensions provide a variety of basic services through modular way, our common variety of built-in functions (such as array series), standard libraries are implemented by extension, users can achieve according to their own needs extension to achieve function expansion, performance optimization purposes (PHP paste it as an intermediate layer in use, rich text parsing typical application is the extension).

      Sapi: Sapi stands for Server Application Programming Interface, which is server-side application programming interface, Sapi by a series of hook function, so that PHP can interact with data and peripherals, it is very elegant and PHP success of a design by the success of the PHP sapi decoupled itself and the upper application isolation, PHP can no longer consider how compatible for different applications, and the application itself can also achieve a different approach for its own characteristics.

      The upper application: This is what we usually write PHP applications, get a variety of applications in different modes sapi ways, such as by implementing a web application webserver, at the command line to run as scripts and so on.

      If PHP is a car, then the car itself is the PHP framework, Zend is the car's engine (engine), Ext following the various components that car wheels, Sapi can be seen as the highway, the car can run on different types of road on a PHP program execution while the car is running on the road. Therefore, we need: excellent performance of engines + + right wheel right track.

   PHP common configuration items

    Are zend.enable_gc open garbage collection

    safe_mode is enabled safe mode

    allow_url_include whether to allow executed by include / require a remote file

    allow_url_fopen is allowed to open remote files

    Register_globals determine whether the $ _GET, $ _ POST variables such as the contents of the array is automatically registered as global variables

    enable_dl whether to allow the use dl () to load a PHP extension function when the script runs again

    log_errors PHP error reporting function log

    error_log Error Reporting log file path

    error_reporting Error Level

    The maximum time the script can run max_execution_time

    memory_limit PHP process can take up memory

    Post_max_size POST method to limit the maximum size of the data submitted

    file_uploads whether to allow file uploads

    Max_file_uploads a maximum file upload limit to the number requested permission

    upload_tmp_dir temporary file storage path of the file upload

    Upload_max_filesize limit the maximum size of uploaded files

    session.save_path session file storage location

    session.save_handle session data storage is provided

    session.use_cookies whether to use client-side storage sessionid cookie again

    session.name setting session name

    extension_dir directory where your extensions

    date.timezone set the time zone

    Read more PHP configuration: https://www.cnblogs.com/wujuntian/p/5768336.html

Guess you like

Origin www.cnblogs.com/dcrq/p/11072042.html