Changeset 12599
- Timestamp:
- 09/30/07 14:16:47 (1 year ago)
- Files:
-
- trunk/midcom/build/packageMidCOMcore.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/build/packageMidCOMcore.php
r12307 r12599 1 1 <?php 2 2 3 function wfile($obj, $f) { 4 5 ob_start(); 6 var_dump($obj); 7 file_put_contents($f, ob_get_contents()); 8 ob_end_clean(); 9 10 } 3 11 4 12 /** … … 77 85 78 86 // todo: add a setVersion from the commandline 79 protected $copyfiles = array (); 87 protected $copyfiles = array (); 88 /* array of files in the static dir. */ 89 protected $staticFiles ; 80 90 81 91 /** … … 96 106 'packagedirectory' => $this->path, 97 107 'baseinstalldir' => 'midcom/lib', 108 'installexceptions' => array( 'support' => '/'), 109 'dir_roles' => array(), 98 110 'simpleoutput' => true, 99 'include' => array('*.php', 'midcom /*', 'support/*'),111 'include' => array('*.php', 'midcom*', 'support*'), 100 112 ); 101 113 … … 115 127 $package->generateContents(); 116 128 129 $this->addStatic($package); 130 117 131 if ($package->debugPackageFile()) { 118 132 echo "Writing package.....\n"; … … 125 139 protected function getNotes($package) { 126 140 // todo add release notes... 141 } 142 /* 143 * This method builds the list of files in the static dir and adds them to the 144 * */ 145 protected function addStatic($package) 146 { 147 148 $this->staticFiles = array(); 149 $this->getDirFilesRecursive($this->path . "/static"); 150 foreach ($this->staticFiles as $path => $files ) 151 { 152 $fpath = str_replace($this->path . '/static/', "", $path); 153 foreach ($files as $filename) 154 { 155 $dir = '/static'; 156 $filen = $fpath .'/' . $filename ; 157 $package->addFile($dir, $filen , array( 158 'role' => 'web', 159 'baseinstalldir' => '/', 160 'install-as' => $fpath ."/". $filename ) ); 161 } 162 } 163 164 } 165 166 protected function getDirFilesRecursive($path) { 167 $list = dir($path); 168 while (($file = $list->read()) !== FALSE) { 169 if ($file{0} == '.') continue; // skipp .svn , . and .. 170 if (is_dir($path .'/'.$file)) { 171 $this->getDirFilesRecursive($path .'/' . $file); 172 } else { 173 if (!isset($this->staticFiles[$path])) $this->staticFiles[$path] = array(); 174 $this->staticFiles[$path][] = $file; 175 } 176 } 177 $list->close(); 127 178 } 128 179
