SparkleShare Git Client with Shared Hosting 1

I have this hosting http://bit.ly/9TTSvJ and will specify everything here according to that hosting.
I am pretty sure you can also work with this other hosting which is better and more reliable: http://bit.ly/d4R3w2

So let’s do hands on:

Firstly one is going to have to setup git on the hosting since it is not necessarily there yet. So for that please follow these instructions:
http://hostmonsterforum.com/showthread.php?4589-HOWTO-install-Git-on-Hostmonster

There will be some settings on the ssh side like uploading your ssh pub key to your server, but basically things will boil down to issuing:
[code]
git clone -u /path_to_git_install/git/bin/git-upload-pack ssh://user@server/~/repos/state.git
[/code]
This line above will clone the repo you created on your server.
It went a complete success on my host and I am pretty sure it would be the same provided your hosting is decent and standard.

From now on we can either stay as we are, happy or try the SparkleShare thing.

There are still some problems with SparkleShare so I will create the second part of this post when I have the solution.

Here are some notes:

Then we will follow this instructions here:
http://velt.de/blog/sven/sparkleshare-and-your-own-git-server

Notice that sometimes there will be no key found on the directory that it says there on the link above, so one can use the key located at ~/.ssh directory. This was because SS broke at some point.

Now I have my git repo working on external shared hosting account.
This post summarizes being with my host for several hours on the chat and IRC channels too.

WordPress Shopping Cart: View All Feature

The feature we want to implement is a link label “view all” that behaves in the same way http://www.sundancecataloge.com product page behaves.

The improvement will make it possible to display all the products of one category (or of all categories) in the same page where it usually is paginated.

There are at least two approaches:
1. hide the regular display of products with pagination and display all products
2. work on modifying the actual display of products function with pagination and tweak it so that it would receive a parameter acted by a form button “view all”

We solved with #2:

We modify the logic for the product queries. After some hard work I have come up with a solution that can be seen in action here


If you would like to get the patch for this feature it is available if you email me at cordoval@gmail.com with a donation of $17.

Your contribution will be used to develop more amazing improvements to the Shopping cart and I will post them on this blog.

Please encourage me to keep developing more patches for WPEC here: Donate HERE
Thanks!

Parsing XML with PHP: An API case

The SimpleXML parsing classes were used to interface an API via cURL functionality. One of the things that I learnt was that it is one can later embed all this functionality perhaps to create a plugin that can interface some other APIs. These sets of functions are consumers because the logic for getting the first piece of information from outside always resides in a simple logic of actually getting this information to mainly display purposes. If the logic builds up from the consumer side then the application could turn into more than just presenting information and the interaction with the web application would become more interesting of course. It is interesting to see this capability as standalone because this will enable us to use it further into the future when we would be working within symfony where the approach is rather from the inside out as a plugin probably.

If you happen to require consulting with SimpleXML and wordpress please let us know through the form on the website.

Management Code Development 2

This is the second part in in our series of Code Management for Developers.
So recently I made some modifications for a new feature locally and then when deploying I asked myself how different was the code that was already on the server from the code base. In order to find out I had to download a copy of the remote file and do a diff:
[code]
diff -b local_file.txt remote_file.txt
[/code]
The output of the diff would indicate to me whether it was just my modifications that created the difference. In case it was so I just had to overwrite the files. In another case I had to merge the changes into one file and upload that file.
That was a tedious task doing it by hand. So a script was actually needed to download a local copy of the files that I had modified, compare them to my versions, merge them, and uploading them back. The first problem we encounter is to realize which files I had modified! I used the names of the branches. Master branch compared to the branch I was in that had the modifications.
To that the git diff command came to our rescue:
[code]
git diff master beatity_variations –stat
[/code]
This would list the files for me:
[code]
…/wp-e-commerce/transaction_result_functions.php | 10 ++++-
wp-content/plugins/wp-e-commerce/user-log.php | 37 +++++++++++——-
…/plugins/wp-e-commerce/widgets/luis_widget.php | 41 +++++++————
…/wp-e-commerce/wpsc-includes/cart.class.php | 38 ++++++++++++++++++
…/wpsc/themes/iShop/shopping_cart_page.php | 3 +-
5 files changed, 86 insertions(+), 43 deletions(-)
[/code]
With this information I was able to do the job however it was manual and I was asked once to restore to previous versions of the remote files after I modified them. This latter request called the support for an “unpatch” feature in to question.

Managing Code Development 1

An interesting problem arose today. After spending time evaluating a solution for a client, I developed and modified a branch of a base code called “beautify_variations”. The master branch is of course “master” and it is not only the master but the code base. If I were to take another client asking for another feature for a custom specials widget then I can develop a branch called “custom_specials_widget”.

The Code Base

The base code “master” branch is very important. In order to troubleshoot for clients I need to have a code base which is default, which is easy to configure, bare minimum, and capable of reproducing all standard features without problems of conflicts with other pieces of code and so on so forth. My master branch does all of that. And to start with a new client I only issue:

[code]git branch[/code]

Which will list all my branches and the branch that I am currently in. And then:

[code]git checkout master[/code]

This will set me back to 0 default to an environment that I can trust and start developing with more confidence than before knowing that everything is saved automatically and I can pickup work anytime from anywhere again.

Being able to do this switching with one command line is just what a developer needed the most. One with several requests from clients of course.

The Construction of Solutions

If a client request a type of customization that is on my archives but it requires some extra modifications there should be a way that I can take the code base, apply the customizations from the archive and then merge all of that with my new customizations. All the more, one would like to set this new code solution as a client custom branch. Can I do this? Yes! We will see this in more detail in the future, I will add in this post my experiential findings.

Deployment Scenarios: Patches

Deployment usually conveys the idea of a far repository or server. This is important since we cannot know all the details of the remote server to where we are deploying our improvements to the code. A deliverable therefore needs to be precise as to what part of the code is changing and we would like to streamline the process through the use of patches. A patch, in this scenario, becomes a diff between a common code base and my improvements. How to automatically run it or have it run by someone else is an important part of delivering patches. We must use patches and “unpatches” in case we negatively impact the code base and can quickly undo our patching.

Deployment Scenarios: Upgrades

From time to time the code base is upgraded to a new version. This creates earth movements that threaten my code base’s stability. They can or cannot introduce new bugs, they can fire up old bugs and can create a lot of confusion with new features conflicting with my old changes. The whole archive of customizations needs to be well documented and specify for which version of the code base the custom code was developed. The new code is public ideally, so one can do merges and update with time since all the information is available to us.

The use of submodules can help this process of upgrading code bases, however, when the customizations are made to the code base we require a quick and systematic way of doing this upgrades. Any takers?