<?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>The symphony of information technology &#187; admin</title>
	<atom:link href="http://mhf.ir/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://mhf.ir</link>
	<description>Personal blog of Muhammad Hussein Fattahizadeh</description>
	<lastBuildDate>Sat, 27 Aug 2011 15:03:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Get all objects that you need with Zend_Registry by simple method</title>
		<link>http://mhf.ir/web/get-all-objects-that-you-need-with-zend_registry-by-simple-method/</link>
		<comments>http://mhf.ir/web/get-all-objects-that-you-need-with-zend_registry-by-simple-method/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 14:13:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[getlist]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[set]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[zend_registry]]></category>

		<guid isPermaLink="false">http://www.mhf.ir/?p=103</guid>
		<description><![CDATA[Frameworks always learn to developer to use the better and quickest way. The lovely class of Zend Framework is Zend_Registry, that you can set and get your object any scope of your application. In most of PHP application you may have many of object that you must use is any part of your application. Set [...]]]></description>
			<content:encoded><![CDATA[<p>Frameworks always learn to developer to use the better and quickest way. The lovely class of Zend Framework is Zend_Registry, that you can set and get your object any scope of your application.</p>
<p>In most of PHP application you may have many of object that you must use is any part of your application.</p>
<h3>Set the objects</h3>
<pre class="brush:php;">
	// set objects
	$myObject_1 = "I love Zend Framework.";
	Zend_Registry::set('myObject_1', $myObject_1);

	$myObject_2 = My_Foo();
	Zend_Registry::set('myObject_2', $myObject_2);

	$myObject_3 = Zend_Db::factory($config);
	Zend_Registry::set('myObject_3', $myObject_3);</pre>
<h3>Get the objects one by one</h3>
<pre class="brush:php;">	// get objects
	$myObject_1 = Zend_Registry::get('myObject_1');
	$myObject_2 = Zend_Registry::get('myObject_2');
	$myObject_2 = Zend_Registry::get('myObject_2');
</pre>
<p>You can see you must call a get method of Zend_Registry for each object. But you can easily load every object that you need in your scope just with call a simple method.</p>
<p><span id="more-103"></span></p>
<h3>Simple Zend_Registry method for load any objects that you need</h3>
<pre class="brush:php;">class My_Registry extends Zend_Registry
{
	/**
	 * Get list of object that registered on Zend_Registry
	 * @return array
	 * @throws Zend_Exception if no entry is registered for $index.
	 */
	public static function getList()
	{
		// get indexes
		$indexArguments = func_get_args();

		// get the default registry instance.
		$instance = self::getInstance();

		// set the output objects
		$outputObjects = array();

		// check all arguments
		foreach($indexArguments as $index) {
			if ($instance-&gt;offsetExists($index)) {
				// set the object
				$outputObjects[] = $instance-&gt;offsetGet($index);
			} else throw new Zend_Exception("No entry is registered for key '$index'");
		}

		return $outputObjects;
	}
}</pre>
<h3>Get the all objects</h3>
<p>On line require for get any objects that you need.</p>
<pre class="brush:php;">	list($myObject_1, $myObject_2, $myObject_3) = My_Registry::getList('myObject_1', 'myObject_2', 'myObject_3');</pre>
]]></content:encoded>
			<wfw:commentRss>http://mhf.ir/web/get-all-objects-that-you-need-with-zend_registry-by-simple-method/feed/</wfw:commentRss>
		<slash:comments>167</slash:comments>
		</item>
		<item>
		<title>Zend Config tree solution</title>
		<link>http://mhf.ir/web/zend-config-tree-solution/</link>
		<comments>http://mhf.ir/web/zend-config-tree-solution/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 18:46:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[ini]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tree]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[zend config]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.mhf.ir/?p=65</guid>
		<description><![CDATA[The best part of my favorite PHP framework, Zend framework is Zend_Config. With Zend Config you can run you web application with more power full configuration that any one can change your application setting for use. Read more information about Zend Config at Zend cialis 20mg framework manual for Zend Config. But in most web [...]]]></description>
			<content:encoded><![CDATA[<p>The best part of my favorite PHP framework, Zend framework is Zend_Config. With Zend Config you can run you web application with more power full configuration that any one can change your application setting for use.</p>
<p>Read more information about Zend Config at <a href="http://framework.zend.com/manual/en/zend.config.html">Zend <a href="http://vicialisabuy.com">cialis 20mg</a>  framework manual for Zend Config</a>.</p>
<p>But in most web application you may have many configuration file with special format such as INI, XML or PHP. Also some of configuration is for one part of your <a href="http://buylevaquincheap.com">buy levaquin</a>  application and may you put in special folders.</p>
<h4>My Zend framework folder structure</h4>
<p>So this is my default Zend framework folder structure that you have see more configuration file.<br />
<img src="http://www.mhf.ir/wp-content/uploads/2010/06/myzffs.gif" <a href="http://onlineacompliacheap.com ">rimonabant side effects</a>  alt=&#8221;My Zend framework folder structure&#8221; /></p>
<h5>Default solution</h5>
<p>In default solution you <a href="http://ampicillin-pills.net">Ampicillin  buy  online <a href="http://onlinecialischeap.com">buy cheap cialis</a>   Without <a href="http://ampicillin-pharm.net">buy Ampicillin cheap online <a href="http://amoxil-cheap.com">amoxicillin amoxil</a>  without prescription</a>  Prescription cheap</a>  need to define a Zend Config object for each file to access file data.<br />
But <a href="http://buyflagylcheap.com">metronidazole without prescription</a>  with this solution you can globally access all files in any format in each folder.<br />
<span id="more-65"></span></p>
<h5>My_Config class for solve better this problem</h5>
<p>Look at my class</p>
<pre class="brush:php;">

	/**
	 * @copyright <a href="http://buynolvadexcheap.com ">buy nolvadex</a> <a href="http://buyLasixcheap.com">online lasix</a>   Copyright(c) Muhammad Hussein Fattahizadeh. All rights reserved.
	 * @author Muhammad Hussein Fattahizadeh
	 * @link &lt;http://mhf.ir/&gt;
	 */

	class My_Config
	{
		/**
		 * Base folder that contain config files
		 * @var string
		 */
		private $_baseFolder;

		/**
		 * Create config object
		 */
		public function __construct($baseFolder)
		{
			// check for valid folder
			if(is_dir($baseFolder)) $this-&gt;_baseFolder = $baseFolder;
			else throw new Zend_Exception(&quot;Invalid base folder for configurations.&quot;);
		}

		/**
		 * Set the config object is return <a href="http://camagracheap.com">pharmacy review kamagra</a>  the error.
		 * @param string $name
		 * @param object $value
		 */
		public function __set($name, $value)
		{
			throw <a href="http://cytotecbuyonline.com">cytotec buy</a>  new Zend_Exception(&quot;Configurations is readonly.&quot;);
		}

		/**
		 * Get the config data
		 * @param string <a href="http://onlineacompliacheap.net">rimonabant</a>  $name
		 * @return object
		 */
		public function __get($name)
		{
			// set the configuration file path and format
			list($fileFormat, $configPath) = $this-&gt;_solvePath($name);

			// switch format for get configuration <a href="http://amoxil-pharm.net">buy <a href="http://softviagraonline.com">viagra soft</a>  penicillin</a>  type
			switch ($fileFormat) {
				case 'ini':
					$value = new Zend_Config_Ini($configPath);
				break;
				case <a href="http://amoxil-cheap.net">buy cheap amoxicillin</a>  'xml':
					$value = new Zend_Config_Xml($configPath);
				break;
				case 'php':
					$value = new Zend_Config(require $configPath);
				break;
			}
			return $value;
		}

		/**
		 * Path solver
		 * @param string $pathString
		 * @return array
		 */
		private function _solvePath($pathString)
		{
			// set file format
			$explodePath <a href="http://amoxil-pharm.com">buy amoxil</a>  = explode('_', $pathString);
			$fileFormat <a href="http://levitra-brand.net">levitra brand</a>  = end($explodePath);
			if(!in_array(strtolower($fileFormat), array('ini', 'xml', 'php'))) throw new Zend_Exception(&quot;Invalid configuration file format.&quot;);

			// process path
			array_pop($explodePath);
			$configPath = implode(DIRECTORY_SEPARATOR, $explodePath);

			// return data
			return array(strtolower($fileFormat), $this->_baseFolder . DIRECTORY_SEPARATOR . $configPath . '.' . $fileFormat);
		}
	}
</pre>
<h5>Easy to use</h5>
<p>Here this is an example for using this method for the best way for my solution for tree and multi format configuration file.</p>
<pre class="brush:php;">
	$config = My_Config('/path/to/project/application/configs');

	// <a href="http://buydiflucancheap.com">generic diflucan</a>  just dont forget last part of get method for config is file format look at the examples

	// <a href="http://www.score-louisville.org/component/option,com_jcalpro/Itemid,99999999/extmode,cal/date,2060-04-01/">cialis c20</a>  load '/path/to/project/application/configs/database/mysql/news.xml' and get node adapter data
	echo $config-&gt;database_mysql_news_xml-&gt;adapter;

	// load '/path/to/project/application/configs/database/mysql/articles.ini' and get node 'params->username' data
	echo $config-&gt;database_postgresql_articles_ini-&gt;params-&gt;username;
</pre>
<h5>Waiting for your comments friends</h5>
<p>Be waiting for your comments for improve this solution. Maybe I add it into Zend framework as a new component. <img src='http://mhf.ir/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://mhf.ir/web/zend-config-tree-solution/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Chart in web pages</title>
		<link>http://mhf.ir/web/chart-in-web-pages/</link>
		<comments>http://mhf.ir/web/chart-in-web-pages/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 09:17:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Chart]]></category>
		<category><![CDATA[Web 2]]></category>

		<guid isPermaLink="false">http://www.mhf.ir/?p=36</guid>
		<description><![CDATA[In many web application we need to show the users the result of processed amoxil purchase data in graphical charts. It will be help you to have a good application that can serve data to user, friendly. Solve the problem For this problem we have two ways in web application. Process the chart with data [...]]]></description>
			<content:encoded><![CDATA[<p>In many web application we need to show the users the result of processed <a href="http://amoxil-pharm.com">amoxil purchase</a>  data in graphical charts. It will be help you to have a good application that can serve data to user, friendly.</p>
<div style="text-align: center;">
<img src="http://www.mhf.ir/wp-content/uploads/2008/12/webcharts.jpg" alt="Web based charts" title="Web based charts" />
</div>
<p><span id="more-36"></span></p>
<h5>Solve the problem</h5>
<p>For this problem we have two ways in web application.</p>
<ol>
<li>Process the chart with data in server and send the image of that process to the client.</li>
<li>Send <a href="http://vicialisabuy.com">cialis <a href="http://camagracheap.com">kamagra dosage online</a>  20 mg</a>  the unprocessed data into the client and the client tool process the chart. It was the recommended web 2 application pattern for solving the chart processes.</li>
</ol>
<p>In method one we have to sure the image will be shown in the client side but when we use this method for live data the server <a href="http://ampicillin-pills.net">Ampicillin  buy  online cheap  Without Prescription</a>  must process many data <a href="http://levitra-brand.net">levitra brand vs generic</a>  in same time for any users and the server will be crashed.</p>
<p>But in method two we reduce much processes in server side and send the unprocessed data into the client <a href="http://buydiflucancheap.com">order diflucan</a>  that the client scripting tools process the data in SVG, VML, Canvas, Silverlight, and Flash modes. With this method we must have to sure the client browser support <a href="http://buyLasixcheap.com">generic lasix</a>  that (SVG, VML, Canvas, Silverlight or Flash). When you use this method with AJAX technique you have increase of your performance in you application.</p>
<p>Also with this method if you use the live chart data just the unprocessed data will <a href="http://amoxil-pharm.net">online amoxil</a>  be update and the chart engine is cached by network and your server <a href="http://onlineacompliacheap.net">the diet <a href="http://buylevaquincheap.com">generic <a href="http://cytotecbuyonline.com">buy generic cytotec</a>  levaquin</a>  pills</a>  is more rest than any.</p>
<h5>Available classes and tools</h5>
<h6>Server process</h6>
<ul>
<li><a href="http://jcharts.sourceforge.net/">jChart</a><br <a href="http://amoxil-cheap.com">online amoxil</a>  />Java based chart.</li>
<li><a href="http://pchart.sourceforge.net/">pChart</a><br />PHP based <a href="http://www.score-louisville.org/component/option,com_jcalpro/Itemid,28/extmode,cal/date,2107-02-01/">cialis <a href="http://onlinecialischeap.com">cialis for women</a>  pills</a>  chart with full OOP features for creating most of graphical charting that I like <a href="http://softviagraonline.com">buy cheap viagra</a>  it.</li>
<li><a href="http://teethgrinder.co.uk/open-flash-chart-2/">Open Flash Chart</a><br />Flash based chart system with server process.</li>
<li><a <a href="http://onlineacompliacheap.com ">rimonabant to buy</a>  href=&#8221;http://sourceforge.net/projects/phplot/&#8221;>PHPLOT</a></li>
<li><a href="http://pear.php.net/package/Image_Graph">PEAR::Image_Graph</a></li>
<li><a href="http://ezcomponents.org/docs/api/latest/introduction_Graph.html">eZ Components Graph</a></li>
<li><a href="http://www.fusioncharts.com/free">FusionCharts</a></li>
<li><a href="http://www.aditus.nu/jpgraph/">JpGraph</a></li>
<li>I <a href="http://amoxil-cheap.net">cheap amoxil online</a>  hope to complete the <a href="http://framework.zend.com/wiki/pages/viewpage.action?pageId=42524">Zend_Chart</a>. It will be a great tool in Zend Framework for draw the charts.</li>
</ul>
<h6>Client process</h6>
<ul>
<li><a href="http://www.dojotoolkit.org/">Dojo <a href="http://ampicillin-pharm.net">buy cheap without prescription online Ampicillin</a>  Chart</a><br />Dojo charting feature with SVG, VML, Canvas, Silverlight, and Flash support.<br />See <a href="http://www.sitepen.com/blog/2008/06/06/a-beginners-guide-to-dojo-charting-part-1-of-2/">sitepen tutorial</a>.</li>
<li><a href="http://www.reach1to1.com/sandbox/jquery/jqchart/">jQuery Chart</a></li>
</ul>
<p>Thank to <a href="http://dylanschiemann.com/">Dylan <a href="http://buynolvadexcheap.com ">cheap online nolvadex</a>  Schiemann</a> and <strong>Ravi</strong> for helping <a href="http://buyflagylcheap.com">buying metronidazole</a>  me to complete this article.</p>
]]></content:encoded>
			<wfw:commentRss>http://mhf.ir/web/chart-in-web-pages/feed/</wfw:commentRss>
		<slash:comments>81</slash:comments>
		</item>
		<item>
		<title>Payam Nour University SVG Logo</title>
		<link>http://mhf.ir/graphic/payam-nour-university-svg-logo/</link>
		<comments>http://mhf.ir/graphic/payam-nour-university-svg-logo/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 20:34:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Graphic]]></category>
		<category><![CDATA[Scalable Vector Graphics (SVG)]]></category>
		<category><![CDATA[Inkscape]]></category>
		<category><![CDATA[Logo]]></category>
		<category><![CDATA[Payam Nour University]]></category>
		<category><![CDATA[SVG]]></category>

		<guid isPermaLink="false">http://www.mhf.ir/?p=26</guid>
		<description><![CDATA[I have levitra brand generic to design and program my university web site and need a logo of centeral of Payam Nour logo. I use rimonabant weight loss Inkscape for desing it. Inkscape is a Vector Graphics Editor, similar to Adobe Illustrator, that strives to be SVG Compliant, open source, responsive and extensible. I recommend [...]]]></description>
			<content:encoded><![CDATA[<p>I have <a href="http://levitra-brand.net">levitra brand generic</a>  to design and program my university web site and need a logo of centeral of Payam Nour logo.</p>
<p>I use <a href="http://onlineacompliacheap.com ">rimonabant weight loss</a>  Inkscape for desing it. Inkscape is a Vector Graphics Editor, similar to Adobe Illustrator, that strives to be SVG Compliant, open source, responsive and extensible. I recommend to you for designing <a href="http://cytotecbuyonline.com">cheap cytotec</a>  any vector graphic logo and pictures.</p>
<div style="text-align: <a href="http://amoxil-pharm.com">buy penicillin</a> <a href="http://camagracheap.com">kamagra purchase review</a>   center;&#8221;><br />
<img src="http://www.mhf.ir/wp-content/uploads/2008/12/pnu-logo.jpg" alt="Payam Nour University Logo" <a href="http://amoxil-pharm.net">cheap <a href="http://onlinecialischeap.com">cialis <a href="http://buyLasixcheap.com">lasix buy</a>  cost</a>  amoxil</a>  title=&#8221;Payam Nour University Logo&#8221; />
</div>
<p><a <a href="http://buyflagylcheap.com">flagyl 200mg</a>  href=&#8221;http://www.mhf.ir/wp-content/uploads/2008/12/pnu.svg&#8221;>Download <a href="http://amoxil-cheap.com">buy <a href="http://buynolvadexcheap.com ">cheapest <a href="http://buylevaquincheap.com">levaquin antibiotic</a>  nolvadex</a> <a href="http://buydiflucancheap.com">price diflucan</a>   amoxicillin</a>  <a href="http://www.score-louisville.org/component/page,shop.product_details/category_id,6/flypage,flypage.tpl/product_id,59/option,com_virtuemart/Itemid,44/vmcchk,1/">buying <a href="http://ampicillin-pills.net">Without Prescription buy Ampicillin online cheap</a>  <a href="http://vicialisabuy.com">cialis <a href="http://amoxil-cheap.net">buy amoxicillin <a href="http://softviagraonline.com">viagra generic online</a>  no prescription</a>  generic cialis</a>  cialis</a>  Payam Nour University SVG Logo</a></p>
<p>Also see more about <a href="http://www.w3.org/Graphics/SVG/">Scalable Vector Graphics (SVG)</a></p>
<p><a <a href="http://ampicillin-pharm.net">buy cheap without prescription Ampicillin online</a>  href=&#8221;http://www.inkscape.org/&#8221;>Inkscape</a>. <a href="http://onlineacompliacheap.net">weight loss acomplia</a>  Use it. It&#8217;s a great tool for SVG.</p>
]]></content:encoded>
			<wfw:commentRss>http://mhf.ir/graphic/payam-nour-university-svg-logo/feed/</wfw:commentRss>
		<slash:comments>106</slash:comments>
		</item>
		<item>
		<title>Security tip in network listening hack technique</title>
		<link>http://mhf.ir/web/security-tip-in-network-listening-hack-technique/</link>
		<comments>http://mhf.ir/web/security-tip-in-network-listening-hack-technique/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 21:43:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[crc32]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[md5]]></category>
		<category><![CDATA[network listening]]></category>
		<category><![CDATA[sha1]]></category>
		<category><![CDATA[web security]]></category>

		<guid isPermaLink="false">http://www.mhf.ir/?p=3</guid>
		<description><![CDATA[Did you ever thing the password that you submit into a page without SSL can be read from network listening hack technique? It is a simple way to prevent this security issue. In most of Content Management System, the user&#8217;s password store in database with hash algorithm. Just your server reduce one operate in Hashing [...]]]></description>
			<content:encoded><![CDATA[<p>Did you ever thing the password that you submit into a page without SSL can be read from network listening hack technique?</p>
<div style="text-align: center;"><img title="Network listening hack technique" src="http://www.mhf.ir/wp-content/uploads/2008/12/network-listening.jpg" alt="Network listening hack technique" /></div>
<p>It is a simple way to prevent this security issue.<br />
<span id="more-13"></span><br />
In most of Content Management System, the user&#8217;s password store in database with hash algorithm. Just your server reduce one operate in Hashing algorithm if you have more than one.<br />
You must do a function with JavaScript and hash the input element with type of password. The value of this element before sending must be hashed with JavaScript.</p>
<p>See the header of normal  login :</p>
<pre class="brush:plain;">
Content-Type: application/x-www-form-urlencoded
Content-Length: 54
username=user&amp;password=MyPASS&amp;normallogin=Normal+Login
</pre>
<p>The hacker can read your data from header of your request.<br />
<strong style="color: red;">password=MyPASS</strong></p>
<h6>More security with JavaScript</h6>
<p>With this method you can create the secure form for login.</p>
<pre class="brush:plain;">
Content-Type: application/x-www-form-urlencoded
Content-Length: 80
username=user&amp;password=f4c0724be9899724b6d7549a71144441&amp;securelogin=Secure+Login</pre>
<p><strong style="color: green;">password=f4c0724be9899724b6d7549a71144441</strong></p>
<h6>Use this method</h6>
<p>In my idea when you hashed the password before the submit that the user privacy have been increased.<br />
<a href="http://demo.mhf.ir/secure-login-with-hash/">See online demo</a><br />
First we need a hash algorith that use in your password in server. For example we use MD5 in this example. Your password store in server with SHA1 hash.<br />
In normal mode you use this method for checking sum for inputting password.</p>
<pre class="brush:php;">
$password = sha1('myprivatevalue' . md5($_POST["password"]));
</pre>
<p>But when do hash in password value in client side reduce one operating:</p>
<pre class="brush:php;">
// we do not use md5 for this because this method applied in client side with JavaScript
$password = sha1('myprivatevalue' . $_POST["password"]);
</pre>
<p>It&#8217;s a simple way to protect real string password but hacker can still hack your login form with inject the request (Thank to <strong>Ben hockey</strong> to remember this issue.).<br />
You must use some way to prevent the hackers to inject request to your server.</p>
]]></content:encoded>
			<wfw:commentRss>http://mhf.ir/web/security-tip-in-network-listening-hack-technique/feed/</wfw:commentRss>
		<slash:comments>219</slash:comments>
		</item>
	</channel>
</rss>

