CN110874211A - PHP file access method and device - Google Patents

PHP file access method and device Download PDF

Info

Publication number
CN110874211A
CN110874211A CN201811027470.1A CN201811027470A CN110874211A CN 110874211 A CN110874211 A CN 110874211A CN 201811027470 A CN201811027470 A CN 201811027470A CN 110874211 A CN110874211 A CN 110874211A
Authority
CN
China
Prior art keywords
php
file
php file
analyzed
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811027470.1A
Other languages
Chinese (zh)
Inventor
时佳风
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201811027470.1A priority Critical patent/CN110874211A/en
Publication of CN110874211A publication Critical patent/CN110874211A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a PHP file access method and a device, wherein the method comprises the following steps: the method comprises the steps of analyzing a PHP file in advance, and loading the analyzed PHP file into a memory for long-term storage; when the PHP file needs to be accessed, determining a label corresponding to the PHP file; and searching the analyzed PHP file in the memory based on the label, and accessing the analyzed PHP file. Based on the scheme provided by the invention, the PHP file after analysis can be directly accessed, the access speed and the execution efficiency of the PHP file are greatly improved, and the development efficiency of the PHP project is correspondingly improved.

Description

PHP file access method and device
Technical Field
The invention relates to the technical field of computers, in particular to a PHP file access method and a PHP file access device.
Background
PHP (Hypertext Preprocessor) is a general open source scripting language. The grammar of the language absorbs the characteristics of C language, Java and Perl, is beneficial to learning, is widely used and is mainly suitable for the field of Web development. In the development process of the PHP project, a PHP file needs to be called from a server to realize the development of basic functions.
In the prior art, a PHP file access is usually a micro service framework based on RESTful or a PHP framework based on MVC design mode, and the basic flow of accessing the PHP file based on the above two frameworks is as follows: when a client requests a PHP file, the server transmits the PHP file request to a PHP analysis process according to the received request and filter rules such as an extension name, and the PHP analysis process calls a PHP analyzer to read the corresponding PHP file on the disk and loads the PHP file into a memory for access. Based on the prior art, each time the PHP file is accessed, the PHP file is subjected to the processes of searching, analyzing and loading the PHP file into the memory, so that the access speed and the execution efficiency of the PHP file are low, and further the project development efficiency of the PHP is low.
Disclosure of Invention
In view of the above problems, the present invention is proposed to provide a PHP file access method and apparatus that overcomes or at least partially solves the above problems, and can improve the access speed and execution efficiency of PHP files.
According to one aspect of the invention, a method for accessing a PHP file is provided, which comprises the following steps:
the method comprises the steps of analyzing a PHP file in advance, and loading the analyzed PHP file into a memory for long-term storage;
when the PHP file needs to be accessed, determining a label corresponding to the PHP file;
and searching the analyzed PHP file in the memory based on the label, and accessing the analyzed PHP file.
Optionally, the tag is written in the note of the PHP file, and has a one-to-one correspondence with the PHP file.
Optionally, when the PHP file needs to be accessed, determining the tag corresponding to the PHP file includes:
determining a top folder for storing the PHP file in a hard disk in advance;
creating an entry file, scanning the PHP file under the top-level folder in advance by the entry file, and determining the tag written in the note of the PHP file;
storing the one-to-one correspondence relationship between the PHP file and the label in the entry file;
loading the entry file into a memory for long-term storage;
and when the PHP file needs to be accessed, searching in the entry file and determining the label.
Optionally, when the tag written in the annotation of the PHP file is determined, if the tag conflicts with tags corresponding to other PHP files, error exception information is generated and displayed
Optionally, the finding the analyzed PHP file in the memory based on the tag and accessing the analyzed PHP file include:
determining the storage address of the analyzed PHP file in the memory based on the label;
and accessing the analyzed PHP file in the memory based on the storage address.
Optionally, the PHP file includes a PHP class file and/or a PHP method file.
According to another aspect of the present invention, there is also provided a PHP file access apparatus, including:
the analysis module is used for analyzing the PHP file in advance and loading the analyzed PHP file into the memory for long-term storage;
the determining module is used for determining a label corresponding to the PHP file when the PHP file needs to be accessed;
and the searching module is used for searching the analyzed PHP file in the memory based on the label and accessing the analyzed PHP file.
Optionally, the tag is written in the note of the PHP file, and has a one-to-one correspondence with the PHP file.
Optionally, the determining module includes:
the first determining unit is used for determining a top folder for storing the PHP file in a hard disk in advance;
the creating unit is used for creating an entry file, scanning the PHP file under the top-level folder in advance by the entry file and determining the tag written in the note of the PHP file;
a storage unit, configured to store, in the entry file, a one-to-one correspondence relationship between the PHP file and the tag;
the loading unit is used for loading the entry file into the memory for long-term storage;
and the second determining unit is used for searching in the entry file and determining the label when the PHP file needs to be accessed.
Optionally, when the tag written in the annotation of the PHP file is determined, if the tag conflicts with tags corresponding to other PHP files, error exception information is generated and displayed.
Optionally, the search module includes:
a third determining unit, configured to determine, based on the tag, a storage address of the analyzed PHP file in the memory;
and the access unit is used for accessing the analyzed PHP file in the memory based on the storage address.
Optionally, the PHP file includes a PHP class file and/or a PHP method file.
According to yet another aspect of embodiments of the present invention, there is also provided a computer storage medium storing computer program code which, when run on a computing device, causes the computing device to perform a PHP file access method according to any one of the above.
According to still another aspect of the embodiments of the present invention, there is also provided a computing device including:
a processor; and
a memory storing computer program code;
the computer program code, when executed by the processor, causes the computing device to perform a PHP file access method according to any one of the above.
The PHP file access method and the device can analyze the PHP file in advance, load the analyzed PHP file into the memory for long-term storage, so that when the PHP file is accessed subsequently, the analyzed PHP file can be found in the memory directly based on the label only by determining the label of the PHP file, and the analyzed file is accessed, and the PHP file is not required to be subjected to hard disk searching, analysis and loading to the memory after an access request is made every time.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments thereof, taken in conjunction with the accompanying drawings.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the alternative embodiments. The drawings are only for purposes of illustrating alternative embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a process flow diagram of a PHP file access method according to one embodiment of the invention;
FIG. 2 is a schematic structural diagram of a PHP file access device according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a PHP file access device according to an alternative embodiment of the present invention;
fig. 4 is a schematic structural diagram of a PHP file access device according to another alternative embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
It should be noted that the technical features of the embodiments and alternative embodiments of the present invention may be combined with each other without conflict.
PHP (Hypertext Preprocessor) is a general open source scripting language. The grammar absorbs the characteristics of C language, Java and Perl, is beneficial to learning, is widely used and is mainly suitable for the field of Web development. The PHP unique syntax mixes the C, Java, Perl and PHP self-created syntax. It can execute dynamic web pages faster than CGI or Perl. Compared with other programming languages, the PHP embeds programs into HTML (an application under a standard general markup language) documents to be executed, and the execution efficiency of the PHP is much higher than that of CGI (common gateway interface) which completely generates HTML marks; the PHP can also execute the compiled code, and the compiling can achieve encryption and optimized code running, so that the code runs faster.
However, each time the PHP file is accessed, the PHP file is subjected to the processes of searching, parsing and loading the PHP file into the memory, which results in low access speed and execution efficiency of the PHP file, and further results in low project development efficiency of the PHP.
In order to solve the problem of low PHP file execution efficiency caused by low PHP file access speed in the prior art, embodiments of the present invention provide a PHP file method access method, which can improve the PHP access speed as much as possible. The following is a detailed description of specific examples.
Fig. 1 is a process flow diagram of a PHP file access method according to an embodiment of the present invention, and as shown in fig. 1, the PHP file access method according to an embodiment of the present invention includes:
step S102: the PHP file is analyzed in advance, and the analyzed PHP file is loaded into the memory for long-term storage;
step S104: when the PHP file needs to be accessed, determining a label corresponding to the PHP file;
step S106: and searching the analyzed PHP file in the memory based on the label, and accessing the analyzed PHP file.
The embodiment of the invention provides a PHP file access method, which can analyze a PHP file in advance, load the analyzed PHP file into a memory and store the PHP file for a long time, so that when the PHP file is accessed subsequently, the analyzed PHP file can be found in the memory directly based on the label only by determining the label of the PHP file, and the analyzed file is accessed, and the PHP file is not required to be subjected to hard disk searching, analysis and loading to the memory after an access request is made every time, so that the access speed and the execution efficiency of the PHP file are improved, and the development efficiency of a PHP project is correspondingly improved.
The PHP file which is not analyzed and loaded into the memory cannot be directly accessed by the user, and the PHP file is analyzed and loaded into the memory after an access request is sent each time, so that the access process is very long. In the step S102, the PHP file is analyzed in advance, and the analyzed PHP file is loaded into the memory for long-term storage, so that the user can directly access the analyzed PHP file in the memory based on the access request, thereby greatly improving the access speed of the PHP file; the analyzed PHP file is stored in the memory for a long time, so that even if the accessed PHP file is accessed for a plurality of times later, the PHP file analyzed in the memory can be directly accessed based on the access request, and the access speed of the PHP file is ensured for a long time.
In the step S104, the tags corresponding to the PHP file are written in the annotations of the PHP file, and have a one-to-one correspondence relationship with the PHP file. Wherein the tags of the PHP file are written at the annotation locations of the PHP file when the PHP file was originally written, for uniquely identifying the PHP file. The degree of freedom for setting a label for the PHP file is high, and is not limited by a storage path in the hard disk of the PHP file, as long as the PHP file can be uniquely identified.
The label of the PHP file may include the function information of the PHP file corresponding to the label. The difference between the conventional microservice PHP framework based on RUSTful and the method is that the routing information of the PHP is uniformly configured, according to the label written for the PHP file in the embodiment, a user can directly obtain the storage address of the corresponding PHP file in the memory according to the determined label, so as to access the corresponding PHP file, the storage address of the PHP file is not required to be searched with great effort, and the access speed of the PHP file can be improved.
The above-mentioned tag may include some other related information of the corresponding PHP file, such as the size of the memory occupied by the PHP file, besides the function information of the PHP, and the information included in the PHP tag is not specifically limited herein.
In an alternative embodiment, step S104 may comprise: determining a top-level folder for storing the PHP file in a hard disk in advance; creating an entry file, scanning the PHP file under the top-level folder in advance by the entry file, and determining the tag written in the note of the PHP file; storing the one-to-one correspondence relationship between the PHP file and the label in the entry file; loading the entry file into a memory for long-term storage; and when the PHP file needs to be accessed, searching in the entry file and determining a corresponding label.
In this optional embodiment, all the PHP files in the hard disk are stored in the top-level folder, so that the entry file does not need to search the PHP files one by one in the local hard disk, but can directly perform reflection analysis on the tags written in all the note positions of the PHP files in the top-level folder, obtain the one-to-one correspondence relationship between the PHP files and the tags, and store the one-to-one correspondence relationship, thereby improving the efficiency of determining the tags written in the notes of the PHP files by the entry file, and enabling the entry file to store the one-to-one correspondence relationship between the PHP files and the tags more quickly.
The created entry file is equivalent to a directory of the PHP files, the entry file comprises the corresponding relation between all the PHP files and the labels of the PHP files in the top folder, and the access to any PHP file in the top folder can be realized based on the entry file. And loading the entry file in which the one-to-one correspondence relationship between the PHP file and the tag is stored into the memory, the access speed to the PHP file can be further increased.
In an optional embodiment, when the entry file determines the tags written in the annotations of the PHP file, if the determined tags conflict with tags corresponding to other PHP files, error exception information is generated and displayed.
The condition that the labels conflict mainly comprises the condition that the labels are repeated, different PHP files are written by different programmers, and when the labels are written for the PHP files, the programmers with different probabilities adopt the same labels, or the same programmer is possible to repeatedly use the labels. When the portal file can determine the tags written in the notes of the PHP file at the beginning, whether the tags of all the PHP files existing in the top folder conflict or not needs to be determined, and error abnormal information is correspondingly generated and displayed, so that managers can change the tags in time, and the condition that users cannot find the PHP files wanted by the users according to the tags is avoided.
In an alternative embodiment, step S208 may comprise: determining the storage address of the analyzed PHP file in the memory based on the label determined in the step S206; and accessing the analyzed PHP file in the memory based on the storage address.
The main function of the tag is to search the storage address of the parsed PHP file in the memory through the tag after the parsed PHP file has been loaded and stored in the memory. After the storage address of the analyzed PHP file in the memory is determined, the PHP file can be directly accessed based on the address. Unlike the prior art, the user needs to determine the storage address of the PHP file in the hard disk firstly, then analyzes the found PHP file and loads the PHP file into the memory, and for the condition that the PHP file needs to be frequently accessed, the method and the device greatly improve the access speed of the PHP file and further improve the execution efficiency of the PHP file.
In an optional embodiment, the PHP file includes a PHP class file and/or a PHP method file, wherein the tags of the PHP class file are written in the notes of the PHP class file, and the tags of the PHP method file are written in the notes of the PHP method file.
Alternatively, the entry file may perform a periodic scan of the top-level folder to determine if there are any newly added PHP files in the top-level folder. And if the newly added PHP file is confirmed in the top file folder, the entry file performs reflection analysis on the newly added PHP file to obtain and store the corresponding relationship between the newly added PHP file and the label, and then the entry file also informs the server of the message of the newly added PHP file, and the PHP file is analyzed and loaded into the memory by the server. The time interval in which the portal file performs the periodic scanning on the top-level folder may be several seconds or several minutes, which is not particularly limited by the present invention.
The specific process for acquiring the PHP file based on the invention is as follows: the method comprises the steps of creating a top-level folder for storing PHP files in a local hard disk in advance, then conducting uniform analysis processing on all the PHP files in the top-level folder, loading all the analyzed PHP files into a memory for long-term storage, conducting reflection analysis on files under the top-level folder in advance by the created entry files, determining tags written in PHP notes, storing one-to-one correspondence relation between the PHP files and the tags, searching in the entry files when an access request about the PHP files is received, determining the corresponding tags, obtaining corresponding memory storage addresses based on the searched tags, and then directly accessing the PHP files stored in the memory.
Based on the same inventive concept, the embodiment of the invention also provides a PHP file access device. Fig. 2 is a schematic structural diagram of a PHP file access apparatus according to an embodiment of the present invention, and referring to fig. 2, the PHP file access apparatus 200 at least includes a parsing module 210, a determining module 220, and a searching module 230.
The functions of the components or devices of the PHP file access device and the connection relationship between the components of the PHP file access device according to the embodiment of the present invention are described first:
the parsing module 210 is configured to parse a PHP file in advance, and load the parsed PHP file into a memory for long-term storage;
a determining module 220, coupled to the parsing module 210, configured to determine a tag corresponding to the PHP file when the PHP file needs to be accessed;
a searching module 230, coupled to the determining module 220, configured to search the analyzed PHP file in the memory based on the tag, and access the analyzed PHP file.
Based on the PHP file access device 200 provided in this embodiment, the PHP file after being analyzed in the memory can be directly accessed according to the tag, and it is not necessary to perform hard disk search, analysis, and loading on the PHP file to the memory after an access request is made each time. The access speed of the PHP file and the execution efficiency of the PHP file are greatly improved, and the development efficiency of the PHP project is further improved.
In an optional embodiment of the present invention, the tag is written in the note of the PHP file, and has a one-to-one correspondence with the PHP file.
In an alternative embodiment of the present invention, referring to fig. 3, the determining module 220 includes:
a first determining unit 221, coupled to the parsing module 210, configured to determine, in advance, a top-level folder for storing the PHP file in the hard disk;
a creating unit 222, coupled to the first determining unit 221, configured to create an entry file, where the entry file scans the PHP file in the top-level folder in advance, and determines a tag written in a note of the PHP file;
a saving unit 223 coupled to the creating unit 222, configured to save the one-to-one correspondence relationship between the PHP file and the tag in the entry file;
the loading unit 224 is coupled to the saving unit 223, and is configured to load the entry file into the memory for long-term saving;
and a second determining unit 225, coupled to the loading unit 224, for performing a lookup in the entry file to determine the tag when the PHP file needs to be accessed.
In an optional embodiment of the present invention, when determining the tag written in the annotation of the PHP file, if the tag conflicts with tags corresponding to other PHP files, error exception information is generated and displayed.
In an alternative embodiment of the present invention, referring to fig. 4, the lookup module 230 includes:
a third determining unit 231, coupled to the second determining unit 225, configured to determine, based on the tag, a storage address of the parsed PHP file in the memory;
the accessing unit 232 is coupled to the third determining unit 231, and is configured to access the parsed PHP file in the memory based on the storage address.
In an optional embodiment of the present invention, the PHP file includes a PHP class file and/or a PHP method file.
According to still another aspect of the present invention, there is also provided a computer storage medium storing computer program code which, when run on a computing device, causes the computing device to perform the PHP file statistics method in any of the above embodiments.
According to yet another aspect of the present invention, there is also provided a computing device, comprising a processor; a memory storing computer program code; the computer program code, when executed by the processor, causes the computing device to perform the PHP file statistics method of any of the embodiments described above.
The embodiment of the invention provides a high-efficiency PHP file statistical method and device, based on the method provided by the embodiment of the invention, a PHP file is analyzed in advance, the analyzed PHP file is loaded into a memory for long-term storage, so that a user can directly access the analyzed PHP file based on an acquired label when accessing the PHP file, the PHP file is not required to be subjected to hard disk search, analysis and loading into the memory after an access request is made, and the analyzed file is stored in the memory for a long time, so that the analyzed PHP file can be directly accessed into the memory even if the same file is accessed for multiple times, and the access speed of the PHP file and the execution efficiency of the PHP file are greatly improved. The tags written in the PHP file notes correspond to the PHP files one by one, so that a user can directly find the corresponding PHP files according to the tags in the entry files. The creation of the top-level folder can ensure that the entry files do not need to search PHP files one by one in a local hard disk, and further improves the efficiency. When the label of the PHP file generates a conflict, error abnormal information is generated and displayed, so that a manager can adjust and modify the conflicting information in time without influencing the access speed of a user.
It can be clearly understood by those skilled in the art that the specific working processes of the system, the apparatus and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and for the sake of brevity, the detailed description is not repeated here.
In addition, the functional units in the embodiments of the present invention may be physically independent of each other, two or more functional units may be integrated together, or all the functional units may be integrated in one processing unit. The integrated functional units may be implemented in the form of hardware, or in the form of software or firmware.
Those of ordinary skill in the art will understand that: the integrated functional units, if implemented in software and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computing device (e.g., a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention when the instructions are executed. And the aforementioned storage medium includes: u disk, removable hard disk, Read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disk, and other various media capable of storing program code.
Alternatively, all or part of the steps of implementing the foregoing method embodiments may be implemented by hardware (such as a computing device, e.g., a personal computer, a server, or a network device) associated with program instructions, which may be stored in a computer-readable storage medium, and when the program instructions are executed by a processor of the computing device, the computing device executes all or part of the steps of the method according to the embodiments of the present invention.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments can be modified or some or all of the technical features can be equivalently replaced within the spirit and principle of the present invention; such modifications or substitutions do not depart from the scope of the present invention.
According to an aspect of the embodiments of the present invention, there is provided an a1. a PHP file access method, including:
the method comprises the steps of analyzing a PHP file in advance, and loading the analyzed PHP file into a memory for long-term storage;
when the PHP file needs to be accessed, determining a label corresponding to the PHP file;
and searching the analyzed PHP file in the memory based on the label, and accessing the analyzed PHP file.
A2. The method according to A1, wherein the tag is written in the note of the PHP file and has a one-to-one correspondence with the PHP file.
A3. The method according to a2, wherein the determining the label corresponding to the PHP file when the PHP file needs to be accessed includes:
determining a top folder for storing the PHP file in a hard disk in advance;
creating an entry file, scanning the PHP file under the top-level folder in advance by the entry file, and determining the tag written in the note of the PHP file;
storing the one-to-one correspondence relationship between the PHP file and the label in the entry file;
loading the entry file into a memory for long-term storage;
and when the PHP file needs to be accessed, searching in the entry file and determining the label.
A4. The method according to a3, wherein when the tag written in the note of the PHP file is determined, if the tag conflicts with tags corresponding to other PHP files, error exception information is generated and displayed.
A5. The method according to any one of a1-a4, wherein the finding the parsed PHP file in the memory based on the tag and accessing the parsed PHP file includes:
determining the storage address of the analyzed PHP file in the memory based on the label;
and accessing the analyzed PHP file in the memory based on the storage address.
A6. The method of any of A1-A4, wherein the PHP files include PHP class files and/or PHP method files.
According to another aspect of the embodiment of the present invention, there is further provided B7. a PHP file access device, including:
the analysis module is used for analyzing the PHP file in advance and loading the analyzed PHP file into the memory for long-term storage;
the determining module is used for determining a label corresponding to the PHP file when the PHP file needs to be accessed;
and the searching module is used for searching the analyzed PHP file in the memory based on the label and accessing the analyzed PHP file.
B8. The apparatus of B7, wherein the tag is written in a note of the PHP file and has a one-to-one correspondence with the PHP file.
B9. The apparatus of B8, wherein the means for determining comprises:
the first determining unit is used for determining a top folder for storing the PHP file in a hard disk in advance;
the creating unit is used for creating an entry file, scanning the PHP file under the top-level folder in advance by the entry file and determining the tag written in the note of the PHP file;
a storage unit, configured to store, in the entry file, a one-to-one correspondence relationship between the PHP file and the tag;
the loading unit is used for loading the entry file into the memory for long-term storage;
and the second determining unit is used for searching in the entry file and determining the label when the PHP file needs to be accessed.
B10. The apparatus of B9, wherein, when the tag written in the note of the PHP file is determined, if the tag collides with tags corresponding to other PHP files, error exception information is generated and displayed.
B11. The apparatus of any one of B7-B10, wherein the lookup module comprises:
a third determining unit, configured to determine, based on the tag, a storage address of the analyzed PHP file in the memory;
and the access unit is used for accessing the analyzed PHP file in the memory based on the storage address.
B12. The apparatus of any of B7-B10, wherein the PHP files include PHP class files and/or PHP method files.
There is also provided, in accordance with another aspect of an embodiment of the present invention, c13 a computer storage medium storing computer program code which, when run on a computing device, causes the computing device to perform the PHP file access method of any one of a1-a 6.
There is also provided, in accordance with another aspect of an embodiment of the present invention, apparatus for computing, including: a processor;
a memory storing computer program code;
the computer program code, when executed by the processor, causes the computing device to perform the PHP file access method of any one of A1-A6.

Claims (10)

1. A PHP file access method comprises the following steps:
the method comprises the steps of analyzing a PHP file in advance, and loading the analyzed PHP file into a memory for long-term storage;
when the PHP file needs to be accessed, determining a label corresponding to the PHP file;
and searching the analyzed PHP file in the memory based on the label, and accessing the analyzed PHP file.
2. The method of claim 1, wherein the tag is written in an annotation of the PHP file and has a one-to-one correspondence with the PHP file.
3. The method of claim 2, wherein the determining the corresponding tag of the PHP file when the PHP file needs to be accessed comprises:
determining a top folder for storing the PHP file in a hard disk in advance;
creating an entry file, scanning the PHP file under the top-level folder in advance by the entry file, and determining the tag written in the note of the PHP file;
storing the one-to-one correspondence relationship between the PHP file and the label in the entry file;
loading the entry file into a memory for long-term storage;
and when the PHP file needs to be accessed, searching in the entry file and determining the label.
4. The method of claim 3, wherein, when determining the tag written in the annotation of the PHP file, if the tag collides with tags corresponding to other PHP files, generating and displaying error exception information.
5. The method according to any one of claims 1 to 4, wherein the finding the parsed PHP file in the memory based on the tag and accessing the parsed PHP file comprises:
determining the storage address of the analyzed PHP file in the memory based on the label;
and accessing the analyzed PHP file in the memory based on the storage address.
6. The method of any of claims 1-4, wherein the PHP file comprises a PHP class file and/or a PHP method file.
7. A PHP file access device, comprising:
the analysis module is used for analyzing the PHP file in advance and loading the analyzed PHP file into the memory for long-term storage;
the determining module is used for determining a label corresponding to the PHP file when the PHP file needs to be accessed;
and the searching module is used for searching the analyzed PHP file in the memory based on the label and accessing the analyzed PHP file.
8. The apparatus of claim 7, wherein the tag is written in an annotation of the PHP file and has a one-to-one correspondence with the PHP file.
9. A computer storage medium storing computer program code which, when run on a computing device, causes the computing device to perform the PHP file access method of any one of claims 1-6.
10. A computing device, comprising:
a processor;
a memory storing computer program code;
the computer program code, when executed by the processor, causes the computing device to perform the PHP file access method of any one of claims 1-6.
CN201811027470.1A 2018-09-04 2018-09-04 PHP file access method and device Pending CN110874211A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811027470.1A CN110874211A (en) 2018-09-04 2018-09-04 PHP file access method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811027470.1A CN110874211A (en) 2018-09-04 2018-09-04 PHP file access method and device

Publications (1)

Publication Number Publication Date
CN110874211A true CN110874211A (en) 2020-03-10

Family

ID=69716972

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811027470.1A Pending CN110874211A (en) 2018-09-04 2018-09-04 PHP file access method and device

Country Status (1)

Country Link
CN (1) CN110874211A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110131556A1 (en) * 2009-11-27 2011-06-02 International Business Machines Corporation Method, computer program and computer system for converting source code written in dynamically typed language into target code written in statically typed language and executing target code
CN102750174A (en) * 2012-06-29 2012-10-24 Tcl集团股份有限公司 Method and device for loading file
CN103268244A (en) * 2013-06-06 2013-08-28 北京奇虎科技有限公司 Method and device for loading file
CN103488517A (en) * 2013-09-10 2014-01-01 新浪网技术(中国)有限公司 PHP code compiling method and device and PHP code running method and device
CN104572194A (en) * 2014-12-30 2015-04-29 北京奇虎科技有限公司 Module loading method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110131556A1 (en) * 2009-11-27 2011-06-02 International Business Machines Corporation Method, computer program and computer system for converting source code written in dynamically typed language into target code written in statically typed language and executing target code
CN102750174A (en) * 2012-06-29 2012-10-24 Tcl集团股份有限公司 Method and device for loading file
CN103268244A (en) * 2013-06-06 2013-08-28 北京奇虎科技有限公司 Method and device for loading file
CN103488517A (en) * 2013-09-10 2014-01-01 新浪网技术(中国)有限公司 PHP code compiling method and device and PHP code running method and device
CN104572194A (en) * 2014-12-30 2015-04-29 北京奇虎科技有限公司 Module loading method and device

Similar Documents

Publication Publication Date Title
CN110059009B (en) Method and apparatus for testing code files
US9465593B2 (en) Method and apparatus for testing browser compatibility
US6647544B1 (en) Method and system for debugging hybrid source code
US8387017B2 (en) Black box testing optimization using information from white box testing
US8806452B2 (en) Transformation of computer programs and eliminating errors
JP2019053729A (en) Test method and test apparatus of smart contract
CN111367595B (en) Data processing method, program running method, device and processing equipment
CN111240653A (en) Interface document generation method and device and readable storage medium
CN111259067A (en) Method, device and equipment for realizing DAO interface based on Spring
CN114153459A (en) Interface document generation method and device
CN112612502A (en) Patch generation method, device, equipment and storage medium
US6625807B1 (en) Apparatus and method for efficiently obtaining and utilizing register usage information during software binary translation
US9116714B2 (en) Methods and systems for file processing
CN111488155A (en) Coloring language translation method
WO2015003452A1 (en) Methods and systems for file processing
CN112860265A (en) Method and device for detecting operation abnormity of source code database
CN115951890A (en) Method, system and device for code conversion between different front-end frames
CN110874211A (en) PHP file access method and device
CN110929188A (en) Method and device for rendering server page
CN114895914A (en) Log output code generation method and device, electronic equipment and storage medium
US20040177350A1 (en) Windowstm f-language interpreter
CN114003489B (en) Front-end code file detection method and device, electronic equipment and storage medium
Habibi et al. Sharif-TaaWS: a tool to automate unit testing of web services
CN113590469A (en) Useless code detection method, useless code detection device, electronic equipment and storage medium
CN114168189A (en) Vue project code translation method, device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination