26
26
*
27
27
* TODO:
28
28
* - add an extra param the dir where to place the created package
29
- * - finish and test Windows support
30
29
*
31
30
* @since PHP 4.0.2
32
31
* @author Stig Bakken <[email protected] >
@@ -35,51 +34,16 @@ class PEAR_Packager extends PEAR_Common
35
34
{
36
35
// {{{ properties
37
36
38
- /** assoc with information about the package */
39
- var $ pkginfo = array ();
40
-
41
- /** name of the package directory, for example Foo-1.0 */
42
- var $ pkgdir ;
43
-
44
- /** directory where PHP code files go */
45
- var $ phpdir ;
46
-
47
- /** directory where PHP extension files go */
48
- var $ extdir ;
49
-
50
- /** directory where documentation goes */
51
- var $ docdir ;
52
-
53
- /** directory where system state information goes */
54
- var $ statedir ;
55
-
56
37
/** debug mode (integer) */
57
38
var $ debug = 0 ;
58
39
59
- /** temporary directory */
60
- var $ tmpdir ;
61
-
62
- /** whether file list is currently being copied */
63
- var $ recordfilelist ;
64
-
65
- /** temporary space for copying file list */
66
- var $ filelist ;
67
-
68
- /** package name and version, for example "HTTP-1.0" */
69
- var $ pkgver ;
70
-
71
40
// }}}
72
41
73
42
// {{{ constructor
74
43
75
- function PEAR_Packager ($ phpdir = PEAR_INSTALL_DIR ,
76
- $ extdir = PEAR_EXTENSION_DIR ,
77
- $ docdir = '' )
44
+ function PEAR_Packager ()
78
45
{
79
46
$ this ->PEAR ();
80
- $ this ->phpdir = $ phpdir ;
81
- $ this ->extdir = $ extdir ;
82
- $ this ->docdir = $ docdir ;
83
47
}
84
48
85
49
// }}}
@@ -135,14 +99,15 @@ function package($pkgfile = null)
135
99
return $ this ->raiseError ("File $ fname does not exist " );
136
100
} else {
137
101
$ filelist [$ i ++] = $ fname ;
102
+ $ this ->log (2 , "Adding file $ fname " );
138
103
}
139
104
}
140
105
// XXX TODO: Rebuild the package file as the old method did?
141
106
142
107
// TAR the Package -------------------------------------------
143
108
$ dest_package = $ this ->orig_pwd . DIRECTORY_SEPARATOR . "{$ pkgver }.tgz " ;
144
- $ tar = new Archive_Tar ($ dest_package , true );
145
- $ tar ->setErrorHandling (PEAR_ERROR_PRINT );
109
+ $ tar =& new Archive_Tar ($ dest_package , true );
110
+ $ tar ->setErrorHandling (PEAR_ERROR_PRINT ); // XXX Don't print errors
146
111
// ----- Creates with the package.xml file
147
112
if (!$ tar ->create ($ pkgfile )) {
148
113
return $ this ->raiseError ('an error ocurred during package creation ' );
0 commit comments