<?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>Funktion-IT</title>
	<atom:link href="https://funktion-it.co.za/feed/" rel="self" type="application/rss+xml" />
	<link>https://funktion-it.co.za</link>
	<description>just another dev blog</description>
	<lastBuildDate>Tue, 10 Mar 2015 05:57:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.41</generator>
	<item>
		<title>Update Symfony 2 Debug Bar on each ajax call</title>
		<link>https://funktion-it.co.za/2012/12/update-symfony-2-debug-bar-on-each-ajax-call/</link>
		<comments>https://funktion-it.co.za/2012/12/update-symfony-2-debug-bar-on-each-ajax-call/#comments</comments>
		<pubDate>Mon, 03 Dec 2012 05:56:49 +0000</pubDate>
		<dc:creator><![CDATA[Sacheen Dhanjie]]></dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[symfony2]]></category>

		<guid isPermaLink="false">http://funktion-it.co.za/?p=70</guid>
		<description><![CDATA[Using JQuery and a bit of javascript, we can update the Symfony 2 debug tool bar on Ajax complete. [crayon-6a0952fb0f0a0761515642/] &#160;]]></description>
				<content:encoded><![CDATA[<p>Using JQuery and a bit of javascript, we can update the Symfony 2 debug tool bar on Ajax complete.</p><pre class="crayon-plain-tag">$(document).ready(function() {

	$("body").ajaxComplete(function(event, XMLHttpRequest, ajaxOption){
		if(XMLHttpRequest.getResponseHeader('x-debug-token')) {
			$('.sf-toolbarreset').remove();
			$.get(window.location.protocol+'//'+window.location.hostname+'/_wdt/'+XMLHttpRequest.getResponseHeader('x-debug-token'),function(data){
			$('body').append(data);
		});
		}
	});

});</pre><p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://funktion-it.co.za/2012/12/update-symfony-2-debug-bar-on-each-ajax-call/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Symfony2 &#8211; Removing the acme demo</title>
		<link>https://funktion-it.co.za/2012/06/symfony2-removing-the-acme-demo/</link>
		<comments>https://funktion-it.co.za/2012/06/symfony2-removing-the-acme-demo/#comments</comments>
		<pubDate>Sat, 09 Jun 2012 14:40:25 +0000</pubDate>
		<dc:creator><![CDATA[Sacheen Dhanjie]]></dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[symfony2]]></category>
		<category><![CDATA[acme]]></category>
		<category><![CDATA[demo bundle]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[remove]]></category>

		<guid isPermaLink="false">http://funktion-it.co.za/?p=56</guid>
		<description><![CDATA[Lets begin Everything in Symfony2 uses or is a bundle [a collection of code that serves a single useful purpose]. In order to use the bundle it has to be registered in some way. This &#8220;Registration&#8221; takes place in the &#8230;<p class="read-more"> <a class="more-link" href="https://funktion-it.co.za/2012/06/symfony2-removing-the-acme-demo/"> <span class="screen-reader-text">Symfony2 &#8211; Removing the acme demo</span> Read More &#187;</a></p>]]></description>
				<content:encoded><![CDATA[<h2>Lets begin</h2>
<p>Everything in Symfony2 uses or is a bundle [a collection of code that serves a single useful purpose]. In order to use the bundle it has to be registered in some way. This &#8220;Registration&#8221; takes place in the <strong>AppKernel.php</strong>. any bundle that you create, will be registered here. <strong><br />
</strong></p>
<p>So the files we will be editing is <strong>app/AppKernel.php</strong>, <strong>app/config/routing_dev.yml</strong> and we will be removing the <strong>src/Acme </strong>folder.</p>
<h2>The App Kernel</h2>
<p>here we have to remove the line<strong> $bundles[] = new Acme\DemoBundle\AcmeDemoBundle();</strong></p><pre class="crayon-plain-tag">&lt;?php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
          ...
        );

        if (in_array($this-&gt;getEnvironment(), array('dev', 'test'))) {
            $bundles[] = new Acme\DemoBundle\AcmeDemoBundle(); /**Remove this line **/
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
            ....
        }
        return $bundles;
    }
}</pre><p></p>
<h2> The routing_dev.yml</h2>
<p>any route prefixed with <strong>_demo</strong> and <strong>_welcome</strong> can be removed</p><pre class="crayon-plain-tag">_welcome:
    pattern:  /
    defaults: { _controller: AcmeDemoBundle:Welcome:index }

_demo_secured:
    resource: "@AcmeDemoBundle/Controller/SecuredController.php"
    type:     annotation

_demo:
    resource: "@AcmeDemoBundle/Controller/DemoController.php"
    type:     annotation
    prefix:   /demo

.......</pre><p></p>
<h2> Deleting the Acme Directory</h2>
<p>Now the only thing left to do is delete the src/Acme folder, and that&#8217;s  it!</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://funktion-it.co.za/2012/06/symfony2-removing-the-acme-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symfony 2 &#8211; Getting started a quick guide without vendors</title>
		<link>https://funktion-it.co.za/2012/06/symfony-2-getting-started-a-quick-guide-without-vendors/</link>
		<comments>https://funktion-it.co.za/2012/06/symfony-2-getting-started-a-quick-guide-without-vendors/#comments</comments>
		<pubDate>Sat, 09 Jun 2012 10:48:42 +0000</pubDate>
		<dc:creator><![CDATA[Sacheen Dhanjie]]></dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[symfony2]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[getting started]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[host file]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[virtual host]]></category>

		<guid isPermaLink="false">http://funktion-it.co.za/?p=30</guid>
		<description><![CDATA[Symfony Installation To get started with Symfony 2, you will require a Web server (such as Apache) with PHP 5.3.2 or higher. If you want to use source control to store your project, this tutorial uses git. Lets start by &#8230;<p class="read-more"> <a class="more-link" href="https://funktion-it.co.za/2012/06/symfony-2-getting-started-a-quick-guide-without-vendors/"> <span class="screen-reader-text">Symfony 2 &#8211; Getting started a quick guide without vendors</span> Read More &#187;</a></p>]]></description>
				<content:encoded><![CDATA[<h2>Symfony Installation</h2>
<p>To get started with Symfony 2, you will require a Web server (such as Apache) with PHP 5.3.2 or higher. If you want to use source control to store your project, this tutorial uses <a title="Git" href="https://github.com/" target="_blank">git</a>.</p>
<p>Lets start by download the zip file from the Symfony <a title="website" href="http://symfony.com/download" target="_blank">website</a>. make sure you select <strong>Symfony Standard 2.0.15 without vendors</strong>.</p>
<ol>
<li>unzip the Symfony_Standard_2.0.15.zip into your web directory
<p><figure id="attachment_32" style="width: 300px;" class="wp-caption alignnone"><a href="http://www.funktion-it.co.za/wp-content/uploads/2012/06/sf2baseInstall.png"><img class="size-medium wp-image-32" title="sf2baseInstall" src="http://www.funktion-it.co.za/wp-content/uploads/2012/06/sf2baseInstall-300x93.png" alt="Symfony2 base install" width="300" height="93" /></a><figcaption class="wp-caption-text">Symfony 2 Base install ~/Sites/sf2demo</figcaption></figure></li>
<li>If you want to use Git to store your project create a new file <strong>.gitignore </strong>in your ~/Sites/sf2demo directory</p><pre class="crayon-plain-tag">/web/bundles/
/app/bootstrap*
/app/cache/*
/app/logs/*
/vendor/
/app/config/parameters.ini</pre><p>
</li>
<li>Copy <strong><tt><code>app/config/parameters.ini</code></tt></strong> to <strong><tt><code>app/config/parameters.ini.dist</code></tt>.</strong> By doing this a new developer can quickly clone the repository, and add their own database passwords and settings, for their local machine.</li>
<li>Init Git by running</p><pre class="crayon-plain-tag">~Sites/sf2demo]$ git init</pre><p>
</li>
<li>Add files to your local git repository</p><pre class="crayon-plain-tag">~Sites/sf2demo]$ git add .</pre><p>
</li>
<li>Make the First Commit</p><pre class="crayon-plain-tag">~Sites/sf2demo]$ git commit -m "First commit"</pre><p>
</li>
<li>Now we can install the vendors</p><pre class="crayon-plain-tag">~Sites/sf2demo]$ php bin/vendors install</pre><p>
</li>
<li>Lock your current vendors installation</p><pre class="crayon-plain-tag">~Sites/sf2demo]$ php bin/vendors lock</pre><p>
</li>
<li>Clean up the vendor install</p><pre class="crayon-plain-tag">~Sites/sf2demo]$ find vendor -name .git -type d | xargs rm -rf</pre><p>
</li>
<li>File permissions to allow cache and logs to be written</p><pre class="crayon-plain-tag">~Sites/sf2demo]$ chmod -R 777 app/cache/ app/logs/</pre><p>
</li>
</ol>
<h2>What are the vendors for?</h2>
<p>The vendors directory contains all of source code [including the Symfony source code] to allow your application to work. Since Symfony2 is highly decoupled, it allows you to include and exclude particular modules or &#8220;bundles&#8221; that you do not need. for example symfony2 vendors come standard with <a title="Docrine" href="http://www.doctrine-project.org/">Doctrine ORM</a>, if you do not need a ORM Mapper of want to install a new one, simply remove or add the vendor in the <strong>deps</strong> file in ~/Sites/sf2demo. the <strong>deps.lock</strong> file makes sure that when you run</p><pre class="crayon-plain-tag">~Sites/sf2demo]$ php bin/vendors install</pre><p>again, it will install the project specific vendor version defined in <strong>deps.lock</strong>. So if you want to upgrade a specific vendor, edit your <strong>deps.lock</strong> and <strong>deps</strong> files to set the version of the module you want to install, then run</p><pre class="crayon-plain-tag">~Sites/sf2demo]$ bin/vendors install --reinstall</pre><p>to re-install your project specific vendors.</p>
<h2>Virtual Host setup</h2>
<p>This will allow you to setup a local domain name when viewing your site in a web browser, each operation system has it <span style="text-decoration: underline;">own directory structure and file locations</span>, for most Linux and Mac OS X the directories will be the same or similar.</p>
<h3>The Host File</h3>
<ol>
<li>Edit the host file<br />
<pre class="crayon-plain-tag">~]$ sudo vim /etc/hosts</pre><br />
Your host file should look some think like this<br />
<pre class="crayon-plain-tag">127.0.0.1       localhost

255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost</pre>
</li>
<li>Add the highlighted text to the file<br />
<pre class="crayon-plain-tag">127.0.0.1       localhost
127.0.0.1       sf2demo.local

255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost</pre><br />
vim hints: press <strong>i</strong> to start inserting text, use arrow keys to navigate, press <strong>esc</strong> to stop editing text, press <strong>: x</strong> [then enter] to save</li>
</ol>
<h3>The Virtual Host file</h3>
<ol>
<li>Create a virtual host file<br />
<pre class="crayon-plain-tag">~]$ sudo vim /etc/apache2/sites/0000_any_80_sf2demo.local.conf</pre>
</li>
<li>Insert the virtual host information [make sure you use your site directory]<br />
<pre class="crayon-plain-tag">&lt;VirtualHost *:80&gt;
        ServerName sf2demo.local
        ServerAdmin your@email.com
        DocumentRoot "/Users/yourusername/Sites/sf2demo/web"
        DirectoryIndex app_dev.php
        CustomLog /var/log/apache2/access_log combinedvhost
        ErrorLog /var/log/apache2/error_log

        &lt;IfModule mod_ssl.c&gt;
                SSLEngine Off
                SSLCipherSuite "ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM"
                SSLProtocol -ALL +SSLv3 +TLSv1
                SSLProxyEngine On
                SSLProxyProtocol -ALL +SSLv3 +TLSv1
        &lt;/IfModule&gt;

        &lt;Directory "/Users/yourusername/Sites/sf2demo/web"&gt;
                Options All +MultiViews -ExecCGI -Indexes
                AllowOverride All
                &lt;IfModule mod_dav.c&gt;
                        DAV Off
                &lt;/IfModule&gt;
        &lt;/Directory&gt;
&lt;/VirtualHost&gt;</pre>
</li>
<li>Edit your<strong> http.conf</strong>file to include your virtual host<br />
<pre class="crayon-plain-tag">~]$ sudo vim /etc/apache2/httpd.conf</pre><br />
Insert content in your <strong>httpd.conf</strong> if it does not exist [this is for Mac OS X Server]<br />
<pre class="crayon-plain-tag">&lt;IfDefine MACOSXSERVER&gt;
    &lt;IfDefine WEBSERVICE_ON&gt;
        Include /etc/apache2/sites/*.conf
    &lt;/IfDefine&gt;
    &lt;IfDefine !WEBSERVICE_ON&gt;
        Include /etc/apache2/sites/virtual_host_global.conf
        Include /etc/apache2/sites/*_.conf
        Include /etc/apache2/sites/*__shadow.conf
    &lt;/IfDefine&gt;
&lt;/IfDefine&gt;</pre>
</li>
<li>Restart Apache<br />
<pre class="crayon-plain-tag">~]$ sudo apachectl restart</pre>
</li>
</ol>
<h3>The .htaccess file</h3>
<ol>
<li>Edit your .htaccess file in ~Sites/sf2demo/web<br />
<pre class="crayon-plain-tag">Sites/sf2demo]$ vim web/.htaccess</pre>
</li>
<li>modify app.php to reflect app_dev.php<br />
<pre class="crayon-plain-tag">&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ app_dev.php [QSA,L]
&lt;/IfModule&gt;</pre><br />
&nbsp;</li>
</ol>
<h2>Viewing the site</h2>
<p>Open up your browser and type enter the Url specified in your host and virtual host files sf2demo.local you should see the Symfony2 configuration page. you can now proceed to configure your application.</p>
<figure id="attachment_43" style="width: 300px;" class="wp-caption alignnone"><a href="http://www.funktion-it.co.za/wp-content/uploads/2012/06/sf2configure.png"><img class="size-medium wp-image-43" title="Symfony2 Setup page" src="http://www.funktion-it.co.za/wp-content/uploads/2012/06/sf2configure-300x155.png" alt="Symfony2 Setup page" width="300" height="155" /></a><figcaption class="wp-caption-text">Symfony2 Setup page</figcaption></figure>
]]></content:encoded>
			<wfw:commentRss>https://funktion-it.co.za/2012/06/symfony-2-getting-started-a-quick-guide-without-vendors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
