couchDB + codeigniter? - codeigniter

Are there anyone who can help me out on how to connect a codeigniter-application with couchDB?
I have tried to find drivers or libraries, but without any success. What can I do to make it work?
Thanks!

Well, CodeIgniter just means PHP -- which means that any library that's written in PHP should do the trick, even if it's not specifically written for, or part of, CodeIgniter.
For a list of PHP libraries to communicate with CouchDb, you might want to take a look at this page of the official CouchDb's wiki : Getting started with PHP
Everything that's said there should work fine with CodeIgniter -- I don't see why it wouldn't.
Of course, you could also write your own communication layer -- shouldn't be that hard, as it only means a couple of REST requests...
... But I wouldn't do that, if I were you : using a well-known library means you'll be using code that's already been tested and fixed -- which means less risks of bugs, and less maintenance work for you.

I don't seem to be able to comment on answers (which I would do if I could; this is a bit much for answering a question made in a comment to an answer)
I think CouchDB comes with a web interface that you can access it (on ubuntu linux anyway) by pointing your browser to http://localhost:5984/_utils/

Related

php alternatives for standalone web allpications

I need to develop multi-user web site which also should be able to run locally (on Windows) for a single user. I'd like to use the same code for both sites. Local copy should work without installing any software, source code shouldn't be available, and web browser should be integrated into application. I may use SQLite as local database and I want to use ExtJS as front-end.
I'm aware of 2 products for PHP that claim to do this, but I'm not sure yet that they will work with the tools I'm interested in (ExtJS and Kohana PHP).
I know that Haskell provides such option, but I don't want to go that far :).
Flex doesn't seem too promising (at least what I remember), as its UI-building capabilities are limited, and I'd like to have online version in HTML, not in Flash.
Are there any other technologies available (.NET, Ruby, Python, etc.)?
Well, you can use PHP itself. It's not the neatest solution available, but you can use php-win.exe to avoid command-line popping out. You can then use some source obfuscators or byte-code compilers to avoid revealing source code. And AFAIK PHP works without instalation (it can run out of a directory if it has all the required files in it)
As I said, not the neatest solution, but will probably meet your requirements.

Modifying Code Igniter

