Updated 055 Dynamic File and Folder Inclusion concept (markdown)

Amigo 2019-09-06 16:14:39 +02:00
parent caf9b3c8f8
commit 3e0442e1f5

@ -33,7 +33,7 @@ Then you need to still set the target path and relation to the ZIP package. You
When JCB detects that you are not targeting the normal Admin, Media or Site Folders,nwhich is not part of the expected component package folders, it will add a little script to the script install.[00:06:28](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m28s) So that it move this folder into its correct place upon installation of the component or whether the component is updated. I have the script file for Component Builder open and I am going to scroll down. [00:06:58](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m58s) This new little script is way at the bottom ,(setDynamicF0ld3rs) it does not 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 is one of these Media, Admin,or Site, it ignores it, because those already being dealt with by Joomla. If it is not, it moves it into its correct place. This is a dangerous feature, you must use this with caution because you can literally grab with this new function, anything anywhere from your Joomla website and overwrite it anywhere on the users installation website, which could be problematic.[00:07:59](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m59s) Something you should not do unless it is your right to do so.
This is the new feature in dynamic movement of folders and files.[00:08:25](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m25s) What makes this all so nice is if you are using these constants in the naming of your paths, 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. That really makes it very comfortable in working in a team and you want to have these files always to be the same everywhere. <<<>>>>>>>>>>>>>>>>>>>>>
This is the new feature in dynamic movement of folders and files.[00:08:25](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m25s) What makes this all so nice is if you are using these constants in the naming of your paths, 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. That really makes it very comfortable in working in a team and you want to have these files always to be the same everywhere.
### Heads Up - Consider With Whom You Are Sharing Packages - Part Of Security
@ -46,8 +46,11 @@ This is the new feature in dynamic movement of folders and files.[00:08:25](http
[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.
The other aspect which I mentioned earlier, where you are able to get content from anywhere works as follows. So anywhere in any custom area of JCB, where you can add custom script, you can also use this 'EXTERNALCODE' Snippet. Now, this could be a URL or it could be a folder in your system. This folder does not yet work with Constants. It needs to be exact for the path at this stage but the reality is that with this EXTERNALCODE concept, you can take for example the variable from a Gits snippet. [00:10:36](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m36s)
Let me illustrate. Here is what I have called 'fancydate' which is a few static functions that are not wrapped in the class yet. It is outside a class because I want to include it in my helper class with the snippet, that I can have others work with me on this code on GitHub. [00:11:07](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m07s) If any changes are made to this code, it automatically updates my system. Now there might be some security concern in doing it. But a few tricks has been added in the compiler to notify you if there has been a change to the code. [00:11:36](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m36s) <<<<<<<<<<<<<<<<<<<< <<<>>>>>>>>>>>>>>>>>>>>>
, 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