<?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>Kadir Özdemir</title>
	<atom:link href="http://www.skorp.eu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.skorp.eu</link>
	<description>Programlama, Güvenlik, Design ve hayatimdan kesintiler</description>
	<lastBuildDate>Thu, 17 May 2012 14:23:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Silverstripe: Sorgulari Cachleme</title>
		<link>http://www.skorp.eu/2012/03/26/silverstripe-sorgulari-cachleme/</link>
		<comments>http://www.skorp.eu/2012/03/26/silverstripe-sorgulari-cachleme/#comments</comments>
		<pubDate>Mon, 26 Mar 2012 20:26:28 +0000</pubDate>
		<dc:creator>Skorp</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Silverstripe]]></category>

		<guid isPermaLink="false">http://www.skorp.eu/?p=606</guid>
		<description><![CDATA[Silverstripe de genellikle birbiriyle iliskili birden cok nesne ile calisiriz. Bu nesneler ile calismak kod yazarken nekadar güzel olsada, sitenin performansini oldukca etkilemektedir. Silverstripe bu konuda cok kolay bir cache Sistemi kullanmakda. Böyle basit bir sorgumuz var sayalim Bu sorgu icin yeni bir fonksiyon yazalim ve bakalim sorunu nasil cözeriz. UPDATE: 17.05.2012 Pagination ve resimli [...]]]></description>
			<content:encoded><![CDATA[<p>Silverstripe de genellikle birbiriyle iliskili birden cok nesne ile calisiriz. Bu nesneler ile calismak kod yazarken nekadar güzel olsada, sitenin performansini oldukca etkilemektedir.</p>
<p>Silverstripe bu konuda cok kolay bir cache Sistemi kullanmakda.</p>
<p>Böyle basit bir sorgumuz var sayalim</p>
<pre class="brush: php; title: ; notranslate">
$result = DataObject::get('ProductCategory',&quot;URLSegment='&quot;.Convert::raw2sql($urlSegment).&quot;'&quot;);
</pre>
<p>Bu sorgu icin yeni bir fonksiyon yazalim ve bakalim sorunu nasil cözeriz.</p>
<pre class="brush: php; title: ; notranslate">
protected function getCategoryID($urlSegment) {
    //cachekey olusturalim
    //preg_replace kullanmamiz lazim cünki Zend_Cache a-zA-Z_0-9 disindaki karakterlere izin vermiyor
    $cachekey = 'Cache_Category'.preg_replace('/-/','_',$urlSegment);
    // SS_Cache in factory methodu üzerinden cache objesini olusturalim
    $cache       = SS_Cache::factory($cachekey);
    //cache yükliyelim
    $result     = $cache-&gt;load($cachekey);
    //cache varsa unserialize yapip result degiskenine atiyalim
    if ($result) {
	$result = unserialize($result);
    } else {
        //cache yoksa veya süresi gecmisse yukaridaki sorgumuzu calistirip kaydedelim
	$result = DataObject::get('ProductCategory',&quot;URLSegment='&quot;.Convert::raw2sql($urlSegment).&quot;'&quot;);
	$cache-&gt;save(serialize($result));
    }
    return $result;
}
</pre>
<p>UPDATE: 17.05.2012<br />
Pagination ve resimli iliskilerde serialize yüzünden cikan sorunlar yüzünden cache i biraz degistirdik. </p>
<pre class="brush: php; title: ; notranslate">
protected function getCategoryID($urlSegment) {
if (!isset($_GET['start']) || !is_numeric($_GET['start'])){
			$start = 0;
		} else {
			$start = intval($_GET['start']);
		}
    $cachekey = 'Cache_Category'.preg_replace('/-/','_',$urlSegment);
    $cache       = SS_Cache::factory($cachekey);
    $result     = $cache-&gt;load($cachekey);
    if ($result) {
	$result = unserialize($result);
        //kayit ettigimiz arrayi bir DataObjectSet e ceviriyoruz.
        $doSet = $this-&gt;buildDataObjectSet($result, 'DataObjectSet', $this-&gt;class);
        //pagination icin limitleri belirleyelim
	$doSet-&gt;setPageLimits($start, 10, $doSet-&gt;Count());
	return $doSet;
    } else {
	$result = DataObject::get('ProductCategory',&quot;URLSegment='&quot;.Convert::raw2sql($urlSegment).&quot;'&quot;);
        //tüm icerikleri bir Array e alip, cache e öyle kayit ediyoruz.
        if($result!= null) {
	     $saveArr = array();
              foreach($result as $value) {
		$saveArr[] = $value-&gt;getAllFields();
	     }
	    $cache-&gt;save(serialize($saveArr));
	}
    }
    return $result;
}
</pre>
<p>Bu arada yukaridada yazdigim gibi SS_Cache arka planda Zend_Cache kullanmakda.<br />
Template de degisen birsey yok.<br />
Template cache lerine birdahaki yazimizda anlatmaya calisacagim.</p>
<p>Silverstripe API: <a href="http://api.silverstripe.org/2.4/sapphire/core/SS_Cache.html" target="_blank">http://api.silverstripe.org/2.4/sapphire/core/SS_Cache.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.skorp.eu/2012/03/26/silverstripe-sorgulari-cachleme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Php 5.4 yayinlandi</title>
		<link>http://www.skorp.eu/2012/03/02/php-5-4-yenilikler-yayinlandi/</link>
		<comments>http://www.skorp.eu/2012/03/02/php-5-4-yenilikler-yayinlandi/#comments</comments>
		<pubDate>Fri, 02 Mar 2012 12:58:47 +0000</pubDate>
		<dc:creator>Skorp</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.skorp.eu/?p=596</guid>
		<description><![CDATA[kaciranlar icin yazayim dün gece 8. RC ardindan Php 5.4 yayinlandi. Degisiklikleri uzun uzun anlatmiyacagim, release ler ciktiginda birsürü blogda zaten yeniliklerden bahsedildi. Önemli degisiklilere kisa bir göz gezdirelim. 1. Traits Php gibi tek mirasli dillerde kodu tekrar kullanmak icin olan bir yöntemdir. cikti Hello World 2. shortened array syntax 3. Constructor ardindan direk Metod [...]]]></description>
			<content:encoded><![CDATA[<p>kaciranlar icin yazayim dün gece 8. RC ardindan Php 5.4 yayinlandi.<br />
Degisiklikleri uzun uzun anlatmiyacagim, release ler ciktiginda birsürü blogda zaten yeniliklerden bahsedildi.<br />
Önemli degisiklilere kisa bir göz gezdirelim.</p>
<p><strong>1. Traits</strong><br />
Php gibi tek mirasli dillerde kodu tekrar kullanmak icin olan bir yöntemdir.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
class Base {
    public function sayHello() {
        echo 'Hello ';
    }
}

trait SayWorld {
    public function sayHello() {
        parent::sayHello();
        echo 'World!';
    }
}

class MyHelloWorld extends Base {
    use SayWorld;
}

$o = new MyHelloWorld();
$o-&gt;sayHello();
?&gt;
</pre>
<p>cikti<br />
<code>Hello World</code></p>
<p><strong>2. shortened array syntax</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
function getArray() {
    return array(1, 2, 3);
}

// on PHP 5.4
$secondElement = getArray()[1];

// as of PHP 5.4
$array = [
    &quot;foo&quot; =&gt; &quot;bar&quot;,
    &quot;bar&quot; =&gt; &quot;foo&quot;
];
</pre>
<p><strong>3. Constructor ardindan direk Metod calistirila bilinir (Fluent Interface)</strong></p>
<pre class="brush: php; title: ; notranslate">echo (new Foo)-&gt;bar()</pre>
<p><strong>< ?=</strong><br />
short_open_tag &#8216;e bakılmaksızın < ?=  artık her zaman kullanılabilir.</p>
<p><strong>4. Binär sayi bicimi kullanimi eklenmistir (0b)</strong></p>
<pre class="brush: php; title: ; notranslate">
$binary = 0b001001101;
echo $binary;
</pre>
<p><strong>Class::{expr}()</strong></p>
<pre class="brush: php; title: ; notranslate">
class Test{
    public function method() {
        echo 'Hello';
    }

    public static function staticmethod() {
        echo 'Static';
    }
}

$method = 'staticmethod';
$test = new Test();

$test-&gt;method();        //Prints Hello
$test-&gt;$method();       //Prints Static
$test-&gt;{'method'}();    //Prints Hello

Test::method();         //Prints Hello
Test::$method();        //Prints Static
Test::{'method'}();     //Prints Hello
</pre>
<p><strong>6. $GLOBALS</strong> lerde artik &#8220;lazy initialisation&#8221; kullaniliyor</p>
<p><strong>Callable Type Hinting</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

// A function that uses type hinting
function typeHinting(callable $a) {
     echo $a() . PHP_EOL;
}

// A closure
$closure = function () {
     return __FUNCTION__;
};

// Call the type hinting function with the closure
typeHinting($closure); // {closure}

class testClass {
     public function testMethod() {
          return __METHOD__;
     }
}

// A mock object
$testObj = new testClass();

// The new way of calling object methods
$objCallable = array($testObj, 'testMethod');

// Call type hinting function with the new method calling way
typeHinting($objCallable); // testClass::testMethod
</pre>
<p><strong>upload progress e direk erisim</strong></p>
<pre class="brush: php; title: ; notranslate">
session.upload_progress.enabled = 1
session.upload_progress.prefix = upload_progress_
session.upload_progress.name = PHP_SESSION_UPLOAD_PROGRESS
</pre>
<pre class="brush: xml; title: ; notranslate">
&lt;form action=&quot;upload.php&quot; method=&quot;POST&quot; enctype=&quot;multipart/form-data&quot;&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;&lt;?php echo ini_get(&quot;session.upload_progress.name&quot;); ?&gt;&quot; value=&quot;johannesupload&quot; /&gt;
 &lt;input type=&quot;file&quot; name=&quot;file1&quot; /&gt;
 &lt;input type=&quot;file&quot; name=&quot;file2&quot; /&gt;
 &lt;input type=&quot;submit&quot; /&gt;
&lt;/form&gt;
</pre>
<p><strong>E_STRICT E_ALL un parcasi haline geldi</strong><br />
<strong>php.ini deki “default_charset” ISO-8859-1 den UTF-8 degistirildi</strong><br />
<strong>Php 5.4 kendi icinde kücük bir Webserver barindirmakta</strong></p>
<p>Safe Mode, register_globals, register_long_arrays php.ini den kaldirildi<br />
Magic Quotes (magic_quotes_gpc) </p>
<p>Simdlik bukadar unuttuklarim varsa asagiya ekleyiniz <img src='http://www.skorp.eu/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Linkler:<br />
<a href="http://php.net/releases/5_4_0.php" target="_blank" title="http://php.net/releases/5_4_0.php">http://php.net/releases/5_4_0.php</a><br />
<a href="http://docs.php.net/manual/en/migration54.new-features.php" target="_blank" title="http://docs.php.net/manual/en/migration54.new-features.php">http://docs.php.net/manual/en/migration54.new-features.php</a><br />
<a href="http://blog.claudiupersoiu.ro/2012/02/11/php-5-4-closures-the-right-way/" title="http://blog.claudiupersoiu.ro/2012/02/11/php-5-4-closures-the-right-way/" target="_blank">http://blog.claudiupersoiu.ro/2012/02/11/php-5-4-closures-the-right-way/</a><br />
<a href="http://schlueters.de/blog/archives/151-Upload-Progress-in-PHP-trunk.html" title="http://schlueters.de/blog/archives/151-Upload-Progress-in-PHP-trunk.html" target="_blank">http://schlueters.de/blog/archives/151-Upload-Progress-in-PHP-trunk.html</a><br />
<a href="http://php.net/manual/en/features.commandline.webserver.php" title="http://php.net/manual/en/features.commandline.webserver.php" target="_blank">http://php.net/manual/en/features.commandline.webserver.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.skorp.eu/2012/03/02/php-5-4-yenilikler-yayinlandi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery UI Dialog enterle tetiklemek</title>
		<link>http://www.skorp.eu/2011/12/02/jquery-ui-dialog-enterle-tetiklemek/</link>
		<comments>http://www.skorp.eu/2011/12/02/jquery-ui-dialog-enterle-tetiklemek/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 14:27:08 +0000</pubDate>
		<dc:creator>Skorp</dc:creator>
				<category><![CDATA[Javascript/Ajax/Jquery]]></category>
		<category><![CDATA[Jquery]]></category>

		<guid isPermaLink="false">http://www.skorp.eu/?p=591</guid>
		<description><![CDATA[jQuery UI dialog da bir formu doldurup entere bastigimizda genelde hic bir tepki almayiz. Oysaki cogumuz giris bilgilerini doldurduktan sonra entere basmayi aliskinlik haline getirmisiz. Jquery Ui dialog ile bir login formu gösteriyorsaniz sayfanizda ve kullanicilariniza bir iyilik yapmak istiyorsaniz, asagidaki kodu programiniza eklemeyi unutmayiniz. Einloggen yazan yere Dialog da buttona verdiginiz adi giriniz. dialog [...]]]></description>
			<content:encoded><![CDATA[<p>jQuery UI dialog da bir formu doldurup entere bastigimizda genelde hic bir tepki almayiz. Oysaki cogumuz giris bilgilerini doldurduktan sonra entere basmayi aliskinlik haline getirmisiz. Jquery Ui dialog ile bir login formu gösteriyorsaniz sayfanizda ve kullanicilariniza bir iyilik yapmak istiyorsaniz, asagidaki kodu programiniza eklemeyi unutmayiniz.</p>
<pre class="brush: jscript; title: ; notranslate">
$('#dialog').live('keyup', function(e){
	  	if (e.keyCode == 13) {
	    	$(':button:contains(&quot;Einloggen&quot;)').click();
	  	}
	});
</pre>
<p><strong>Einloggen</strong> yazan yere Dialog da buttona verdiginiz adi giriniz.<br />
<strong>dialog</strong> da gösterdiginiz div in id si</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skorp.eu/2011/12/02/jquery-ui-dialog-enterle-tetiklemek/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse 3.7 Android ADT kurulum hatasi</title>
		<link>http://www.skorp.eu/2011/11/09/eclipse-3-7-android-adt-kurulum-hatasi/</link>
		<comments>http://www.skorp.eu/2011/11/09/eclipse-3-7-android-adt-kurulum-hatasi/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 11:40:24 +0000</pubDate>
		<dc:creator>Skorp</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://www.skorp.eu/?p=589</guid>
		<description><![CDATA[Eclipse 3.7 de Android ADT kurarken söyle bir hata ile karsilasanlar varsa. Cannot complete the install because one or more required items could not be found. Software being installed: Android Development Tools 15.0.0.v201110251216-213216 (com.android.ide.eclipse.adt.feature.group 15.0.0.v201110251216-213216) Missing requirement: Android Development Tools 15.0.0.v201110251216-213216 (com.android.ide.eclipse.adt.feature.group 15.0.0.v201110251216-213216) requires ‘org.eclipse.wst.sse.core 0.0.0′ but it could not be found http://download.eclipse.org/releases/indigo adresini Help [...]]]></description>
			<content:encoded><![CDATA[<p>Eclipse 3.7 de Android ADT kurarken söyle bir hata ile karsilasanlar varsa.</p>
<p><em>Cannot complete the install because one or more required items could not be found.<br />
  Software being installed: Android Development Tools 15.0.0.v201110251216-213216 (com.android.ide.eclipse.adt.feature.group 15.0.0.v201110251216-213216)<br />
  Missing requirement: Android Development Tools 15.0.0.v201110251216-213216 (com.android.ide.eclipse.adt.feature.group 15.0.0.v201110251216-213216) requires ‘org.eclipse.wst.sse.core 0.0.0′ but it could not be found</em></p>
<p><a href="http://download.eclipse.org/releases/indigo" title="http://download.eclipse.org/releases/indigo">http://download.eclipse.org/releases/indigo</a> adresini <strong>Help -> Install New Software -> Add</strong> eklemeleri ve kurulumu yeniden denemeleri gerekiyor.<br />
Bende sorun bu sekilde cözüldü.</p>
<p>kolay gelsin</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skorp.eu/2011/11/09/eclipse-3-7-android-adt-kurulum-hatasi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverstripe yeni sayfa tipleri</title>
		<link>http://www.skorp.eu/2011/11/01/silverstripe-yeni-sayfa-tipleri/</link>
		<comments>http://www.skorp.eu/2011/11/01/silverstripe-yeni-sayfa-tipleri/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 19:11:24 +0000</pubDate>
		<dc:creator>Skorp</dc:creator>
				<category><![CDATA[Cms]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Silverstripe]]></category>

		<guid isPermaLink="false">http://www.skorp.eu/?p=574</guid>
		<description><![CDATA[Silverstripe&#8217;i ilk kurdugumuzda bazi standard sayfa türleri ile gelir. Sistemimizin gereksinime göre degisik sayfa türleri üretmemiz gereklidir. Bugünki yazimizda SS&#8217;de baska bir sayfa türü nasil olusturulur ona bakacagiz. Önce SS ile default olarak gelen sayfa türlerini taniyalim: Page:en temel sayfa türüdür.Ilerki yazilarda üretecegimiz tüm sayfalar bu türden olacaktir ErrorPage:Hata oldugunda gösterilicek olan sayfa. Degisik hatalara [...]]]></description>
			<content:encoded><![CDATA[<p>Silverstripe&#8217;i ilk kurdugumuzda bazi standard sayfa türleri ile gelir.<br />
Sistemimizin gereksinime göre degisik sayfa türleri üretmemiz gereklidir.<br />
Bugünki yazimizda SS&#8217;de baska bir sayfa türü nasil olusturulur ona bakacagiz. </p>
<p>Önce SS ile default olarak gelen sayfa türlerini taniyalim:</p>
<ul>
<li><strong>Page:</strong>en temel sayfa türüdür.Ilerki yazilarda üretecegimiz tüm sayfalar bu türden olacaktir</li>
<li><strong>ErrorPage:</strong>Hata oldugunda gösterilicek olan sayfa. Degisik hatalara degisik sayfalar üretile bilinir. mesela 404 bulunamadi ile 403 erisim engellendi sayfalari degisik görüne bilinir</li>
<li><strong>RedirectorPage:</strong> Baska bir sayfaya veya Websitesine yönlendirmek icin kullanilir</li>
<li><strong>VirtualPage:</strong> baska bir sayfanin icerigini kullanir. Redirector sayfasindan bunu ayiran, sadece sitemiz icindeki sitelerde kullanilir ve icerigini kopyalar.</li>
</ul>
<p><strong>Kendi Sayfa türümüzü olusturalim</strong><br />
/mysite/code klasörü icinde Baslik, tarih, resim ve icerik eklene bilen bir sayfa türü üretelim, adinida ArticlePage koyalim.</p>
<p>/mysite/code/ArticlePage.php</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

class ArticlePage extends Page { // Model
    static $db = array(
       'Date' =&gt; 'Date',
    );
    public static $has_one = array(
        'Picture' =&gt; 'Image',
    );
    function getCMSFields() {
       $fields = parent::getCMSFields();

       $fields-&gt;addFieldToTab('Root.Content.Main', new DateField('Date'), 'Content');
       $fields-&gt;addFieldToTab(&quot;Root.Content.Main&quot;, new ImageField('Picture'));

       return $fields;
    }
}
/* controller */
class ArticlePage_Controller extends Page_Controller {
}

?&gt;
</pre>
<p>Silverstripe MVC tasarim kalibini kullanmaktadir.<br />
Silverstripe de olusturdugumuz her sayfa Model ve Controller kismini barindirmaktadir.<br />
Her sayfa Page sayfasindan extend etmelidir.</p>
<pre class="brush: php; title: ; notranslate">
static $db = array('Date' =&gt; 'Date',);
</pre>
<p><em>db</em> degiskeninin özel bir islevi vardir, veritabani alanlari tanimlamak icin kullanilir.<br />
Örnegimizde tarihi kaydetmek icin Date tipinde bir alan adi tanimladik.</p>
<p><em>has_one</em> degiskeni her ArticlePage sayfamiza bir resim eklemesini söylüyor.<br />
Bu baglantilara daha sonraki bir yazimizda daha detayli bakacagiz.</p>
<p>Gerekli alanlari tanimladikdan sonra bunlari Admin e eklememiz gerekiyor.<br />
<em>GetCMSFields</em> ile bu isi yapa biliriz.</p>
<p>View kismina bakalim.<br />
theme dosyamizda ArticlePage.ss adinda bir dosya olusturalim.<br />
/themes/blackcandy/templates/Layout/ArticlePages.ss</p>
<pre class="brush: xml; title: ; notranslate">

    &lt;div&gt;
        &lt;h1&gt;$Title&lt;/h1&gt;
        &lt;div&gt;Date : $Date.nice&lt;/div&gt;
        &lt;div&gt;$Picture&lt;/div&gt;
        $Content
        $Form
    &lt;/div&gt;
</pre>
<p>Model, view ve Controlleri tamamladikdan sonra adres satirina /dev/build/?flush=all yazip degisiklikleri kaydedelim.<br />
Simdi Admin de yeni bir sayfa üretmek istedigimizde ArticlePage sayfamizi sece biliriz.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skorp.eu/2011/11/01/silverstripe-yeni-sayfa-tipleri/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Silverstripe snippetler</title>
		<link>http://www.skorp.eu/2011/09/04/silverstripe-snippetler/</link>
		<comments>http://www.skorp.eu/2011/09/04/silverstripe-snippetler/#comments</comments>
		<pubDate>Sun, 04 Sep 2011 15:22:45 +0000</pubDate>
		<dc:creator>Skorp</dc:creator>
				<category><![CDATA[Cms]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Silverstripe]]></category>

		<guid isPermaLink="false">http://www.skorp.eu/?p=542</guid>
		<description><![CDATA[Adres satirina eklenenler Template in olusturdugu kodu görmek icin önbellegi temizlememe kodu ve db yi senkronlamak icin önemli (http://localhost/dev/build seklinde olmali) Tüm sayfalari birden yayinlamak veritabanini olusturur ama kayitlari eklemez config dosyasindaki degere aldirilmadan, Test moduna gec tüm queryleri göstermek icin: tüm insert ve updateleri gösterir ama calistirmaz performance icin diger mysite/_config.php icine eklenenler development [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Adres satirina eklenenler</strong><br />
Template in olusturdugu kodu görmek icin</p>
<pre class="brush: php; title: ; notranslate">?isDev=1&amp;showtemplate=1</pre>
<p>önbellegi temizlememe</p>
<pre class="brush: php; title: ; notranslate">?flush=all</pre>
<p>kodu ve db yi senkronlamak icin önemli (http://localhost/dev/build seklinde olmali)</p>
<pre class="brush: php; title: ; notranslate">/dev/build</pre>
<p>Tüm sayfalari birden yayinlamak</p>
<pre class="brush: php; title: ; notranslate">/admin/publishall/</pre>
<p>veritabanini olusturur ama kayitlari eklemez</p>
<pre class="brush: php; title: ; notranslate">/dev/build?dont_populate=1</pre>
<p>config dosyasindaki degere aldirilmadan, Test moduna gec</p>
<pre class="brush: php; title: ; notranslate">?isTest=1</pre>
<p>tüm queryleri göstermek icin:</p>
<pre class="brush: php; title: ; notranslate">?showqueries=1</pre>
<p>tüm insert ve updateleri gösterir ama calistirmaz</p>
<pre class="brush: php; title: ; notranslate">
?previewwrite=1</pre>
<p>performance icin</p>
<pre class="brush: php; title: ; notranslate">
?debug_memory=1
?debug_profile=1
?debug_profile=1&amp;profile_trace=1
</pre>
<p>diger</p>
<pre class="brush: php; title: ; notranslate">
?debugmanifest=1
?debugmethods=1
?debugfailover=1
?debug_request=1
?debug=1</pre>
<p><strong>mysite/_config.php icine eklenenler</strong><br />
development moda gecmek icin (standard live mod)</p>
<pre class="brush: php; title: ; notranslate">Director::set_environment_type('dev'); </pre>
<p><span id="more-542"></span><br />
live moda gecmek icin</p>
<pre class="brush: php; title: ; notranslate">Director::set_environment_type('live');</pre>
<p>source code da hangi template in hangi kodu olusturdugunu görmek icin</p>
<pre class="brush: php; title: ; notranslate">SSViewer::set_source_file_comments(true);</pre>
<p>Dev modda sürekli siteyi ?/flush=1 yazmak yerine bu kullanila bilirni:</p>
<pre class="brush: php; title: ; notranslate">if(Director::isDev()){
SSViewer::flush_template_cache();
}</pre>
<p>Cms de ana menüden birsey cikarmak icin</p>
<pre class="brush: php; title: ; notranslate">CMSMenu::remove_menu_item('ReportAdmin');</pre>
<p>Logoyu degistirmek icin</p>
<pre class="brush: php; title: ; notranslate">
LeftAndMain::setLogo(
'themes/bar/images/CMSLogo.png',
'margin: 2px;'
);
</pre>
<p>Cms yüklenirken gösterilen logoyu degistirmek icin:</p>
<pre class="brush: php; title: ; notranslate">LeftAndMain::set_loading_image('themes/bar/images/CMSLoading.gif');</pre>
<p>tinymce de diyelim tablo kontrollerini göstermek istemiyorsunuz ozaman bunu kullaniniz</p>
<pre class="brush: php; title: ; notranslate">HtmlEditorConfig::get('cms')-&gt;removeButtons('tablecontrols');</pre>
<p>tinymce de setoptions</p>
<pre class="brush: php; title: ; notranslate">
HtmlEditorConfig::get('cms')-&gt;setOption(
'convert_fonts_to_spans', false
);</pre>
<p>www siz istekleri hep www.siteadi.com a yönlendirmek icin</p>
<pre class="brush: php; title: ; notranslate">Director::forceWWW();</pre>
<p> //sade live modda calisiyor</p>
<p>Googlesitemap modul kullaniyorsaniz her yeni sayfada google i haberdar etmek icin</p>
<pre class="brush: php; title: ; notranslate">GoogleSitemap::enable_google_notification();</pre>
<p>resim kalitesi icin </p>
<pre class="brush: php; title: ; notranslate">GD::set_default_quality(95);</pre>
<p>prototype js validasyonu kapatmak icin</p>
<pre class="brush: php; title: ; notranslate">
Validator::set_javascript_validation_handler('none');</pre>
<p>Dataobject lerin siralarmasini düzenlemek icin:</p>
<pre class="brush: php; title: ; notranslate">SortableDataObject::add_sortable_class('CustomImage');</pre>
<p>arama fonksiyonunu acalim:</p>
<pre class="brush: php; title: ; notranslate">FulltextSearchable::enable();</pre>
<p><strong>Controller icinde</strong><br />
Theme klasörü icindeki bir Css dosyasini eklemek icin</p>
<pre class="brush: php; title: ; notranslate">Requirements::themedCSS('form', 'screen,projection');</pre>
<p>Theme klasörü disinden bir Css dosyasi eklemek icin</p>
<pre class="brush: php; title: ; notranslate">Requirements::css('file', 'media');</pre>
<p>tüm css dosyalarini combine etmek icin:</p>
<pre class="brush: php; title: ; notranslate">
Requirements::themedCSS('print', 'print');
$theme = SSViewer::current_theme();
Requirements::combine_files('combined.css', array(
THEMES_DIR . '/' . $theme . '/css/layout.css',
THEMES_DIR . '/' . $theme . '/css/typography.css',
THEMES_DIR . '/' . $theme . '/css/form.css',
));
</pre>
<p>özel css eklemek icin</p>
<pre class="brush: php; title: ; notranslate">Requirements::customCss('.once { font-weight: bold; }', 'once');</pre>
<p>Head tagi icine mesela conditional statement eklemek icin</p>
<pre class="brush: php; title: ; notranslate">
Requirements::insertHeadTags('
&lt;!--[if lt IE 9]&gt;
&lt;style type=&quot;text/css&quot;&gt;
......
&lt;/style&gt;
&lt;![endif]--&gt;
', 'IE-styling');
</pre>
<p>Javascript eklemek icin: </p>
<pre class="brush: php; title: ; notranslate">Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery-packed.js');</pre>
<p>otomatik eklenen js dosyalarini engellemek icin</p>
<pre class="brush: php; title: ; notranslate">Requirements::block(THIRDPARTY_DIR . '/prototype/prototype.js');</pre>
<p>sadece Live modda calismasini istedigin kod icin</p>
<pre class="brush: php; title: ; notranslate">if(Director::isLive()){..}</pre>
<p>sade dev modda calismasini istedigin kod  icin </p>
<pre class="brush: php; title: ; notranslate">if(Director::isDev()){ ... } </pre>
<p>Google Analytics kodu eklemek icin</p>
<pre class="brush: php; title: ; notranslate">
if(Director::isLive()){
Requirements::customScript(&quot;
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
_gaq.push(['_trackPageview']);
(function(){
var ga = document.createElement('script');
ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ?
'https://ssl' : 'http://www') +
'.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
&quot;, 'google-analytics');
}
</pre>
<p>Kod icinde Debug:</p>
<pre class="brush: php; title: ; notranslate">
Debug::show($variable);
Debug::message('My message');
SS_Backtrace::backtrace()
user_error('My message', E_USER_ERROR):
</pre>
<p><strong>Model e eklenen ayarlar:</strong><br />
adminde görünmesini istemediginiz Sayfalar icin:</p>
<pre class="brush: php; title: ; notranslate">public static $hide_ancestor = 'Page';</pre>
<p>Cms deki Sayfalar icon eklemek icin:</p>
<pre class="brush: php; title: ; notranslate">public static $icon = 'mysite/icons/intro';</pre>
<p>cikti: <em>mysite/icons/intro-file.gif</em><br />
dikkat edilmesi gereken -file.gif kendiliginden ekleniyor.</p>
<p>sade üst sayfa icin (true) alt sayfa olmasi icin(false)</p>
<pre class="brush: php; title: ; notranslate">public static $can_be_root = false;</pre>
<p>Sayfanin hangi alt sayfalari ola bilir diye belirlemek icin:</p>
<pre class="brush: php; title: ; notranslate">public static $allowed_children = array('ContentPage');</pre>
<p>CMS e tab eklemek veya silmek icin:</p>
<pre class="brush: php; title: ; notranslate">
$fields-&gt;removeFieldFromTab('Root.Content.Main', 'Content');
$fields-&gt;addFieldToTab().('Root.Content.Main', 'Content');
</pre>
<p>query gidecek olan icerikleri escape etmek icin:</p>
<pre class="brush: php; title: ; notranslate">$good = Convert::raw2sql($_GET['evil']);
DataObject::get_one('SiteTree', &quot;URLSegment = '$good'&quot;);</pre>
<p>tüm model deki metodlari veya degiskenler <strong>public</strong> olmalidir</p>
<p>Controllerde ise:<br />
url den erisilicek olan metodlar <strong>public</strong><br />
helper olarak calisacak olan metodlar <strong>protected</strong><br />
init ise <strong>public</strong> olmalidir</p>
<p>metodlari url den erisilmesi icin bunuda kullana bilirsiniz.</p>
<pre class="brush: php; title: ; notranslate">public static $allowed_actions = array('visible');</pre>
<p>devami zamanla gelecek.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skorp.eu/2011/09/04/silverstripe-snippetler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MSSQL snippetler</title>
		<link>http://www.skorp.eu/2011/07/15/mssql-tum-indexleri-gosterm/</link>
		<comments>http://www.skorp.eu/2011/07/15/mssql-tum-indexleri-gosterm/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 13:26:54 +0000</pubDate>
		<dc:creator>Skorp</dc:creator>
				<category><![CDATA[Veritabani]]></category>
		<category><![CDATA[MSSQL]]></category>

		<guid isPermaLink="false">http://www.skorp.eu/?p=525</guid>
		<description><![CDATA[Konuyu Mssql Snippet konusuna cevirmeye karar verdim. Aradigimda kolaylikla bulabilmek icin bu satirlari ekliyorum. Mssql de bir DB nin tüm indexlerini görüntülemek icin bu satirlari kullana bilirsiniz. db de eski programdan tarihleri ve zamanlari ayni olan siparisler vardi buda benim bir queryimi bozuyordu, ayni olan zamanlarin birine 3 saniye fazladan ekledim. devami gelecek&#8230;]]></description>
			<content:encoded><![CDATA[<p>Konuyu Mssql Snippet konusuna cevirmeye karar verdim.<br />
Aradigimda kolaylikla bulabilmek icin bu satirlari ekliyorum.<br />
Mssql de bir DB nin tüm indexlerini görüntülemek icin bu satirlari kullana bilirsiniz.</p>
<pre class="brush: sql; title: ; notranslate">
SELECT i.object_id, i.name, o.name
 FROM sys.indexes as i, sys.objects as o
 WHERE i.name not like 'queue%'
 and i.object_id = o.object_id
 AND o.name NOT like 'sys%'
</pre>
<p>db de eski programdan tarihleri ve zamanlari ayni olan siparisler vardi buda benim bir queryimi bozuyordu, ayni olan zamanlarin birine 3 saniye fazladan ekledim.</p>
<pre class="brush: sql; title: ; notranslate">
update orders set
or_datetime=DATEADD(ss,03,or_datetime)
where or_id in (select MAX(or_id) from orders as x
		where or_datetime in(select or_datetime
		   from orders where x.or_person_id=or_person_id
		   group by or_datetime having count(*) &gt; 1)
               group by or_person_id
)
</pre>
<p>devami gelecek&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skorp.eu/2011/07/15/mssql-tum-indexleri-gosterm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# .COM bileseniyle Excel export</title>
		<link>http://www.skorp.eu/2011/07/14/csharp-winforms-excel-e-export-hizli-interop-fast-performance/</link>
		<comments>http://www.skorp.eu/2011/07/14/csharp-winforms-excel-e-export-hizli-interop-fast-performance/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 20:48:15 +0000</pubDate>
		<dc:creator>Skorp</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.skorp.eu/?p=531</guid>
		<description><![CDATA[Bugün son günlerde urastigim birseyi sizlerle paylasmak istiyorum. Datagridview dan Excel e veri export etmem gerekiyordu, bunun icin hemen bir Library aradim, FF de arkadasin birisi sagolsun yardimci olmaya calisti. Ben vermis oldugu linkten NPOI kütüphanesini kesfettim ve kullanmaya basladim. Ama Iki gün önce farkettimki 10 000 satir lik bir export haddinden fazla (>10 dk) [...]]]></description>
			<content:encoded><![CDATA[<p>Bugün son günlerde urastigim birseyi sizlerle paylasmak istiyorum.<br />
Datagridview dan Excel e veri export etmem gerekiyordu, bunun icin hemen bir Library aradim, <a href="http://friendfeed.com/aspnet-microsoft/ca3b40aa/excel-export-icin-onere-bileceginiz-free-bir">FF</a> de arkadasin birisi sagolsun yardimci olmaya calisti.<br />
Ben vermis oldugu linkten NPOI kütüphanesini kesfettim ve kullanmaya basladim.<br />
Ama Iki gün önce farkettimki 10 000 satir lik bir export haddinden fazla (>10 dk) sürüyordu. Halbuki yapilacak olan export nice 10 000 leri yapa bilmeli.<br />
Devam arastirdim bizim servere disaridan erisim kapali sadece Citrix icinden calisiyor ve üstünde Excel bulunuyordu, bende .COM bilesenlerini kullanmaya karar verdim.<br />
Yeni bir test yapip en basit haliyle söyle bir kod olusturdum.</p>
<pre class="brush: csharp; title: ; notranslate">
private void btn_export_Click(object sender, EventArgs e) {
    Excel.Application xlApp;
    Excel.Workbook xlWorkBook;
    Excel.Worksheet xlWorkSheet;
    object misValue = System.Reflection.Missing.Value;

    xlApp = new Excel.Application();
    xlApp.ScreenUpdating = false;
    xlApp.Calculation = Excel.XlCalculation.xlCalculationManual;
    xlWorkBook = xlApp.Workbooks.Add(misValue);
    xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
    int ix = 0;
    int j = 0;
    //datagridview un baslik sütunünü ekliyelim
    for (int x = 0; x &lt; dgv_search_result.Columns.Count; x++)
    {
        xlWorkSheet.Cells[1, x + 1] = dgv_search_result.Columns[x].HeaderText;
    }
    //basliklari kalin yazalim ve yaziyi ortaliyalim
    xlWorkSheet.get_Range(&quot;A1&quot;, &quot;T1&quot;).Font.Bold = true;
    xlWorkSheet.get_Range(&quot;A1&quot;, &quot;T1&quot;).VerticalAlignment = Excel.XlVAlign.xlVAlignCenter;
    //ardindan Datagridview daki satirlari excel dosyamiza yazalim
    for (ix = 1; ix &lt;= rowcount; ix++) {
       for (j = 0; j &lt;= dgv_search_result.ColumnCount - 1; j++){
          DataGridViewCell cell = dgv_search_result[j, ix - 1];
          //10. sutünü Text olarak formatliyalim
          if(j==10)
             xlWorkSheet.Cells[ix + 1, j + 1].NumberFormat = &quot;@&quot;;
          xlWorkSheet.Cells[ix + 1, j + 1] = cell.Value;
         }
     }

     //kayit edelim
      xlWorkBook.SaveAs(extraction_export.FileName, Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
      xlWorkBook.Close(true, misValue, misValue);
       xlApp.Quit();
     //objeleri yok edelim
      releaseObject(xlWorkSheet);
      releaseObject(xlWorkBook);
      releaseObject(xlApp);
}
private void releaseObject(object obj){
   try
   {
      System.Runtime.InteropServices.Marshal.ReleaseComObject(obj);
      obj = null;
   }
   catch (Exception ex)
   {
       obj = null;
       MessageBox.Show(&quot;Hata olustu &quot; + ex.ToString());
   }
   finally
   {
        GC.Collect();
   }
 }
</pre>
<p><span id="more-531"></span><br />
Bu Npoi yönteminden cok daha hizliydi ama yinede yeterince hizli degildi 10 dk dan fazla sürmesede en az 5 dk sürüyordu 10 000 satir icin.</p>
<p>Bunu dahada hizlandirmam gerekiyordu, Öncelikle yukarki kodda her satiri tek tek ekledigimizden bir güc kaybediyorduk bunu degistirmek icin aramalara girdim.<br />
Ardindan hepsini bir objeye kaydedip birden eklemenin daha dogru olacagini okudum.</p>
<p>Hemen uyguladim söyle bir kod cikti ortaya</p>
<pre class="brush: csharp; title: ; notranslate">
private void btn_export_Click(object sender, EventArgs e)
{
    Excel.Application xlApp;
    Excel.Workbook xlWorkBook;
    Excel.Worksheet xlWorkSheet;
    Excel.Sheets excelSheet;
    Excel.Workbooks excelWorkBooks;
    object misValue = System.Reflection.Missing.Value;

    xlApp = new Excel.Application();
    excelWorkBooks = xlApp.Workbooks;
    xlWorkBook = excelWorkBooks.Add(misValue);
    excelSheet = xlWorkBook.Worksheets;
    xlWorkSheet = (Excel.Worksheet)excelSheet.get_Item(1);

    var data = new object[rowcount, columncount];

    //basliklari ekliyelim
    for (int x = 0; x &lt; columncount; x++){
        data[0, x] = dgv_search_result.Columns[x].HeaderText;
    }
    //basliklari kalin ve sutünun ortasina pozisyonliyalim
    var boldformat = xlWorkSheet.get_Range(&quot;A1&quot;, &quot;T1&quot;);
    var m_objfont = boldformat.Font;
    m_objfont.Bold = true;

    var verformat = xlWorkSheet.get_Range(&quot;A1&quot;, &quot;T1&quot;);
    verformat.VerticalAlignment = Excel.XlVAlign.xlVAlignCenter;

    //satirlari objemize ekliyelim
    for (var row = 1; row &lt; rowcount; row++){
        for (var column = 1; column &lt;= columncount; column++){
            data[row , column - 1] = dgv_search_result.Rows[row - 1].Cells[column - 1].Value.ToString();
        }
     }

     //K sütünün Text olarak formatliyalim
     string endcelltelephone = &quot;K&quot; + rowcount.ToString();
     var writeFormat = xlWorkSheet.get_Range(&quot;K1&quot;, endcelltelephone);
     writeFormat.NumberFormat = &quot;@&quot;;

     //Objeyi ekliyecegimiz Range i belirliyelim
     string endcell = &quot;T&quot; + rowcount.ToString();
     var writeR = xlWorkSheet.get_Range(&quot;A1&quot;, endcell);
     //objeyi hazirladigimiz range e ekliyelim
     writeR.Value2 = data;
    //kayit edelim
    xlWorkBook.SaveAs(extraction_export.FileName, Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
    data = null;
    xlWorkBook.Close(false, misValue, misValue);
    excelWorkBooks.Close();
    xlApp.Quit();

    //objeleri yok edelim
    System.Runtime.InteropServices.Marshal.ReleaseComObject(verformat);
    System.Runtime.InteropServices.Marshal.ReleaseComObject(boldformat);
    System.Runtime.InteropServices.Marshal.ReleaseComObject(m_objfont);
    System.Runtime.InteropServices.Marshal.ReleaseComObject(writeFormat);
    System.Runtime.InteropServices.Marshal.ReleaseComObject(writeR);
    System.Runtime.InteropServices.Marshal.ReleaseComObject(xlWorkSheet);
    System.Runtime.InteropServices.Marshal.ReleaseComObject(excelSheet);
    System.Runtime.InteropServices.Marshal.ReleaseComObject(excelWorkBooks);
    System.Runtime.InteropServices.Marshal.ReleaseComObject(xlWorkBook);
    System.Runtime.InteropServices.Marshal.ReleaseComObject(xlApp);
    verformat = null;
    boldformat = null;
    m_objfont = null;
    writeR = null;
    writeFormat = null;
    xlWorkSheet = null;
    excelSheet = null;
    excelWorkBooks = null;
    xlWorkBook = null;
    xlApp = null;

    //GC calistiralim
    GC.GetTotalMemory(false);
    GC.Collect();
    GC.WaitForPendingFinalizers();
    GC.Collect();
    GC.GetTotalMemory(true);
}
</pre>
<p>bu yöntem ile 10 000 satiri 10 saniye den az bi zamanda export ede biliyoruz.<br />
Simdi dikkat edilmesi gereken seyleri yazmak istiyorum arkadaslar.<br />
Öncelikle <strong>.COM</strong> bilesenini kullanmak istiyorsaniz Programi kullandiginiz makinada Excel kurulu olmalidir.<br />
Projenin References bölümünden &#8220;Add Reference&#8221; e tiklayarak Reference ekleme penceresini aciyoruz. COM sekmesinde  sunucuda kayitli Com bilesenlerine ulasa bilirsiniz biz <strong>Microsoft Excel 12.0 Object Library</strong> yi projemize ekliyoruz. (12 sizde degisik ola bilir, bende Excel 2007 var ondan 12 )<br />
Projemizin basina </p>
<pre class="brush: csharp; title: ; notranslate">using Excel = Microsoft.Office.Interop.Excel;</pre>
<p>yaziyoruz.</p>
<p>Ve son olarak ögrenmis oldugum en önemli seylerden birtanesini sizlerle paylasmak istiyorum.</p>
<p><strong>Never use 2 dots with COM objects:</strong></p>
<p>Ben yukarki kodda Excel in kayit ettikden sonra kapanmamasi ve üretilen Excel dosyasinin ici bos görünmesi sorununu yasiyorudm.<br />
Bunu asmanin tek yolu yukardaki kural a uymakdir.</p>
<p>Örnek vermek gerekirse</p>
<pre class="brush: csharp; title: ; notranslate">
xlWorkSheet.get_Range(&quot;A1&quot;, &quot;T1&quot;).Font.Bold = true;
</pre>
<p>bu sekil iken excel kapanmiyor ve ben cildiriyordum. bu satiri böyle düzeltince ve diger satirlarida düzenleyince sorunlar kalkti.</p>
<pre class="brush: csharp; title: ; notranslate">
var boldformat = xlWorkSheet.get_Range(&quot;A1&quot;, &quot;T1&quot;);
var m_objfont = boldformat.Font;
m_objfont.Bold = true;
</pre>
<p>gördügünüz gibi tek satir icinde 2 (.) nokta kullanmadik.<br />
Kodumuzun basindada normalde internet örneklerinde bulunan satirlardan fazla satir bulunmakda bunun tek sebebi o kuraldir.</p>
<pre class="brush: csharp; title: ; notranslate">
Excel.Application xlApp;
Excel.Workbook xlWorkBook;
Excel.Worksheet xlWorkSheet;
Excel.Sheets excelSheet;
Excel.Workbooks excelWorkBooks;
</pre>
<p>umarim isinize yarar ve benim kadar aramak zorunda kalmassiniz.<br />
Kolay gelsin</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skorp.eu/2011/07/14/csharp-winforms-excel-e-export-hizli-interop-fast-performance/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Silverstripe</title>
		<link>http://www.skorp.eu/2011/07/12/silverstripe/</link>
		<comments>http://www.skorp.eu/2011/07/12/silverstripe/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 18:56:00 +0000</pubDate>
		<dc:creator>Skorp</dc:creator>
				<category><![CDATA[Cms]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Silverstripe]]></category>

		<guid isPermaLink="false">http://www.skorp.eu/?p=528</guid>
		<description><![CDATA[COktandir kullanmaya vakit bulamadigim, ama sonunda kullandigim acik kaynakli bir CMS/Framework den bahsetmek istiyorum. Simdiye kadar kullandigim CMS ler arasinda bir PHP cinin kullana bilecegi en iyi CMS diye bilirim. Silverstripe (SS) alt yapisinda yine SS in kurucularinin yazmis olduklari Sapphire Framework kullanilmakda. SS icin bircok eklenti mevcut bunlara silverstripe.org sitesinden baka bilirsiniz. SUana kadar [...]]]></description>
			<content:encoded><![CDATA[<p>COktandir kullanmaya vakit bulamadigim, ama sonunda kullandigim acik kaynakli bir CMS/Framework den bahsetmek istiyorum.<br />
Simdiye kadar kullandigim CMS ler arasinda bir PHP cinin kullana bilecegi en iyi CMS diye bilirim.</p>
<p>Silverstripe (SS) alt yapisinda yine SS in kurucularinin yazmis olduklari Sapphire Framework kullanilmakda.</p>
<p>SS icin bircok eklenti mevcut bunlara <a href="http://www.silverstripe.org" title="silverstripe.org" target="_blank">silverstripe.org</a> sitesinden baka bilirsiniz.</p>
<p>SUana kadar tespit ettiklerim:</p>
<ul>
<li>güclü nesne yönelimli yapisi</li>
<li>MVC-Pattern</li>
<li>Scaffolding</li>
<li>kolay genisletilebilirlik</li>
<li>kullanim kolayligi</li>
<li>eklentiler</li>
</ul>
<p>.. vs bu liste uzar gider php de yeni bir CMS ariyan varsa demo icin buraya baka bilir: <a href="http://demo.silverstripe.org/" target="_blank">Silverstripe Demo</a> </p>
<p>Bu arada bir günde Theming ile birlikde bir site olusturdum gecen hafta.<br />
<em>Silverstripe 2.4 Module Extension, Themes and Widgets</em> kitabini okumaya basladim bundan sonra silverstripe hakkinda daha cok seyler yazacagim insallah.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skorp.eu/2011/07/12/silverstripe/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Zend ViewHelper ve birden cok Metot barindirma</title>
		<link>http://www.skorp.eu/2011/03/29/zend-viewhelper-ve-birden-cok-metot-barindirma/</link>
		<comments>http://www.skorp.eu/2011/03/29/zend-viewhelper-ve-birden-cok-metot-barindirma/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 22:57:30 +0000</pubDate>
		<dc:creator>Skorp</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.skorp.eu/?p=521</guid>
		<description><![CDATA[View Scriptlerde komplex fonksiyonlari bircok kez calistirmak gerekiyorsa, bildigimiz gibi bunu Zend Framework ün bize sunmus oldugu View Helperler ile gerceklestire biliriz. Bu yazimizda View Helperde birden cok Metodu nasil barindirirz ona bakalim. Helper dedigimiz aslinda basit bir Sinif. Diyelimki &#8220;String&#8221; adinda bir helper olusturmak istiyoruz. Bu string helperi bize string adinda bir string geri [...]]]></description>
			<content:encoded><![CDATA[<p>View Scriptlerde komplex fonksiyonlari bircok kez calistirmak gerekiyorsa, bildigimiz gibi bunu Zend Framework ün bize sunmus oldugu View Helperler ile gerceklestire biliriz.<br />
Bu yazimizda View Helperde birden cok Metodu nasil barindirirz ona bakalim.<br />
Helper dedigimiz aslinda basit bir Sinif.<br />
Diyelimki &#8220;<strong>String</strong>&#8221; adinda bir helper olusturmak istiyoruz.<br />
Bu string helperi bize string adinda bir string geri versin istiyoruz.<br />
Zend Studio nun varsayilan sablonunda helperler <em>/application/views/helpers</em> klasörü altinda kayit edile bilinir.<br />
Bu klasörün icinde <strong>String.php</strong> diye bir dosya olusturalim.<br />
Ve icine sunu kaydedelim<br />
<span id="more-521"></span></p>
<pre class="brush: php; title: ; notranslate">
class Zend_View_Helper_String extends Zend_View_Helper_Abstract
{

    public function string ()
    {
       return &quot;Bubir helperdir: string()&quot;;
    }

}
</pre>
<p>Sinif adimiz baska birsey belirtilmemisse <strong>Zend_View_Helper_String</strong> bunu <strong>Zend_View_Helper_Abstract</strong> dan <em>extend</em> ediyoruz.<br />
Extend etmedende yapa bilirsniz, ama siz ileride sorun yasamak istemiyorsaniz benim yaptigim gibi yapin.</p>
<p>simdi <strong>index.phtml</strong> dosyamiza su satiri ekliyelim.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo $this-&gt;string();?&gt;
</pre>
<p>kaydedip sayfayi calistirdigimizda </p>
<p><code>BU bir Helperdir: string()</code></p>
<p>yazisini görmemiz gerekiyor.</p>
<p>Basit bir View Helperi böyle yapiyoruz, simdi ise asil bu yaziyi yazmama sebeb olan <a href="http://www.faruktemur.com/" target="_blank">Faruk Temur </a>arkadasimin istedigi gibi, bir Helper sinifinda nasil birden cok Metotu barindiririz ona bakalim.</p>
<p>Sinifimizi su sekil degistiriyoruz.</p>
<pre class="brush: php; title: ; notranslate">
class Zend_View_Helper_String extends Zend_View_Helper_Abstract
{

    public function string ()
    {
       return $this;
    }

    public function substr() {
    	return &quot;Bu bir helperdir: substr()&lt;br&gt;&quot;;
    }
    public function strlen() {
    	return &quot;Bu Helperdeki ikinci metot: strlen()&lt;br&gt;&quot;;
    }

}
</pre>
<p>görüldügü gibi string metodu <strong>return $this</strong> yaparak kendi nesnesini geri döndürüyor ve böylelikle string sinifi icinden baska bir metot cagirmamiza olanak sagliyor.</p>
<p><strong>index.phtml </strong>dosyamiza sunlari ekliyelim</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo $this-&gt;string()-&gt;substr();?&gt;
&lt;?php echo $this-&gt;string()-&gt;strlen();?&gt;
</pre>
<p>asagidaki ciktiyi aliyorsaniz herseyi dogru yaptiniz demektir.<br />
<code>Bu bir helperdir: substr()<br />
Bu Helperdeki ikinci metot: strlen()</code></p>
<p>Bugünlük bukadar kolay gelsin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skorp.eu/2011/03/29/zend-viewhelper-ve-birden-cok-metot-barindirma/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

