<?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>Albert Fama &#187; environment</title>
	<atom:link href="http://albertfama.com/tag/environment/feed/" rel="self" type="application/rss+xml" />
	<link>http://albertfama.com</link>
	<description>Freelance Web Programmer - specializing in PHP &#38; MySQL</description>
	<lastBuildDate>Fri, 20 Nov 2009 16:06:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>NOTICES mean something</title>
		<link>http://albertfama.com/php/notices-mean-something/</link>
		<comments>http://albertfama.com/php/notices-mean-something/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 06:34:36 +0000</pubDate>
		<dc:creator>Albert Fama</dc:creator>
				<category><![CDATA[Error Handling]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[environment]]></category>
		<category><![CDATA[error messages]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[learning]]></category>

		<guid isPermaLink="false">http://albertfama.com/?p=264</guid>
		<description><![CDATA[In numerous books and articles the general consensus seems to be that for a production environment Errors and Warnings should be turned on and Notices turned off; as opposed to the development environment where error reporting should be set to E_ALL (report all errors). The reasoning behind this is, Errors and Warnings mean something serious [...]]]></description>
			<content:encoded><![CDATA[<p>In numerous books and articles the general consensus seems to be that for a production environment Errors and Warnings should be turned <strong>on</strong> and <a href="/php/errors-and-error-messages-deciphered/#notice">Notices</a>  turned <strong>off</strong>; as opposed to the development environment where error reporting should be set to E_ALL (report all errors). The reasoning behind this is, Errors and Warnings mean something serious has gone wrong with the script and you (as the developer) need to know about it. Notices on the other hand are kind of disregarded as a nuisance in production.</p>
<p>I completely disagree with this point of view. If I write code which is not intended to generate Notices, then as the developer I want to know if and when Notices are being generated in <strong>any</strong> environment.</p>
<p>Notices are very helpful in tracking down logical errors or bugs, which cause the script not to function as expected.  In PHP they are normally generated when using a previously undeclared variable. Technically speaking there is nothing wrong with this in PHP, other programming languages are not so forgiving. </p>
<p>I personally started declaring all variables when I began to focus on the security implications of using undeclared variables (we&#8217;ll save that information for another post). After getting in the habit I found that I was able find logical errors during development even before I noticed that a bug existed. After realizing this, I now never release code which is know to generate notices. I have also started setting error reporting to E_ALL in <strong>all</strong> environments.</p>
<p>I understand that this is not feasible for everyone. It may not be possible in a professional working environment because of dealing with legacy code. Another issue could arise if you use third-party code which has not subscribed to this way of thinking. Although personally, I feel this is not an excuse there is no reason you can&#8217;t get in there and &#8216;fix&#8217; their script.  </p>
<h5>A word of warning</h5>
<p>I was once hired to fix numerous bugs on a site, all were a fairly obvious fix, but one in particular had me stumped.  I turned on notices when attempting to debug the problem and ended up with an error log that contained over 250 notices for every page load. Since this was a dev environment setup by the client for my use, it was no big deal, but if it were a heavily trafficked live site, there could have been some serious implications.</p>

                            <div id="aspdf">
                                <a href="http://albertfama.com/wp-content/plugins/as-pdf/generate.php?post=264">
                                    <span>&nbsp;</span>
                                </a>
                            </div>
                        ]]></content:encoded>
			<wfw:commentRss>http://albertfama.com/php/notices-mean-something/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Development Environment Setup</title>
		<link>http://albertfama.com/content/development-enviroment-setup/</link>
		<comments>http://albertfama.com/content/development-enviroment-setup/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 18:29:52 +0000</pubDate>
		<dc:creator>Albert Fama</dc:creator>
				<category><![CDATA[Content]]></category>
		<category><![CDATA[Project: Udid]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[environment]]></category>
		<category><![CDATA[project]]></category>

		<guid isPermaLink="false">http://obnexus.net/?p=46</guid>
		<description><![CDATA[Before we get into the directory structure we will be using for this project, I wanted to let you know I have decided on a project name. The basic idea for the application I&#8217;m building is to create a hierarchical storage system, hence the name: UDID &#8211; User Designed/Defined Information Directory (Of course it is [...]]]></description>
			<content:encoded><![CDATA[<p>Before we get into the directory structure we will be using for this project, I wanted to let you know I have decided on a project name. The basic idea for the application I&#8217;m building is to create a hierarchical storage system, hence the name:</p>
<p>UDID &#8211; User Designed/Defined Information Directory<br />
(Of course it is an acronym, you expected something else?)</p>
<p>There is a legitimate reason for naming the project before even setting up the development area. The project will be stored under the &#8216;Udid&#8217; directory, and all of the class names will reflect the position of the file within the project&#8217;s directory structure. I will explain more about this when we get into writing classes and actually coding, but if you would like more information about this type of setup you can read about the <a href="http://framework.zend.com/" title="Zend Framework" >Zend Framework</a> <a href="http://framework.zend.com/manual/en/coding-standard.naming-conventions.html" title="Zend Framework naming conventions" >naming conventions for classes</a>.</p>
<p>OK now we have a name and it&#8217;s time to setup the directory structure. First we create the &#8216;udid&#8217; directory and beneath that we create a &#8216;project&#8217; directory; such as:<br />
<code><br />
udid<br />
|-&gt; project<br />
</code><br />
The &#8216;project&#8217; directory will hold all the files directly associated to the project. The reason I have created this directory and did not just store the project code within &#8216;udid&#8217;, is because we will be using some third party applications to help with development and I do not want that third party code to actually be associated to the project code. For example we will be using <a href="http://www.lastcraft.com/simple_test.php" title="Simple Test" >Simple Test</a> for unit testing. We will be placing Simple Test within &#8216;udid&#8217;, but not within &#8216;project&#8217;. So now we have:<br />
<code><br />
udid<br />
|-&gt; project<br />
|-&gt; simpletest<br />
</code><br />
As you know we will be using SVN to store the code, so we are going to be using what I learned as the traditional setup for a SVN project, not because it is the traditional way, but because I&#8217;ve used it before and it has worked well for me. This structure is:<br />
<code><br />
project<br />
|-&gt; branches<br />
|-&gt; tags<br />
|-&gt; trunk<br />
</code><br />
These three directories have very specific purposes:</p>
<ul>
<li><strong>branches</strong>: Experimental development branches. Branches are used when you decide to make some dramatic changes to the code base, but your not really sure how it is going to work out, so you do not want to code within the &#8216;trunk&#8217; but you may want to merge the code within the trunk at a later time.</li>
<li><strong>tags</strong>: This directory is used to store the project at certain milestones, i.e. version releases.</li>
<li><strong>trunk</strong>: Main development thread</li>
</ul>
<p>So this is what our directory structure looks like so far:<br />
<code><br />
udid<br />
|<br />
|-&gt; project<br />
|  |-&gt; branches<br />
|  |-&gt; tags<br />
|  |-&gt; trunk<br />
|<br />
|-&gt; simpletest<br />
</code><br />
OK, for the rest of this post we will be working in the &#8216;trunk&#8217; to setup the actual directory structure for the project code&#8230;</p>
<p>At some point a long time ago I got into the habit of creating a subdomain for each new project I work on, this I find convenient because the subdomain&#8217;s document root is its own and is not cluttered with other directories, files, etc. As an added bonus the document root can be anywhere on the system. Consequently the directories below &#8216;trunk&#8217; look like this:<br />
<code><br />
trunk<br />
|-&gt; public_html<br />
|-&gt; Udid<br />
</code><br />
Obviously &#8216;public_html&#8217; is the document root, and &#8216;Udid&#8217; will store all the back-end PHP code. Notice the PHP code will be stored outside the document root (where a browser is unable to access it directly). I prefer to setup my projects this way as an added security measure. For more information about the security aspects of this; check out <a href="http://shiflett.org" title="Chris Shiflett PHP and Web Application Security" >Chris Shiflett</a>&#8216;s article: <a href="http://shiflett.org/articles/secure-design" title="shiflett.org: Security Corner: Secure Design" >Security Corner: Secure Design</a> (be sure to read the comments).</p>
<p>For now &#8216;public_html&#8217; will remain empty and &#8216;Udid&#8217; will hold the directory structure for the application. So this will be the development directory structure we&#8217;ll be using&#8230;<br />
<code><br />
udid<br />
|<br />
|-&gt; project<br />
|    |-&gt; branches<br />
|    |-&gt; tags<br />
|    |-&gt; trunk<br />
|         |-&gt; public_html<br />
|         |-&gt; Udid<br />
|<br />
|-&gt; simpletest<br />
</code><br />
Please note, I have still not imported the project into SVN, you can actually do the import as soon as you have the first directory created, but I like to wait until I have the basic structure of the application set, which brings us to the topic of the next post. What is the directory structure of the application itself; or what directories will be created below Udid: &#8216;udid-&gt;project-&gt;trunk-&gt;Udid&#8217;?</p>
<p>I will post this structure in the next few days, and import the project into SVN, so we can finally get down to some code! Thanks for reading.</p>

                            <div id="aspdf">
                                <a href="http://albertfama.com/wp-content/plugins/as-pdf/generate.php?post=46">
                                    <span>&nbsp;</span>
                                </a>
                            </div>
                        ]]></content:encoded>
			<wfw:commentRss>http://albertfama.com/content/development-enviroment-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting a New Project</title>
		<link>http://albertfama.com/content/starting-a-new-project/</link>
		<comments>http://albertfama.com/content/starting-a-new-project/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 18:18:17 +0000</pubDate>
		<dc:creator>Albert Fama</dc:creator>
				<category><![CDATA[Content]]></category>
		<category><![CDATA[Project: Udid]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[environment]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[requirements]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://obnexus.net/?p=45</guid>
		<description><![CDATA[Greetings once again; I am currently in the design phase of a new project. I thought it could prove to be an interesting set of blog entries if I loosely documented the progress here at Obnexus. I will try to relate all experiences as the project is created. Even if we try to account for [...]]]></description>
			<content:encoded><![CDATA[<p>Greetings once again; I am currently in the design phase of a new project. I thought it could prove to be an interesting set of blog entries if I loosely documented the progress here at Obnexus. I will try to relate all experiences as the project is created. </p>
<p>Even if we try to account for all aspects in the design phase, I know there will be situations where decisions made early on will have negative effects later down the road. I will document everything as it happens, because I find that I learn more from mistakes, and hopefully you will to. </p>
<p>I will mainly be working on this project solo, which means I will not only be dealing with PHP and MySQL, but also HTML, CSS, JavaScript, etc. Since I believe many developers work alone I hope that this will interest most readers.</p>
<p>I personally like to start a project with a name, simply because it gives the project an identity, but&#8230; In this case I cannot decide on an appropriate name so I am going to skip this step for the moment and move onto some actual code design, one of the most important and exciting steps.</p>
<p>First let&#8217;s set down some general guidelines: </p>
<ul>
<li>Version Control: Subversion (SVN)</li>
<li>PHP Version: The project will be written in PHP5 and will not support PHP4. Let&#8217;s face it PHP4 is dead and if your server is still running 4 you NEED to upgrade. </li>
<li>MySQL Version: I will be using MySQL 5, again if your not on 5, what are you waiting for?</li>
<li>HTTP Server Platform: Apache</li>
<li>Browser Support: Firefox, Internet Explorer, AOL Browser, Netscape, Opera, Safari. This is just a list off the top of my head, basically we are going to attempt to support as many browsers as possible.</li>
</ul>
<p>Again these are just general guidelines; eventually the project will be able to support multiple database servers, different HTTP server platforms, etc. Initially these are our targets for support; no reason to bog the development process down with attempting to support everything under the sun, but&#8230; Since we want the project to be as flexible as possible, we will need to account for this NOW in our framework design.</p>
<p>OK, now that we have our guidelines; the next step will be to start coding right? Wrong, next we will decide on a directory structure, and create the SVN repository to hold our project.</p>
<p>I hope you are as excited as I am to get this thing underway, please check back soon.</p>

                            <div id="aspdf">
                                <a href="http://albertfama.com/wp-content/plugins/as-pdf/generate.php?post=45">
                                    <span>&nbsp;</span>
                                </a>
                            </div>
                        ]]></content:encoded>
			<wfw:commentRss>http://albertfama.com/content/starting-a-new-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

