Skip to content

012 Component FTP and more

Amigo edited this page May 14, 2019 · 21 revisions

Next in the component view we are gonna add the ReadMe script to a component The reapme script is commonly used as the components Homepage sort of so if you were to go to gethub for That's open we are on the demo components page for example Let's open GetHub and you'll see that it has this nice image here and it has some Details and some layout Now this all is done with the ReadMe file so it's with this file here we can open That and then look at the Raw And here you can see the It's basically the same text this we looking at previously 00:00:53 So inside of component Builder you can add this read me and read me text and This is basically placeholders Now I know that that is part of the markup for a header so You need to Know a little bit about Markdown Sorry not markup markdown to you know what is placeholders and what is not That is why I added The Script so you can sort of get an idea of everything that are placeholders 00:01:27 And these place holders are Automatically updated from the details that are in these Fields here so So you can see The the actual placeholders Names it's nice so if you change the version here It'll updated there Automatically So that is just read me file Really a place for you to give a lot of information to those who are using Your 00:02:01 Application so Maybe you can add some links to it or you could has Some links to help menus or even instructions on installing it or anything else that you'd like to share through the ReadMe file I would ask if it's if it's not too much for you you know for you to leave this area this commenting The more people using component builder the more involve within a community Others getting This training set Help us to sustain this project So if 00:02:36 you leave that in it will certainly be helpful you not Compulsory I mean it's only if you want to And then if you wanna know more about markup markdown markdown not markup Then you can open this link here And it shows you the this little bit of a cheat sheet of everything that you can do Ok so that is looking at the ReadMe area This admin View area 00:03:06 And the site View area Should be seen as a place where you can create new admin views Do realize that if you create a new admin view it's not necessarily linked to this component You need to still link it in here in settings under admin view This is more a place to create admin view so if you click on new Or to edit existing admin views that are linked to this component Same goes with the site views so it's simply a way for you to to gain access to editing those site views that already linked to this application easily And then the third one forth actually 00:03:51 one two three four we wanna look at is the FTP server that FTP server basically been added to Give you a hand in moving this application this component to your server and also add the feature of that automated updating that is inside of Joomla. So the update server Is actually a Joomla concept And if you open a component So I'll open Summon distributor wait over there This is the front I need to look at the backend And we look at the 00:04:39 XML file of this component Component builder obviously built this whole file for you But at the very bottom You see that there is a App updates server That is being added Now this is not added if you Have not Set the service it will set to no It will not be adding an update server if you add this 00:05:03 Then you can set the link To where the update server is you know gonna be hosted And it will automatically take that link in added into your XML file like it's done here And That file itself Component Builder Can also build that file for you The way does it Is that This obviously 00:05:31 Should look like that host = hostname And port = port Int& And option bracket type = FTP BINARY Now this FTP binary usually is 15 sorry That is the the default value FTP binary Where is that would usually be 21 and that would usually be 15 And then username and a password 00:06:04 Now this FTP details should actually login directly To this folder that you have up here this updates folder Ok that one So that basically all component builder does is it loggs into your server move this file in there and then this disconnects And this information is what will make it possible for him to do that Same goes with the sales server the sales server usually Would be Very much the same concept You'de Simply be adding the same kind of string here except usually the The update server and the sales server is not the same place 00:06:47 The update server let's the user know that there is an update where is the sales service actually where this component Zip file will be stored on your server so you have something like whmcs Or Another Component through which you are selling your extensions you can Use the folder in on your server which it's looking for the files You can use that folder you know great in FTP Account to that folder and then set that details In this field here And then Component Builder on the moment that you could compile It has a 00:07:30 An option here it says add backup folder and save sales server you click that to Yes and if you compile it now It will move The zip file to sales server as well as creating a backup now the backup and the Git Folder is actually set up in your components Global options so we We haven't really spoken much about the global options let us open it now here We saw in this area here That it says that this field is encrypted now in component builder if you go to Global Settings it says Encryption settings in in here 00:08:18 You would add a your own key By which it will encrypt once you've added this key You shouldn't change it because it will obviously not be able to decrypt Because it's used to encrypt and as well to decrypt The data so if you well that just means everything that's been encrypted it is now needs to To be redone which in this case is is gonna be these these login Information is FTP login information That's this is the basic encryption which we spoke of on talk about storing types you got basic encryption and advanced encryption now this is Basic encryption way basically having such a 00:09:01 Is also called basic key Then you have files here or folder paths These two first folder paths called compiler folder and custom folder I would leave them For now they are a little buggy I haven't fully managed to achieve them being Flexible so to move them at this stage is difficult For a number of reasons for now I would suggest you just leave them blank But here you would add a backup folder And this obviously should be related to the root of your server So As well as a Git folder 00:09:41 And Git folder would be where component builder creates a folder with all the compounds Files without zipping them And then you can go to that folder and create a git create a git repository there And from that folder you can push to Github Or any other git server Respectively So basically 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 00:10:17 compiles the component so you can move it out of your Joomla install basically And that's what these folder paths are for So when you do the compiling of the component it does that git repository it won't delete the Dot git file sorry folder it will just replace all the files in it Basically first remove the old ones then add the new ones and git obviously we'll see that Only the files that is been changed it will notice and those who you need to do a recommit well just obviously a normal commit To get it into your repository obviously if you don't know Git then possibly this then possibly doesn't make sense to you There's some great courses as well about Git on lynda.com as well as Udome So you can just go look at those ok so that's a backup folder And the sales server the same goes here this FTP 00:11:18 credentials should be that direct folder in which these zip files should be stored Unfortunately component builder cannot Storing and subfolders at this point so the FTP details he will just login to that FTP account And in that very folder which here is which he has the access to you'll put the file there So no subfolders or Other folders the FTP details should be going directly to the folder now In the component builder I was thinking just for your own Peace of mind if you look in component builder so That will be in the backend components component builder and then Helpers there is a file called compiler if you open that file 00:12:14 You would see that we have a function here built me and here's all the place holders That you can use in the built me file and will be replaced with the relative information And then there is a function here called move file to FTP server This move file to FTP server calls another function called Where is it getFTP now getFTP is this function here And basically it takes the signature checks whether we are ready made such a connection before And then loads that object But here basically I'm using this parse string function To convert the string into the variables so all the Variables in that string is converted to erase all variables respectively 00:13:12 And that then is used to actually make use of Joomlas own client FTP class so if you wanna know where that is you can NetBeans you'd click control spacebar and it shows you it's in library JclientsFTP .PHP that's where the file is you click there open it So we basically using Joomlas built-in FTP client and we passing the host the port the option the Username the password and making a connection and then we sending that off To do this move file which then basically takes the file content and moves it To the server So that's just for your own piece of mind that the data itself is not Being leaked or compromised 00:14:04 It's So 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 The other thing that I know is quite in Important Is this update server Is an XML file 00:14:25 And this XML file is basically build up of versions And download links to those versions So Like I explain to you in a previous video There is this reality that while you are developing your component Your users Excuse me wouldn't need Any 00:14:47 change Updates or anything are there 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 to be able adapt to that change And the biggest changes you can make 00:15:03 Is adding new views or adding new Fields To the component And so that makes it a little hard But like I explain previously With the history component We've done scripting to take you know take control of That problem But 00:15:21 You also need to think about the database So we created this thing called Version Updates Which Gives you the ability To actually add sql Scripting Which needs to be executed upon the updating Now the way for you to think about this If you have a new version that's a 1.2.9 00:15:43 Then and now you know that there needs to be a table alteration Obviously you need to know see if MySQL commands To do that I'm not gonna teach you that you just Need to put that MySQL command in here according to the Joomla conventions which means The table name must have that hash underscore underscore in front of it and Joomla will dynamicaly put in the prefix so you might just simply will do a MySQL script here but if you are making a change and the new releases 1.2.9 And 1.0 Didn't have that 00:16:23 Specific field of view Then you must realize that You're updating this one and so the sql must come next to that specific version The update must be placed at the version Which Needs the update So if you make it change don't put it here Because it won't Update correctly You need to put the update next 00:16:44 to the Version that needs to be updated And then over here You would put the link To the respective Downloads Ok so Like here we had Version 2. 9 And then we had version 1.3. 00:16:59 0 And We added the 1.3.0 link here Obviously I'm using GitHub as my distributing Platform of the application You could use any URL And these URLs is what will be used In your updates Server So the update server 00:17:18 If I was to open that for us first let me close this and we will go to the update server Link copy that You'd see that it has this URLs here for the download And as we move on it 3, 3.1, 3.2 And so it's getting these these Details It is getting them 00:17:48 From This version update area And so the last version in this List being 1.3. 2 Must be the same Is the one that you set here That is important So that it will know ok now we are at the current version 00:18:07 And it will do the necessary you know the adjustments to that Ok so that is Basically All the concepts that would be Necessary To cover Regarding the Component Area We've looked at adding admin views 00:18:26 We will again look at site views and adding them as well as your custom admin views And we will possibly Going to more depths about this MySQL tweak What we briefly spoke about But the For most part that's or the at Component Area 00:18:48 And all it's nice Features Obviously 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 Start building the front and the site area Which You wouldn't be able to To really do effectively until now It is really necessary to First do the admin views And then only do the site views Well Thank you for watching

Clone this wiki locally