Updated 012 Component FTP and more (markdown)

Amigo 2019-06-12 11:07:06 +02:00
parent 2c0a873d5e
commit 96905d2ac7
1 changed files with 7 additions and 8 deletions

@ -37,19 +37,18 @@ The 'backup' and the 'Git' folder is set up in your Components Global options. I
These two first folder paths, called 'compiler folder' and 'custom folder', leave them for now, they are not flexible. To move them at this stage is difficult, just leave them blank. Here at 'Backup Folder Path' you should add a backup folder. This should be related to the root of your server, as well as to a 'Git' folder. [00:09:41](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m41s) The 'Git' folder would be where component builder creates a folder with all the components files without zipping them. You can go to that folder and create a 'Git create'and a 'Git repository'. From that folder you can push it to Github or any other Git server respectively. It's able to create a folder from which you can do Github or any other kind of repository work which are separate from your backup folder and also separate from the temporary folder in which it compiles the component.[00:10:17](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m17s) You can move it out of your Joomla install. That is the function of the folder paths, it does the Git Repository when you compile the component and it will not delete the .Gitfolder, it will just replace all the files in it.
First remove the old ones, then add the new ones and Git will see that only the files that has been changed, will be noticed, and the ones that you need to recommit and do just a normal commit to get it into your repository. If you don't know Git, then possibly it doesn't make sense to you. There is courses about Git on Lynda.com: https://www.google.com/search?q=lynda.com+courses&oq=lynda.&aqs=chrome.2.69i60j69i57j0l2j69i60j0.7499j0j7&sourceid=chrome&ie=UTF-8
as well as Udome. That's a backup folder and the sales server. [00:11:18](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m18s) The same applies here with this FTP credentials should be that direct folder in which these zip files should be stored. Unfortunately component builder cannot store it in subfolders at this point. The FTP details will just login to that FTP account,
<<<<<<< and in that folder which has the access you'll put the file there. No subfolders or other folders, the FTP details should be going directly to the folder. In the component builder, then will be in the back end components, component builder and then Helpers. There is a file called compiler. If you open that file, [00:12:14](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m14s) you would see that we have a function here builtme. Here's all the placeholders that you can use in the builtme file, and will be replaced with the relative information.
as well as Udome. That's a backup folder and the sales server. [00:11:18](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m18s) The same applies here with this FTP credentials should be that direct folder in which these zip files should be stored. Unfortunately component builder cannot store it in subfolders at this point. The FTP details will login to that FTP account,and in that very folder which has the access you'll put the file. No sub-folders or other folders, the FTP details should be going directly to the folder. In the Component Builder, in the back end, 'components', 'component builder' and then 'Helpers'. There is a file called 'compiler'. [00:12:14](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m14s) If you open that file, you would see that we have a function 'buildme'. Here's all the placeholders that you can use in the 'buildme' file, and it will be replaced with the relative information.
### Component Builder Compiler.PHP FTP Info
There is a function here called move file to FTP server. This move file to FTP server, calls another function called: getFTP. Now getFTP is this function here, it takes the signature, checks whether we already made such a connection before. And then loads that object. But here I'm using this parse string function to convert the string into the variables. All the variables in that string is converted to arrays or variables respectively. [00:13:12](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m12s) That then is used to make use of Joomlas own client FTP class. If you want to know where that is, you can in NetBeans you'd click control spacebar. It shows you it's in libraries/Joomla/client/FTP.PHP. You can click there, open it, so we are using Joomlas built-in FTP client, and we passing the host, the port, the option, the username, the password, and making a connection. Then we sending that off to do this move file, which then takes the file content and moves it to the server. That's just for your own piece of mind that the data itself is not being leaked or compromised. [00:14:04](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m04s) It's all handled right here and you can follow its events in component builder, from relations to the update server as well as to the sales server.
There is a function called move file to FTP server. This move file to FTP server, calls another function called: 'getFTP'. Now 'getFTP' is this function here(See video) and it takes the signature, checks whether we already made such a connection before and then loads that object. But here I'm using this parse string function to convert the string into the variables. All the variables in that string is converted to arrays or variables respectively. [00:13:12](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m12s) That then is used to make use of Joomlas own client FTP class. If you want to know where that is, you can click in NetBeans 'control spacebar'. It shows that it is in libraries/Joomla/client/FTP.PHP. You can click there, open it, so we will be using Joomlas built-in FTP client, and passing the host, the port, the option, the username, the password, and making a connection. Then we sends that off to do this move file, which then takes the file content and moves it to the server. That's just for your own piece of mind that the data itself is not being leaked or compromised. [00:14:04](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m04s) It's all handled right here and you can follow its events in Component Builder, from 'relations' to the update server as well as to the sales server.
### Update Server Extra Info(Versions)
The other thing that I know is quite in important. Is this update server, it is an XML file. [00:14:25](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m25s) This XML file is build up of versions and download links to those versions. So like I explain to you in a previous video. There is this reality while you are developing your component. Your users wouldn't need any [00:14:47](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m47s) change updates or anything. The moment you put your component out there on the web. Immediately you need to consider when you make a change in the application, how will you user be able adapt to that change. The biggest changes you can make [00:15:03](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m03s) is adding new views or adding new fields to the component. That makes it a little hard. Like I explain previously, with the history component we've done scripting to take control of that problem. [00:15:21](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m21s) You also need to think about the database. We created this thing called: Version Updates. Which gives you the ability to actually add MySQL scripting, which needs to be executed upon the updating.
Quite important is this update server, it is an XML file. [00:14:25](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m25s) This XML file is build up of versions and download links to those versions. As explained in a previous video, there is this reality that while you are developing your component, your users wouldn't need any change of updates or anything.[00:14:47](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m47s) The moment you put your component out there on the web, immediately you need to consider when you make a change in the application, and how will you user be able adapt to that change. The biggest changes you can make [00:15:03](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m03s) is adding new views or adding new fields to the component. Like I have explained previously: With the History component we've done scripting to deal with that problem. [00:15:21](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m21s) You also need to consider the database. We have created this thing called: Version Updates. Which gives you the ability to add SQL scripting, which needs to be executed upon the updating.
* **Table Alteration 1.2.9 version**
If you have the new version 1.2.9, there needs to be a table alteration. [00:15:43](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m43s) You need to know if MySQL commands to do that. You need to put that MySQL command in (MySQL - Update Dump) according to the Joomla conventions. The table name must have that '#_ _' in front of it and Joomla will dynamically put in the prefix. You might do a MySQL script here. If you are making a change and the new release is 1.2.9 and 1.0 didn't have that [00:16:23](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m23s) specific field or view, then you must realize that you're updating this one and the SQL must come next to that specific version. The update must be placed at the version, which needs the update. If you make a change don't put it here(1.2.9), because it won't update correctly. You need to put the update next [00:16:44](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m44s) to the version(1.0) that needs to be updated. Then over here(Version URL), you would put the link to the respective downloads. Like here we have version 1.2.9 and then we have version 1.3.0 [00:16:59](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m59s)and we added the 1.3.0 link.(see video)
Now the way for you to think about this, if you have a new version 1.2.9, [00:15:43](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m43s) then there needs to be a table alteration. You need to know if MySQL commands to do that. I'm not going to teach you that. You just need to put that MySQL command in here(MySQL - Update Dump) according to the Joomla conventions. The table name must have that #_ _ in front of it and Joomla will dynamically put in the prefix. You might just simply will do a MySQL script here. If you are making a change and the new release is 1.2.9 and 1.0 didn't have that [00:16:23](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m23s) specific field or view, then you must realize that you're updating this one and the SQL must come next to that specific version. The update must be placed at the version, which needs the update. If you make a change don't put it here(1.2.9), because it won't update correctly. You need to put the update next [00:16:44](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m44s) to the version(1.0) that needs to be updated. Then over here(Version URL), you would put the link to the respective downloads. Like here we have version 1.2.9 and then we have version 1.3.0 [00:16:59](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m59s)and we added the 1.3.0 link heresee video).
I'm using GitHub as my distributing platform of the application. You could use any URL. These URLs is what will be used in your updates server. In the update server, [00:17:18](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m18s) we will go to the update server link, copy that. You'd see that it has URLs, for the download. As we move on it 1.3.0, 1.3.1, 1.3.2. and it's getting these details. It is getting them [00:17:48](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m48s) from this version update area. The last version in this list being 1.3.2, must be the same as the one that you set here.(See video) That is important. We are at the current version [00:18:07](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m07s) and it will do the necessary adjustments to that.
I'm using GitHub as my distributing platform of the application. You could use any URL. These URLs is what will be used in your updates server. The update server, [00:17:18](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m18s) if I was to open that for us. First, we will go to the update server link, copy that. You'd see that it has this URLs here, for the download. As we move on it 1.3.0, 1.3.1, 1.3.2. and it's getting these details. It is getting them [00:17:48](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m48s) from this version update area. The last version in this list being 1.3.2, must be the same as the one that you set here. That is important. We are at the current version [00:18:07](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m07s) and it will do the necessary adjustments to that. That is all the concepts that would be necessary to cover regarding the component area. We've looked at adding admin views. [00:18:26](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m26s) We will again look at site views and adding them as well as your custom admin views. We will possibly going into more depths about this MySQL tweak, what we briefly mentioned. But the for most part that's or the at component area, [00:18:48](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m48s) and all it's nice features. It all stacks upon each other from the fields then the admin views, and then the components themselves. And if you have come this far you set out your component, you have added some admin views, you are now ready to [00:19:06](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m06s) start building the front and the site area. You wouldn't be able to do effectively until now. It is necessary to first do the admin views and then only do the site views.
That is all the concepts that would be necessary to cover regarding the component area. We've looked at adding admin views. [00:18:26](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m26s) We will again look at site views and adding them as well as your custom admin views. We will possibly going into more depths about this MySQL tweak, what we briefly mentioned. But the for most part that is the component area, [00:18:48](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m48s) and all it's features. It all stacks upon each other from the fields then the admin views, and then the components themselves. If you have come this far setting up your component, added some admin views, you are now ready to [00:19:06](https://www.youtube.com/watch?v=hzbZlLl-xlA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m06s) start building the front and the site area. You wouldn't be able to do that effectively until now. It is necessary to first do the admin views and then only do the site views.