Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Diploma_Les_Miras.docx
Скачиваний:
0
Добавлен:
01.07.2025
Размер:
2.13 Mб
Скачать

2.1.2.3. Composer

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

Composer is not a package manager in the same sense as Yum or Apt are. Yes, it deals with "packages" or libraries, but it manages them on a per-project basis, installing them in a directory (e.g. vendor) inside your project. By default it does not install anything globally. Thus, it is a dependency manager. It does however support a "global" project for convenience via the global command.

Suppose:

  1. You have a project that depends on a number of libraries.

  2. Some of those libraries depend on other libraries.

Composer:

  1. Enables you to declare the libraries you depend on.

  2. Finds out which versions of which packages can and need to be installed, and installs them (meaning it downloads them into your project).

Using Laravel Composers allows you to have clean code without duplicating any of the data. Though there are many different ways of doing this, the way in this guide is, in my opinion, the correct way of doing it using Laravel Composers.

composer create-project laravel/laravel blog "5.1.*"

Code syntax 2.4 Create new Laravel project via composet

2.1.2.4. Artisan cli

A developer has to usually interact with the Laravel framework using a command line that creates and handles the Laravel project environment. Laravel provides built-in tool for command-line called Artisan. This tool allows us to perform the majority of those repetitive and tedious programming tasks that most of the developers avoid to perform manually.

Artisan can be utilized to create a skeleton code, the database structure and build their migration which becomes very easy to manage the database system. It can also be engaged to generate the basic MVC files right away through the command-line and manage those assets and their respective configurations. Artisan even lets us create our own commands and do convenient things. Lastly, we can also perform Unit tests for our application through this.

The features of Artisan are mapped to different subcommands of the artisan command-line utility, providing functionality that aids in managing and building Laravel-based applications. Common uses of Artisan include managing database migrations and seeding, publishing package assets, and generating boilerplate code for new controllers and migrations; the latter frees the developer from creating proper code skeletons. The functionality and capabilities of Artisan can also be expanded by implementing new custom commands, which, for example, may be used to automate application-specific recurring tasks.

php artisan controller:make PhotoController

Code syntax 2.5 Create RESTful Resource Controllers via artisan command

2.1.3 MySql Database Management System

A database is a structured collection of data. It may be anything from a simple shopping list to a picture gallery or the vast amounts of information in a corporate network. To add, access, and process data stored in a computer database, you need a database management system such as MySQL Server. Since computers are very good at handling large amounts of data, database management systems play a central role in computing, as standalone utilities, or as parts of other applications.

MySQL, the most popular Open Source SQL database management system, is developed, distributed, and supported by Oracle Corporation.

  • MySQL is a database management system.

  • MySQL databases are relational.

  • MySQL software is Open Source.

  • The MySQL Database Server is very fast, reliable, scalable, and easy to use.

  • MySQL Server works in client/server or embedded systems.

  • A large amount of contributed MySQL software is available.

phpMyAdmin is a free and open source tool written in PHP intended to handle the administration of MySQL with the use of a web browser. It can perform various tasks such as creating, modifying or deleting databases, tables, fields or rows; executing SQL statements; or managing users and permissions. The software, which is available in 78 languages, is maintained by The phpMyAdmin Project.

It can import data from CSV and SQL, and transform stored data into any format using a set of predefined functions, like displaying BLOB-data as images or download-links.

Figure2.3 phpMyAdmin page

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]