answersLogoWhite

0

How do you make a library system in PHP?

Updated: 10/26/2022
User Avatar

Wiki User

βˆ™ 13y ago

Best Answer

Assuming that "a collection of useful functions" is the intended meaning of "library," this is essentially the same process in all languages. The primary difference from an application is that a library doesn't actually do anything; it only provides tools which other programs can use. To that end, you should ensure that your functions work for as wide a variety of use-cases as is practical. However, also be careful to not make the logic overly complex to support some corner cases.

You should first decide what the central purpose of the program is, and set about writing functions (and classes, in some cases) which satisfy that purpose. This can be done in at least two ways: by detailed pre-planning, or by quickly implementing everything according to the concept in your own head.

Detailed pre-planning is the better method (for any large program, not just libraries), but some programmers have difficulty designing a program on paper rather than in code. Even if you are unable to do this at first, try writing a simple mock-up and use it as a learning experience from which to draw ideas for your design document. Then start over, using the design document as a guide and repeat this process as many times as necessary. The primary benefit of this is that you will be less likely to get tangled up in conflicting ideas for how the program should work.

Alternatively, you can just start programming by the seat of your pants. This is commonly known within the programming community as "hacking." While it is more efficient than pre-planning for smaller bits of code, you will be more likely to write ugly, confusing code as the project grows.

In both cases, of course, proper programming style is essential. Write self-documenting code as often as possible, comment where this doesn't work, and document all functions, classes, class members, and (as necessary) global variables. And make sure to test everything frequently, perhaps setting planned features as milestones, after whose initial implementation you will run all tests to ensure that the new code didn't break old code.

Finally, very large projects are often separated into modules, which are locked from modification once they are completed. If a completed module must be modified to accomodate another, you should return to the pre-planning stage to produce a new design document, ensuring that the new implementation will be compatible with all the modules which already depend on the one to be modified.

User Avatar

Wiki User

βˆ™ 13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you make a library system in PHP?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you adjust php 5.3 code to make Wordpress Frugal website compatible with php 5.4?

Use PHP 5.4 version latest library .


What should you do to enable image functions in PHP?

Image creating and manipulating in PHP can be done with multiple libraries, some officially supported by PHP and some made by third parties. A common library, especially for developers new to image libraries, is the GD package. You must include the library you wish to use upon installation of PHP (if it is officially supported), or manually include the library into your scripts.


How can you export data from MySQL to PDF using PHP?

If you know FPDF or simlar library which helps to make a PDF file, using PHP,you will be able to write to a PDF file out of data read from mysql tables.


What are the advantages of php file system?

PHP is a scripting side language and has more key points than other development languages. The speed of PHP is fast relative to other languages because it uses many system resources. It is an open-source language that’s why it is maintained by a large group of PHP developers and the support community is more than other languages. It is easy to use because it follows the syntax of β€œC”. Those who familiar with C language can easily understand PHP. It has powerful library support you can easily find functional modules. It has built-in database functionality. These are some points that consider as core advantages of PHP.


Which mysql product is suitable for php connection?

mysql client library


What exactly is a PHP computer system?

A PHP computer system is simply a set of computers using the PHP programming language. It is used in over 200 million websites currently and was created in 1995.


Need of PHP language?

To generate output server side from files databases etc. You can also make images for example with the GD library. The possibilities are endless.


What is a PHP content management system?

A PHP content management system is a computer software management system. This is where sites and downloads are distributed through this specific type of software.


What is the Malay-utf-8.inc. php file?

This particular file is a file specific to the PHP program or script you are using. It is not a "php system file".


How do you make an account system in PHP?

If you would like to code this by yourself, you need to understand SQL language and php, and also (maybe) html. But, you can also find some scripts to download for free, like this one: free-php-login-script.com. It works great!


What problems can PHP sleep cause when writing PHP code?

On earlier versions of PHP, when PHP sleep was called on Windows machines, it returned an error. The command can also be interrupted by the Operating System.


Can you play 3d games in php?

All 3DS games are designed to make use of the system's 3D capabilities.