Autoloading Classes in PHP: PSR-4 and Composer

preview_player
Показать описание
Learn how to load class files automatically in PHP.

‣ EXCLUSIVE hosting with Bluehost at $1.99/month:

In this project-based tutorial, code along with the instructor to learn how to organise your class files using best practices so they can be loaded automatically.

Topics covered:
• Coding standards
• PSR-1, PSR-4
• The spl_autoload_register function
• Composer's autoloader

Source code:

Related videos:

Links shown in the video:

00:00 Introduction
00:13 How NOT to do it
00:58 Classes in separate files
02:55 spl_autoload_register
04:24 PSR-1
07:34 PSR-4
12:30 Composer
14:19 dump-autoload
17:02 Summary

#PHP #composer #PSR4
Рекомендации по теме
Комментарии
Автор

Even though I already know how PSR4 and spl_autoload_register work, I still found this video is very well organized and easy to follow.
Thanks Dave!

ahmad-murery
Автор

Many thanks, Dave. Your videos are always so clear. A great pleasure to learn from you.

ianw
Автор

You can be a high paid influencer with this chill voice and clear accent. I wish to see a detailed Laravel course from your voice and significant teaching skills.

MemoryMire
Автор

This was so helpful. I have learned alot and now understand the namespace declarations and use statements in frameworks like CI4 (learning CodeIgniter 4 from your course.)

pythonantole
Автор

This is great, thanks alot for sharing sir.

sam-jzy
Автор

Thank 😍😍😍😍 am understand OOP and create class sample and route path we give more sample course OOP keep up 👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻

minutes.official
Автор

Dave, what code editor and the theme/color scheme you use in this video?

dmxd
Автор

What makes the spl_autoload_register() special? Why can't just write what is equivalent to its callback function and just use that?

MobiusCoin
Автор

Dave, thanks so much. The best handling of this topic ever.
Never seen anything near as good.

I need your help. A question please.
Too often I am forced reinstall Composer! Is that your experience?
I install it globally.
And in days, when I need it in another Project, I get the crazy message "command not found"!

What am I doing wrong. I run on Windows and Wampserver

NedumEze
Автор

The Hivemind Has Found It's Next Victim

ploob
Автор

Hi Mr.Dave, thanks for the video.
Also is missing the info that composer also is capable of load files, which can have functions or constants. Also to be a complete / detail about autoload with composer, mention about classmap and psr-0. Thanks anyway.

jediampm
Автор

Hi, Dave. Can you add a polish soundtrack? Many people from Poland are watching you. Thank you for your tutorials.

rafanarafana
Автор

I dont know why you didnt include autoload in your MVC course

tanzimibthesam
Автор

😅 my English very sample am learning languages 🤦🏻🤣 thank you 🎉🎉❤❤❤

minutes.official
Автор

I am not a fan of namespaces in PHP, i never use them

Wizatek
Автор

Please, if you make the audio track in your video Bengali, it would be beneficial for us Bangladeshis or those who follow you from my Bangladesh country. Please please bangla the audio track. ☺☺

Mr.Jacks-sq