Re: Question concerning proper dir structure for PEAR/Smarty

From: Date: Thu, 03 Mar 2005 21:04:04 +0000
Subject: Re: Question concerning proper dir structure for PEAR/Smarty
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-17824@lists.php.net to get a copy of this message
* Jimmy <jimmymg@gmail.com>: > OK, I am new to the whole PEAR/Smarty templating thing. I am trying to > setup my directory structure correctly. If someone could weigh in and > see if I have this setup "right", I would appreciate it. Actually, first off, Smarty is not a PEAR project. If it were, you would be able to install it with PEAR, and you wouldn't be having the questions you're having. > Directory structure: > > pear/ > db/ > db/ > DB/ > doc/ > tests/ > DB.php > ... other pear packages This looks odd. How are you installing PEAR packages? You should be using the pear command -- I'm guessing you're not. More on that below. > smarty/ > ... all smarty files > OS/ > PEAR/ > ... pear basic package files > scripts/ I'm not sure what scripts/ is from -- I don't have this in my PEAR directory... but then I'm only using a subset of PEAR. > package.xml > package2.xml > package.dtd > PEAR.php > System.php > template.spec > > I want to make sure this looks right, because my PEAR db class appears > to be buried pretty deep (db/db/DB.php) and I want to make sure I > manually put the smarty files in the correct place. That's odd -- did you install DB using PEAR? (i.e., from the commandline, typing 'pear install DB')? It should appear as: pear/ DB.php DB/ (a bunch o' other files) Based on the structure you presented, I'd say you're grabbing PEAR packages off the PEAR website and installing them by hand. You don't need to do this, and probably shouldn't -- PEAR has some great utilities for package management, and does a good job installing itself and other PEAR packages. If at all possible, install PEAR libraries using pear. Other than that, the location you used for Smarty looks fine -- it's where I generally put it. You'll invoke it with: include_once 'Smarty/Smarty.class.php'; Unless you decide to add /path/to/pear/Smarty to your include_path (which I did), in which case you can simply include Smarty.class.php. > I did a lot of searching, and really didn't come up with much. Would > appreciate some input, thank you very much! Read the PEAR documentation regarding installation of pear and the usage of the pear command. -- Matthew Weier O'Phinney | WEBSITES: Webmaster and IT Specialist | http://www.garden.org National Gardening Association | http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org mailto:matthew@garden.org | http://vermontbotanical.org

« previous php.pear.general (#17824) next »