title: Issue import vendor file in cakephp
body: <p>I'm trying to import a non cake php file into a view. I copied the file into the Vendors folder and then added the following line to my code:</p>
  
  <pre><code>&lt;?php
  App::import('Vendor', 'sitecommon');
  ?&gt;
  </code></pre>
  
  <p>But this gives me the following error message:</p>
  
  <pre><code>Fatal error: Cannot redeclare class IncFunc in /var/www/html/PHP/site/includes/sitecommon.php on line 6
  </code></pre>
  
  <p>But if I remove the import statement I get the message:</p>
  
  <pre><code>Class 'IncFunc' not found in &lt;b&gt;/var/www/html/cakepftest/app/views/alerts/view.ctp
  </code></pre>
  
  <p>This is for cake version 1.3.7.</p>
  
  <pre><code>&lt;?php
  
  
  //various include functions for javascript libraries,etc.
  class IncFunc
  {
  
      static public $PHP_ROOT_PATH="/PHP";
      static public $CAKE_ROOT_PATH="/cakepftest";
      static public $JSP_ROOT_PATH="http://localhost:8080/JSPDataSource";
  
  
      static function icon()
      {
          echo "&lt;link href=\"".self::$PHP_ROOT_PATH."/site/images/favicon.ico\" type=\"image/x-icon\" rel=\"icon\" /&gt;&lt;link href=\"".self::$PHP_ROOT_PATH."/site/images/favicon.ico\" type=\"image/x-icon\" rel=\"shortcut icon\" /&gt;";
  
      }
  
      static function linkStyleCSS()
      {
  
          echo "&lt;link rel=\"stylesheet\" href=\"".self::$PHP_ROOT_PATH."/site/includes/style.css\" type=\"text/css\" /&gt;"; 
      }
  
      static function logo()
      {
          echo "&lt;a id=\"jq-siteLogo\" href=\"http://www.pikefin.com\" title=\"PikeFin Home\"&gt;&lt;img src=\"/PHP/site/images/33pctsizecrop.jpg\"/&gt;&lt;/a&gt;";
      }
  
      static function primaryNav($Page)
      {
  
  
          echo "&lt;div id=\"jq-primaryNavigation\"&gt;\n";
          echo "&lt;ul&gt;\n";
          echo "&lt;li class=\"jq-home ".($Page=="home"?"jq-current":"")."\"&gt;&lt;a href=\"".self::$PHP_ROOT_PATH."/site/main/index.php\" title=\"Pikefin Home\"&gt;Home&lt;/a&gt;&lt;/li&gt;\n";
          echo "&lt;li class=\"jq-alerts ".($Page=="alerts"?"jq-current":"")."\"&gt;&lt;a href=\"".self::$CAKE_ROOT_PATH."/users/chart\" title=\"Pikefin Alert Manager\"&gt;Alert Manager&lt;/a&gt;&lt;/li&gt;\n";
          echo "&lt;li class=\"jq-charts ".($Page=="charts"?"jq-current":"")."\"&gt;&lt;a href=\"".self::$PHP_ROOT_PATH."/charts/allassets/topchart.php\" title=\"Pikefin Charts\"&gt;Charts&lt;/a&gt;&lt;/li&gt;";
          //echo "&lt;li class=\"jq-blog ".($Page=="blog"?"jq-current":"")."\"&gt;&lt;a href=\"/PHP/site/main/blog.php\" title=\"Pikefin Blog\"&gt;Blog&lt;/a&gt;&lt;/li&gt;";
          //echo "&lt;li class=\"jq-about ".($Page=="about"?"jq-current":"")."\"&gt;&lt;a href=\"/PHP/site/main/about.php\" title=\"About Pikefin\"&gt;About&lt;/a&gt;&lt;/li&gt;";
          echo "&lt;/ul&gt;\n";
          echo "&lt;/div&gt;&lt;!-- /#primaryNavigation --&gt;\n";
  
  
  
  
      }
  
      static function incJquery()
      {
  
          echo "&lt;script src=\"".self::$PHP_ROOT_PATH."/site/includes/jquery-1.5.1.js\" type=\"text/javascript\"&gt;&lt;/script&gt;";
      }
  
      static function header1($context)
      {
          //require_once '../../common/functions.php';
          echo "&lt;div id=\"jq-header\" &gt;";
          self::logo();
          self::primaryNav($context);
          //self::pageCounter();
          echo "&lt;/div&gt; &lt;!-- header --&gt;";
      }
  
  
      static function pageCounter()
      {
  
  
          $uri = $_SERVER['REQUEST_URI'];
  
          if (strpos($uri,'?')!=false)
              $uri = substr($uri,0,strpos($uri,'?'));
  
          db_utility::db_connect();
  
          $query1 = "select hits from page_counters where uri='".$uri."'";
  
          $result1 = mysql_query($query1) or die("Failed Query of " . $query1);
  
          $row1 = mysql_fetch_array($result1);
  
          if ($row1==null)
          {
              $query2 = "insert into page_counters (uri,hits) values ('".$uri."',1)";
          }
          else 
          {
              $query2 = "update page_counters set hits=".($row1['hits']+1)." where uri='".$uri."'";
          }
  
          mysql_query($query2) or die("Failed Query of " . $query2);
  
  
  
  
      }
  
      static function chartSecondaryNav()
      {
  
          echo "&lt;div id=\"jq-secondaryNavigation\"&gt;\n";
          echo "&lt;ul&gt;\n";
          echo "&lt;li class=\"jq-fedreserve jq-first\"&gt;&lt;a href=\"".self::$PHP_ROOT_PATH."/charts/fed/balsheet.php\"&gt;Federal Reserve Main&lt;/a&gt;&lt;/li&gt;\n";
          echo "&lt;li class=\"jq-allassets\"&gt;&lt;a href=\"".self::$PHP_ROOT_PATH."/charts/allassets/tablesample3A.php\"&gt;All Assets&lt;/a&gt;&lt;/li&gt;\n";
          echo "&lt;li class=\"jq-forex\"&gt;&lt;a href=\"".self::$PHP_ROOT_PATH."/charts/forex/forex.php\"&gt;Foreign Exchange&lt;/a&gt;&lt;/li&gt;\n";
          echo "&lt;li class=\"jq-commodities\"&gt;&lt;a href=\"".self::$PHP_ROOT_PATH."/charts/commods/commodities.php\"&gt;Commodities&lt;/a&gt;&lt;/li&gt;\n";
          echo "&lt;li class=\"jq-equities jq-last\"&gt;&lt;a href=\"".self::$PHP_ROOT_PATH."/charts/usequities/usequities.php\"&gt;U.S Equities&lt;/a&gt;&lt;/li&gt;\n";
          echo "&lt;/ul&gt;\n";
          echo "&lt;/div&gt;&lt;!-- /#secondaryNavigation --&gt;\n";
  
      }
  
      static function yuiDropDownJavaScript()
      {
  
          echo "  &lt;!-- Combo-handled YUI CSS files: --&gt;";
          //echo "&lt;link rel=\"stylesheet\" type=\"text/css\" href=\"http://yui.yahooapis.com/combo?2.8.2r1/build/reset-fonts-grids/reset-fonts-grids.css\"&gt;";
          echo "&lt;link rel=\"stylesheet\" type=\"text/css\" href=\"http://yui.yahooapis.com/combo?2.8.2r1/build/menu/assets/skins/sam/menu.css\"&gt;";
          echo "&lt;link rel=\"stylesheet\" type=\"text/css\" href=\"http://yui.yahooapis.com/combo?2.8.2r1/build/button/assets/skins/sam/button.css\"&gt;";
          echo "&lt;!-- Combo-handled YUI JS files: --&gt;";
          echo "&lt;script type=\"text/javascript\" src=\"http://yui.yahooapis.com/combo?2.8.2r1/build/yuiloader-dom-event/yuiloader-dom-event.js&amp;2.8.2r1/build/container/container_core-min.js&amp;2.8.2r1/build/menu/menu-min.js&amp;2.8.2r1/build/element/element-min.js&amp;2.8.2r1/build/button/button-min.js\"&gt;&lt;/script&gt;";
  
          echo "&lt;script type=\"text/javascript\" src=\"".self::$PHP_ROOT_PATH."/site/includes/yuiDropDown.js\"&gt;&lt;/script&gt;";
  
          echo "&lt;script type=\"text/javascript\"&gt;";
  
          echo "var rootpath='".self::$PHP_ROOT_PATH."';";
          //echo "var rootpath='/PHP';";
          //echo "var rootpath='/phptest';";
  
          echo "YAHOO.util.Event.onContentReady(\"productsandservices\", yuiCallBack);";
          echo "&lt;/script&gt;";
  
  
      }
  
      static function yuiDropDownMenu()
      {
  
          echo "&lt;div class=\"yui-skin-sam\" id=\"yahoo-com\" style=\"padding: 0 160px;\"&gt;";
          echo "  &lt;div id=\"doc\" class=\"yui-t1\" width=\"30em\"&gt;";
          echo "      &lt;div id=\"productsandservices\" class=\"yuimenubar yuimenubarnav\"&gt;";
          echo "          &lt;div class=\"bd\"&gt;";
          echo "              &lt;ul class=\"first-of-type\"&gt;";
          echo "              &lt;li class=\"yuimenubaritem first-of-type\"&gt;";
          echo "                  &lt;a class=\"yuimenubaritemlabel\" &gt;Equities&lt;/a&gt;";
          echo "              &lt;/li&gt;";
          echo "              &lt;li class=\"yuimenubaritem\"&gt;";
          echo "                  &lt;a class=\"yuimenubaritemlabel\" &gt;Commodities&lt;/a&gt;";
          echo "              &lt;/li&gt;";
          echo "              &lt;li class=\"yuimenubaritem\"&gt;";
          echo "                  &lt;a class=\"yuimenubaritemlabel\" &gt;Foreign Exchange&lt;/a&gt;";
          echo "              &lt;/li&gt;";
          echo "              &lt;li class=\"yuimenubaritem\"&gt;";
          echo "                  &lt;a class=\"yuimenubaritemlabel\" &gt;Miscellaneous&lt;/a&gt;";
          echo "              &lt;/li&gt;";
          echo "              &lt;/ul&gt;";
          echo "          &lt;/div&gt;";
          echo "      &lt;/div&gt;";
          echo "  &lt;/div&gt;";
          echo "&lt;/div&gt;";
  
  
  
  
  
      }
  
      static function blogFeedJavaScript()
      {
          echo "&lt;script src=\"https://www.google.com/jsapi?key=ABQIAAAAxIClsZ3ToqpAEYJ0xpbYDBQvMn8QNL-nLRnNjyJkuSEqYss18BSxvSrpXIIMYm_A6P2cdVBEmC64UA\" type=\"text/javascript\"&gt;&lt;/script&gt;\n";
          echo "&lt;script language=\"Javascript\" type=\"text/javascript\"&gt;    \n";
          echo "/*\n";
          echo " *  How to use the Feed Control to grab, parse and display feeds.\n";
          echo "*/\n";
  
          echo "google.load(\"feeds\", \"1\");\n";
  
          echo "function OnLoad() {\n";
          echo "/* Create a feed control */\n";
          echo "var feedControl = new google.feeds.FeedControl();\n";
  
          echo "/* Add two feeds. */\n";
          echo "feedControl.addFeed(\"http://pikefin.blogspot.com/feeds/posts/default\", \"Pikefin Blog\");\n";
  
          echo "/* Draw it.*/\n";
          echo "feedControl.draw(document.getElementById(\"blogcontrol\"))\n";
          echo "}\n";
  
          echo "google.setOnLoadCallback(OnLoad);\n";
          echo "&lt;/script&gt;\n";
  
  
  
      }
  
  }
  
  
  
  ?&gt;
  </code></pre>