I'm new to Cassandra and I'm looking for the best way to integrate it with PHP.
As always there are many clients but it looks like most of them are not being supported. From what I've seen the most up to date is PHPCassa, unfortunately it doesn't look like it was designed for CQL (which as I understand is the preferable way to talk to Cassandra).
Cassandra-PDO looks interesting because it's using PDO abstraction, and I can (probably?) use high level libraries like Doctrine or Propel with it. Unfortunately the last commit was pushed about 2 years ago and it was very difficult to compile it (to be fair, it was probably a Mac / Thrift issue). I'm always very paranoiac about building something around "rusty" projects, so my question is:
Is it safe to use Cassandra-PDO with Cassandra 2.x? If it's not a good idea should I forget about CQL and go for PHPCassa or perhaps there is another solution?
This might help: https://github.com/Orange-OpenSource/YACassandraPDO
"This repository is a fork of:
https://code.google.com/a/apache-extras.org/p/cassandra-pdo/ We cloned
it on GitHub because the original project seemed to be dead.
This version is developped for the CQL3 target only. We do not provide
any support for former versions of CQL."
HTH,
Carlo
To my knowledge YACassandraPDO not stable.
Please check this PHP library http://evseevnn.github.io/php-cassandra-binary/
It is written by me, and how to work with it is similar to the PDO wrapper. Maybe it will suit you.
Related
i wonder, is there a way to work with SQLite on PHP version 4.2.3 ?
if you say i must update my php version, no i can't simply update my PHP version.
the system already have database, but i can't change that database it's not my authority though i can view, edit, or do anything to that database.
so i think maybe it's easier if i use my own sqlite database and make my own function to deal with the sqlite database, but i don't know if it supported by PHP version 4.2.3
thanks, any suggestion would be a great lift.
For what I found, yes, is possible to have sqlite under php4.
http://www.phpbuilder.com/columns/farell20040824.php3?page=1
http://polarwebservices.com/hostingblog/?p=6
http://forums.cpanel.net/f5/howto-install-sqlite-php4-servers-59201.html
And the source code of the sqlite extension is here: http://pecl.php.net/package/SQLite
Keep in mind is no longer supported, and is sqlite2 instead of sqlite3.
But if you are still using php4 on this year, I don't think you would really mind using an old sqlite, right? :P
By the way, IMHO, if that application makes you money, I think you should at least spend some time updating it.
I'm faced with a similar situation being stuck with PHP4. And I know where you're coming from (switching is much easier said than done specially if it's your own money you're spending).
But it's not the end of the world. Like you I needed to integrate newer technologies to my app. So what I did was instead to run 2 PHP versions along-side each other and created an API that I access via curl from PHP4.
That's the simplest approach I can think of. Hope that helps. I feel you man hehehe...
Does anyone know how to use phpcassa for cassandra with Yiiframework?
I've tried Cassandra PDO. It works very well, but I happened to like the way phpcassa works. Especially the support for most cassandra features.
I don't know but I found phpcassa much easier to use.
Any suggestions?
Regards
I'm not familiar with Yii in particular, but after glancing at it, I suspect you won't be able to use most of the Yii ORM-like features directly, whether it's though phpcassa or the PDO driver. Certainly it could work for some cases, but in general, your data in Cassandra is not modeled around objects, it's modeled around queries. Your goal is to lay out your data in such a way that you can answer queries that you have planned for very efficiently. Because Yii is object-oriented, there's a fundamental mismatch in how it expects you to interact with the database.
I've written an Yii extension today for cassandra-cql3, hope this might help others searching for an yii wrapper for cassandra CQL3
https://github.com/masumsoft/yii-cassandra-cql3
I'm trying to plan a web application that should use a noSQL solution - Cassandra seems to be a good solution. I saw there are libraries for PHP to manipulate the database like phpCassa.
Also I saw the new version of Cassandra 0.8 is introducing a query language CQL.
Are there php interfaces that use the CQL? What is the benefit using the CQL? Is it just a more sql-like way to make queries?
Thank you!
The link Greg posted above is to date the working repo and state of the php-cql driver efforts.
While a driver is not yet available it does not stop you from using CQL, the drivers are all going to be a wrapper of the thrift method "execute_cql_query" (Until a new transport is created anyway).
That means you can simply compile thrift for php or get it from an updated project and then pass your cql query to that method. It does mean manual handling of things that a driver will/should take care of.
"Is it just a more sql-like way to make queries?", basically...yes. One of the things that came up on the Cassandra mailing list was getting CQL to be as SQL-Like as possible.
"What is the benefit using the CQL?" Well, mainly that some new Cassandra users find the thrift API tedious to get to grips with, CQL may be much easier to learn since its is so close to the "normal" sql.
https://github.com/nicktelford/php-cql
I also believe that phpCassa should support it as well.
It's designed to make NoSQL more logical for people coming from SQL as a database engine.
This will really be helpful if you wish to use CQL to communicate with Cassandra via PHP
https://gist.github.com/1024060/983a5607390433b77d5c2e64a4ee148f4df46b69
This is a sample of what zcourts mentioned in his previous post
Regards,
Tamil
The official CQL drivers supported by the Apache Cassandra project at large are, I believe, all on Apache Extras, at this link:
http://code.google.com/a/apache-extras.org/hosting/search?q=label:cql
The PHP one is at
http://code.google.com/a/apache-extras.org/p/cassandra-pdo/
Connection via Thrift deprecated.
I am using PHP library for Cassandra database via a binary protocol.
Or is it just at a 'finished' state? I've used PHPDoc for many years on all my PHP projects, but I recently noticed that the last post on the PHPDoc website was from 2008. So I'm wondering if it's time to look into other alternatives like Doxygen. Are there any advantages to using something other than PHPDoc?
EDIT: Interesting post on Dev Zone today when Matthew announced the release of Zend Framework 1.11.5 he wrote:
"Mike van Riel offered to convert our API documentation generation to DocBlox. We'd already been considering it for ZF2, but on seeing the flexibility of the templating system, and, more importantly for us in terms of packaging, the speed and minimal resources it utilizes in generating the output, we were sold. (API documentation generation time was reduced from taking 80-100 minutes to less than 10.) You can view the results for yourself." http://devzone.zend.com/article/13643
This is why I'm concerned, if large projects like Zend Framework are dropping phpDoc, it seems to me the inactivity of phpDoc is not going unnoticed. 100 minutes down to 10..that's what I like to hear.
#gms8994 good call
*UPDATE: So turns out DocBlox is PHPDocumentor2 in disguise/re-branded. http://www.docblox-project.org/
Although I currently use doxygen, too, I have to post that PHPDocumentor is not dead. Instead the attempts made by the DocBlox project are joined to form the basis for PHPDocumentor2 which sports a brand new website. These days I'm not convinced it's production ready but it does already look really promising.
I have recently used Doxygen for generating documentation for PHP.This is open-source tool for documentation and support other languages too.I would say this is a good tool and it easily generate documentation as well as class diagrams and have lots of configurable features.It is available for Windows as well as UNIX/LINUX
Can Find the latest release and DOWNLOAD Here
Why fix something that isn't broken? PHPDoc works great, doesn't need anything else really. They're not trying to innovate, just to help create documentation. Which they did, very well.
I had several problems with phpDocumentor. One of them was the xml export. After a few attempts to fix the code I decided to look for an alternative.
What I found and liked was: Rarangi
https://bitbucket.org/laurentj/rarangi/wiki/Home
Rarangi is a generator of documents from php source code.
The interesting thing about it was that it saves the information in a mysql db and you can make your own custom reports.
phpDocumentor v3 (with proper PHP 7 support) is currently alpha, getting real close to a stable release. The problem is that they don't have a lot of people working on it, so development is slow.
I've tested the latest alpha on one of my Symfony projects and it does the job okay, although it's missing some features and has a couple of bugs. They were all reported, of course.
https://github.com/phpDocumentor/phpDocumentor/releases
Update: phpDocumentor v3 just went beta. Check releases.
I strongly prefer not to use additional 3rd party components, libraries or DLLs (at least in v1.0), unless there is absolutely no other solution.
Question: (how) can I use Delphi to progrtiamatically crate a BDE database and write to it, then use PHP to read from it?
Any URLs for examples of tutorial?
People are advising against it. Ok, the ultimate goal is some form of ODBC interface anyway. Someone mentioned ADO to me, but I don't see how to install it.
I need to crate the entire database and contents programatically in Delphi - at run time - I have no idea of it's contents or even name at compile time.
What's the simplest route for me? Thanks
Sounds like a bad idea to me, to be honest. BDE is long-since deprecated and I seriously doubt if you could get PHP to jive with it.
I would recommend using a standard database such as Firebird or MySQL for which established Delphi and PHP libraries exist, or XML if the dataset is not too large.
By BDE you mean Paradox or DBase? Wouldn't recomment using those anymore. I moved into Firebird and MySQL years ago just like Alan recommends.
Delphi supports Firebird/Interbase database out of the box AFAIK and PHP libraries exist for it. Other way around : MySQL support is in all PHP installations and there are some very good components for Delphi