Is it possible to use a pear package without pear itself?
Honestly, I know nothing about pear (... installation and all). But I know that there are MANY useful functions available through pear. I wonder if it is possible to use a source file 开发者_C百科out of the repository and use it with complete disregard for the rest of pear?
What I mean is "is it technically possible to use a source file out of the repository and use it with complete disregard for the rest of pear?
For instance Zend Framework offers canned functionality too, but the packages are so tightly interleaved that you simply cannot use a source file in isolation and have to include many others on which it depends. Well, does the same, or a similar condition exist with pear?
As long as you adhere to the particular license expressed in the module for which you're using the source code from.
Here's an example of one that I looked at randomly from the Calendar module:
LICENSE: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
@category Date and Time
@package Calendar
@author Harry Fuecks
@author Lorenzo Alberton
@copyright 2003-2007 Harry Fuecks, Lorenzo Alberton
@license http://www.debian.org/misc/bsd.license BSD License (3 Clause)
@version CVS: $Id: Calendar.php,v 1.9 2008/11/15 21:21:42 quipo Exp $
@link http://pear.php.net/package/Calendar
It depends on the package - it may or may not utilise functionality in the base PEAR classes, such as throwing PEAR_Exceptions, making use of the PEAR registry and so on.
Honestly, you are far better off installing the package through pear than downloading the source code and manually extracting it to some directory inside your include_path. By using the pear installer to set up the package you won't waste time later on should you need to install a later version or manage dependencies between various packages - just let the installer take care of it.
精彩评论