<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sense Egbert Hofstede &#187; php</title>
	<atom:link href="http://www.sehofstede.nl/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sehofstede.nl</link>
	<description>Personal site of a tech enthusiast</description>
	<lastBuildDate>Fri, 13 Jan 2012 15:01:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>“Ubuntu Wanted revision 20: new model interface</title>
		<link>http://www.sehofstede.nl/%e2%80%9cubuntu-wanted-revision-20-new-model-interface</link>
		<comments>http://www.sehofstede.nl/%e2%80%9cubuntu-wanted-revision-20-new-model-interface#comments</comments>
		<pubDate>Sat, 17 Jan 2009 16:29:29 +0000</pubDate>
		<dc:creator>Sense Egbert Hofstede</dc:creator>
				<category><![CDATA[English Posts]]></category>
		<category><![CDATA[Planet Ubuntu]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ubuntuwanted]]></category>

		<guid isPermaLink="false">http://qense.nl/?p=247</guid>
		<description><![CDATA[Recent revisions 20. By Sense Hofstede 2 minutes ago Not working current state of the model rewrite. ToDo: skill-task bridge and let the views use the new model interface, currently they&#8217;re broken. via “Ubuntu Wanted devel version” branch in Launchpad. &#8230; <a href="http://www.sehofstede.nl/%e2%80%9cubuntu-wanted-revision-20-new-model-interface">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>Recent revisions</p>
<p>20. By  Sense Hofstede 2 minutes ago</p>
<p>Not working current state of the model rewrite. ToDo: skill-task bridge and let the views use the new model interface, currently they&#8217;re broken.</p>
<p>via <a href="https://code.edge.launchpad.net/~qense/ubuntu-wanted/qevel">“Ubuntu Wanted devel version” branch in Launchpad</a>.</p></blockquote>
<p>I&#8217;ve just commited the 20th revision of Ubuntu Wanted to my working copy branch of it. In this revision the largest part of the new model interface has been done.</p>
<p>Although it yet has to be integrated and the Model::store() function doesn&#8217;t work, the basic functions are working.<br />
Most of the code has been moved to the Model class itself, which was abstracted.</p>
<p>Based on the input of the Model::init() function the Model::load() function generates the query and executes it. The only thing the extended models currently do is giving the table name.</p>
<p>All data is stored duplicate, a read only and a working copy. You can freely edit the working copy. If you&#8217;re done you can either revert the changes you did by executing Model::clean() or save them by executing Model::store(). That method will compare both data copies and will only update those variables and rows that were changed.</p>
<p>Other new things: Model::reload and Model::purge.</p>
<p>I still need to create a skill-task link, but I&#8217;ve already got an idea. I&#8217;m going to give the task model a method that creates a list of needed skills and request the skill model in the controller &#8212; need to figure out some kind of dependency system &#8212; and adds the references to the data of the skills used in each task entry.</p>
<p>Feedback is very welcome, just like programmers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sehofstede.nl/%e2%80%9cubuntu-wanted-revision-20-new-model-interface/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Launchpad PHP library</title>
		<link>http://www.sehofstede.nl/launchpad-php-library</link>
		<comments>http://www.sehofstede.nl/launchpad-php-library#comments</comments>
		<pubDate>Sat, 13 Sep 2008 10:03:36 +0000</pubDate>
		<dc:creator>Sense Egbert Hofstede</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[English Posts]]></category>
		<category><![CDATA[Planet Ubuntu]]></category>
		<category><![CDATA[launchpad]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.qense.nl/?p=159</guid>
		<description><![CDATA[A while ago there was a really nice session at #ubuntu-classroom during the UbuntuDeveloperWeek about the Launchpad API(LaunchpadWebService). During this session I said that I started with a implementation in PHP, which at first I meant to be used for &#8230; <a href="http://www.sehofstede.nl/launchpad-php-library">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A while ago there was a really nice session at #ubuntu-classroom during the <a href="https://wiki.ubuntu.com/UbuntuDeveloperWeek">UbuntuDeveloperWeek</a> about the Launchpad API(<a href="https://wiki.ubuntu.com/MeetingLogs/devweek0809/LaunchpadWebService">LaunchpadWebService</a>). During this session I said that I started with a implementation in PHP, which at first I meant to be used for the Ubuntu Wanted site. However, I postponed this because it wasn&#8217;t necessary anymore for UW and because of the lack of a WADL (dynamic) implementation for PHP, which means that every time a new version of the API is released a lot of changes are needed.</p>
<p>Other things that made me stop were rumours about a Drupal 5 module and a lack of time. I did want to share the small stub I had, though. I uploaded the single file to <a href="https://code.launchpad.net/~qense/+junk/liblp-php">lp:~qense/+junk/liblp-php</a>. Don&#8217;t expect much of it though. All it currently should be able to do is to authenticate itself using OAuth. I just tested it a tiny bit, so there could be a lot of bugs.</p>
<p>I&#8217;ll explain how you can authenticate yourself. It&#8217;s possible that I&#8217;ve made some bad design decissions, but please remember this isn&#8217;t even pre-alpha. I didn&#8217;t safe OAuth keys, so reusing authentication could be problematic.</p>
<p>You start with calling the contructor by creating a new class. You need at least to pass on two things: the key you want to use, which is used to identify your site and generate the OAuth key and if you&#8217;ve got a token from earlier sessions you should pass it as the second argument. A username can be passed as the third argument, although the only thing the class currently does with it, is saving it.</p>
<p>After that you need to call the method <em>auth()</em>, which checks if the user already has given permission to the page to use Launchpad on his/her behalf. If (s)he hasn&#8217;t the URL the user needs to surf to is returned, if the user already was authenticated it returns true and when you get the tokens for the first time the tokens are returned. That is probably a very bad practise, but I wanted to get something working quicly so I could test it.</p>
<p>That&#8217;s currently all it can do, although I did write two functions which can do GET and POST requests usin cURL. The idea is to let bugs, people and other things be represented by classes, which members can used to manipulate the data. When you do <em>echo classname_of_e.g._bug</em> you should get the link to its page.</p>
<p>Well, that&#8217;s just the idea. I&#8217;m not sure if it will ever be finished. If anyone is interested in continuing with this I&#8217;d be glad to help if (s)he needs me. People don&#8217;t have to use it, I just though that I should share it, so people who could be interested would be able to find it.</p>
<p>Feedback is welcome, as always. However, please keep in mind that this code is written in one afternoon and didn&#8217;t got any reviews afterwards. This means it can be dangerous to use. ONLY use it on staging.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sehofstede.nl/launchpad-php-library/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

