Manuel B.: "patch" für PHP

Beitrag lesen

Ich grüsse den Cosmos,

http://www.php-resource.de/handbuch/function.xdiff-string-diff.htm

http://www.php-resource.de/handbuch/function.xdiff-file-diff.htm
http://forum.de.selfhtml.org/archiv/2005/9/t115401/

Diese Funktionen vergleichen zwar Dateien, haben aber mit patch und diff nichts zu tun.
SVN erzeugt Dateien, die so aussehen;

  
Index: admin/templates/show_edit.tpl  
===================================================================  
--- admin/templates/show_edit.tpl (revision 11)  
+++ admin/templates/show_edit.tpl (working copy)  
@@ -1,44 +1,58 @@  
+<h4 class="radio_plan_button"><a href="{$backlink}" class="radio_plan">zurück</a></h4>  
  
-<h4 class="radio_plan_button"><a href="{$backlink}" class="radio_plan">{$back}</a></h4>  
+{if $show_data}  
+ <h4 class="radio_plan_button"><a href="?action=show_edit">neue Show anlegen</a></h4>  
+{/if}  
  
 <form action="{$target}" method="get" name="radio_plan">  
- <h4 class="radio_plan" style="height: 17px;"><span style="float: left;">Titel</span><span style="float: right;"><input type="text" name="titel" value="{$show_edit_title}" class="radio_plan" /></h4>  
- <h4 class="radio_plan" style="height: 54px;"><span style="vertical-align: top; float: left;">Beschreibung</span><span style="float: right;"><textarea name="text" class="radio_plan">{$show_edit_text}</textarea></span></h4>  
+ <h4 class="radio_plan" style="height: 17px;">  
+  <span style="float: left;">Titel</span><span style="float: right;">  
+  <input type="text" name="title" value="{$show_data.title}" class="radio_plan" />  
+ </h4>  
+ <h4 class="radio_plan" style="height: 54px;">  
+  <span style="vertical-align: top; float: left;">Beschreibung</span>  
+  <span style="float: right;"><textarea name="text" class="radio_plan">{$show_data.text}</textarea></span>  
+ </h4>  
  
  <h4 class="radio_plan" style="height: 17px;">  
   <span style="float: left;">Hintergrundfarbe</span>  
   <span style="float: right;">  
    <select name="color" class="radio_plan">  
-       {$color_list}  
+       <option value="0">keine</option>  
+  
+       {foreach from=$colors item=color name=color}  
+     <option value="{$smarty.foreach.color.iteration}" style="background-color: {$color}">{$smarty.foreach.color.iteration} - {$color}</option>  
+    {/foreach}  
+  
    </select>  
   </span>  
  </h4>  
- <h4 class="radio_plan"><button type="submit" name="submit" value="submit" class="radio_plan">{$submit_button}</button></h4>  
- <input type="hidden" name="id" value="{$show_edit_id}" />  
+ <h4 class="radio_plan"><button type="submit" name="submit" value="submit" class="radio_plan">Absenden</button></h4>  
+ <input type="hidden" name="id" value="{$show_data.id}" />  
  <input type="hidden" name="action" value="show_edit" />  

Und patch parst diese Datei und verändert die Files nur in den angegeben Zeilen. Und genau sowas suche ich auf PHP-Basis.

Möge das "Self" mit euch sein

--
Neulich dachte ich mir, einmal S/M ausprobieren wäre eine tolle Erfahrung. Also hab ich Windows gebootet ...
ie:{ br:> fl:| va:| ls:& fo:{ rl:( n4:{ de:] ss:) ch:? js:| mo:) sh:( zu:)