Laravel 4 Getting Started video tutorial

Source: Internet
Author: User
Tags php framework
Laravel Framework is an elegant, efficient PHP framework, more and more popular at the same time the enterprise needs are gradually increasing, the same can be qualified for independent development needs, "Laravel 4 Introductory video Tutorial" will bring you to know the famous Laravel.

Course Play Address: http://www.php.cn/course/278.html

The teacher's lecture style:

The lectures are kind and natural, unpretentious, no affectation, nor deliberately rendered, but instilled, careful way, between teachers and students in a kind of equality, cooperation, harmonious atmosphere, the silent emotional exchange, the thirst for knowledge and exploration into a simple, real teaching situation, students in the quiet thinking, To gain knowledge in silent consent

The most difficult part of this video is the Message Queuing queue and message queue:

Queue configuration

Let's start by explaining how I used queue in my previous project.

Our current projects are used symfony, older projects with the symfony1.4, the new point of the project is Symfony2. Symfony with the overall feeling is very cool, especially symfony2, the overall use of a lot of Java inside the framework of the design ideas. But he doesn't support the queue. In Symfony, we also experienced several processes using the queue. The first to use Zhang Yi classmate's Httpsqs. This is simple to use, but there is a single point. After all, our project is officially outside the service, so we studied Apache's Open source project ACTIVEMQ, research found that Apache also has updated MQ, that is, Apollo. Finally we decided to use the Apollo.

Queue in our project the main application scenario is to asynchronously handle some of the more time-consuming functions, such as synchronizing third-party data, data changes the synchronization of notifications to our third-party data users and so on. Our general idea is that, in each controller, if it needs to be processed asynchronously, a JSON object is encode and plugged into Apollo. Write a work command, parse the JSON object in this command, and invoke the different methods according to the action and parameters. Running the command as a daemon on different machines, depending on the business needs, is also a scenario for implementing asynchronous multitasking applications. It was so used until Laravel was discovered. I'm going to look into it. It is not impossible to replace it if possible. Oh.

Because only then began to study, of course directly on Laravel5. Routes, controller, view are basically and symfony difference, it is not difficult to get started. Finally, consider the queue.

How to use asynchronous queues

1. Configuration

There is no introduction to the definition of the queue. We have two keys to using an asynchronous queue:

(1) Where the queue is stored
(2) Service for performing tasks
Open config/queue.php, which is the Laravel5 configuration file for the queue. First we can specify the default queue driver through the default parameter, which is sync, which is the synchronization queue, we have to do the asynchronous queue first change here. Assuming that we use database as the driver, the queue task will be stored in the databases, and we will later start a background service to handle the queue task, this is the asynchronous way.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.