I am looking into developing a commercial application using PHP. Since I have experience in CodeIgniter and it has been working well for me, I decided to use it. Now, if ever my application comes to a point that it needs to grow and have to have custom modifications in the platform, is it possible to modify the CodeIgniter source code to the point that it's far from the original?
I'd strongly recommend not modifying the source code as this is the back bone of the application will make updating to futures releases of codeigniter impossible.
Instead you should be creating your own classes/libraries that extend the core bases. This is best practice.
The codeigniter users guide has some fantastic information regarding this, http://codeigniter.com/user_guide/general/creating_libraries.html
Good luck.
Don't modify it, extend it. Ellislab is good about releasing bug fixes and patches, and the last thing you want is to have to re-engineer all the updates into your new hybrid everytime they release updated source code. Plus, different features and bug fixes are released at different paces for the core and reactor, so unless you plan to lock your framework in at the current version, extending is the way to go.
The good news is CI is built for and encourages extensions of the source. The system folder and the application folder separation are a clear indication of how you should segregate your enhancements from the base libraries.
CodeIgniter is written in PHP. You can completely rewrite the framework anyway you like. So the answer is "yes".
There are many big websites that were written in a different language or build on a framework when they started and have been rewritten many times since. I think a lot of developers (mostly freelancers) are over-thinking when starting out. When I start a project, then I try to get it done and get it out in the web asap. If a website starts taking of - and most of the times start making you money - then you can always take the time to rewrite it.
I think it is a lot more important to spend time when you plan and design your database and tables. I think it is a lot harder to redo parts of your database later on then it is to rewrite the code that uses the data.
Just my 2 cents.
If you have used CI, then you should know that being a PHP framework that all of the source-code is there in the download, furthermore opening the system and application folders and looking through there will tell you a lot. Yes all of the source is there in plain English (plain programming English) and not only is it in plain English but has been extensively documented inside and out (literally that is in the source and in the user-guide). CI gained initial fame from that simple fact, that all code is extensively and meticulously documented.
Beyond all that, the question itself raises concerns that maybe you should study CI a bit further before writing commercial applications using it. Ci is a powerful and very easy to use PHP framework, but it is not a WYSIWYG. In my opinion, a coder should know his tools inside and out in order to be able to create a solid secure and trusted application. The first measure of which is to read the user manual, you should know at the very least everything in it, and since there are 12 sections in it that cover everything from extending CI libraries to creating your own libraries, and everything in between I would say you need to spend a little more time with it.
I want to say though, I am not being rude or trying to shame you in any way I am simply saying that you should learn the framework a bit more before venturing into a commercial application using it.
In the early days of PHP people realized how amazingly easy it was to use and how fast you could write an application with it. At the time the major options where very difficult for new and hobby programmers to use or involved expensive software to run, PHP was free, easy to learn and most of all ran on a free OS. It also took hardly any setup to get going, you could download PHP and essentially be programming in minutes. All of these factors lead to the almost destruction of the language.
Entry level programmers were destroying it with bits of code taken from other applications, never knowing (or caring) what the code actually did beyond the simple fact that it did what they wanted at the time, never considering or even investigating if the code might be harmful. Because of this practice PHP applications that had grown to Goliath sized websites, taking thousands of hits an hour were:
beginning to crash
being hacked to reveal sensitive customer/client data
generally crumbling all around the web
All because since the language was so easy to use that people had taken advantage of it and failed to take time to learn it. PHP was becoming a joke to other professional programmers and wasn't even thought of as a viable application language by many who had dubbed it "the copy and paste" language.
So my advice to you, please take the time to know your tools inside and out, what makes them tick, if they have any gotchas and where they are vulnerable. I understand that in order to learn a language to a professional level you have to build with it so I suggest that you take it slow with CI stick to the core for now. Trust me when I say that even in its purest form CI is an amazing and powerful tool that in the right hands can create awesome powerful web application, but in the uneducated/inexperienced hands it can create havoc and destruction.
So (stepping off of the soap box) I simply ask that if you are serious about creating commercial applications period that you take your time and learn your tools/language become as close to an expert on them as possible. I gurentee that if you do that you will always have work when you need it and you will spend less hours beating your head against the table or worse explaining to a client why their site is down.
I truly wish you good luck, just slow down and learn your trade and you will do just fine.
Yes, Codeigniter is an open source framework. However, I would advise against modifying the core of Codeigniter, as most files can be extended and rewritten safely without modifying the core files which will cause you headaches if you ever decide to update.
To extend a core class by default you would do this in Codeigniter. We'll extended the parser class for this example, but this applies to all classes pretty much. This link in the comprehensive user guide will give you all the information you need to extended and overload methods inside of a Codeigniter core class: http://codeigniter.com/user_guide/general/core_classes.html

Limitations of CodeIgniter

What are the limitations that can be faced with codeigniter. I know my question is very broad but I wanted to know from the experts if there are any specific limitations.
This is because for my website I want to have visual representation like google maps. The steps which have to be visually displayed. Can the codeigniter handle everything or are there any limitations?
The issue is not what limitations CodeIgniter has, it's when does implementing something break outside the local use of the framework.
CodeIgniter is written in PHP, therefore your limitations really are the limitations of PHP itself.
The part to consider though is that if you're spending most of your time working around the paradigms put forth in CodeIgniter then the platform is probably not for you.
On a second note
The limitations also are greatly dependant on your skill & resources. It's not strictly the platform that'll prevent someone from achieving thier intended result.

Using Drupal and Ruby. Has anyone integrated both?

