<?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>schwobeseggl.de &#187; PHP</title>
	<atom:link href="http://schwobeseggl.de/category/programmiersprachen/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://schwobeseggl.de</link>
	<description>ein Neigschmecktr in Baden</description>
	<lastBuildDate>Wed, 14 Jul 2010 09:24:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Klassenvariablen</title>
		<link>http://schwobeseggl.de/2009/06/19/klassenvariablen/</link>
		<comments>http://schwobeseggl.de/2009/06/19/klassenvariablen/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 10:11:14 +0000</pubDate>
		<dc:creator>pennywise</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://schwobeseggl.de/?p=2074</guid>
		<description><![CDATA[PHP hat ein scheußĺiches Feature: Dynamik. class Foobar { /** * @constructor */ function Foobar($params) { foreach ($params as $key=&#62;$val) { $this-&#62;$key= $val; } } } hiermit erzeugt man einfach mal beliebige Klassenvariablen. Man kann das auch gleich noch besonders toll machen und &#8220;magische&#8221; getter und setter benutzen: public function __set($var, $val){ $this-&#62;$var = $val; [...]]]></description>
			<content:encoded><![CDATA[<p>PHP hat ein scheußĺiches Feature: Dynamik.</p>
<pre>
<pre class="brush: php;">class Foobar {
/**
* @constructor
*/
  function Foobar($params) {
    foreach ($params as $key=&gt;$val) {
      $this-&gt;$key= $val;
    }
  }
}</pre>
</pre>
<p>hiermit erzeugt man einfach mal beliebige Klassenvariablen. Man kann das auch gleich noch besonders toll machen und &#8220;magische&#8221; getter und setter benutzen:</p>
<pre>
<pre class="brush: php;">public function __set($var, $val){
  $this-&gt;$var = $val;
}

public function __get($var){
  if(isset($this-&gt;$var)){
    return $this-&gt;$var;
  } else {
    throw new Exception(&quot;Property ‘$var’ does not exist&quot;);
  }
}</pre>
</pre>
<p>Echt toll. Somit weiß man _nie_ welche Variablen ein Objekt zur Zeit hat. Tolle Sache.</p>
]]></content:encoded>
			<wfw:commentRss>http://schwobeseggl.de/2009/06/19/klassenvariablen/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Code Examples, Part 1</title>
		<link>http://schwobeseggl.de/2009/06/17/code-examples-part-1/</link>
		<comments>http://schwobeseggl.de/2009/06/17/code-examples-part-1/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 07:24:48 +0000</pubDate>
		<dc:creator>pennywise</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Spass]]></category>

		<guid isPermaLink="false">http://schwobeseggl.de/?p=2059</guid>
		<description><![CDATA[Gerade hab ich folgendes Code-Beispiel gefunden (nein, nicht auf der Arbeit, sondern &#8220;im Internet&#8221;) function is_negative($number) { return substr((string)$number, 0, 1) === '-'; } Ich lass das einfach mal so stehen &#8230;]]></description>
			<content:encoded><![CDATA[<p>Gerade hab ich folgendes Code-Beispiel gefunden (nein, nicht auf der Arbeit, sondern &#8220;im Internet&#8221;)</p>
<pre>
<pre class="brush: php;">function is_negative($number) {
return substr((string)$number, 0, 1) === '-';
}</pre>
</pre>
<p>Ich lass das einfach mal so stehen &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://schwobeseggl.de/2009/06/17/code-examples-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powerpoint mit PHP</title>
		<link>http://schwobeseggl.de/2009/04/29/powerpoint-mit-php/</link>
		<comments>http://schwobeseggl.de/2009/04/29/powerpoint-mit-php/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 21:18:41 +0000</pubDate>
		<dc:creator>pennywise</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[klasse]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[Powerpoint]]></category>

		<guid isPermaLink="false">http://schwobeseggl.de/?p=1870</guid>
		<description><![CDATA[Wieder was interessantes aus der Gegend von PHP. Office 2007 baut ja inzwischen XML-basierte Dateien, d.h. das Erstellen von Office-Dokumenten ist erstaunlich einfach geworden. Nun gibt es neben der Excel-Klasse auch noch Powerpoint per PHP. Ein Quellcodebeispiel gibt es hier: http://blog.maartenballiauw.be/post/2009/04/27/PHPPowerPoint-010-(CTP1)-released!.aspx Das Zipfile das es zum Download gibt, enthält auch vier Testfälle. In meinem Fall [...]]]></description>
			<content:encoded><![CDATA[<p>Wieder was interessantes aus der Gegend von PHP. Office 2007 baut ja inzwischen XML-basierte Dateien, d.h. das Erstellen von Office-Dokumenten ist erstaunlich einfach geworden. Nun gibt es neben der <a  href="http://www.phpexcel.net/">Excel-Klasse</a> auch noch Powerpoint per PHP.</p>
<p>Ein Quellcodebeispiel gibt es hier: <a  href="http://blog.maartenballiauw.be/post/2009/04/27/PHPPowerPoint-010-(CTP1)-released!.aspx">http://blog.maartenballiauw.be/post/2009/04/27/PHPPowerPoint-010-(CTP1)-released!.aspx</a></p>
<p>Das Zipfile das es zum Download gibt, enthält auch vier Testfälle. In meinem Fall musste ich noch den <a  href="http://www.php.net/manual/de/book.xmlwriter.php">XMLWriter</a> mit in PHP einkompilieren und danach noch ein paar Dateien und Verzeichnisse umbennen, da Linux bekanntlich sehr auf Groß- und Kleinschreibung achtet (PHPPowerpoint.php != PHPPowerPoint.php). Anyway, hier ein Beispielcode aus dem Zip und danach die generierte Powerpoint-Datei:</p>
<pre>
<pre class="brush: php;">&lt;?php
/**
 * PHPPowerPoint
 *
 * Copyright (c) 2009 - 2010 PHPPowerPoint
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * @category   PHPPowerPoint
 * @package    PHPPowerPoint
 * @copyright  Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
 * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
 * @version    0.1.0, 2009-04-27
 */

/** Error reporting */
error_reporting(E_ALL);

/** Include path **/
set_include_path(get_include_path() . PATH_SEPARATOR . '../Classes/');

/** PHPPowerPoint */
include 'PHPPowerPoint.php';

/** PHPPowerPoint_IOFactory */
include 'PHPPowerPoint/IOFactory.php';

// Create new PHPPowerPoint object
echo date('H:i:s') . &quot; Create new PHPPowerPoint object\n&quot;;
$objPHPPowerPoint = new PHPPowerPoint();

// Set properties
echo date('H:i:s') . &quot; Set properties\n&quot;;
$objPHPPowerPoint-&gt;getProperties()-&gt;setCreator(&quot;Maarten Balliauw&quot;);
$objPHPPowerPoint-&gt;getProperties()-&gt;setLastModifiedBy(&quot;Maarten Balliauw&quot;);
$objPHPPowerPoint-&gt;getProperties()-&gt;setTitle(&quot;Office 2007 PPTX Test Document&quot;);
$objPHPPowerPoint-&gt;getProperties()-&gt;setSubject(&quot;Office 2007 PPTX Test Document&quot;);
$objPHPPowerPoint-&gt;getProperties()-&gt;setDescription(&quot;Test document for Office 2007 PPTX, generated using PHP classes.&quot;);
$objPHPPowerPoint-&gt;getProperties()-&gt;setKeywords(&quot;office 2007 openxml php&quot;);
$objPHPPowerPoint-&gt;getProperties()-&gt;setCategory(&quot;Test result file&quot;);

// Remove first slide
echo date('H:i:s') . &quot; Remove first slide\n&quot;;
$objPHPPowerPoint-&gt;removeSlideByIndex(0);

// Create templated slide
echo date('H:i:s') . &quot; Create templated slide\n&quot;;
$currentSlide = createTemplatedSlide($objPHPPowerPoint); // local function

// Create a shape (text)
echo date('H:i:s') . &quot; Create a shape (rich text)\n&quot;;
$shape = $currentSlide-&gt;createRichTextShape();
$shape-&gt;setHeight(200);
$shape-&gt;setWidth(600);
$shape-&gt;setOffsetX(10);
$shape-&gt;setOffsetY(400);
$shape-&gt;getAlignment()-&gt;setHorizontal( PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT );

$textRun = $shape-&gt;createTextRun('Introduction to');
$textRun-&gt;getFont()-&gt;setBold(true);
$textRun-&gt;getFont()-&gt;setSize(28);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

$shape-&gt;createBreak();

$textRun = $shape-&gt;createTextRun('PHPPowerPoint');
$textRun-&gt;getFont()-&gt;setBold(true);
$textRun-&gt;getFont()-&gt;setSize(60);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

// Create templated slide
echo date('H:i:s') . &quot; Create templated slide\n&quot;;
$currentSlide = createTemplatedSlide($objPHPPowerPoint); // local function

// Create a shape (text)
echo date('H:i:s') . &quot; Create a shape (rich text)\n&quot;;
$shape = $currentSlide-&gt;createRichTextShape();
$shape-&gt;setHeight(100);
$shape-&gt;setWidth(930);
$shape-&gt;setOffsetX(10);
$shape-&gt;setOffsetY(10);
$shape-&gt;getAlignment()-&gt;setHorizontal( PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT );

$textRun = $shape-&gt;createTextRun('What is PHPPowerPoint?');
$textRun-&gt;getFont()-&gt;setBold(true);
$textRun-&gt;getFont()-&gt;setSize(48);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

// Create a shape (text)
echo date('H:i:s') . &quot; Create a shape (rich text)\n&quot;;
$shape = $currentSlide-&gt;createRichTextShape();
$shape-&gt;setHeight(600);
$shape-&gt;setWidth(930);
$shape-&gt;setOffsetX(10);
$shape-&gt;setOffsetY(100);
$shape-&gt;getAlignment()-&gt;setHorizontal( PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT );

$textRun = $shape-&gt;createTextRun('- A class library');
$textRun-&gt;getFont()-&gt;setSize(36);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

$shape-&gt;createBreak();

$textRun = $shape-&gt;createTextRun('- Written in PHP');
$textRun-&gt;getFont()-&gt;setSize(36);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

$shape-&gt;createBreak();

$textRun = $shape-&gt;createTextRun('- Representing a presentation');
$textRun-&gt;getFont()-&gt;setSize(36);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

$shape-&gt;createBreak();

$textRun = $shape-&gt;createTextRun('- Supports writing to different file formats');
$textRun-&gt;getFont()-&gt;setSize(36);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

// Create templated slide
echo date('H:i:s') . &quot; Create templated slide\n&quot;;
$currentSlide = createTemplatedSlide($objPHPPowerPoint); // local function

// Create a shape (text)
echo date('H:i:s') . &quot; Create a shape (rich text)\n&quot;;
$shape = $currentSlide-&gt;createRichTextShape();
$shape-&gt;setHeight(100);
$shape-&gt;setWidth(930);
$shape-&gt;setOffsetX(10);
$shape-&gt;setOffsetY(10);
$shape-&gt;getAlignment()-&gt;setHorizontal( PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT );

$textRun = $shape-&gt;createTextRun('What\'s the point?');
$textRun-&gt;getFont()-&gt;setBold(true);
$textRun-&gt;getFont()-&gt;setSize(48);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

// Create a shape (text)
echo date('H:i:s') . &quot; Create a shape (rich text)\n&quot;;
$shape = $currentSlide-&gt;createRichTextShape();
$shape-&gt;setHeight(600);
$shape-&gt;setWidth(930);
$shape-&gt;setOffsetX(10);
$shape-&gt;setOffsetY(100);
$shape-&gt;getAlignment()-&gt;setHorizontal( PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT );

$textRun = $shape-&gt;createTextRun('- Generate slide decks');
$textRun-&gt;getFont()-&gt;setSize(36);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

$shape-&gt;createBreak();

$textRun = $shape-&gt;createTextRun('    - Represent business data');
$textRun-&gt;getFont()-&gt;setSize(28);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

$shape-&gt;createBreak();

$textRun = $shape-&gt;createTextRun('    - Show a family slide show');
$textRun-&gt;getFont()-&gt;setSize(28);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

$shape-&gt;createBreak();

$textRun = $shape-&gt;createTextRun('    - ...');
$textRun-&gt;getFont()-&gt;setSize(28);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

$shape-&gt;createBreak();

$textRun = $shape-&gt;createTextRun('- Export these to different formats');
$textRun-&gt;getFont()-&gt;setSize(36);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

$shape-&gt;createBreak();

$textRun = $shape-&gt;createTextRun('    - PowerPoint 2007');
$textRun-&gt;getFont()-&gt;setSize(28);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

$shape-&gt;createBreak();

$textRun = $shape-&gt;createTextRun('    - Serialized');
$textRun-&gt;getFont()-&gt;setSize(28);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

$shape-&gt;createBreak();

$textRun = $shape-&gt;createTextRun('    - ... (more to come) ...');
$textRun-&gt;getFont()-&gt;setSize(28);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

// Create templated slide
echo date('H:i:s') . &quot; Create templated slide\n&quot;;
$currentSlide = createTemplatedSlide($objPHPPowerPoint); // local function

// Create a shape (text)
echo date('H:i:s') . &quot; Create a shape (rich text)\n&quot;;
$shape = $currentSlide-&gt;createRichTextShape();
$shape-&gt;setHeight(100);
$shape-&gt;setWidth(930);
$shape-&gt;setOffsetX(10);
$shape-&gt;setOffsetY(10);
$shape-&gt;getAlignment()-&gt;setHorizontal( PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT );

$textRun = $shape-&gt;createTextRun('Need more info?');
$textRun-&gt;getFont()-&gt;setBold(true);
$textRun-&gt;getFont()-&gt;setSize(48);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

// Create a shape (text)
echo date('H:i:s') . &quot; Create a shape (rich text)\n&quot;;
$shape = $currentSlide-&gt;createRichTextShape();
$shape-&gt;setHeight(600);
$shape-&gt;setWidth(930);
$shape-&gt;setOffsetX(10);
$shape-&gt;setOffsetY(100);
$shape-&gt;getAlignment()-&gt;setHorizontal( PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT );

$textRun = $shape-&gt;createTextRun('Check the project site on CodePlex:');
$textRun-&gt;getFont()-&gt;setSize(36);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

$shape-&gt;createBreak();

$textRun = $shape-&gt;createTextRun('    http://phppowerpoint.codeplex.com');
$textRun-&gt;getFont()-&gt;setSize(36);
$textRun-&gt;getFont()-&gt;setColor( new PHPPowerPoint_Style_Color( 'FFFFFFFF' ) );

// Create templated slide
echo date('H:i:s') . &quot; Create templated slide\n&quot;;
$currentSlide = createTemplatedSlide($objPHPPowerPoint); // local function

// Save PowerPoint 2007 file
echo date('H:i:s') . &quot; Write to PowerPoint2007 format\n&quot;;
$objWriter = PHPPowerPoint_IOFactory::createWriter($objPHPPowerPoint, 'PowerPoint2007');
$objWriter-&gt;save(str_replace('.php', '.pptx', __FILE__));

// Echo memory peak usage
echo date('H:i:s') . &quot; Peak memory usage: &quot; . (memory_get_peak_usage(true) / 1024 / 1024) . &quot; MB\r\n&quot;;

// Echo done
echo date('H:i:s') . &quot; Done writing file.\r\n&quot;;

/**
 * Creates a templated slide
 *
 * @param PHPPowerPoint $objPHPPowerPoint
 * @return PHPPowerPoint_Slide
 */
function createTemplatedSlide(PHPPowerPoint $objPHPPowerPoint)
{
	// Create slide
	$slide = $objPHPPowerPoint-&gt;createSlide();

	// Add background image
    $shape = $slide-&gt;createDrawingShape();
    $shape-&gt;setName('Background');
    $shape-&gt;setDescription('Background');
    $shape-&gt;setPath('./images/realdolmen_bg.jpg');
    $shape-&gt;setWidth(950);
    $shape-&gt;setHeight(720);
    $shape-&gt;setOffsetX(0);
    $shape-&gt;setOffsetY(0);

    // Add logo
    $shape = $slide-&gt;createDrawingShape();
    $shape-&gt;setName('PHPPowerPoint logo');
    $shape-&gt;setDescription('PHPPowerPoint logo');
    $shape-&gt;setPath('./images/phppowerpoint_logo.gif');
    $shape-&gt;setHeight(40);
    $shape-&gt;setOffsetX(10);
    $shape-&gt;setOffsetY(720 - 10 - 40);

    // Return slide
    return $slide;
}
</pre>
</pre>
</pre>
<p>Die Testdatei geniert folgende Konsolenausgabe:</p>
<pre>23:16:10 Create new PHPPowerPoint object
23:16:10 Set properties
23:16:10 Remove first slide
23:16:10 Create templated slide
23:16:10 Create a shape (rich text)
23:16:10 Create templated slide
23:16:10 Create a shape (rich text)
23:16:10 Create a shape (rich text)
23:16:10 Create templated slide
23:16:10 Create a shape (rich text)
23:16:10 Create a shape (rich text)
23:16:10 Create templated slide
23:16:10 Create a shape (rich text)
23:16:10 Create a shape (rich text)
23:16:10 Create templated slide
23:16:10 Write to PowerPoint2007 format
23:16:10 Peak memory usage: 3.5 MB
23:16:10 Done writing file.</pre>
<p>Und dieses PDF hab ich aus dem Ergebnis erstellt (dazu brauch man dann wieder Powerpoint 2007, das kann die Klasse glaube ich nicht <img src='http://schwobeseggl.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<ul>
<li><a  href="http://schwobeseggl.de/wp-content/uploads/2009/04/02presentation.pdf">02presentation.pdf</a>.</li>
</ul>
<p>Soweit so gut.</p>
<ul>
<li>Quelle<a  href="http://www.phppowerpoint.net/">http://www.phppowerpoint.net/</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://schwobeseggl.de/2009/04/29/powerpoint-mit-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quassel &#8211; PHP_search</title>
		<link>http://schwobeseggl.de/2009/04/24/quassel-php_search/</link>
		<comments>http://schwobeseggl.de/2009/04/24/quassel-php_search/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 13:15:25 +0000</pubDate>
		<dc:creator>pennywise</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sonstiges]]></category>
		<category><![CDATA[Spass]]></category>
		<category><![CDATA[Quassel]]></category>
		<category><![CDATA[suche]]></category>

		<guid isPermaLink="false">http://schwobeseggl.de/?p=1856</guid>
		<description><![CDATA[Ich nutze ja schon eine Weile lang Quassel-IRC. Leider durchsucht die Suche nur das bereits vorhandene Backlog (bzw. die &#8220;Chathistorie&#8221;) und man muss immer erst mühsam bis zum Anfang hochscrollen, damit er sich &#8220;mehr&#8221; holt. Jetzt hab ich einfach auf dem Server auf dem der Core läuft folgendes PHP-Script hinterlegt: #!/usr/bin/php -q &#60;?php $shortopts = [...]]]></description>
			<content:encoded><![CDATA[<p>Ich nutze ja schon eine Weile lang <a  href="http://www.quassel-irc.org/">Quassel-IRC.</a> Leider durchsucht die Suche nur das bereits vorhandene Backlog (bzw. die &#8220;Chathistorie&#8221;) und man muss immer erst mühsam bis zum Anfang hochscrollen, damit er sich &#8220;mehr&#8221; holt.</p>
<p>Jetzt hab ich einfach auf dem Server auf dem der Core läuft folgendes PHP-Script hinterlegt:</p>
<pre>
<pre class="brush: php;">#!/usr/bin/php -q
&lt;?php
$shortopts  = &quot;&quot;;
$shortopts .= &quot;h:&quot;;
$shortopts .= &quot;u:&quot;;
$shortopts .= &quot;c:&quot;;
$shortopts .= &quot;s:&quot;;

$options = getopt($shortopts);

function getMessage($db, $quasseluser, $channel, $search = null) {
    $quasseluser = sqlite_escape_string($quasseluser);
    $channel = sqlite_escape_string($channel);
    $search = sqlite_escape_string($search);

    $sql = '
        SELECT DISTINCT
                backlog.time AS time,
                sender.sender AS sender,
                backlog.message AS message,
                buffer.buffername AS buffername
        FROM backlog
        OUTER JOIN quasseluser, buffer, sender
        ON (
                quasseluser.username = &quot;'.$quasseluser.'&quot;
                AND
                backlog.bufferid = buffer.bufferid
                AND
                quasseluser.userid = buffer.userid
                AND
                buffer.buffername LIKE &quot;%'.$channel.'%&quot;
                AND
                sender.senderid = backlog.senderid
        )';
    if ($search != null) {
        $sql .= ' WHERE message LIKE &quot;%'.$search.'%&quot;;';
    }
    $output = array();
    $longestname = 0;
    foreach ($db-&gt;query($sql) as $row) {
        $sender = explode(&quot;!&quot;, $row['sender']);
        $sendername = $sender[0];
        if (strlen($sendername) &gt; $longestname) {
            $longestname = strlen($sendername);
        }
        array_push(
            $output,
            array(
                date(&quot;Y-m-d H:i:s&quot;, $row['time']),
                $row['buffername'],
                $sendername,
                $row['message']
            ));
    }
    foreach ($output as $entry) {
        printf(&quot;%s (%s) %s : %s\n&quot;, $entry[0], $entry[1], str_pad($entry[2], $longestname, &quot; &quot;), $entry[3]);
    }
    printf(&quot;Es wurden %u Ergebnisse gefunden.\n&quot;, count($output));
}

try {
    $homepath = $options[&quot;h&quot;];
    $username = $options[&quot;u&quot;];
    $buffer = $options[&quot;c&quot;];
    $search = $options[&quot;s&quot;];

    if(!$homepath || !$username || !$buffer) {
        $output = &quot;usage: &quot;;
        $output .= __FILE__.&quot; -h &lt;path/to/quassel/sqlite&gt; -u &lt;quasseluser&gt; -c &lt;channel/buffer&gt; [-s &lt;string&gt;]&quot;;
        die($output . &quot;\n&quot;);
    }

    $db = new PDO('sqlite:' . $homepath);
    getMessage($db, $username, $buffer, $search);

} catch (PDOException $e) {
    echo 'Connection failed: ' . $e-&gt;getMessage();
}</pre>
</pre>
</pre>
<p>Keinerlei Fehlerbehandlung, wenns schiefläuft geht bestimmt irgendwas irreperabel kaputt. Keine Garantie für nichts <img src='http://schwobeseggl.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Ein möglicher Aufruf wäre:</p>
<pre>
<pre class="brush: bash;">14:34:46 pennywise ~# ./searchQuassel.php -h quassel-storage.sqlite -u pennywise -c quassel.de -s foobar
2008-11-03 11:49:01 (#quassel.de) pennywise    : und da war der Bot jetzt halt drin, weil er irgendwas gesagt hat wie &quot;hallo foobar, wilkkommen in der hölle&quot;
2008-11-06 20:35:57 (#quassel.de) pennywise    : kann ich auch ein temporäres netzwerk haben? sowas wie /join irc.server.com/#foobar?
2008-11-12 11:52:56 (#quassel.de) hanswurst    : im core-log steht nur &quot;foobar benutzer x getrennt&quot;</pre>
</pre>
</pre>
<p><strong>manpage</strong></p>
<blockquote><p><strong>-h</strong> : Pfad zur SQLite-DB von quasselcore. Liegt meist in <em>~/.config/quassel-irc.org/</em><br />
<strong>-u</strong> : Der Benutzer mit dem man sich in quassel einloggt. Dies hat nichts mit der IRC-Identität zu tun.<br />
<strong>-c</strong> : Der Channel (bzw. das Query) in dem gesucht werden soll. Ist case insensitive und kann auch nur teilweise übergeben werden (z.B. "quassel" findet "#quassel", "#quassel.de" und "quassel-announce")<br />
<strong>-s</strong> : OPTIONAL. Der Text nach dem gesucht werden soll. Wenn weggelassen, dann werden alle Nachrichten im übergebenen Channel zurückgegeben</p></blockquote>
<p>Ich hatte auch noch ne Version mit Prepared Statements, aber die hat beim "$db->prepare($sql)" einfach kein Statement erzeugt. Ohne Fehlermeldung ohne alles. WTF?!</p>
]]></content:encoded>
			<wfw:commentRss>http://schwobeseggl.de/2009/04/24/quassel-php_search/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aus PHP C#-Klassen nutzen</title>
		<link>http://schwobeseggl.de/2009/04/22/aus-php-c-klassen-nutzen/</link>
		<comments>http://schwobeseggl.de/2009/04/22/aus-php-c-klassen-nutzen/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 15:36:06 +0000</pubDate>
		<dc:creator>pennywise</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://schwobeseggl.de/?p=1852</guid>
		<description><![CDATA[Netter Artikel (auf Englisch) dazu findet sich hier: http://dev.juokaz.com/winphp-2009/using-php-with-c-written-libraries]]></description>
			<content:encoded><![CDATA[<p>Netter Artikel (auf Englisch) dazu findet sich hier:</p>
<ul>
<li><a  href="http://dev.juokaz.com/winphp-2009/using-php-with-c-written-libraries">http://dev.juokaz.com/winphp-2009/using-php-with-c-written-libraries</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://schwobeseggl.de/2009/04/22/aus-php-c-klassen-nutzen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scienta ZF Debug Bar</title>
		<link>http://schwobeseggl.de/2009/03/30/scienta-zf-debug-bar/</link>
		<comments>http://schwobeseggl.de/2009/03/30/scienta-zf-debug-bar/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 13:36:31 +0000</pubDate>
		<dc:creator>pennywise</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sonstiges]]></category>
		<category><![CDATA[Debug]]></category>
		<category><![CDATA[erweiterung]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://schwobeseggl.de/?p=1783</guid>
		<description><![CDATA[Der Firefox und seine diversen Erweiterungen. Es gibt mit Firebug und FirePHP schon exzellente Tools zur Entwicklung mit PHP und jetzt gibt es noch ein Weiteres: Scienta ZF Debug Bar Der aufmerksame Leser hat hier ZF entdeckt und, ja tatsächlich, hier ist die Rede vom Zend Framework. Die Toolbar erlaubt es einem die SQL-Queries, die [...]]]></description>
			<content:encoded><![CDATA[<p>Der Firefox und seine diversen Erweiterungen. Es gibt mit <a  href="https://addons.mozilla.org/de/firefox/addon/1843">Firebug</a> und <a  href="https://addons.mozilla.org/en-US/firefox/addon/6149">FirePHP</a> schon exzellente Tools zur Entwicklung mit PHP und jetzt gibt es noch ein Weiteres:</p>
<p style="text-align: center;"><strong>Scienta ZF Debug Bar</strong></p>
<p>Der aufmerksame Leser hat hier ZF entdeckt und, ja tatsächlich, hier ist die Rede vom Zend Framework.</p>
<p><a  class="thickbox no_icon" href="http://schwobeseggl.de/wp-content/uploads/2009/03/2009scienta-debugbar.png" rel="gallery-1783" title="2009scienta-debugbar.png"><img class="aligncenter size-medium wp-image-1781" title="2009scienta-debugbar.png" src="http://schwobeseggl.de/wp-content/uploads/2009/03/2009scienta-debugbar-300x11.png" alt="2009scienta-debugbar.png" width="300" height="11" /></a></p>
<p>Die Toolbar erlaubt es einem die SQL-Queries, die Page-Render-Zeit, die Version des ZF und den Speicherverbrauch anzuzeigen. Und noch ein paar Gimmicks mehr, dazu verweise ich aber einfach auf den Original-Blogeintrag.</p>
<p>Quelle: <a  title="http://jokke.dk/blog/2009/01/introducing_the_scienta_zf_debug_bar" href="http://jokke.dk/blog/2009/01/introducing_the_scienta_zf_debug_bar">http://jokke.dk/blog/2009/01/introducing_the_scienta_zf_debug_bar</a></p>
]]></content:encoded>
			<wfw:commentRss>http://schwobeseggl.de/2009/03/30/scienta-zf-debug-bar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Professionell erstellte Supportanfragen</title>
		<link>http://schwobeseggl.de/2008/12/22/professionell-erstellte-supportanfragen/</link>
		<comments>http://schwobeseggl.de/2008/12/22/professionell-erstellte-supportanfragen/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 09:30:38 +0000</pubDate>
		<dc:creator>pennywise</dc:creator>
				<category><![CDATA[PC & Accessoires]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Mailingliste]]></category>

		<guid isPermaLink="false">http://schwobeseggl.de/?p=1514</guid>
		<description><![CDATA[Gott sei Dank ist meine Supporterzeit schon ne Weile her, aber gerade hab ich eine Mailinglisten-Anfrage gelesen, da hab ich schon beim &#8220;Betreff&#8221;-Lesen das Schaudern gekriegt: Noob configuration issue Ohne Witz. Schon jetzt keine Lust auch nur annähernd mich in sein Problem reinzudenken]]></description>
			<content:encoded><![CDATA[<p>Gott sei Dank ist meine Supporterzeit schon ne Weile her, aber gerade hab ich eine Mailinglisten-Anfrage gelesen, da hab ich schon beim &#8220;Betreff&#8221;-Lesen das Schaudern gekriegt:</p>
<p><strong>Noob configuration issue</strong></p>
<p>Ohne Witz. Schon jetzt keine Lust auch nur annähernd mich in sein Problem reinzudenken <img src='http://schwobeseggl.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://schwobeseggl.de/2008/12/22/professionell-erstellte-supportanfragen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP hates me &#8211; eine Set-Klasse</title>
		<link>http://schwobeseggl.de/2008/12/12/php-hates-me-eine-set-klasse/</link>
		<comments>http://schwobeseggl.de/2008/12/12/php-hates-me-eine-set-klasse/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 10:46:01 +0000</pubDate>
		<dc:creator>pennywise</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Set]]></category>

		<guid isPermaLink="false">http://schwobeseggl.de/?p=1451</guid>
		<description><![CDATA[Kommentare gesperrt, weil dieses Posting Spambots magisch anzieht. Mir ist aufgefallen, daß meine Klasse nicht abfängt wenn man zweimal dasselbe Objekt ins Set setzt. Deshalb ein kleines Update Nils Langner von PHP hates me hat eine Aufgabe gestellt. Und hier meine spontane Lösung, vom Hirn ins Terminal &#60;?php &#60;div class=&#34;moz-text-plain&#34; style=&#34;font-family: -moz-fixed; font-size: 13px;&#34; lang=&#34;x-western&#34;&#62; [...]]]></description>
			<content:encoded><![CDATA[<p class="update">Kommentare gesperrt, weil dieses Posting Spambots magisch anzieht.</p>
<p class="update">Mir ist aufgefallen, daß meine Klasse nicht abfängt wenn man zweimal dasselbe Objekt ins Set setzt. Deshalb ein kleines Update</p>
<p>Nils Langner von <em>PHP hates me</em> <a  href="http://www.phphatesme.com/blog/allgemein/meinphp-eine-aufgabe-viele-losungen/">hat eine Aufgabe gestellt</a>. Und hier meine spontane Lösung, vom Hirn ins Terminal <img src='http://schwobeseggl.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre>
<pre class="brush: php;">&lt;?php
&lt;div class=&quot;moz-text-plain&quot; style=&quot;font-family: -moz-fixed; font-size: 13px;&quot; lang=&quot;x-western&quot;&gt;
&lt;pre&gt;class Foobar {
}

/**
 * @author Matthias Coy
 */
class Set {
    private $set = null;
    private $typ = null;
    private $className = null;

    /**
     * The method to add something to the set. The type of the set is defined by its first entry.
     * @param &lt;type&gt; $something
     * @public
     */
    function push($something) {
        if ($this-&gt;set == null) {
            $this-&gt;typ = gettype($something);
            $this-&gt;set = array();
            array_push($this-&gt;set, $something);
            if($this-&gt;typ == &quot;object&quot;) {
                $class = new ReflectionClass($something);
                $this-&gt;className = $class-&gt;getName();
                echo &quot;It's a class, with the name: '&quot;.$this-&gt;className.&quot;'\n&quot;;
            } else {
                echo &quot;It's something else: '&quot;. $this-&gt;typ .&quot;'&quot;;
            }
        } else {
            $myType = gettype($something);
            if($myType != $this-&gt;typ) {
                throw new Exception(&quot;Wrong Type, this set is a set of '&quot;.$this-&gt;typ.&quot;'&quot;);
            } else {
                if ($myType == &quot;object&quot;) {
                    $class = new ReflectionClass($something);
                    if ($this-&gt;className != $class-&gt;getName()) {
                        throw new Exception(&quot;Right Type, but wrong class (is: '&quot;.$class-&gt;getName().&quot;', should be: '&quot;.$this-&gt;className.&quot;')&quot;);
                    }
                    foreach($this-&gt;set as $entry) {
                        if ($something === $entry) {
                            throw new Exception('Right Type, but already in Set');
                        }
                    }
                }
                array_push($this-&gt;set, $something);
                echo &quot;adding sth. (&quot;.$myType.&quot;)\n&quot;;
            }
        }
    }

    /**
     * Return the last inserted entry of the set.
     *
     * @return &lt;type&gt;
     * @public
     * @throws Exception if set is empty
     */
    function pop() {
        $returnValue = array_pop($this-&gt;set);
        if ($returnValue == null) {
            $this-&gt;set = null;
            $this-&gt;typ = null;
            $this-&gt;className = null;
            throw new Exception(&quot;Set is not yet defined, please add something first&quot;);
        }
        return $returnValue;
    }

    /**
     * Returns the amount of entries in the set
     *
     * @return &lt;type&gt; Entry of the set
     * @public
     */
    function count() {
        return count($this-&gt;set);
    }
}

$var1 = new Set();
$var2 = new Foobar();

$mySet = new Set();
$mySet-&gt;push($var1);
try {
    // Add something that is different to the types already in the set
    $mySet-&gt;push($var2); // throws execption
} catch (Exception $e) {
    print $e-&gt;getMessage().&quot;\n&quot;;
}
try {
    // Add something which has the right type, but is already inside the set
    $mySet-&gt;push($var1); // throws execption
} catch (Exception $e) {
    print $e-&gt;getMessage().&quot;\n&quot;;
}
while($mySet-&gt;count() &gt; 0) {
    $mySet-&gt;pop();
}
$mySet-&gt;push($var2);
try {
    $mySet-&gt;push($var1);
} catch (Exception $e) {
    print $e-&gt;getMessage().&quot;\n&quot;;
}
/* Output:
It's a class, with the name: 'Set'
Right Type, but wrong class (is: 'Foobar', should be: 'Set')
Right Type, but already in Set
It's a class, with the name: 'Foobar'
Right Type, but wrong class (is: 'Set', should be: 'Foobar')
 */</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://schwobeseggl.de/2008/12/12/php-hates-me-eine-set-klasse/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Netbeans 6.5</title>
		<link>http://schwobeseggl.de/2008/12/05/netbeans-65/</link>
		<comments>http://schwobeseggl.de/2008/12/05/netbeans-65/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 14:35:42 +0000</pubDate>
		<dc:creator>pennywise</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Netbeans]]></category>

		<guid isPermaLink="false">http://schwobeseggl.de/?p=1422</guid>
		<description><![CDATA[&#8230; ist inzwischen schon ne Weile draussen, aber jetzt hat sich mal jemand die PHP-Unterstützung genauer angeschaut: http://codeutopia.net/blog/2008/12/01/netbeans-65-review/]]></description>
			<content:encoded><![CDATA[<p>&#8230; ist inzwischen <a  href="http://www.netbeans.org/downloads/index.html">schon ne Weile draussen</a>, aber jetzt hat sich mal jemand die PHP-Unterstützung genauer angeschaut:</p>
<ul>
<li><a  href="http://codeutopia.net/blog/2008/12/01/netbeans-65-review">http://codeutopia.net/blog/2008/12/01/netbeans-65-review</a>/</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://schwobeseggl.de/2008/12/05/netbeans-65/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; SPL</title>
		<link>http://schwobeseggl.de/2008/11/03/php-spl/</link>
		<comments>http://schwobeseggl.de/2008/11/03/php-spl/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 18:20:19 +0000</pubDate>
		<dc:creator>pennywise</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SPL]]></category>

		<guid isPermaLink="false">http://schwobeseggl.de/?p=1351</guid>
		<description><![CDATA[Ein neuer schöner Überblick über die SPL (Standard PHP Library) gibts unter http://www.phpro.org/tutorials/Introduction-to-SPL.html]]></description>
			<content:encoded><![CDATA[<p>Ein neuer schöner Überblick über die SPL (Standard PHP Library) gibts unter</p>
<ul>
<li>http://www.phpro.org/tutorials/Introduction-to-SPL.html</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://schwobeseggl.de/2008/11/03/php-spl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
