The answer is yes, but another question is if you should? :]
As you admitted yourself, you are only started learning Web Development and Yii and you already want to develop whole social network? That seems to be a kind of huge, really huge work (especially for just one developer) and I’m thinking, if you are not to fast? Wouldn’t be easier for you to write first something easier like a blog or sth? You know, social networks are (by definition) pages being used by thousand of people, where even smallest mistake (especially in security area) can ruin whole project and make you really a lot of troubles.
Don’t get me wrong, I believe you are a fast learning person and I wish you the best. But you’re aiming in a really big adventure and I wish it wouldn’t be to big for you. I know quite a few people here that has Yii coding experience year or longer, PHP and Website development experience counted in many years and still wouldn’t take such a task like develop social network just by a one person.
And you admitted yourself, you are only started learning Web Development and Yii…
It’s certainly possible. There’s the http://www.yiiframework.com/doc/api/1.1/CWebService/ if you want to go that route, or you can use the curl Extension that was recently posted of Jacmoe’s REST that is shown here …
Generally speaking, I’m pretty convinced that if you can think of it (ESPECIALLY if it’s something that already exists elsewhere), you can build it Some things are just a little more complicated to accomplish than others.
Can someone give me an example of REST and SOAP operations, and what the difference is between them? I don’t really get the concept of these Web APIs or whatever, sorry I’m a noob just curious. Thanks.
Like an old proverb saying that the only thing impossible is to piss toward rain and remain dry! :] (sorry) But, on the other hand, as samdark replied in one of my topics, there are a few things in Yii that still need to be implemented. But… it is good to know that there aren’t many! :}
I am another person that would personally be very interested in such reading. Maybe someone can give as some tip on good reading, not sending us to old good uncle Google (right, Mike? :]) And maybe someone would be interested in writing a short cookbook article about it?
This REST is what makes it possible to write those nifty desktop apps you can use to read and post Tweets (Twitter) and/or update your blog from your desktop.
Or, what I need: to use TortoiseHg to fetch the list of outstanding issues and reference/close/fix them by commit messages (issue browser).
great job, I think that’s exactly what I need. To be straightforward - I’m absolutely new to this, but I still need to write some kind of REST interface…
So, what I did is:
copied your code (class RestRequest) to a new file protected\components\RestRequest.php
added the “‘resources’ => array(‘post’, ‘page’)” to my config\main.php
ran the code you provided …
But then I get an error
"Fatal error: Call to undefined function curl_init() in C:\xampp\htdocs\iDispatch\protected\components\RestRequest.php on line 44"
I think I have missed something or have done something wrong… Can you help me…?
I know it is more than a year after this was posted, but you will get this error if you do not have the php_curl extension installed on your web server. Hope this helps someone.