I started a small web project and used Drupal to build it. So far, so good: you can quickly set up a nice CMS oriented site, add social features via modules, and you have an extensive API to do the customizations in a nicely architected platform.
The problem comes now: the site is growing beyond what was originally planned for and I find myself in the situation of seriously starting write code for it. While I gained a new respect for PHP thanks to the Drupal project, I want to do it in Ruby. I'll feel more confortable, it'll be easier to maintain later and I can reuse it in other Ruby/Rails apps. Over time I suppose I'll rewrite the existing parts in Drupal in Ruby.
Based on this, the question is: has anyone integrated both (both a success or failure story)? It's quite a big decision, and I just can't find info about anyone who has done it on Google.
Sorry to be negative. This doesn't sound like a good idea to me.
I'll feel more confortable, it'll be easier to maintain later for me and I can reuse it in other Ruby/Rails apps.
I seriously doubt that. It will probably be more difficult to maintain/reuse in the future because of the extra code you will need to write to "integrate" Drupal and Ruby. The more the code, the more the likelihood of bugs. I'm assuming you're going to link the two together using REST/webservices/similar technology -- if that is the case you are writing so much extra code! Gluing the front end elements (which have to be in Drupal) with the functional elements (probably in Ruby) justs sounds so complicated to me.
I'm guessing its only you who is going to be maintaining the code. What if its someone else? Will you easily be able to find someone who has two skill sets (Ruby + Drupal) in your area/budget?
What about giving back to the Drupal community? If your code becomes something useful and its this big mess of Drupal + Ruby you really can't put it up on Drupal.org for others to build, improve and test.
I suggest two options
Use Drupal only.
Sounds like you're in love with Ruby or at any rate just too used to it. In that case: Find a Ruby based CMS! (Sorry I don't know any!)
To me its a classic dilemma: Should you do Drupal Custom Module development which will mean more short term pain cause you'll be out of your comfort zone.... or should you integrate Ruby + Drupal which will be easier in the short run but very painful in the long.
I would choose short term pain :-)
I think the term used to describe your idea is Polyglot Programming: http://memeagora.blogspot.com/2006/12/polyglot-programming.html
One of my criticisms of Drupal is that everything is in Drupal or PHP. Drush is an exception of course but it would be nice to see some development tools that don't use the Drupal stack exclusively. I have used Apache Ant on Drupal with some success (before the days of Drush).
I've also worked on a Drupal project that provided Software as a Service to a Java front end. That didn't work too well but the Drupal Services project has enjoyed some renewed development since then. I've also worked on several Drupal projects that interface with flash front ends (ugg!), google maps and mobile phone gadgets.
Are you thinking of a Service Orientated Architecture? If you're comfortable with that then you could be on the write track to writing truly agile software. I'd like to hear how you go!
However, if your only justification is that your feel more comfortable in Ruby (and I can see why) then, you should probably get yourself out of your comfort zone.

Transfering ASP Classic Pages from Windows to Linux

Has anyone tried a solution to host ASP classic pages on something else than IIS/Windows? I'm wondering if it would be a good idea to try one of the solutions for that problem. I know about Sun Java System Active Server Pages (or Chilisoft) but haven't tried it. Is there any big problems with those solutions? Does the hosted code need change?
You could try with Apache::ASP in your Linux, but I'll use it just for the meantime until can migrate the application to other language with better support (PHP, Perl, Python, Java, Ruby... even .Net with Mono).
Note that Apache:ASP can't manage classes, so you'll need to recode your classes to just variables and functions. Well, classes in classic ASP aren't so much complicated than just variables and functions...
There is a program that exists called ASP 2 PHP. With that you could migrate your application to PHP. The project leader does not recommend using it continuously as it is not, nor ever will be 100% perfect.
There is also an FAQ and a Notes page to get a glimpse of the problems that you may encounter while using it.
I think you'll get in troubles trying that ... :(
If it was ASP.NET I'd encourage you to use Mono, but for classic ASP I don't think there are that many solutions, but I could be wrong :)
I had client who chose, unknowingly, an ISP with form of ASP emulation under Linux many years ago. The program I installed didn't work properly because filenames in Windows are not case-sensitive, in Unix they are. It was a whole pile if fail. Include files, URLs, form posts, image filenames, you name it.

Resources