Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 15    Views: 77

Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
02/13/14 12:43 PM (11 years ago)

Question on Self Hosted Plugins

Quick question, which I think I already know the answer to, but thought I'd check with the pros before trying it and messing something up. We all make changes to our projects by hand coding some minor alterations, fixes, etc... I'm wondering if we modify the code in our project of let's say a plugin's .m file, and that particular code suits us better in a "from now on" scenario, can we simply copy the projectName/bt_plugins/pluginName/fileName.m file and upload/overwrite the existing one located on our server at /BT-server/files/plugins/pluginName/source-ios-3.0 (assuming we are working with 3.0 version code for iOS)? And if so, if we don't plan on using the code for android or BT 2.0, we wouldn't have to edit the code in those android or source-ios-2.0 folder as well would we? I realize that it will be overwritten if we update the plugin in the future, but I can work with that. Just thought it might things easier when starting a new project down the road, instead of having to go through and apply all of my custom edits to the code that make things look the way that I prefer them in my apps. I'm guessing by overwriting that file with our custom one, a newly generated and downloaded project file would have the custom edits already applied to it. I didn't just want to try it in case it affected something else (of course I'd backup everything first, but still).
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
02/13/14 01:26 PM (11 years ago)
Very good question!! Would love to know too. That would be a fantastic time saver. Farcat
 
Cakebit
Code is Art
Profile
Posts: 502
Reg: Dec 15, 2010
In your local b...
16,520
like
02/13/14 01:49 PM (11 years ago)
Yes, That is exactly how it works... Any changes you upload to the plugins directory will simply be added in the Xcode/Android project when you download it.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
02/13/14 01:52 PM (11 years ago)
Awesome. Great to know. So if I only use BT 3.0 projects, and don't do android apps at all, I wouldn't have to worry about changing the code in the plugins source-ios-2.0, source-android-2.0 or source-android 3.0 folders, right? I can just make the changes in source-ios-3.0 and ignore the other folders?
 
Cakebit
Code is Art
Profile
Posts: 502
Reg: Dec 15, 2010
In your local b...
16,520
like
02/13/14 01:55 PM (11 years ago)
Yes. Buzztouch (self hosted) copies the code directly from the plugins directory into your project.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
02/13/14 01:59 PM (11 years ago)
Sweet :) Thanks Cake! I thought so, but wanted to make sure it wasn't pulling anything from the iOS 2.0 folder when I download a 3.0 project, or if the core files insisted that all folders even be there. I assumed it was only concerned with the version you were downloading, but wanted to check first.
 
@rob
Code is Art
Profile
Posts: 115
Reg: Dec 10, 2013
Alabama
8,800
like
02/13/14 05:29 PM (11 years ago)
@Angry Ninja sorry if I am hijacking the thread a little here but this seems to be the correct audience to ask. Has anyone else noticed that the self hosted plugins (at least the few I have manually downloaded) are missing the index.php file?
 
Cakebit
Code is Art
Profile
Posts: 502
Reg: Dec 15, 2010
In your local b...
16,520
like
02/13/14 06:25 PM (11 years ago)
@RobWainwright, All Self-Hosted plugins on the 3.0 core should not include a index.php file. Instead they use a config_cp.txt to tell the control panel how they should operate.
 
@rob
Code is Art
Profile
Posts: 115
Reg: Dec 10, 2013
Alabama
8,800
like
02/13/14 06:34 PM (11 years ago)
@CakeBit thanks for the reply.... I was just concerned because my current menu_button plugin folder has a index.php file but the updated version I downloaded does not, so before I overwrite the old one I just wanted to be sure. In the past I have been able to update to new versions via the update function in my Self Hosted CP, but recently when I try to update an existing plugin, it starts the process and says "downloading file" but it just never completes the process, so I have started just manually downloading the newer versions when I need to update. I will back up my old version and give it a whirl
 
@rob
Code is Art
Profile
Posts: 115
Reg: Dec 10, 2013
Alabama
8,800
like
02/13/14 06:39 PM (11 years ago)
@CakeBit, upgraded plugin works perfectly, I guess I was just a little too paranoid, thanks!
 
Cakebit
Code is Art
Profile
Posts: 502
Reg: Dec 15, 2010
In your local b...
16,520
like
02/13/14 06:52 PM (11 years ago)
Glad to hear that! What host are you using for your self hosting? Some Buzztouch users have had trouble with updating plugins through their host as well.
 
@rob
Code is Art
Profile
Posts: 115
Reg: Dec 10, 2013
Alabama
8,800
like
02/13/14 06:55 PM (11 years ago)
You know thats something I had'nt thought about, I was originally on GoDaddy but switched to HostGator because GoDaddy does not allow push notifications, it hasn't worked since I migrated to HostGator, but I had just chalked it up to something that I broke when I moved my server files and database over.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
02/13/14 07:19 PM (11 years ago)
I'm using hostgator, and over 60 plugins. All of them update fine, except webform generator won't update automatically... Well, technically it's updated already, but my control panel always says it's at version 1.0 and needs an update, which always fails, because the actual installed version is the latest, higher than 1.0. All other plugins update automatically just fine though
 
Cakebit
Code is Art
Profile
Posts: 502
Reg: Dec 15, 2010
In your local b...
16,520
like
02/13/14 07:24 PM (11 years ago)
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/14/14 12:54 AM (11 years ago)
Angry Ninja: Until the plugin is updated, yes you are correct. However, a plugin update will wipe out all of your changes. Keep a separate log somewhere of what you did to where. Most new plugins will get updates for the first 3-4 weeks while the 'gotchas' are gotten. :) Quite often during plugin development, I will have the plugin 'skeleton' installed in my control panel (when you first 'create' a plugin, you are provided with a 'shell') and have the files open for editing in a remote text editor (Notepad++, Text Wrangler) while working in the development environment. Periodically, I copy and paste my working methods into the plugin 'skeleton' and do a quick search/replace on the projectname/appDelegate references, and it's all good from that point on. I *know* that the copy on my server is the latest copy with the latest code. When I'm ready to distribute, I just download it, zip it, and send it. That's part of my plugin development workflow. It keeps me from keeping track of a million different versions, and I'm not having to FTP files up and down every 5 minutes... Cheers! -- Smug
 
@rob
Code is Art
Profile
Posts: 115
Reg: Dec 10, 2013
Alabama
8,800
like
02/15/14 07:48 PM (11 years ago)
@CakeBit thanks so much for the link to that thread, I was able to contact HostGator and get my update script WHITELISTED and now my plug-ins update perfectly, thank so much for the followup
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.