Changeset 12600
- Timestamp:
- 09/30/07 14:20:01 (1 year ago)
- Files:
-
- branches/MidCOM_2_8/build/packageMidCOMcore.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/MidCOM_2_8/build/packageMidCOMcore.php
r12583 r12600 1 1 <?php 2 3 4 2 /** 5 3 * Created on 10/09/2006 … … 8 6 * @copyright The Midgard Project, http://www.midgard-project.org 9 7 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License 8 * 9 * Package midcom core as a pear package 10 10 * 11 11 */ … … 75 75 76 76 // todo: add a setVersion from the commandline 77 protected $copyfiles = array (); 77 protected $copyfiles = array (); 78 /* array of files in the static dir. */ 79 protected $staticFiles ; 78 80 79 81 /** … … 97 99 'packagedirectory' => $this->path, 98 100 'baseinstalldir' => 'midcom/lib', 101 'installexceptions' => array( 'support' => '/'), 102 'dir_roles' => array(), 99 103 'simpleoutput' => true, 100 'include' => array('*'), 104 'ignore' => array('package-template.xml'), 105 'include' => array('*.php', 'midcom*', 'support*'), 101 106 ); 102 107 … … 118 123 $package->generateContents(); 119 124 125 $this->addStatic($package); 126 120 127 if ($package->debugPackageFile()) { 121 128 echo "Writing package.....\n"; … … 128 135 protected function getNotes($package) { 129 136 // todo add release notes... 137 } 138 /* 139 * This method builds the list of files in the static dir and adds them to the 140 * */ 141 protected function addStatic($package) 142 { 143 144 $this->staticFiles = array(); 145 $this->getDirFilesRecursive($this->path . "/static"); 146 foreach ($this->staticFiles as $path => $files ) 147 { 148 $fpath = str_replace($this->path . '/static/', "", $path); 149 foreach ($files as $filename) 150 { 151 $dir = '/static'; 152 $filen = $fpath .'/' . $filename ; 153 $package->addFile($dir, $filen , array( 154 'role' => 'web', 155 'baseinstalldir' => '/', 156 'install-as' => $fpath ."/". $filename ) ); 157 } 158 } 159 160 } 161 162 protected function getDirFilesRecursive($path) { 163 $list = dir($path); 164 while (($file = $list->read()) !== FALSE) { 165 if ($file{0} == '.') continue; // skipp .svn , . and .. 166 if (is_dir($path .'/'.$file)) { 167 $this->getDirFilesRecursive($path .'/' . $file); 168 } else { 169 if (!isset($this->staticFiles[$path])) $this->staticFiles[$path] = array(); 170 $this->staticFiles[$path][] = $file; 171 } 172 } 173 $list->close(); 130 174 } 131 175
