From a9da46ddfe3084539b4146df5a02a3b92b9fa118 Mon Sep 17 00:00:00 2001 From: Amigo <49749100+aamigo@users.noreply.github.com> Date: Fri, 2 Aug 2019 15:37:52 +0200 Subject: [PATCH] 9 --- ...namic-File-and-Folder-Inclusion-concept.md | 59 ++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/055-Dynamic-File-and-Folder-Inclusion-concept.md b/055-Dynamic-File-and-Folder-Inclusion-concept.md index ea4a56e..7d79345 100644 --- a/055-Dynamic-File-and-Folder-Inclusion-concept.md +++ b/055-Dynamic-File-and-Folder-Inclusion-concept.md @@ -23,5 +23,62 @@ Just being sure that the PHP which usually is a php has permission, has the righ ### Need To Set The Target Path And Relation To The Zip Package [00:04:29](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m29s) + +Then you need to still set the target path and relation to the ZIP package. You will have folders called admin. But as you can see here, I'm doing a folder called libraries/vdm_io. [00:04:45](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m45s) That means I am targeting a folder which isn't part of a component package. But because I want that folder to be installed with my component every time. I don't want to have a separate package for this library. [00:05:15](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m15s) I've improved JCB to include this package, which is, if you guys go look at this(see video) you will see that it's a composer file and I'm including some Composer Classes there, which we are now using in JCB. I'm moving it every time with each install [00:05:39](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m39s) into its place. That might be outside of convention I suppose, but there is neither rules against it. That's what we're doing. + +### JCB Detects You Are Not Targeting Normal Folders - Add A Little Script To Script Install + +[00:05:53](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m53s) + +What's nice though is that when JCB detects that you are not targeting the normal Admin or Media [00:06:02](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m02s) or Site Folder, those are the normal folders. If JCB detects you're going to be moving content into a folder that's not part of the expected component package folders, [00:06:28](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m28s) it will add a little script to the script install. So that it all move this folder into its correct place upon installation of the component or whether the component is updated. You can go look at that. In fact I can show you just briefly. I have the component open, the script file for Component Builder. I'm going to scroll down. It's obviously a huge file. [00:06:58](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m58s) At the bottom we know have this new little script. Its named a little weird,(setDynamicF0ld3rs) it doesn't conflict with any other method at anytime. It gets the details from the above methods. Then it checks whether the folders gets the dynamic install folder. It checks whether there is more than one. Then [00:07:29](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m29s) if it's one of these media, admin, site, it ignores it, because those already being deal dealt with by Joomla. If it isn't, it moves it into its correct place. This is a dangerous feature, as you can see here I'm saying you must use this with caution. Because you can literally grab with this new function, anything anywhere from your Joomla website and overwrite [00:07:59](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m59s) it anywhere on the users installation website, which could be problematic. Something you shouldn't do unless it is your right to do so. + +This is the new feature in doing dynamic movement of folders [00:08:25](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m25s) and files. What's make this all so nice if you're using these constants in your naming of your paths, and you export and import this component into another Joomla website. I mean as a JCB package. If you export a JCB package and you import it at another JCB install, it remaps these files. It export them, remaps them and move them back into place on the other install. Which really makes it very comfortable in working in a team and you want to have these [00:09:06](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m06s) files always to be the same everywhere. This is going to be very helpful for that. + +### Heads Up - Consider With Whom You Are Sharing Packages - Part Of Security + +[00:09:13](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m13s) + +I can also, because of the feature give you a little heads up that if you import a package from anyone and you do not know or you do not trust them they could move files through this method into your system, [00:09:32](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m32s) and is therefore part of security which you need to consider with whom you are sharing packages. This is so some of the feature regarding the new folder and file implementation. + +### Use EXTERNALCODE Snippet + +[00:09:49](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m49s) + +The other aspect which I mentioned earlier, were you are able to get content from anywhere works as follow. So anywhere in any custom area of JCB, where you can add custom script. [00:10:06](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m06s) You can also use this EXTERNALCODE Snippet. Now this could be a URL or it could be a folder inside of your system. This folder does not yet work with Constance, I should make it that it does. It needs to be the exact for the path of the stage. But the reality is that with this EXTERNALCODE concept, you can take [00:10:36](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m36s) for example the variable from a Gits snippet. +Let me show you. Here I have what I've called fancydate. Which is a few static functions. Which are not wrapped in the class yet. It's outside of a class. Why? Because I want to include it into my [00:11:07](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m07s) helper class with the snippet, that I can have others work with me on this code on GitHub. If any changes be made to this code, it automatically updates my system. Now I know that there is some question of security in doing so. But we've added a few little tricks in the compiler to notify you [00:11:36](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m36s) if there's been a change to the code. What that means, the first time you use that snippet to include this snippet that you've got here, you do something like Raw. Here I have basically a text file. You'd grab that URL(see video) an add it like this. You can take away [00:12:11](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m11s) the actual because currently it is bound to a specific version. Which if anybody makes a change to the snippet, you won't get the new version. Well that's the way of locking it in. But if you wanted to have it be dynamic, you can remove a part of this(see video). I think it's this part. Let me just check. Yeah that's right. [00:12:35](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m35s) Then you can use it like that. + +### Specific Piece Of Text Dynamically Added To The Back End Of Component Builder + +[00:12:38](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m38s) + +Now this specific piece of text that you see here, will dynamically be added to my component. Let me demonstrate. I've opened Component Builder in it's back end. I've gone to this Libs & Helpers tab. I'm going to scroll down to this area which is called Admin class. I will do it in the admin area so that's easily detectable. [00:13:07](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m07s) I'm going to add that snippet like that so it says EXTERNALCODE with the path of the URL. That's it. I'm going to save and close. + +### When Compiled - It Should Tell You Have Added The EXTERNALCODE To Your Component + +[00:13:19](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m19s) + +Let's go to the Compiler. Now what should happen is that the moment you've compiled this, it should tell you that you've added This kind of external code to your component. If it doesn't tell you that then something's wrong. it should tell you the first time you've add the snippet. [00:13:43](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m43s) Because it creates a hash of that snippet. In the future if it changes, you get notified. When we grab the snippet from Github and anybody in the middle tampers with it, it will notify you that the snippet was changed. If you know that it should have changed because you made a change to the Gits snippet or someone else in your team did, [00:14:15](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m15s) then obviously you'll be expecting that. You could still for safety sake go check in the code of the component where the snippet is being added to ensure that it is still accurate. I'll show you that. Let's compile this. + +### When Compile Two Messages Are Relevant To The Issue + +* First Message + +[00:14:34](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m34s) + +So we see two messages that are relevant to the issue at hand. This one is a new message which I'm not going to go into now, but it's dealing that it detected that. [00:14:50](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m50s) Remember we said we have this folder we putting inside of the Library folders and every time you'd compile, it will actually tell you that. It will tell you that it is detected it and it's added the script to the script PHP. [00:15:11](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m11s) This first line here(see video), is showing you the snippet, and it's telling you there's been added for the first time, and that you should be investigate to insure the correct code string was used. You should go to the place where the compile package, where this should have been added, go and check that it is the correct, that what you see here on GitHub, the string here, [00:15:44](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m44s) is also what you going to see in the code. That's the first thing. + +* Second Message + +[00:15:51](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m51s) + +Every time there after it should give you this little message here. It should tell you how many code strings are being added to this component as an external code, and to avoid shipping your component with malicious code string, always make sure that the correct code string values were used. Now I did tell you that if we detect a change, it will also notify you. + +### Do As Note Says: Check If It Is The Correct Code + +[00:16:16](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m16s) + +First let's go do what it said here. Let's go check that it is the correct code. I'm in the ZIP package. [00:16:25](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m25s) We see that this library folder has been added. We going to go to the admin area, helpers, open componentbuilders helper file where I added the snippet. Let's just open that and then here we have it, fancydate, and fancydatetime. [00:16:53](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m53s) + ???? -Then you need to still set the target path and relation to the ZIP package. You will have folders called admin. But as you can see here, I'm doing a folder called libraries. [00:04:45](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m45s) That means I am targeting a folder which isn't part of a component package. But because I want that folder to be installed with my component every time And I don't want to do actually have a separate A package for For this library I've actually [00:05:15](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m15s) Improved JCB to include this Package Which is basically if you guys go look at this You see that is It's basically a Composer file and I'm including some Composer Classes there which we are now using in JCB And I'm moving it Every time with each install [00:05:39](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m39s) Into its place Now That might be I'll sort of convention I suppose But there is neither rules against it I think in Yeah so That's what we're doing What's nice though is that when JCB detects that you are not targeting the normal Admin Or Media [00:06:02](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m02s) Or Image folder or site Those are the normal folders Then oh wait not Image folder is neither is that normal But did you got your three that is site admin and Media If If JCB detects you're gonna be moving content Into a folder that's not part of the Expected package component package folders [00:06:28](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m28s) It will actually add a little script To the script install So that it all move this folder into its correct place On upon installation of the component Or whether the component is updated So you can go look at that In fact I can show you just briefly So here I got the component open The Script file for component Builder I'm gonna scroll down it's obviously a huge file [00:06:58](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m58s) But here at the bottom we know have this new little script It's named a little weird so it doesn't conflict with any other method in it at anytime And basically It gets the The details from the above methods And then it checks whether The folders obviously it gets there the dynamic install folder It checks whether there is more than one And Then [00:07:29](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m29s) If it's One of these it ignores it because those already being deal dealt with by Joomla And if it isn't It actually moves it into it's correct place Now this is a dangerous featuring As you can see here I'm saying you must use this with caution because you can literally Grab With this new function Any Thing anywhere from your Joomla website and overwrite [00:07:59](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m59s) It anywhere On the Users installation website Which could be problematic And Something you shouldn't do Unless you are You know unless it is your right to do so Ok so this is the new feature in in doing dynamic Movement of folders [00:08:25](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m25s) And files What's make this all so nice if you're using these constants in your naming of your paths And you export and import this component into another Joomla website Then I mean as a JCB package right If you export a JCB package and you imported at another JCB install It actually remaps these files it actually export them Remaps them and move them back into place on the other install Which Really makes it very comfortable in you know working in a team and you wanna have these [00:09:06](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m06s) Is files always be the same everywhere This is so gonna be very helpful for that I can also Obviously because of the feature I give you the heads Up But if you import a package From anyone And and you do not know or you do not trust them they could actually move files Through this method into your system [00:09:32](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m32s) And is therefore part of first security which you need to consider With whom you are sharing packages Anyway So this is so some of the Feature regarding the new folder implementation folder and file implementation The other aspect which I mentioned earlier Were you actually able to get content from anywhere Works as follow So anywhere in any custom area of JCB Where you can actually add custom script [00:10:06](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m06s) You can also now used to this external code Snippet Now this could be a URL Or it could be a folder inside of your system This folder does not yet work with With Constance I should actually make it that it does And it actually needs to be the exact for the path of the stage But the reality is that with this external code Concept You can take [00:10:36](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m36s) For example variable From a Gits snippet let me let me show you So here I have what I've called fancy date Which is basically a few functions static functions Which are not wrapped in the class yet so it's basically outside of a class And why because I want to include it Into my [00:11:07](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m07s) Helper class With the snippet So That I can have others work with me on this code on GitHub And If any changes be made to this code it automatically updates my system Now I know that there is some question of security in doing so But we've added a few little Tricks in the compiler They actually notify you [00:11:36](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m36s) If there's been a change to the code So what that means is the first time you use that snippet To include this Snippet that you've got here You obviously do something like Raw And then here I have basically a text file So you'd grab that URL An add it like this You can take away [00:12:11](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m11s) The actual because currently It is bound to a specific version Which obviously If anybody makes a change to the snippet You won't get the new version Well that's the way of locking it in But if you wanted to have it be Dynamic you can actually remove a part of this I think it's this part Let me just check Yeah that's right [00:12:35](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m35s) Then you can use it like that Now this specific piece of text that you see here Will dynamically be added to my component Let me demonstrate So here I've opened component Builder in it's back end I'm gonna scroll I've gone to this libs and helpers tab I'm gonna scroll down To this area which is called Admin class so I just do in the admin area so that's easily Detectable [00:13:07](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m07s) I'm gonna add that snippet like that so it says external code With the path of the URL And That's it I'm gonna save and close Then let's go to the compiler Now what should happen Is that the moment you've compiled this it should tell you That you've added This kind of external code to your component If it doesn't tell you that then something's wrong it should tell you the first time you've add the snippet [00:13:43](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m43s) Because it actually creates a hash Of that snippet So that in the future if it changes You get notified So when we grab the snippet from Github An anybody in the middle you know tampers with it It will notify you that the snippet was changed now if you know that it should have changed because You made a change to the gits you know snippet or someone else in your team did [00:14:15](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m15s) That obviously you'll be expecting that But you could still for safety sake go check in the code of the component Where the snippet is being added to ensure that it is actually still accurate So I'll show you that Let's compile this So we see two messages that are relevant to the issue at hand This one is a new message which I'm not gonna go into now But it's basically dealing with that That is actually detected That [00:14:50](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m50s) Remember we said we have this folder we Pulling inside of the Library folders And Everytime You'd compile You actually tell you that You tell you That it is detected it and it's added The Script to the script PHP So Yeah I wasn't gonna explain it I did [00:15:11](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m11s) Anyway so that's what that is about but this first line here Is showing you the snippet And it's telling you there's been added for the first time And that you should be investigate to insure the correct code string was used So you should go To the place where in JCB the sorry in the package The compile package where this should have been added Go and check that it is the correct That what you see here on GitHub The string here [00:15:44](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m44s) Is also what you gonna see in the code That's the first thing Every time there after it should give you this little message here And it should tell you how many code strings are being added to this component as an external code And to avoid shipping your component with malicious code string always make sure that the correct code string values Were used Now I did tell you that if we did take the change it will also notify you so First let's go do what it said here Let's go check that it is to correct code Because I'm in the ZIP package [00:16:25](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m25s) So we see that this the library folder been added we gonna go to the admin area helpers and then open Component Builders helper File which is where I added the snippet right So let's just open that And then Here we have it fancy date And fancy datetime So [00:16:53](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m53s) Basically from here To here Was taken from GitHub and put inside of the component Now I'm gonna go make it change to the snippet on GitHub I'm gonna just do something small So that we can see what happens if it change is made To this code And how JCB response I'm just adding this [00:17:20](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m20s) New little string here saying change was made And I'm updating this public Gist So it now tells us that it's been revised for a second time And a change was made Now let's compile the component without doing anything else just make the changes here on GitHub Then go back to the component and compile it So here we are Selecting version Compile [00:17:51](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m51s) I can see I will have the maybe add some space in between the messages here Doesn't always seem clear enough That the messages are not related to each other like Here it's showing that other message again like it said it would But you might miss that So I think I'll have to look at that anyway Here in the warnings area We see this We see that [00:18:18](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m18s) It has changed Since the last compilation Please investigate To ensure that changes safe That means JCB is automatically detected That the snippet that you originally added has actually been updated At this point we anticipated that so If we go and look at the code We see that it just added this little part here the change was made [00:18:49](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m49s) And the rest of it is exactly the way we want that And so everything is fine It's a change we anticipated So we know that nobody else has tampered with the script And neither was there a man in the middle attack An in any case If there is someone tampering with the script It will end up as a string here So let's say they put something in here it will it'll do [00:19:16](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m16s) Something like that whatever they put in And you will see this error In your file So that's Basically how it will play out But in the actual reality JCB will detect that It will see that the hash for the script is changed And it will notify you with that message I'm gonna do my part and trying to make sure that it's more obvious you won't miss that message But that anyway when you use this kind of implementation [00:19:52](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m52s) It is not the most ideal implementation it's just that sometimes we want included an external value in our component Which is dynamically changing And And we wanna do it without really thinking about all the time And this is what this feature is ideal for I'm so use it with caution and You know know what you doing Or don't use it at all So that was a quick overview [00:20:21](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m21s) Of the new Folder file Inclusion As well external code Inclusion Features which I really trust would be useful to you It's powerful tools so I realize There are the danger of it being abused But at the same time I think component development works upon reputation and if you wanna have a good [00:20:54](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m54s) reputation in the community You shouldn't do anything that will hurt others Or damage their Contribution And their applications but you should steer Within the parameters of your own component And your own implementation and any case because people are gonna look at your code they are gonna unzip your package they are gonna see If you're doing things that are not [00:21:22](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m22s) You no good they're gonna notice that and your reputation will get hurt And that's the last thing you would want When you're developing components for Joomla Anyway thank you for watching + +From here to here(see video) was taken from GitHub and put inside of the component. I'm going to make a change to this snippet on GitHub. I'm going to just do something small so that we can see what happens if a change is made to this code, and how JCB response. I'm just adding this [00:17:20](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m20s) new little string saying (change was made) and I'm updating this public Gist. So it now tells us that it's been revised for a second time. And a change was made. Now let's compile the component without doing anything else just make the changes here on GitHub, Then go back to the component and compile it. So here we are Selecting version Compile [00:17:51](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m51s) I can see I will have the maybe add some space in between the messages here Doesn't always seem clear enough That the messages are not related to each other like Here it's showing that other message again like it said it would But you might miss that So I think I'll have to look at that anyway Here in the warnings area We see this We see that [00:18:18](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m18s) It has changed Since the last compilation Please investigate To ensure that changes safe That means JCB is automatically detected That the snippet that you originally added has actually been updated At this point we anticipated that so If we go and look at the code We see that it just added this little part here the change was made [00:18:49](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m49s) And the rest of it is exactly the way we want that And so everything is fine It's a change we anticipated So we know that nobody else has tampered with the script And neither was there a man in the middle attack An in any case If there is someone tampering with the script It will end up as a string here So let's say they put something in here it will it'll do [00:19:16](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m16s) Something like that whatever they put in And you will see this error In your file So that's Basically how it will play out But in the actual reality JCB will detect that It will see that the hash for the script is changed And it will notify you with that message I'm gonna do my part and trying to make sure that it's more obvious you won't miss that message But that anyway when you use this kind of implementation [00:19:52](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m52s) It is not the most ideal implementation it's just that sometimes we want included an external value in our component Which is dynamically changing And And we wanna do it without really thinking about all the time And this is what this feature is ideal for I'm so use it with caution and You know know what you doing Or don't use it at all So that was a quick overview [00:20:21](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m21s) Of the new Folder file Inclusion As well external code Inclusion Features which I really trust would be useful to you It's powerful tools so I realize There are the danger of it being abused But at the same time I think component development works upon reputation and if you wanna have a good [00:20:54](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m54s) reputation in the community You shouldn't do anything that will hurt others Or damage their Contribution And their applications but you should steer Within the parameters of your own component And your own implementation and any case because people are gonna look at your code they are gonna unzip your package they are gonna see If you're doing things that are not [00:21:22](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m22s) You no good they're gonna notice that and your reputation will get hurt And that's the last thing you would want When you're developing components for Joomla Anyway thank you for watching