<?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><![CDATA[]]></title>
	<atom:link href="https://www.magentron.com/blog/feed" rel="self" type="application/rss+xml" />
	<link><![CDATA[https://www.magentron.com/blog/]]></link>
	<description><![CDATA[]]></description>
	<lastBuildDate>Sun, 15 Dec 2019 18:24:53 +0000</lastBuildDate>
	<language></language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator><![CDATA[http://fishpig.co.uk/wordpress-integration/]]></generator>
			<item>
		<title><![CDATA[PHP: Determine the full URL of the current page]]></title>
		<link><![CDATA[https://www.magentron.com/blog/2017/10/16/php-determine-full-url-current-page]]></link>
		<comments><![CDATA[https://www.magentron.com/blog/2017/10/16/php-determine-full-url-current-page#respond]]></comments>
		<pubDate>Mon, 16 Oct 2017 16:55:32 +0000</pubDate>
		<dc:creator></dc:creator>
			<guid isPermaLink="false"><![CDATA[https://www.magentron.com/blog/?p=148]]></guid>
			<description><![CDATA[<p class="smaller">This article originally appeared on <a href="https://www.phpfreelancer.org/blog/php-get-current-url.html" target="_blank">www.phpfreelancer.org</a>.</p>
<div class="featured-image left">
	<img src="/media/luke-michael-71491-950x256-768x207.jpg" alt="" title="" width="670" height="178"/>
</div>
<p>
Sometimes you want to know in a simple PHP script what the current URL (the URL through which the PHP script is called) is. When I was looking for a solution without reinventing the wheel, I actually found no piece of PHP code that met my expectations. So let me try it as well.</p>
<!--more-->
<h3>From which components does a URL consist?</h3>
<p>The format of a URL looks like this:</p>
<pre class="shell">	protocol://username:password@host:port/path?query#fragment</pre>
<br/>
<p>
This URL format is not only used for the World Wide Web. For example, it is also used to communicate or configure the required data for access to a database.
Since everyone uses URLs almost daily, I do not need to describe the different parts of the URL further.</p>
<p>I assume that if you want to use the full URL in your PHP code, you do not want to include the credentials (username and password) to prevent them from being used in an undesired way. Also, the fragment will never be passed through the <a href="https://en.wikipedia.org/wiki/Common_Gateway_Interface" target="_blank">CGI interface</a> so you can not use it either.</p>
<h3>Which data are available to you in PHP?</h3>
<p>Using the function <a href="http://php.net/phpinfo" target="_blank">phpinfo()</a> for example, you can see in PHP which data is available to you to determine the current URL:</p>
<p><img src="//cdn.hosten.nu/content/phpfreelancer/images/phpinfo-localhost-path-query-fragment.jpg" alt="Screen shot of phpinfo() output"></p>
<h3>The solution?</h3>
<p>Using this we can generate the following function:</p>
<pre class="brush:php;">&lt;?php
	function get_current_url()
	{
		$url = false;

		// check whether this script is being run as a web page
		if (isset($_SERVER['SERVER_ADDR']))
		{
			$is_https	= isset($_SERVER['HTTPS']) && 'on' == $_SERVER['HTTPS'];
			$protocol   = 'http' . ($is_https ? 's' : '');
			$host       = isset($_SERVER['HTTP_HOST'])
							? $_SERVER['HTTP_HOST']
							: $_SERVER['SERVER_ADDR'];
			$port       = $_SERVER['SERVER_PORT'];
			$path_query = $_SERVER['REQUEST_URI'];

			$url = sprintf('%s://%s%s%s',
				$protocol,
				$host,
				$is_https
					? (443 != $port ? ':' . $port : '')
					: ( 80 != $port ? ':' . $port : ''),
				$path_query
			);
		}

		return $url;
	}
</pre>
<h3>Bonus</h3>
<p>As a bonus, I give you <a href="https://www.phpfreelancer.org/php.net-get_current_url.html" target="_blank">English manual page for the get_current_url() function</a>.<br>
And the gist URL is: <a href="https://gist.github.com/Magentron/05ee3b8f62886878c2f1c3d76e8e3696" target="_blank">https://gist.github.com/Magentron/05ee3b8f62886878c2f1c3d76e8e3696</a></p>
<p>
If you have any improvement or suggestion to share, please leave a message below.</p>]]></description>
			</item>
		<item>
		<title><![CDATA[What's my IP address? - Now easy to remember curl command line++]]></title>
		<link><![CDATA[https://www.magentron.com/blog/2017/10/03/whats-my-ip-address-now-easy-to-remember-curl-command-line]]></link>
		<comments><![CDATA[https://www.magentron.com/blog/2017/10/03/whats-my-ip-address-now-easy-to-remember-curl-command-line#respond]]></comments>
		<pubDate>Tue, 03 Oct 2017 15:14:45 +0000</pubDate>
		<dc:creator></dc:creator>
			<guid isPermaLink="false"><![CDATA[https://www.magentron.com/blog/?p=141]]></guid>
			<description><![CDATA[<p class="smaller">This article originally appeared on <a href="https://www.phpfreelancer.org/blog/whats-my-ip-address-command-line-api-javascript-php-shell-soap-xml-dns-geoip.html" target="_blank">www.phpfreelancer.org</a>.</p>
<div class="featured-image left">
	<a href="https://in.je/ip" target="_blank"><img src="/media/IP_address_icon-150x150.png" alt="in.je/ip" title="in.je/ip" width="150" height="150"/></a>
</div>
<p>
Many times when I checking for example access or error logs, I need to know my public or external IP address (these days most people by now should be using <a href="https://en.wikipedia.org/wiki/Network_address_translation" target="_blank">NAT</a> at home because their Internet access router configures it out of the box so that they cannot simply use ifconfig or ipconfig to see which IP address is in use).</p><p>
 To do so I would have more or less two options:</p>
<!--more-->
<ol>
<li>Retrieve the public IP address from the router, or</li>
<li>Consult an external server to provide me with the external IP address I'd be using to access that server.</li>
</ol>
<p>
Since routers come in many brands, types and operating systems, it is not generally possible to retrieve any information from it in a standard way. Furthermore, you might just be a simple user of the network that is not responsible for the network administration and as such you would not have access to the router to begin with.</p><p>
So, that leaves us with the second option. There are many websites that provide a service for you to know your remote IP address, optionally with additional information such as your location, browser, supported languages, screen size, and what not. For me the most used sites are <a href="http://whatsmyip.net" target="_blank">whatsmyip.net</a>, <a href="http://www.whatsmyip.org" target="_blank">whatsmyip.org</a> and <a href="https://whatsmyip.com" target="_blank">whatsmyip.com</a>, but there are many more.</p><p>
However, I'm to lazy to open a tab in my browser and type any of those URLs, I'm faster with the command line... &#9786;
</p><p>
Instead I wrote a simple PHP script to help me with that. The result is <a href="https://in.je/ip" target="_blank"><strong>in.je/ip</strong></a>, which you can easily call using <a href="https://curl.haxx.se/docs/manual.html" target="_blank">curl</a> or <a href="https://www.gnu.org/software/wget/manual/wget.html" target="_blank">wget</a>:</p>
<ul>
	<li class="command"><span>curl in.je/ip</span></li>
	<li class="command"><span>wget -qO - in.je/ip</span></li>
</ul>
<p><br/>Example:</p>
<pre class="command-line">
jeroen@dev:~$ time <strong>curl in.je/ip</strong>
66.249.76.156

real    0m0.103s
user    0m0.007s
sys     0m0.007s
</pre>
<br/>
<p>
So it complies with the first requirement of working from the command line, where you can for example pipe it into a different program if necessary.</p><p>
Also, it supports different kinds of output data and formats, such as binary, DNS, GeoIP information, HTML, Javascript, PHP, shell scripts, API, XML or SOAP requests, etc. For example to do reverse DNS lookup just use:</p>
<pre class="command-line">
jeroen@dev:~$ <strong>curl in.je/ip/rdns</strong>
crawl-66-249-76-156.googlebot.com
</pre>
<br/>
<p>
Please go to <a href="https://in.je/ip" target="_blank">in.je/ip</a> to read about all the features.</p><p>
Enjoy!</p><p>
If you have any improvement or suggestion to share, please leave a message via the link below.</p>]]></description>
			</item>
		<item>
		<title><![CDATA[Automatically upgrade all PHPMailer installs on your server]]></title>
		<link><![CDATA[https://www.magentron.com/blog/2016/12/29/automatically-upgrade-all-phpmailer-installs-on-your-server]]></link>
		<comments><![CDATA[https://www.magentron.com/blog/2016/12/29/automatically-upgrade-all-phpmailer-installs-on-your-server#respond]]></comments>
		<pubDate>Thu, 29 Dec 2016 17:05:56 +0000</pubDate>
		<dc:creator></dc:creator>
			<guid isPermaLink="false"><![CDATA[https://www.magentron.com/blog/?p=118]]></guid>
			<description><![CDATA[<div class="featured-image left">
<img src="/media/PHPMailer-3959702-150x150.png" alt="">
</div>
In the last week two critical issues where discovered by <a href="https://legalhackers.com/" target="_blank">Dawid Golunski</a> in <a href="https://github.com/PHPMailer/PHPMailer" target="_blank">PHPMailer</a>, a library to facilitate sending email messages using PHP.
The disclosures can be found here:
<ul>
 	<li><a href="https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html" target="_blank">CVE-2016-10033 - PHPMailer &lt; 5.2.18 Remote Code Execution</a></li>
 	<li><a href="https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html" target="_blank">CVE-2016-10045 - PHPMailer &lt; 5.2.20 Remote Code Execution (0day Patch Bypass/exploit)</a></li>
</ul>
You can read PHPMailer's response about it in the PHPMailer Wiki article <a href="https://github.com/PHPMailer/PHPMailer/wiki/About-the-CVE-2016-10033-and-CVE-2016-10045-vulnerabilities" target="_blank">"About the CVE 2016 10033 and CVE 2016 10045 vulnerabilities"</a>.

<!--more-->

In order to prevent me from having to write all my customers to have them update the library and hope that they are going to do so, I wrote a simple shell script that updates the PHPMailer core files (<code>class.phpmailer.php</code>, <code>class.pop3.php</code>, <code>class.smtp.php</code>) that are found in the directories that you supply.

The script is called <code>upgrade-phpmailer.sh</code> and can be found as <a href="https://gist.github.com/Magentron/689995f0f94899fab2156c945d340dbd" target="_blank">GitHub gist upgrade-phpmailer.sh</a> (<a href="https://gist.githubusercontent.com/Magentron/689995f0f94899fab2156c945d340dbd/raw/3924200dc1ad2354316de99103172a564e1476fe/upgrade-phpmailer.sh" target="_blank">download upgrade-phpmailer.sh</a> [use right-click and <em>Save</em>]).

The usage of the script <code>upgrade-phpmailer.sh</code>:
<pre>phpmailer-upgrade.sh v1.0.0 - Copyright (c) 2016 Derks.IT / Jeroen Derks
Upgrades PHPMailer files automatically to last version

usage: upgrade-phpmailer.sh [-d] [-n] [-v] [-x] [-B branch] [-C checkout] [-D backup ]
[-K] [-M extension] [-N] [-O] directory [ directory [...] ]
    -d    Enable debug output
    -n    Dry-run mode
    -v    Enable verbose output
    -x    Enable shell debug output
    -B    PHPMailer GitHub branch name to use (default: master)
    -C    Directory containing cloned repository with branch to use
    -D    Backup directory to use (default: /phpmailer.backup)
    -K    Keep temporary directory
    -M    Rename original files using supplied extension (default: .BACKUP)
    -N    Do not create backup directory
    -O    Compare only, do not actually upgrade
</pre>
If you have any improvements or suggestions, please leave a message below or <a href="https://gist.github.com/Magentron/689995f0f94899fab2156c945d340dbd" target="_blank">create a pull request</a>.]]></description>
			</item>
		<item>
		<title><![CDATA[Programmatically creating a coupon (including the rule) with conditions in Magento]]></title>
		<link><![CDATA[https://www.magentron.com/blog/2012/05/22/programmatically-creating-a-coupon-including-the-rule-with-conditions-in-magento]]></link>
		<comments><![CDATA[https://www.magentron.com/blog/2012/05/22/programmatically-creating-a-coupon-including-the-rule-with-conditions-in-magento#respond]]></comments>
		<pubDate>Tue, 22 May 2012 19:53:06 +0000</pubDate>
		<dc:creator></dc:creator>
			<guid isPermaLink="false"><![CDATA[http://www.magentron.com/blog/?p=94]]></guid>
			<description><![CDATA[<p>For one of my projects I needed to programmatically create a random coupon for a specific product in Magento.
Since I did not find an exact sample that I could use I decided to post my solution here.</p>
<!--more-->
<p><strong>NB: Please note that this post is a work-in-progress, your mileage may vary, so please test thorougly
before using this solution in a production environment.</strong><br/>
Please let me know if you find any problems with this solution. Thanks!</p>
<pre class="brush:php;">&lt;?php
    // load product
    /** @var Mage_Catalog_Model_Product $product */
    $product = Mage::getModel('catalog/product')
                    ->setStoreId($storeId)
                    ->load($productId);

    // set length of coupon code
    /** @var Mage_SalesRule_Model_Coupon_Codegenerator $generator */
    $generator = Mage::getModel('salesrule/coupon_codegenerator')
                        ->setLength(8);
    /** @var Mage_SalesRule_Model_Rule_Condition_Product $conditionProduct */
    $conditionProduct = Mage::getModel('salesrule/rule_condition_product')
                                                ->setType('salesrule/rule_condition_product')
                                                ->setAttribute('sku')
                                                ->setOperator('==')
                                                ->setValue($product->getSku());
                                                
    /** @var Mage_SalesRule_Model_Rule_Condition_Product_Found $conditionProductFound */
    $conditionProductFound = Mage::getModel('salesrule/rule_condition_product_found')
                                            ->setConditions(array($conditionProduct));
    /** @var Mage_SalesRule_Model_Rule_Condition_Combine $condition */
    $condition = Mage::getModel('salesrule/rule_condition_combine')
                    ->setConditions(array($conditionProductFound));
                                                
    /** @var Mage_SalesRule_Model_Coupon $coupon */
    $coupon = Mage::getModel('salesrule/coupon');
    // try to generate unique coupon code
    $attempts = 0;
    do {
        if ($attempts++ >= 8) {
            Mage::throwException(Mage::helper('mymodule')->__('Unable to create requested Coupons. Please try again.'));
        }
        $code = $generator->generateCode();
    } while ($coupon->getResource()->exists($code));

    // create rule
    /** @var Mage_SalesRule_Model_Rule $rule */
    $rule = Mage::getModel('salesrule/rule');
    $rule->setName(Mage::helper('mymodule')->__('Name of the coupon'))
        ->setDescription($rule->getName())
        ->setFromDate(date('Y-m-d'))
        ->setCustomerGroupIds($this->_getCustomerGroups())
        ->setIsActive(1)
        ->setConditionsSerialized(serialize($condition->asArray()))
        //->setActionsSerialized     
        //->setStopRulesProcessing 
        //->setIsAdvanced                     
        ->setSimpleAction(Mage_SalesRule_Model_Rule::BY_FIXED_ACTION)
        ->setDiscountAmount($product->getFinalPrice())
        ->setDiscountQty(1)
        //->setDiscountStep                     
        ->setStopRulesProcessing(0)
        ->setIsRss(0)
        ->setWebsiteIds(array(1))
        ->setCouponType(Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC)
        ->setConditions($condition)
        ->save();            
    
    // create coupon
    $coupon->setId(null)
        ->setRuleId($rule->getRuleId())
        ->setCode($code)
        ->setUsageLimit(1)
        //->setUsagePerCustomer
        //->setTimesUsed
        //->setExpirationDate
        ->setIsPrimary(1)
        ->setCreatedAt(time())
        ->setType(Mage_SalesRule_Helper_Coupon::COUPON_TYPE_SPECIFIC_AUTOGENERATED)
        ->save();
</pre>
<p>Please let me know if this works for you or not!</p>]]></description>
			</item>
		<item>
		<title><![CDATA[How to add customer authentication to your Magento API]]></title>
		<link><![CDATA[https://www.magentron.com/blog/2012/05/22/how-to-add-customer-authentication-to-your-magento-api]]></link>
		<comments><![CDATA[https://www.magentron.com/blog/2012/05/22/how-to-add-customer-authentication-to-your-magento-api#respond]]></comments>
		<pubDate>Tue, 22 May 2012 19:22:57 +0000</pubDate>
		<dc:creator></dc:creator>
			<guid isPermaLink="false"><![CDATA[http://www.magentron.com/blog/?p=82]]></guid>
			<description><![CDATA[<p>In this post I will provide a simple solution to adding customer authentication to the Magento API.
How to add functionality to the Magento API has already been properly documented in the Magento wiki page <a href="http://www.magentocommerce.com/wiki/doc/webservices-api/custom-api">Creating a custom API or extending the Core API</a>,
so we will not dive into that.</p>
<p>The idea is to simply call the same function for login() which would be used in the frontend and then check for customer
authentication in every API call that requires customer authentication.</p>
<!--more-->
<p><strong>NB: Please note that this post is a work-in-progress, your mileage may vary, so please test thorougly before using this solution
in a production environment.</strong></p>
<p><strong>Update: changed to use customer session for storing current website and store.</strong><br/>
Please let me know if you find any problems with this solution. Thanks!</p>
<p>Don't forget that you also have to setup API access in the Magento administration area.</p>
<p>First you need to define a function in your API class to handle the customer login:</p>
<pre class="brush:php;">&lt;?php
/**
 * Custom API model
 */
class MyCompany_MyModule_Model_Api extends Mage_Api_Model_Resource_Abstract
{
    /** @var Mage_Customer_Model_Session */
    protected $_customerSession = null;

    /**
     * Customer authentication.
     *
     * @param   string  $website Website code of website to authenticate customer against
     * @param   string  $username Username of customer to authenticate
     * @param   string  $password Password of customer to authenticate
     * @return  boolean True, if successfully authenticated customer for supplied website; false, otherwise.
     */
    public function login( $website, $email, $password )
    {
        // determine store to login to
        $store = $this->_getStore($website);

        // get customer session object
        $session = $this->_getCustomerSession();

        // authenticate customer
        $authenticated = $session->login($email, $password);

        // return authentication result
        return $authenticated;
    }

    /**
     * Logout authenticated customer, if any.
     * @return boolean True.
     */
    public function logout()
    {
        // get customer session object
        $session = $this->_getCustomerSession();
        
        // logout customer
        $session->logout();

        return true;
    }
</pre>
<p>Next, you have to check for an authenticated customer in your API functions that require this:</p> 
<pre class="brush:php;">
    /**
     * Do something for an authenticated customer.
     */
    public function doSomethingThatRequiresCustomerAuthentication()
    {
        // check whether customer is actually authenticated
        $this->_checkCustomerAuthentication();

        // retrieve customer object
        $customer = $this->_getAuthenticatedCustomer()

        // do something for authenticated customer
        ...
    }
</pre>
<p>Finally, you have to define the helper functions we have used:</p>
<pre class="brush:php;">
    /**
     * Check whether a customer has been authenticated in this session.
     * 
     * @return void
     * @throws Mage_Core_Exception If customer is not authenticated.
     */
    protected function _checkCustomerAuthentication()
    {
        // get customer session object
        $session = $this->_getCustomerSession();
        
        // check whether customer is logged in
        if ( !$session->isLoggedIn() ) {
            // if customer is not logged in throw an exception
            Mage::throwException(Mage::helper('mymodule')->__('Not logged in'));
        }
    }

    /**
     * Get authenticated customer object.
     * 
     * @return Mage_Customer_Model_Customer Authenticated customer object.
     * @throws Mage_Core_Exception If customer is not authenticated or does not exist.
     */
    protected function _getAuthenticatedCustomer()
    {
        // retrieve authenticated customer ID
        $customerId = $this->_getAuthenticatedCustomerId();
        if ( $customerId )
        {
            // load customer
            /** @var Mage_Customer_Model_Customer $customer */
            $customer = Mage::getModel('customer/customer')
                            ->load($customerId);
            if ( $customer->getId() ) {
                // if customer exists, return customer object
                return $customer;
            }
        }
        
        // customer not authenticated or does not exist, so throw exception
        Mage::throwException(Mage::helper('mymodule')->__('Unknown Customer'));
    }

    /**
     * Get authenticated customer ID.
     * 
     * @return integer Authenticated customer ID, if any; null, otherwise.
     */
    protected function _getAuthenticatedCustomerId()
    {
        // get customer session object
        $session = $this->_getCustomerSession();
        
        // return authenticated customer ID, if any
        return $session->getCustomerId();
    }

    /**
     * Get store object from supplied website code or from register or session.
     * 
     * @param string $code Code
     */
    protected function _getStore( $code = null )
    {
        // get customer session
        $session = $this->_getCustomerSession();

        // if website code not supplied, check for selected store in register or selected website in session
        if ( null === $code ) {
            // try to get selected store from register
            $store = Mage::registry('current_store');
            if ( $store ) {
                return $store;
            }
                
            // try to get selected website code from session
            $code = $session->getCurrentWebsiteCode();
            if ( !$code ) {
                // if no store in register or website code in session, throw an exception
                Mage::throwException(Mage::helper('mymodule')->__('No Store set'));
            }
        }

        // load website from code
        /** @var Mage_Core_Model_Website $website */
        $website = Mage::getModel('core/website')
                        ->load($code, 'code');
        if ( !$website->getId() ) {
            // if unknown website, throw an exception
            Mage::throwException(Mage::helper('mymodule')->__('Invalid Store') . $code);
        }
        
        // get the default store of the website
        $store = $website->getDefaultStore();
        
        // register the current store
        Mage::app()->setCurrentStore($store);
        Mage::register('current_store', $store, true);
        
        // set the current website code in the session
        $session->setCurrentWebsiteCode($website->getCode());
        
        // return store object
        return $store;
    }

    /**
     * @return Mage_Customer_Model_Session
     */
    protected function _getCustomerSession()
    {
        if ( !$this->_customerSession ) {
            $this->_customerSession = Mage::getSingleton('customer/session');
        }
        return $this->_customerSession;
    }

    ...
}
</pre>
<p>Please let me know if this works for you or not!</p>]]></description>
			</item>
		<item>
		<title><![CDATA[Questions to ask when interviewing a candidate Magento developer ]]></title>
		<link><![CDATA[https://www.magentron.com/blog/2012/05/06/questions-to-ask-when-interviewing-a-candidate-magento-developer]]></link>
		<comments><![CDATA[https://www.magentron.com/blog/2012/05/06/questions-to-ask-when-interviewing-a-candidate-magento-developer#respond]]></comments>
		<pubDate>Sun, 06 May 2012 21:46:29 +0000</pubDate>
		<dc:creator></dc:creator>
			<guid isPermaLink="false"><![CDATA[http://www.magentron.com/blog/?p=70]]></guid>
			<description><![CDATA[Since there is a lot of work to do for Magento, I have been looking to find some help. In my experience it is very difficult to determine the knowledge and expertise of a candidate until he/she is actually working on a project with you. During my search I have compiled a list of questions to help make the decision on who to actually talk to. When actually talking to a candidate, the questions are used to discuss the various topics more in depth.
<br />
<!--more-->
<br />
Since IMHO not only Magento/Zend/PHP knowledge is necessary for a good Magento programmer, but also general knowledge of programming methodologies and the system (OS, Apache, etc), the list also includes questions regarding more general topics which are closely related to running a (Magento or otherwise) website.
<br />
Furthermore, when using these questions, please make sure to the candidate that you would like to hear more than just a simple yes or no. The more detail can be given, the better (e.g. I have received responses to questions asking for a description that just consisted of a couple of words, which
is of course not a description).
<br />
<br />
If you have any additions, improvements, or any other comments, please let me know so I can improve this list, thanks in advance!
<br />
<br />
So, here goes:<br />

<h2>Magento</h2>
How may years of experience do you have in Magento?<br />
Can you say something about the technical challenges you have tackled in Magento?<br />
What kind of problems did you encounter and how did you find an anser and solve them?<br />
What kind of Magento projects did you do? (preferably for a couple of projects per project minimally one line description of what kind of functionalities you implemented)<br />
Do you have Magento certification?<br />
How would you start creating a new extension?<br />
Do know about moduleCreator? Did you use it? What do you think about it?<br />
When would you modify core files?<br />
Are you familiar with the rewrite functionality in the config.xml? How did you use it?<br />
Do you have a solution for the rewrite conflict issue in Magento? What were the different solutions you've used?<br />
Are you familiar with modman? Did you use it? What do you think about it?<br />
Can you describe your programming experience with the following topics in Magento:
<ul>
	<li>Tax</li>
	<li>Quotes</li>
	<li>Orders</li>
	<li>Invoices/Creditmemos</li>
	<li>EAV (customer, catalog, product, etc)</li>
	<li>Multi-language website</li>
	<li>Shipping</li>
	<li>Payment</li>
	<li>Overriding models/blocks</li>
	<li>Overriding controller</li>
	<li>Config XML</li>
	<li>Debugging</li>
	<li>Performance</li>
</ul>

<h2>Debugging</h2>
Are you familiar with xdebug? What features of xdebug do you use, how and why?<br />
Do you sometimes trace code by stepping through it? How?<br />
Did you ever use xdebug trace log functionality? Why? How?<br />
Did you ever use xdebug profiling functionality? Are you familiar with cachegrind?<br />

<h2>Logging</h2>
Do you know how to configure (error) logging in PHP? How?<br />
Where are the errors logged to?<br />
Do you know how to do log messages in Magento? What level did you use? How?<br />
In what situations in the code would you use logging messages in Magento?<br />
Do you like to log as little as possible or as much as possible? Please explain.<br />

<h2>IDE / Editor</h2>
What editor(s) are you using? On what platform(s)?<br />
Please describe your linux/unix experience?<br />
Are you using Apache on your development environment? Why/why not?<br />
Which editor do you prefer and why?<br />
Which editor do you use for actually programming Magento?<br />

<h2>Version control</h2>
Are you familiar with version control systems such as git, svn, mercurial, etc?<br />
How do you prefer to work with many developers on the same project regarding to version control?<br />
Do know how to create branches and do merges? Can you describe how you resolve conflicts?<br />
Can you describe the process you use to commit code? (e.g. do a diff before committing, etc)<br />

<h2>Quality Assurance (QA)</h2>
Are you familiar with unittesting: PHPUnit, Mage_Test, Ecomdev_PHPUnit, Selenium? How and when would you use it?<br />
Describe your knowledge/experience with Mock objects<br />
What are your ideas about code quality?<br />
Do you use coding standards? Why? How/which?<br />
Describe your knowledge/experience with unit testing (incl. code coverage reports, CRAP score)<br />
Describe your knowledge/experience with continuous integration (like Jenkins). What do you think about it?<br />
Can you descibe your process regarding release management? (e.g. which steps do you take to get code from your development environment to production)<br />
Please include the tools you use for this<br />
How do you deal with different configurations for Magento on these different environments? (e.g. different URL)<br />

<h2>Issue tracking / Project management</h2>
Describe your experience with issue tracking and/or project management systems to keep track of work/tasks/issues. Which have you used and which did you like best and why? (e.g. asana, assembly, basecamp, pivotal, redmine, git, trac, mantis, bugzilla, etc)<br />

<h2>Apache</h2>
Can you tell us a bit about your Apache expertise?<br />
Describe some complex Rewriting rules and access control configurations in Apache that you have used<br />

<h2>MySQL</h2>
Describe your expertise in MySQL<br />
Did you ever encounter version-related problems with MySQL? Could you describe them and the solution you have implemented.<br />

<h2>Cron</h2>
Do know how to configure cron jobs from the command line on *nix?<br />
Do know how to configure cron jobs in Magento?<br />]]></description>
			</item>
		<item>
		<title><![CDATA[Useful Magento extensions for developers, novice users and others]]></title>
		<link><![CDATA[https://www.magentron.com/blog/2012/02/20/useful-magento-extensions-for-developers-novice-users-and-others]]></link>
		<comments><![CDATA[https://www.magentron.com/blog/2012/02/20/useful-magento-extensions-for-developers-novice-users-and-others#respond]]></comments>
		<pubDate>Mon, 20 Feb 2012 20:36:09 +0000</pubDate>
		<dc:creator></dc:creator>
			<guid isPermaLink="false"><![CDATA[http://www.magentron.com/blog/?p=54]]></guid>
			<description><![CDATA[<a title="Magento Connect" href="http://www.magentocommerce.com/magento-connect/">Magento Connect</a> has many, many extensions, but which of them could be useful for the developers, novice users and other users of Magento? Working with Magento as a developer has led me to some useful extensions to make my life and that of my customers easier.
<!--more-->
<ul class="normal">
	<li>
<h4><a href="http://www.magentocommerce.com/magento-connect/system-configuration-search.html">System Config Search</a> by <a href="http://alanstorm.com/category/magento">Alan Storm</a></h4>
This is one of the most useful extensions for novice users. It allows you to search through the system configuration options in the administration area. Not only novice users will benefit from this extension, but also seasoned developers sometimes may forget where exactly certain configuration options are available.</li>
	<li>
<h4><a href="http://www.magentocommerce.com/magento-connect/magneto-debug-8676.html">Magneto Debug</a> by <a href="https://github.com/sstoiana">Sorin Stoiana</a></h4>
<p>This is also one of the most useful extensions, but then for developers and designers. Using a non-obtrusive element on the frontend you can quickly see:
<ul class="inside">
	<li>which modules are in use and what versions</li>
	<li>how long it took to generate the page and how much memory was used</li>
	<li>the current configuration</li>
	<li>controller and request data</li>
	<li>which models have been used for the page</li>
	<li>which layout configuration was used</li>
	<li>which blocks were used</li>
</ul>
</p></li>
	<li>
<h4><a href="http://www.magentocommerce.com/magento-connect/image-clean.html">Image Clean</a> by <a href="http://www.magentocommerce.com/magento-connect/developer/defcon2">Defcon2</a></h4>
For most clients some sort of import is necessary. While importing usually images for products get configured multiple times causing multiple copies in the media/catalog/product folder. Using this extension you can find the images in that directory that cannot be found in the products data and remove them to reclaim diskspace.</li>
	<li>
<h4><a href="http://www.magentocommerce.com/magento-connect/clever-cms.html">Clever CMS</a> by <a href="http://www.johannreinke.com/">Johann Reinke</a></h4>
If you want to have a simple CMS tree structure, this extension works nicely out of the box. Beware that a copy is made of the current CMS pages upon installation, so if you would uninstall or disable the module your old CMS pages would become visible again.</li>
	<li>
<h4><a href="http://www.magentocommerce.com/magento-connect/wordpress-integration.html">WordPress Integration</a> by <a href="http://fishpig.co.uk">FishPig</a></h4>
If you want to have a more advanced CMS, you can integrate WordPress right into Magento. After some configuration you can quickly have your new or existing (possibly remote) WordPress blog integrated into your Magento website.</li>
	<li>
<h4><a href="http://www.magentocommerce.com/magento-connect/module-list.html">Module List</a> by <a href="http://www.pulsestorm.net/">Pulse Storm LLC (Alan Storm)</a></h4>
As all Magento developers and users will know, functionality can be added or modified by installing modules. To have an overview of the installed modules in the administration area, you can use Module List.</li>
	<li>
<h4><a href="http://www.magentocommerce.com/magento-connect/vertical-navigation-with-css-classes.html">Vertical Navigation</a> by <a href="http://www.magentocommerce.com/magento-connect/developer/Rico+Neitzel">Rico Neitzel</a></h4>
The default header menu might suffice, but sometimes the design requires a vertical menu for navigating the catalog. This extension will make that very easy and it's very easy to customise.</li>
	<li>
<h4><a href="http://www.magentocommerce.com/magento-connect/phpunit-testing-integration.html">PHPUnit Testing Integration</a> by <a href="http://www.ecomdev.org/">EcomDev (Ivan Chepurnyi)</a></h4>
Recently I came across the quote "If you want to improve your software, don't test more; develop better." However, I do not think that works unless you include testing as part of development. So, to help you out, this extension will help you to write unit tests for your Magento code. It comes with a lot of documentation and you can take a look at the test classes for my <a href="http://www.magentron.com/extensions/magento-emailimages.html">EmailImages extension</a> at <a href="https://github.com/Magentron/EmailImages/tree/master/Magentron/EmailImages/Test">GitHub</a>.</li>
	<li>
<h4><a href="http://www.magentocommerce.com/magento-connect/email-template-adapter.html">Email Template Adapter</a> by <a href="http://www.magentocommerce.com/magento-connect/developer/Finn">Finn</a></h4>
One of the things that escape my attention sometimes (although less and less lately) are the emails sent by Magento. Personally I'm not that fond of the configuration of the emails, but since I have discovered this extension, it is very easy to add a design to all outgoing emails.</li>
</ul>
<p>If you know of an extension that should be mentioned here, please let me know via a comment or email, thanks!</p>]]></description>
			</item>
		<item>
		<title><![CDATA[Products have disappeared after import into Magento? A possible solution!]]></title>
		<link><![CDATA[https://www.magentron.com/blog/2011/12/16/products-have-disappeared-after-import-a-possible-solution]]></link>
		<comments><![CDATA[https://www.magentron.com/blog/2011/12/16/products-have-disappeared-after-import-a-possible-solution#respond]]></comments>
		<pubDate>Fri, 16 Dec 2011 03:48:36 +0000</pubDate>
		<dc:creator></dc:creator>
			<guid isPermaLink="false"><![CDATA[http://www.magentron.com/blog/?p=47]]></guid>
			<description><![CDATA[<p>Well, it happened to me before, but of course it was already such a long time ago that the solution was only passively available in my brain. So I imported a bunch of products (again). But this time all the products that I had imported disappeared. I checked the database, but the products were there. How to deal with this?</p>
<!--more-->
<p>I could not find much about it on the internet, but after reading <a href="http://www.magentocommerce.com/boards/viewthread/96053/P45/#t237630">Uploaded products do not show on front end</a>, my brain started working again and I thought: "Eureka! It has to be the locale setting of the backend" (which I fageuly remember being changed after installing locale files). Unfortunately Magento's import functionality uses a text value for some fields. Depending on the configured locale different texts are used for the same values. So, if you have an import that works on one locale (let's say en_US), then it most probably will not work using another locale (and actually break the site in a very unprofessional way).</p>
<p>Hopefully this post will be able to help some other <a href="http://www.magenteers.com/">Magenteers</a>, good luck and may the force be with you!</p>]]></description>
			</item>
		<item>
		<title><![CDATA[Fixing a corrupted Thunderbird popstate.dat file]]></title>
		<link><![CDATA[https://www.magentron.com/blog/2011/10/11/fix-corrupted-thunderbird-popstate]]></link>
		<comments><![CDATA[https://www.magentron.com/blog/2011/10/11/fix-corrupted-thunderbird-popstate#respond]]></comments>
		<pubDate>Tue, 11 Oct 2011 12:20:15 +0000</pubDate>
		<dc:creator></dc:creator>
			<guid isPermaLink="false"><![CDATA[http://www.magentron.com/blog/?p=30]]></guid>
			<description><![CDATA[<p><strong>Update 2013/Mar/18: released v1.2: added support for use of CRLF line endings communicating with server (for e.g. hotmail) </strong></p>

<p>It does not happen often, but sometimes my computer crashes. Unfortunately, but such is the live of a computer user. Most programs and their data are fine after, however, Thunderbird is not one of those. Sometimes after the crash, the popstate.dat file is either corrupted, empty or missing. See also <a title="Thunderbird's bugtracker: Bug 263142 - popstate.dat file is not updated while messages are deleted or downloaded from the server, resulting in incorrect state relative to server after a crash" href="https://bugzilla.mozilla.org/show_bug.cgi?id=263142" target="_blank">Thunderbird bug #263142</a><p>
<!--more-->

<p>This causes Thunderbird to retrieve all the email messages that were kept at the server to be downloaded again. After another one of those incidents I decided to try and find a work-around for it. Luckily the format of the popstate.dat file is pretty straightforward. Retrieving the <a title="POP3 RFC: UIDL command " href="http://tools.ietf.org/html/rfc1939#page-12" target="_blank">UIDL</a> list for the emails stored at the server is key to the solution.</p>

<p>To make things easy, I have written a <a href="https://github.com/Magentron/rebuild_thunderbird_popstate">simple PHP script that will rebuild Thunderbird's popstate.dat file based on the emails stored at the server</a>. Usage is pretty straightfoward.
<pre class="brush:plain;">usage: rebuild_popstate.php [-c] [-d] [-i n] [-s] [-v] [-f file] server [ port ]
-c CRLF flag, use when talking to Windows servers
-d debug flag
-f output filename
-i ignore the last n messages (for if you don't have them yet)
-s use for secure POP3 (SSL/TLS)
-v verbose flag</pre>

<p>You can find the script at github:
<a title="PHP script to rebuild Thunderbird's popstate.dat" href="https://github.com/Magentron/rebuild_thunderbird_popstate">rebuild_thunderbird_popstate</a><p>

<p>I hope it helps, and if so it would be nice if you could share your experiences here, thanks!</p>]]></description>
			</item>
		<item>
		<title><![CDATA[How to display your extension version in Magento admin configuration]]></title>
		<link><![CDATA[https://www.magentron.com/blog/2011/07/20/how-to-display-your-extension-version-in-magento-admin]]></link>
		<comments><![CDATA[https://www.magentron.com/blog/2011/07/20/how-to-display-your-extension-version-in-magento-admin#respond]]></comments>
		<pubDate>Wed, 20 Jul 2011 22:58:30 +0000</pubDate>
		<dc:creator></dc:creator>
			<guid isPermaLink="false"><![CDATA[http://www.magentron.com/blog/?p=22]]></guid>
			<description><![CDATA[<p>To view the version of installed Magento extensions, you can go to Magento Connect Manager. But, then you have to go out of the admin, log in again, and then go back. It works, but I would prefer to see the version information together with the extension configuration in the Magento administration configuration section. This can be easily achieved by 2 or 3 additional modifications.</p>
<!--more-->
<p>First, you might add a function to your helper class to retrieve the extension version:</p>
<pre class="brush:php;">
	public function getExtensionVersion()
	{
		return (string) Mage::getConfig()->getNode()->modules->MyCompany_MyModule->version;
	}
</pre>
<p>Second, you should create a admin block to display this version e.g. in <i>MyCompany/MyModule/Block/Adminhmtl/Version.php</i>:</p>
<pre class="brush:php;">
class MyCompany_MyModule_Block_Adminhtml_Version
    extends Mage_Adminhtml_Block_System_Config_Form_Field
{
	protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
	{
		return (string) Mage::helper('mymodule')->getExtensionVersion();
    }
}
</pre>
<p>Lastly, you configure the block in your <i>MyCompany/MyModule/etc/system.xml</i>:<p>
<pre class="brush:xml;">
<?xml version="1.0"?>
<config>
	...
	<fields>
		<version translate="label">
			<label>MyModule extension version</label>
	                <frontend_type>select</frontend_type>
	                <frontend_model>MyCompany_MyModule_Block_Adminhtml_Version</frontend_model>
	                <sort_order>0</sort_order>
	                <show_in_default>1</show_in_default>
	                <show_in_website>1</show_in_website>
	                <show_in_store>1</show_in_store>
		</version>
	...
	</fields>
	...
</config>
</pre>
<p>Of course, then your have to flush the cache, and go to the appropriate admin configuration section.<p>
<p>Please let us know whether you found this article interesting, any comment is welcome!<p>]]></description>
			</item>
	</channel>
</rss>