![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| Pear Pear programming, this is a very complex subject as with using pear with php can be a difficult task for some, so lets talk pear. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| cellog Fri May 25 19:38:06 2007 UTC Modified files: /pear-core/PEAR/PackageFile v2.php Log: add missing require_once http://cvs.php.net/viewvc.cgi/pear-c...&diff_format=u Index: pear-core/PEAR/PackageFile/v2.php diff -u pear-core/PEAR/PackageFile/v2.php:1.136 pear-core/PEAR/PackageFile/v2.php:1.137 --- pear-core/PEAR/PackageFile/v2.php:1.136 Tue Feb 20 00:16:12 2007 +++ pear-core/PEAR/PackageFile/v2.php Fri May 25 19:38:06 2007 @@ -15,7 +15,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: v2.php,v 1.136 2007/02/20 00:16:12 cellog Exp $ + * @version CVS: $Id: v2.php,v 1.137 2007/05/25 19:38:06 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -1947,16 +1947,16 @@ $this->getTasksNs(); // transform all '-' to '/' and 'tasks:' to '' so tasks:replace becomes replace $task = str_replace(array($this->_tasksNs . ':', '-'), array('', ' '), $task); - $task = str_replace(' ', '/', ucwords($task)); - $ps = (strtolower(substr(PHP_OS, 0, 3)) == 'win') ? ';' : ':'; - foreach (explode($ps, ini_get('include_path')) as $path) { - if (file_exists($path . "/PEAR/Task/$task.php")) { - include_once "PEAR/Task/$task.php"; - $task = str_replace('/', '_', $task); - if (class_exists("PEAR_Task_$task")) { - return "PEAR_Task_$task"; - } - } + $taskfile = str_replace(' ', '/', ucwords($task)); + $task = str_replace('/', '_', $task); + if (class_exists("PEAR_Task_$task")) { + return "PEAR_Task_$task"; + } + $fp = @fopen("PEAR/Task/$taskfile.php", 'r', true); + if ($fp) { + fclose($fp); + require_once "PEAR/Task/$taskfile.php"; + return "PEAR_Task_$task"; } return false; } | |||
| | #2 | ||
| I hadn't realized this code was not yet committed. This is actually a fix for tasks with "-" in the name coupled with a better check for if the file is in the include_path Greg Beaver wrote: > cellog Fri May 25 19:38:06 2007 UTC > > Modified files: > /pear-core/PEAR/PackageFile v2.php > Log: > add missing require_once > > http://cvs.php.net/viewvc.cgi/pear-c...&diff_format=u > Index: pear-core/PEAR/PackageFile/v2.php > diff -u pear-core/PEAR/PackageFile/v2.php:1.136 pear-core/PEAR/PackageFile/v2.php:1.137 > --- pear-core/PEAR/PackageFile/v2.php:1.136 Tue Feb 20 00:16:12 2007 > +++ pear-core/PEAR/PackageFile/v2.php Fri May 25 19:38:06 2007 > @@ -15,7 +15,7 @@ > * @author Greg Beaver <cellog@php.net> > * @copyright 1997-2006 The PHP Group > * @license http://www.php.net/license/3_0.txt PHP License 3.0 > - * @version CVS: $Id: v2.php,v 1.136 2007/02/20 00:16:12 cellog Exp $ > + * @version CVS: $Id: v2.php,v 1.137 2007/05/25 19:38:06 cellog Exp $ > * @link http://pear.php.net/package/PEAR > * @since File available since Release 1.4.0a1 > */ > @@ -1947,16 +1947,16 @@ > $this->getTasksNs(); > // transform all '-' to '/' and 'tasks:' to '' so tasks:replace becomes replace > $task = str_replace(array($this->_tasksNs . ':', '-'), array('', ' '), $task); > - $task = str_replace(' ', '/', ucwords($task)); > - $ps = (strtolower(substr(PHP_OS, 0, 3)) == 'win') ? ';' : ':'; > - foreach (explode($ps, ini_get('include_path')) as $path) { > - if (file_exists($path . "/PEAR/Task/$task.php")) { > - include_once "PEAR/Task/$task.php"; > - $task = str_replace('/', '_', $task); > - if (class_exists("PEAR_Task_$task")) { > - return "PEAR_Task_$task"; > - } > - } > + $taskfile = str_replace(' ', '/', ucwords($task)); > + $task = str_replace('/', '_', $task); > + if (class_exists("PEAR_Task_$task")) { > + return "PEAR_Task_$task"; > + } > + $fp = @fopen("PEAR/Task/$taskfile.php", 'r', true); > + if ($fp) { > + fclose($fp); > + require_once "PEAR/Task/$taskfile.php"; > + return "PEAR_Task_$task"; > } > return false; > } > > | |||
| Featured Websites | ||||
|
![]() |
| Tags: cvs, pearcore, pearpackagefile, v2php |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| cvs: pear-core /PEAR/Command Remote.php | Helgi Þormar Þorbjörnsson | Pear | 0 | 05-27-2007 7:46 PM |
| cvs: pear-core /PEAR/Command Remote.php | Greg Beaver | Pear | 0 | 05-20-2007 7:42 PM |
| cvs: pear-core /PEAR/Command Install.php | Greg Beaver | Pear | 0 | 05-20-2007 7:42 PM |
| cvs: pear-core / package-PEAR.xml package2.xml /PEAR/PackageFile/Generator v2.php | Greg Beaver | Pear | 0 | 05-20-2007 7:42 PM |
| cvs: pear-core / package-PEAR.xml package2.xml /PEAR Installer.php /PEAR/PackageFile v1.php /PEAR/PackageFile/v2 Validator.php | Greg Beaver | Pear | 0 | 05-20-2007 7:42 PM |
| Featured Websites | ||||
|