<?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>Subesh Pokhrel&#039;s Blog - Magento Development Tips &#187; domain</title>
	<atom:link href="http://subesh.com.np/tag/domain/feed/" rel="self" type="application/rss+xml" />
	<link>http://subesh.com.np</link>
	<description>PHP &#38; Magento Tips and Tutorials</description>
	<lastBuildDate>Tue, 20 Mar 2012 18:15:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Moving Magento Shop from Development Enviornment to Production Enviornment or Production to Local</title>
		<link>http://subesh.com.np/2009/12/moving-magento-shop-development-enviornment-production-enviornment-production-local/</link>
		<comments>http://subesh.com.np/2009/12/moving-magento-shop-development-enviornment-production-enviornment-production-local/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 12:38:33 +0000</pubDate>
		<dc:creator>Subesh Pokhrel</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[custom options]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[dump]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://subesh.com.np/?p=170</guid>
		<description><![CDATA[Today, I had really a good chance to move Magento Shop from Development Enviournment to Product Enviornment. On that course I faced some big difficulty in moving the database. I already had the files and DB of the development enviornment, imporing DB was a PIA. I uploaded all the files, which was easy. And next [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I had really a good chance to move Magento Shop from Development Enviournment to Product Enviornment. On that course I faced some big difficulty in moving the database. I already had the files and DB of the development enviornment, imporing DB was a PIA. I uploaded all the files, which was easy. And next thing I did was uploaded DB dumpped files to root of Magento. Then I logged into SSH and logged into MYSQL. Then Used the following commands to import the dumpped DB files. But first made the database say &#8220;magento&#8221;.</p>
<pre class="brush: sql; title: ; notranslate">
/**Using the Previously created DB**/
mysql&gt; use magento

/**Import the Dumpped SQL**/
mysql&gt;source pathToMagentoRoot/mySql.sql
</pre>
<p>So after the command is executed I had the whole DB on production enviornment. Similarly we can also import dumpped data of Production on Local database running on WAMP server.<br />
To import Dumpped SQL data on WAMP, first create a database, say magento and then use the following commands</p>
<pre class="brush: sql; title: ; notranslate">
/**
	Using the Previously created DB.
	-p password part is optional if you have not configured password for MYSQL locally
	-u Username (root by default)
**/

mysql&gt; C:\wamp\bin\mysql\mysql5.0.51b\bin&gt;mysql.exe -use magento -u root -p password

/**Import the Dumpped SQL**/
mysql&gt;source pathToSQLSource/mySql.sql
</pre>
<p>By Now we have the database synced between Local and Production. Next is configuring the database name used by Magento. Browse to app/etc/local.xml and change in the following part.</p>
<pre class="brush: xml; title: ; notranslate">
    &lt;connection&gt;
                    &lt;host&gt;&lt;![CDATA[localhost]]&gt;&lt;/host&gt;
                    &lt;username&gt;&lt;![CDATA[username_here]]&gt;&lt;/username&gt;
                    &lt;password&gt;&lt;![CDATA[password_here]]&gt;&lt;/password&gt;
                    &lt;dbname&gt;&lt;![CDATA[databasename_here]]&gt;&lt;/dbname&gt;
                    &lt;active&gt;1&lt;/active&gt;
    &lt;/connection&gt;
</pre>
<p>Finally, browsed through table core_config_data and find value of path: web/unsecure/base_url and path: web/secure/base_url and change their values accordingly.</p>
<p>Now I had my Shop enviorment switched. Most work for you as well. LOL.</p>
]]></content:encoded>
			<wfw:commentRss>http://subesh.com.np/2009/12/moving-magento-shop-development-enviornment-production-enviornment-production-local/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Checking if the domain is registered or not ?</title>
		<link>http://subesh.com.np/2008/06/checking-if-the-domain-is-registered-or-not/</link>
		<comments>http://subesh.com.np/2008/06/checking-if-the-domain-is-registered-or-not/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 06:32:40 +0000</pubDate>
		<dc:creator>Subesh Pokhrel</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[whois]]></category>

		<guid isPermaLink="false">http://subesh.com.np/?p=24</guid>
		<description><![CDATA[On doing one of my project, I came across this situation when I need to find out whether the domain name supplied by the user is available or not? I then came up with a solution, here&#8217;s is what I did. But before that let me explain somethings. There is something called WHOIS LOOKUP. WHOIS [...]]]></description>
			<content:encoded><![CDATA[<p>On doing one of my project, I came across this situation when I need to find out whether the domain name supplied by the user is available or not? I then came up with a solution, here&#8217;s is what I did. But before that let me explain somethings. There is something called WHOIS LOOKUP. WHOIS LOOKUP is action relating to look on official WHOIS database server for the information related to domain name.</p>
<p>According to wikipedia WHOIS &#8220;WHOIS  is a TCP-based query-response  protocol for querying an official database in order to determine the owner of a domain name, an IP address, or an autonomous system number on the Internet&#8221;. ICAAN is presently undertaking the task for managing the WHOIS information.</p>
<p>For querying WHOIS servers here is the PHP code.</p>
<pre class="brush: php; title: ; notranslate">
function check_domain($domain,$ext)
{

	/************************	SERVER DEFINITIONS	************************************/
	$serverdefs= array(
							&quot;com&quot; =&gt; array(&quot;whois.crsnic.net&quot;,&quot;No match for&quot;),
							&quot;net&quot; =&gt; array(&quot;whois.crsnic.net&quot;,&quot;No match for&quot;),
							&quot;org&quot; =&gt; array(&quot;whois.pir.org&quot;,&quot;NOT FOUND&quot;),
							&quot;biz&quot; =&gt; array(&quot;whois.biz&quot;,&quot;Not found&quot;),
							&quot;info&quot; =&gt; array(&quot;whois.afilias.net&quot;,&quot;NOT FOUND&quot;),

					);
	/*********************** 	END SERVER DEFINITIONS	*********************************/

    $server = $serverdefs[$ext][0];
    $nomatch = $serverdefs[$ext][1];

	$output=&quot;&quot;;
    if(($sc = fsockopen($server,43))==false){return 2;}
           fputs($sc,&quot;$domain.$ext\n&quot;);

	while(!feof($sc)){$output.=fgets($sc,128);}
    fclose($sc);
    //compare what has been returned by the server
    if (eregi($nomatch,$output)){
		return true; // if matched
    }else{
        return false;
    }
}
</pre>
<p><strong>Code #04 &#8211; #13</strong> defines the array of official WHOIS server for respective extensions of domains and the respective responses (a chunk of) we get after querying the database servers. For example if we query <em>whois.crsnic.net</em> we get response which contains the phrase &#8220;<em>No match for</em>&#8221; if the domain does not exists.<br />
<strong>Code #19 &#8211; #23</strong> requests the respective server on the basis of extension  and gets the response in form of string on variable <em>$output</em>.<br />
Then the response is matched with the respective value of response defined in the array (which contains the phrase when the domain does not exists). Then it outputs the boolean value accordingly if the domain does not exists or can be registered it returns <em>true</em>, <em>false </em>otherwise.</p>
]]></content:encoded>
			<wfw:commentRss>http://subesh.com.np/2008/06/checking-if-the-domain-is-registered-or-not/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

