public function __construct(Engine_Package_Manifest_Entity_Package $package, $selected = false) { //$this->_package = $package; $this->_packageGuid = $package->getGuid(); $this->_packageKey = $package->getKey(); $this->_selected = (bool) $selected; }
public function addToArchive(Archive_Tar $archive) { // Add top level package manifest $archive->addString('package.json', $this->toString('json')); // Normal stuff parent::addToArchive($archive); }
public function addPackage($package, $options = null) { if (!$package instanceof Engine_Package_Manifest_Entity_Package) { if (!isset($options['basePath'])) { $options['basePath'] = $this->getBasePath(); } $package = new Engine_Package_Manifest_Entity_Package($package, $options); } else { if (is_array($options)) { $package->setOptions($options); } } $package->setBasePath($this->getBasePath()); $name = self::fix_path($package->getPath()); if ($this->_jitInstantiation) { $this->_structure[$name] = $package->toArray(); } else { $this->_structure[$name] = $package; } return $this; }
protected function _getPackageFiles(Engine_Package_Manifest_Entity_Package $package = null) { if (null === $package) { return array(); } $files = $package->getFileStructure(true); return $files; }
public function packageSelect(Engine_Package_Manifest_Entity_Package $package) { $key = $package->getKey(); $guid = $package->getGuid(); $safeKey = str_replace('.', '-', $key); $safeGuid = str_replace('.', '-', $guid); $basename = basename($package->getBasePath()); ob_start(); ?> <li class="file file-success package_<?php echo $safeGuid; ?> package_<?php echo $safeKey; ?> "> <span class="file-name"> <span class="file-select"> <input type="checkbox" name="packages[]" id="<?php echo $safeKey; ?> " value="<?php echo $package->getKey(); ?> " checked="checked"/> </span> <label for="<?php echo $safeKey; ?> "> <?php echo $package->getKey(); ?> </label> </span> <span class="file-info"> <span class="file-package-info"> <span class="file-package-info-title"> <?php if (!$package->getMeta()->getTitle()) { ?> <?php echo $guid; ?> <?php } else { ?> <?php echo $package->getMeta()->getTitle(); ?> <?php } ?> v<?php echo $package->getVersion(); ?> </span> <?php if ($package->getMeta()->getAuthors()) { ?> <span class="file-package-info-author"> by <?php echo join(', ', $package->getMeta()->getAuthors()); ?> </span> <?php } ?> </span> </span> <span class="file-package-remove"> <a href="javascript:void(0);" onclick="removePackage('<?php echo $basename; ?> ');"> remove </a> </span> </li> <?php return ob_get_clean(); }