<?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>Webuml - Developer Notes</title>
	<atom:link href="http://www.webuml.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.webuml.com/blog</link>
	<description>Developer Notes</description>
	<lastBuildDate>Thu, 17 May 2012 12:52:37 +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>Zend Framework 2: Routing does not work after pulling latest code</title>
		<link>http://www.webuml.com/blog/zend-framework-2-routing-does-not-work-after-pulling-latest-code/95</link>
		<comments>http://www.webuml.com/blog/zend-framework-2-routing-does-not-work-after-pulling-latest-code/95#comments</comments>
		<pubDate>Thu, 17 May 2012 12:52:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[zf2]]></category>

		<guid isPermaLink="false">http://www.webuml.com/blog/?p=95</guid>
		<description><![CDATA[This note is true as of 17th of May 2012. To have your routings work again, edit your module.config.php files and replace Zend\Mvc\Router\RouteStack with Zend\Mvc\Router\RouteStackInterface. That&#8217;s it.]]></description>
			<content:encoded><![CDATA[<p>This note is true as of 17th of May 2012.</p>
<p>To have your routings work again, edit your module.config.php files and replace <strong>Zend\Mvc\Router\RouteStack</strong> with<strong> Zend\Mvc\Router\RouteStackInterface</strong>. That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webuml.com/blog/zend-framework-2-routing-does-not-work-after-pulling-latest-code/95/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Client.Management. Development. Code</title>
		<link>http://www.webuml.com/blog/client-management-development-code/86</link>
		<comments>http://www.webuml.com/blog/client-management-development-code/86#comments</comments>
		<pubDate>Tue, 22 Feb 2011 17:47:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.webuml.com/blog/?p=86</guid>
		<description><![CDATA[I worked in big environments as well as in small companies.  Management doesn&#8217;t care about code quality. They want it, but don&#8217;t really care about it. They care about respecting deadlines. There is nothing more to stay. For once I want to see a client flexible (and with budget generous) enough  to trust a development [...]]]></description>
			<content:encoded><![CDATA[<p>I worked in big environments as well as in small companies.  Management doesn&#8217;t care about code quality. They want it, but don&#8217;t really care about it. They care about respecting deadlines. There is nothing more to stay.</p>
<p>For once I want to see a client flexible (and with budget generous) enough  to trust a development team and to allow them as much time as they need, not force them to develop half-solutions.</p>
<h2>Walking on water and developing software from a specification are easy if both are frozen<strong>.</strong></h2>
]]></content:encoded>
			<wfw:commentRss>http://www.webuml.com/blog/client-management-development-code/86/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Versioning. For lazy people.</title>
		<link>http://www.webuml.com/blog/versioning-for-lazy-people/79</link>
		<comments>http://www.webuml.com/blog/versioning-for-lazy-people/79#comments</comments>
		<pubDate>Tue, 26 Jan 2010 09:58:45 +0000</pubDate>
		<dc:creator>khelo</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[versioning]]></category>

		<guid isPermaLink="false">http://www.webuml.com/blog/?p=79</guid>
		<description><![CDATA[I am a pretty lazy guy and therefore I want to do all things with as little trouble as possible. Usually , I don&#8217;t plan a certain methodology for my projects, instead , I use an organic approach. If things are needed, they will be added to my &#8216;methodology&#8217;. One of the most important issues [...]]]></description>
			<content:encoded><![CDATA[<p>I am a pretty lazy guy and therefore I want to do all things with as little trouble as possible. Usually , I don&#8217;t plan a certain methodology for my projects, instead , I use an organic approach.  If things are needed, they will be added to my &#8216;methodology&#8217;.</p>
<p>One of the most important issues for me is <strong>versioning</strong> . It doesn&#8217;t matter whether you are using svn , git , or whatever, it&#8217;s only important to be able to version via tags ( I use tags) or other mechanisms .</p>
<p>When you work from time to time on a particular project, you will certainly loose track of what you do and you will probably forget most of your code.   For me it&#8217;s important to know the differences between versions, even if I don&#8217;t plan them.</p>
<p>The standard <strong>versioning </strong>system is composed of 3 digits : like <strong>x.y.z</strong> . Most of the people think these numbers are random , or incremental , but they are not. For example if product A has the version 1.1.0 and the next version is 1.1.1 , i will know that some bugs have been fixed.  A <strong>changelog</strong> will  further detail this . If the next version will be 1.2.0 I know that some new features will be added to the product. If the new version will be 2.0 I know product A will go trough major changes and most of the base code will be rewritten and improved (also means backwards compatibility is broken).  And finally , if product A is versioned 0.y.z , I will know that the product is not considered ready yet.</p>
<h2>How do I use this in my projects?</h2>
<p>If I work on small things , bug related stuff, I will increase the minor ( z) . So from 0.1.0 I will go to 0.1.2 .</p>
<p>If I add new features, I will increase the middle digit (y). So from 0.1.0 I will go to 0.2.0 .</p>
<p>If I finish a first stable and complete version, I will go from 0.1.0 to 1.0.0 .</p>
<h2>At deploy</h2>
<p>Let&#8217;s say my current version is 0.1.2 and  the new version is 0.2.0 . My site being www.example.com , I find it convenient to create the following subdomains : <strong>sandbox</strong> and <strong>history</strong>.</p>
<p>First , I will place the new version ,  0.2.0 in the sandbox environment. All the testing will be done there. If everything looks ok,  example.com  contents  will move to history, and sandbox will move to the live site, example. com</p>
<p>So at this point, the environments will be as follow:</p>
<pre><strong>example.com - 0.2.0
sandbox.example.com - 0.2.0
history.example.com  -  0.1.2</strong></pre>
<p>If anything goes wrong , I will easily revert example.com to 0.1.2 , using the history environment.</p>
<p>Having versioning in place , allows you to see all the changes that took place in time , and also provide snapshot of your application from the past.  If you provide meaningful description to your commits, you will be able to generate a nice automated text that will build your changelog.</p>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webuml.com/blog/versioning-for-lazy-people/79/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using a decorator for caching purposes</title>
		<link>http://www.webuml.com/blog/using-a-decorator-for-caching-purposes/62</link>
		<comments>http://www.webuml.com/blog/using-a-decorator-for-caching-purposes/62#comments</comments>
		<pubDate>Wed, 18 Nov 2009 12:53:36 +0000</pubDate>
		<dc:creator>khelo</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[decorator]]></category>
		<category><![CDATA[patterns]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.webuml.com/blog/?p=62</guid>
		<description><![CDATA[In my previous post I  gave some examples on  how caching can evolve.   However , what annoys  me in the  second and third approach is that I have some extra code and  dependencies  which are not really related to my class.  The examples bellow detail how you can use a decorator to cache another class. [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://www.webuml.com/blog/?p=49">previous</a> post I  gave some examples on  how caching can evolve.   However , what annoys  me in the  second and third approach is that I have some extra code and  dependencies  which are not really related to my class.  The examples bellow detail how you can use a decorator to cache another class.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Foo
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getExpensiveData<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getNotSoExpensiveData<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getUnbelievableExpensiveData<span style="color: #009900;">&#40;</span><span style="color: #000088;">$param</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">//no hardware in the world can scale this</span>
        <span style="color: #990000;">sleep</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'string'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span> 
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> Foo_Decorator_Exception <span style="color: #000000; font-weight: bold;">extends</span> Exception<span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> Foo_Decorator
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$source</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span>Foo <span style="color: #000088;">$foo</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">source</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$foo</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __call<span style="color: #009900;">&#40;</span><span style="color: #000088;">$method</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$args</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$tag</span>    <span style="color: #339933;">=</span> <span style="color: #000088;">$method</span><span style="color: #339933;">.</span><span style="color: #990000;">serialize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$method</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'getUnbelievableExpensiveData'</span><span style="color: #339933;">:</span>
            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'getExpensiveData'</span><span style="color: #339933;">:</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>Cache<span style="color: #339933;">::</span><span style="color: #004000;">isCached</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tag</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    Cache<span style="color: #339933;">::</span><span style="color: #004000;">save</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_call<span style="color: #009900;">&#40;</span><span style="color: #000088;">$method</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$args</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$tag</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
&nbsp;
                <span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> Cache<span style="color: #339933;">::</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tag</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">default</span> <span style="color: #339933;">:</span>
                <span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_call<span style="color: #009900;">&#40;</span><span style="color: #000088;">$method</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$args</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$result</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _call<span style="color: #009900;">&#40;</span><span style="color: #000088;">$method</span><span style="color: #339933;">,</span> <span style="color: #000088;">$args</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">is_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">source</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> Foo_Exception<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;No delegate object set&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000088;">$delegate</span>        <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">source</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$method_variable</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$delegate</span><span style="color: #339933;">,</span> <span style="color: #000088;">$method</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$callableName</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">is_callable</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$method_variable</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$callableName</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #990000;">call_user_func_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$method_variable</span><span style="color: #339933;">,</span> <span style="color: #000088;">$args</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> Foo_Exception<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Function missing in both decorate and delegate object&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.webuml.com/blog/using-a-decorator-for-caching-purposes/62/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Three simple php caching tehniques</title>
		<link>http://www.webuml.com/blog/three-simple-php-caching-techniques/49</link>
		<comments>http://www.webuml.com/blog/three-simple-php-caching-techniques/49#comments</comments>
		<pubDate>Tue, 10 Nov 2009 15:20:37 +0000</pubDate>
		<dc:creator>khelo</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[simple]]></category>

		<guid isPermaLink="false">http://www.webuml.com/blog/?p=49</guid>
		<description><![CDATA[No talking . Just examples class Foo { private static $_bar = null; private function getBar() { if ( null == self::$_bar) { //very expensive operation self::$bar = $this-&#62;expensiveOperation(); } return self::$bar; } private function expensiveOperation() { return 1+1;//wow } } Extending the example class Foo { private function getBar() { if ( !this-&#62;isCached()) { [...]]]></description>
			<content:encoded><![CDATA[<p>No talking . Just examples</p>
<pre>class Foo
{</pre>
<pre>    private static $_bar = null;

    private function getBar()
    {
        if ( null == self::$_bar) {
            //very expensive operation
            self::$bar = $this-&gt;expensiveOperation();
        }

        return self::$bar;
    }

    private function expensiveOperation()
    {
        return 1+1;//wow
    }
}</pre>
<p>Extending the example</p>
<pre>class Foo
{</pre>
<pre>    private function getBar()
    {
        if ( !this-&gt;isCached()) {
            //very expensive operation
            $this-&gt;saveCache($this-&gt;expensiveOperation);
        }

        return $this-&gt;getCache();
    }

    protected function saveCache($value)
    {
        file_put_contents($this-&gt;getCachePath(),$value);
    }

    protected function getCache()
    {
        return file_get_contents($this-&gt;getCachePath());
    }

    protected function isCached()
    {
        return is_file($this-&gt;getCachePath());
    }

    private function getCachePath()
    {
        return '/path/to/somefile.txt';
    }
<pre>    private function expensiveOperation()
    {
        return 1+1;//wow
    }
}</pre>
<p>Final example</p>
<pre>class Cache
{
    public static function isCached($tag)
    {
        return is_file(self::isFile(self::getCacheFile($tag)));
    }

    public static function save($value , $tag)
    {

        $file = self::getCacheFile($tag);
        file_put_contents($file , $value);
    }

    public static function load( $tag)
    {
        $file = self::getCacheFile($tag);
        return file_get_contents($file);
    }

    private static function getCachePath($tag)
    {
        return "/path/to/somefile_$tag.txt";
    }
}

class Foo
{
    public static function getBar()
    {
       if ( !Cache::isCached('my_tag')) {
            //very expensive operation
            Cache::save($this-&gt;expensiveOperation(),'my_tag');
        }
        return $this-&gt;load('my_tag');
    }

    private function expensiveOperation()
    {
        return 1+1;//wow
    }
}

All three examples are variations of the same technique.
Of course , the  <strong>file_get_contents</strong> thing is used for the example's sake only</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.webuml.com/blog/three-simple-php-caching-techniques/49/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A short look on nwire</title>
		<link>http://www.webuml.com/blog/a-short-look-on-nwire/34</link>
		<comments>http://www.webuml.com/blog/a-short-look-on-nwire/34#comments</comments>
		<pubDate>Wed, 14 Oct 2009 06:49:03 +0000</pubDate>
		<dc:creator>khelo</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[explore]]></category>
		<category><![CDATA[nwire]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.webuml.com/blog/?p=34</guid>
		<description><![CDATA[nwire is a new eclipse for extension, and it allows you to  explore your code.  When I say explore , I really mean explore. It&#8217;s not a static stuff where you watch a diagram.  More about this in the youtube presentations . This is a must have extension for devs who do a lot of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.nwiresoftware.com/download/get-nwire"><strong>nwire</strong></a> is a new eclipse for extension, and it allows you to  <strong>explore</strong> your code.  When I say explore , I really mean explore. It&#8217;s not a static stuff where you watch a diagram.  More about this in the youtube presentations .</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/crtGjrvwO70" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/crtGjrvwO70"></embed></object></p>
<p>This is a must have extension for devs who do a lot of refactoring , as you can see everything , including what uses or changes a variable , which in softwares like wordpress is a bless. Some pics bellow.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webuml.com/blog/a-short-look-on-nwire/34/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notice: Indirect modification of overloaded property ..</title>
		<link>http://www.webuml.com/blog/notice-indirect-modification-of-overloaded-property/27</link>
		<comments>http://www.webuml.com/blog/notice-indirect-modification-of-overloaded-property/27#comments</comments>
		<pubDate>Tue, 13 Oct 2009 11:54:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[notice]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.webuml.com/blog/?p=27</guid>
		<description><![CDATA[You get this because you have the __get method set up , and you are trying to access an array that is not declared. class a { //      private $stuff = array(); public function foo() { $this-&#62;stuff['asd'] = 'foo'; } public function __get($name) { return null; } $a = new a(); $a-&#62;foo(); The above code [...]]]></description>
			<content:encoded><![CDATA[<p>You get this because you have the <strong>__get</strong> method set up , and you are trying to access an array that is not declared.</p>
<pre>class a {
 //      private $stuff = array();
 public function foo()
 {
     $this-&gt;stuff['asd'] = 'foo';
 }

 public function __get($name)
 {
     return null;
 }
$a = new a();
$a-&gt;foo();</pre>
<p>The above code will result in :</p>
<pre><strong><strong>Notice</strong>:</strong>  Indirect modification of overloaded property a::$stuff has no effect</pre>
<p>I think this happens only for 5.2.x . More details <a href="http://weierophinney.net/matthew/archives/131-Overloading-arrays-in-PHP-5.2.0.html">here</a>.</p>
<p>I encountered this bug while refactoring a set of classes. The property got lost from the parent , who had a <a href="http://php.net/manual/en/language.oop5.magic.php"><strong>__get</strong></a> method set , and was called from the child class.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webuml.com/blog/notice-indirect-modification-of-overloaded-property/27/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uploading a image in php with curl</title>
		<link>http://www.webuml.com/blog/uploading-a-image-in-php-with-curl/20</link>
		<comments>http://www.webuml.com/blog/uploading-a-image-in-php-with-curl/20#comments</comments>
		<pubDate>Mon, 12 Oct 2009 08:16:16 +0000</pubDate>
		<dc:creator>khelo</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://www.webuml.com/blog/?p=20</guid>
		<description><![CDATA[In the latest years we (php programmers) have spent a lot of time  behind classes and frameworks ,  making all our repetitive tasks available in simple and understandable forms like : $image = new Image('/var/www/image.jpg'); $image-&#62;upload('http://www.somesite.com/upload.php'); However , when the Image class can not be used ,  most of use will google for  &#8220;how to [...]]]></description>
			<content:encoded><![CDATA[<p>In the latest years we (<strong>php</strong> programmers) have spent a lot of time  behind <strong>classes</strong> and <strong>frameworks</strong> ,  making all our repetitive tasks available in simple and understandable forms like :</p>
<pre>$image = new Image('/var/www/image.jpg');
$image-&gt;upload('http://www.somesite.com/upload.php');</pre>
<p>However , when the Image class <strong>can not</strong> be used ,  most of use will <strong>google</strong> for  &#8220;how to upload an image with php curl&#8221;.</p>
<p>The following snippet of code can be used to upload a image:</p>
<pre>$url = 'http://somesite.com/upload.php;
$file = 'image.jpg';</pre>
<pre>$curl  = curl_init($url);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS,
             array('image' =&gt; "@$file;type=image;type=image/jpeg"));
$resp = curl_exec($curl);</pre>
<p>Note the @ before the file. It will extract the binary contents of file , so be wary of your php memory limit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webuml.com/blog/uploading-a-image-in-php-with-curl/20/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding custom admin config options in Magento</title>
		<link>http://www.webuml.com/blog/adding-custom-module-for-custom-admin-config-options-in-magento/13</link>
		<comments>http://www.webuml.com/blog/adding-custom-module-for-custom-admin-config-options-in-magento/13#comments</comments>
		<pubDate>Fri, 09 Oct 2009 08:32:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[module]]></category>

		<guid isPermaLink="false">http://www.webuml.com/blog/?p=13</guid>
		<description><![CDATA[I had  a problem   related to the admin configuration options in Magento. (not 100% resolved yet) .  It took me  some time to figure it out.  To have your magento module add it&#8217;s own configuration options in the sytem area , there are (theoretically) some simple steps to follow. However , I obtained the access [...]]]></description>
			<content:encoded><![CDATA[<p>I had  a problem   related to the admin configuration options in <strong>Magento</strong>. (not 100% resolved yet) .  It took me  some time to figure it out.  To have your <strong>magento</strong> <strong>module</strong> add it&#8217;s own <strong>configuration options</strong> in the sytem area , there are (theoretically) some <a href="http://devzone.pratthost.com/2008/09/29/magento-add-custom-module-for-custom-admin-config-options/">simple steps</a> to follow. However , I obtained the <strong>access denied </strong>screen when I tried to view the configuration options. If you have caching enabled, you will only get a blank screen. (How cool is that?)</p>
<p>One quick solution is to go to <strong>Magento-&gt;System-&gt;Roles</strong> , edit the <strong>Administrator</strong> group and set the permissions to All again.  Searching for a bug  related to this problem , I have found that the solution is allready posted <a title="access denied in magento admin" href="http://inchoo.net/ecommerce/magento/access-denied-in-magento-admin/">here </a>, so I&#8217;ll skip the rest of the details. Be sure <strong>NOT TO</strong> uncheck all the permissions and then save, or you  will not have to edit the database to restore your permissions  ( How cool is that? A store owner has to pay a programmer to fix the mess if he screws permissions).</p>
<p>If you accidentally found my post while trying to discover how you can create custom admin config options in Magento,  you can <a href="http://inchoo.net/wp-content/uploads/2009/08/ActiveCodeline_CoolDash.zip">download</a> a blank magento <strong>module </strong> (description <a href="http://www.candesprojects.com/magento/develop-magento-admin-module-with-cooldash/">here</a> ), which can be used as a template for your admin configuration options.  Be adivsed that it still has the above mentioned <strong>problem</strong>.</p>
<p>K.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webuml.com/blog/adding-custom-module-for-custom-admin-config-options-in-magento/13/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Some integration plugins are pure crap</title>
		<link>http://www.webuml.com/blog/some-integration-plugins-are-pure-crap/8</link>
		<comments>http://www.webuml.com/blog/some-integration-plugins-are-pure-crap/8#comments</comments>
		<pubDate>Thu, 08 Oct 2009 20:08:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[crap]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[lame]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.webuml.com/blog/?p=8</guid>
		<description><![CDATA[I recently stumbled uppon a WordPress integration plugin for Magento , which was actually hosted on Magento main site. The plugin required both Mangento and WordPress to be edited. Which is crap. That&#8217;s not a wordpress integration, that&#8217;s wordpress hackintegration . Because both Magento and WordPress have to be edited, neither can be upgraded anymore. [...]]]></description>
			<content:encoded><![CDATA[<p>I recently stumbled uppon a <strong>WordPress</strong> integration plugin for <strong>Magento</strong> , which was actually hosted on <strong>Magento</strong> <strong>main</strong> <strong>site</strong>. The <strong>plugin</strong> required both Mangento and WordPress to be edited. Which is <strong>crap</strong>.  That&#8217;s not a wordpress integration, that&#8217;s wordpress hackintegration .</p>
<p>Because both Magento and WordPress have to be edited, neither can be upgraded anymore. And because you actually include and run WordPress code for <strong>each</strong> Magento request ,  a <strong>WordPress</strong> error will  stop Magento from working.</p>
<p>And finally , wordpress content is only included and displayed within mangento , but not integrated.</p>
<p>Such lame plugins should never be posted.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webuml.com/blog/some-integration-plugins-are-pure-crap/8/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

