当前位置: 首页>>代码示例>>PHP>>正文


PHP PEAR_PackageFileManager2::addRole方法代码示例

本文整理汇总了PHP中PEAR_PackageFileManager2::addRole方法的典型用法代码示例。如果您正苦于以下问题:PHP PEAR_PackageFileManager2::addRole方法的具体用法?PHP PEAR_PackageFileManager2::addRole怎么用?PHP PEAR_PackageFileManager2::addRole使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PEAR_PackageFileManager2的用法示例。


在下文中一共展示了PEAR_PackageFileManager2::addRole方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

$packagexml->setPackageType('php');
$packagexml->addRelease();
$packagexml->setPackage($config['package']);
$packagexml->setChannel($config['channel']);
$packagexml->setReleaseVersion($config['release_ver']);
$packagexml->setAPIVersion($config['api_ver']);
$packagexml->setReleaseStability($config['stability']);
$packagexml->setAPIStability($config['stability']);
$packagexml->setSummary($config['summery']);
$packagexml->setDescription($config['description']);
$packagexml->setNotes($config['note']);
$packagexml->setPhpDep($config['dep_php']);
$packagexml->setPearinstallerDep($config['pear_ver']);
$packagexml->addMaintainer('lead', 'koriyama', 'Koriyama', 'koriyama@users.sourceforge.jp');
$packagexml->setLicense('The BSD License', 'http://www.opensource.org/licenses/bsd-license.php');
$packagexml->addRole('sh', 'script');
$packagexml->addRole('conf', 'php');
$packagexml->addRole('yml', 'php');
$packagexml->addRole('css', 'php');
$packagexml->addGlobalReplacement('pear-config', '@PEAR-DIR@', 'php_dir');
$packagexml->addGlobalReplacement('pear-config', '@DATA-DIR@', 'data_dir');
$packagexml->addGlobalReplacement('pear-config', '@PHP-BIN@', 'bin_dir');
$packagexml->generateContents();
//$pkg = &$packagexml->exportCompatiblePackageFile1();
if (isset($_GET['make']) || isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make') {
    //    $pkg->writePackageFile();
    $packagexml->writePackageFile();
    //    $packagexml->debugPackageFile();
} else {
    //    $pkg->debugPackageFile();
    //    $packagexml->writePackageFile();
开发者ID:ryo88c,项目名称:Panda,代码行数:31,代码来源:make.php

示例2: buildSinglePackage

 public function buildSinglePackage()
 {
     $v = $this->getVersion();
     $apiversion = $v[0] . '.0.0';
     $opts = array('packagedirectory' => (string) $this->basedir . '/.subsplit/src/', 'filelistgenerator' => 'file', 'ignore' => array('*composer.json'), 'baseinstalldir' => '/', 'packagefile' => 'package.xml');
     $pfm = new PEAR_PackageFileManager2();
     $e = $pfm->setOptions($opts);
     $pfm->addRole('md', 'doc');
     $pfm->setPackage('Guzzle');
     $pfm->setSummary("Object-oriented PHP HTTP Client for PHP 5.3+");
     $pfm->setDescription($this->guzzleinfo['description']);
     $pfm->setPackageType('php');
     $pfm->setChannel('guzzlephp.org/pear');
     $pfm->setAPIVersion($apiversion);
     $pfm->setReleaseVersion($this->getVersion());
     $pfm->setAPIStability('stable');
     $pfm->setReleaseStability('stable');
     $pfm->setNotes($this->changelog_notes);
     $pfm->setPackageType('php');
     $pfm->setLicense('MIT', 'http://github.com/guzzle/guzzle/blob/master/LICENSE');
     $pfm->addMaintainer('lead', 'mtdowling', 'Michael Dowling', 'mtdowling@gmail.com', 'yes');
     $pfm->setDate($this->changelog_release_date);
     $pfm->generateContents();
     $phpdep = $this->guzzleinfo['require']['php'];
     $phpdep = str_replace('>=', '', $phpdep);
     $pfm->setPhpDep($phpdep);
     $pfm->addExtensionDep('required', 'curl');
     $pfm->setPearinstallerDep('1.4.6');
     $pfm->addPackageDepWithChannel('required', 'EventDispatcher', 'pear.symfony.com', '2.1.0');
     if (!empty($this->subpackages)) {
         foreach ($this->subpackages as $package) {
             $pkg = dirname($package);
             $pkg = str_replace('/', '_', $pkg);
             $pfm->addConflictingPackageDepWithChannel($pkg, 'guzzlephp.org/pear', false, $apiversion);
         }
     }
     ob_start();
     $startdir = getcwd();
     chdir((string) $this->basedir . '/build/pearwork');
     echo "DEBUGGING GENERATED PACKAGE FILE\n";
     $result = $pfm->debugPackageFile();
     if ($result) {
         $out = $pfm->writePackageFile();
         echo "\n\n\nWRITE PACKAGE FILE RESULT:\n";
         var_dump($out);
         // load up package file and build package
         $packager = new PEAR_Packager();
         echo "\n\n\nBUILDING PACKAGE FROM PACKAGE FILE:\n";
         $dest_package = $packager->package($opts['packagedirectory'] . 'package.xml');
         var_dump($dest_package);
     } else {
         echo "\n\n\nDEBUGGING RESULT:\n";
         var_dump($result);
     }
     echo "removing package.xml";
     unlink($opts['packagedirectory'] . 'package.xml');
     $log = ob_get_clean();
     file_put_contents((string) $this->basedir . '/build/artifacts/logs/pear_package.log', $log);
     chdir($startdir);
 }
开发者ID:Frinstio,项目名称:AlfredWorkflow.com,代码行数:60,代码来源:GuzzlePearPharPackageTask.php

示例3: array

}
$config = array('baseinstalldir' => 'Ethna', 'packagedirectory' => dirname(dirname(__FILE__)), 'filelistgenerator' => 'file', 'ignore' => array('CVS/', '.svn/', 'package.xml', 'ethna_make_package.php', 'ethna_make_package.sh', '*optional_package*'), 'changelogoldtonew' => false, 'exceptions' => array('README' => 'doc', 'LICENSE' => 'doc', 'CHANGES' => 'doc'), 'description' => $description, 'exceptions' => array('bin/ethna.sh' => 'script', 'bin/ethna.bat' => 'script'), 'installexceptions' => array('bin/ethna.sh' => '/', 'bin/ethna.bat' => '/'), 'installas' => array('bin/ethna.sh' => 'ethna', 'bin/ethna.bat' => 'ethna.bat'));
$ethna_channel = 'pear.ethna.jp';
$packagexml = new PEAR_PackageFileManager2();
$packagexml->setOptions($config);
$packagexml->setPackage($package);
$packagexml->setSummary('Ethna PHP Framework Package');
$packagexml->setDescription($description);
$packagexml->setChannel($ethna_channel);
$packagexml->setAPIVersion($version);
$packagexml->setReleaseVersion($version);
$packagexml->setReleaseStability($state);
$packagexml->setAPIStability($state);
$packagexml->setNotes('Ethna PHP Web Application Framework');
$packagexml->setPackageType('php');
$packagexml->addRole('*', 'php');
$packagexml->setPhpDep('5.2.0');
$packagexml->setPearinstallerDep('1.3.5');
$packagexml->addPackageDepWithChannel('optional', 'DB', 'pear.php.net');
$packagexml->addPackageDepWithChannel('optional', 'Smarty', $ethna_channel);
$packagexml->addPackageDepWithChannel('optional', 'simpletest', $ethna_channel);
$packagexml->addMaintainer('lead', 'sotarok', 'Sotaro Karasawa', 'sotaro.k@gmail.com');
$packagexml->setLicense('The BSD License', 'http://www.opensource.org/licenses/bsd-license.php');
$packagexml->addReplacement('bin/ethna.bat', 'pear-config', '@PEAR-DIR@', 'php_dir');
$packagexml->addReplacement('bin/ethna.bat', 'pear-config', '@PHP-BIN@', 'bin_dir');
$packagexml->addReplacement('bin/ethna.sh', 'pear-config', '@PHP-BINARY@', 'php_bin');
$packagexml->addReplacement('bin/ethna.sh', 'pear-config', '@PEAR-DIR@', 'php_dir');
$packagexml->addReplacement('bin/ethna.sh', 'pear-config', '@PHP-BIN@', 'bin_dir');
$packagexml->addRelease();
$packagexml->setOSInstallCondition('windows');
$packagexml->addInstallAs('bin/ethna.bat', 'ethna.bat');
开发者ID:riaf,项目名称:pastit,代码行数:31,代码来源:ethna_make_package.php

示例4: die

    die(__LINE__ . "\n");
}
$package->setPackage($name);
$package->setSummary($summary);
$package->setDescription($description);
$package->setChannel($channel);
$package->setAPIVersion($apiVersion);
$package->setReleaseVersion($version);
$package->setReleaseStability('stable');
$package->setAPIStability($apiStability);
$package->setNotes($notes);
$package->setPackageType('php');
// this is a PEAR-style php script package
$package->setLicense('GPL', 'http://www.gnu.org/copyleft/gpl.txt');
foreach ($roles as $r) {
    $package->addRole($r['role'], $r['type']);
}
foreach ($maintainer as $m) {
    $package->addMaintainer($m['role'], $m['handle'], $m['name'], $m['email'], $m['active']);
}
foreach ($dependency as $d) {
    $package->addPackageDepWithChannel($d['type'], $d['package'], $d['channel'], $d['version']);
}
$package->setPhpDep($require['php']);
$package->setPearinstallerDep($require['pear_installer']);
$package->generateContents();
$result = $package->writePackageFile();
if (PEAR::isError($result)) {
    echo $result->getMessage();
    die;
}
开发者ID:ookwudili,项目名称:chisimba,代码行数:31,代码来源:pearpacker.php

示例5: array

$notes = APP_NAME;
$version = APP_VERSION;
$config = array('filelistgenerator' => 'file', 'packagedirectory' => dirname(dirname(dirname(__FILE__))) . '/', 'baseinstalldir' => APP_ID, 'ignore' => array('CVS/', 'package.xml', '.svn/', '.htaccess', 'beardev/', '.DS_Store', 'error.log', 'page.log'), 'changelogoldtonew' => false, 'description' => APP_DESCRIPTION, 'dir_roles' => array('data' => 'data'), 'roles' => array('php' => 'data', 'tpl' => 'data', 'txt' => 'data'));
$packagexml = new PEAR_PackageFileManager2();
$packagexml->setOptions($config);
$packagexml->setPackage(APP_PACKAGE_NAME);
$packagexml->setSummary($notes);
$packagexml->setDescription(APP_DESCRIPTION);
$packagexml->setAPIVersion($version);
$packagexml->setReleaseVersion($version);
$packagexml->setReleaseStability(APP_RELEASE_STATUS);
$packagexml->setAPIStability(APP_RELEASE_STATUS);
$packagexml->setNotes($notes);
$packagexml->setLicense('The BSD License', 'http://www.opensource.org/licenses/bsd-license.php');
$packagexml->setPackageType('php');
$packagexml->addRole('*', 'data');
$packagexml->setPhpDep('5.2.0');
$packagexml->setPearinstallerDep('1.4.0');
// Maintainer
$packagexml->addMaintainer('lead', DEVELOPER_NAME_SHORT, DEVELOPER_NAME_LONG, DEVELOPER_NAME_EMAIL);
$packagexml->addRelease();
// dependency
// dependency
$packagexml->addPackageDepWithChannel('required', 'BEAR', 'pear.bear-project.net', '0.2.0');
//$packagexml->addPackageDepWithChannel('required', 'Spreadsheet_Excel_Writer', 'pear.php.net', '0.9.0');
/**
 * user if no arg
 */
if (!isset($_SERVER['argv'][1])) {
    print "Usage: php{$_SERVER['argv'][0]} package_uri uri|channel [make]\n";
    print "ex)\n1) php {$_SERVER['argv'][0]} pear.example.co.jp channel \n";
开发者ID:ryo88c,项目名称:BEAR.Saturday,代码行数:31,代码来源:make_package.php

示例6:

// Require custom file role for our web installation
$pkg->addPackageDepWithChannel('required', 'Role_Web', 'pearified.com');
// Geeklog Required Packages.  In a 'typcial' for non-core plugins this wouldn't happen and
// instead the plugins would require a specific version of Geeklog.  In fact, for non-core
// plugins (e.g. Forum, File Manager, etc) that's exactly what should happen
$pkg->addPackageDepWithChannel('required', 'Geeklog_FCKeditor', 'pear.geeklog.net', '2.3.1');
$pkg->addPackageDepWithChannel('required', 'Geeklog_Layout_Professional', 'pear.geeklog.net', $currentGeeklogVersion);
$pkg->addPackageDepWithChannel('required', 'Geeklog_Plugin_Calendar', 'pear.geeklog.net', '1.0.2');
$pkg->addPackageDepWithChannel('required', 'Geeklog_Plugin_Links', 'pear.geeklog.net', '1.1.1');
$pkg->addPackageDepWithChannel('required', 'Geeklog_Plugin_Polls', 'pear.geeklog.net', '2.0.1');
$pkg->addPackageDepWithChannel('required', 'Geeklog_Plugin_Spamx', 'pear.geeklog.net', '1.1.1');
$pkg->addPackageDepWithChannel('required', 'Geeklog_Plugin_Staticpages', 'pear.geeklog.net', '1.4.4');
// Define that we will use our custom file role in this script
$pkg->addUsesRole('web', 'Webfiles');
// Mapping misc roles to file name extensions
$pkg->addRole('', 'web');
$pkg->addRole('png', 'web');
$pkg->addRole('gif', 'web');
$pkg->addRole('jpeg', 'web');
// Create the current release and add it to the package definition
$pkg->addRelease();
// Package release needs a maintainer
$pkg->addMaintainer('lead', 'tony', 'Tony Bibbs', 'tony@tonybibbs.com');
// Internally generate the XML for our package.xml (does not perform output!)
$test = $pkg->generateContents();
// If called without "make" parameter, we just want to debug the generated package.xml file and
// want to receive additional information on error.
if (isset($argv[1]) and $argv[1] === 'make') {
    $pkg->writePackageFile();
} else {
    $pkg->debugPackageFile();
开发者ID:Geeklog-Core,项目名称:geeklog,代码行数:31,代码来源:buildpackage.php

示例7: array

 /**
  * @access private
  */
 function &_makePackage($setting, $workdir)
 {
     // package.xml を作る
     $pkgconfig = array('packagedirectory' => $workdir, 'outputdirectory' => $workdir, 'ignore' => array('CVS/', '.cvsignore', '.svn/', 'package.xml', '*.ini', $setting['pkgname'] . '-*.tgz'), 'filelistgenerator' => 'file', 'changelogoldtonew' => false);
     $packagexml = new PEAR_PackageFileManager2();
     $pkgconfig = array_merge($pkgconfig, $setting['config']);
     $packagexml->setOptions($pkgconfig);
     $packagexml->setPackage($setting['pkgname']);
     $packagexml->setSummary($setting['summary']);
     $packagexml->setNotes($setting['notes']);
     $packagexml->setDescription($setting['description']);
     $packagexml->setChannel($setting['channel']);
     $packagexml->setAPIVersion($setting['version']);
     $packagexml->setReleaseVersion($setting['version']);
     $packagexml->setReleaseStability($setting['state']);
     $packagexml->setAPIStability($setting['state']);
     $packagexml->setPackageType('php');
     foreach ($setting['maintainers'] as $m) {
         $packagexml->addMaintainer($m['role'], $m['user'], $m['name'], $m['email'], $m['active']);
     }
     $packagexml->setLicense($setting['license']['name'], $setting['license']['uri']);
     $packagexml->addRole('css', 'php');
     $packagexml->addRole('tpl', 'php');
     $packagexml->addRole('ethna', 'php');
     $packagexml->addRole('sh', 'script');
     $packagexml->addRole('bat', 'script');
     $packagexml->setPhpDep('4.3.0');
     $packagexml->setPearinstallerDep('1.3.5');
     $packagexml->generateContents();
     foreach ($setting['callback'] as $method => $params) {
         $r = call_user_func_array(array(&$packagexml, $method), $params);
     }
     $r = $packagexml->writePackageFile();
     if (PEAR::isError($r)) {
         return Ethna::raiseError($r->getMessage, $r->getCode());
     }
     //  finally make package
     PEAR_Command::setFrontendType('CLI');
     $ui = PEAR_Command::getFrontendObject();
     $config = PEAR_Config::singleton();
     $ui->setConfig($config);
     PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(&$ui, 'displayFatalError'));
     $cmd = PEAR_Command::factory('package', $config);
     if (PEAR::isError($cmd)) {
         return Ethna::raiseError($cmd->getMessage, $cmd->getCode());
     }
     $r = $cmd->run('package', array(), array("{$workdir}/package.xml"));
     if (PEAR::isError($r)) {
         return Ethna::raiseError($r->getMessage, $r->getCode());
     }
 }
开发者ID:riaf,项目名称:pastit,代码行数:54,代码来源:MakePluginPackage.php

示例8: array

    exit;
}
$config = array('baseinstalldir' => 'Ethna', 'packagedirectory' => dirname(dirname(__FILE__)), 'filelistgenerator' => 'file', 'ignore' => array('CVS/', 'package.xml', 'ethna_make_package.php', 'ethna_make_package.sh'), 'changelogoldtonew' => false, 'exceptions' => array('README' => 'doc', 'LICENSE' => 'doc', 'CHANGES' => 'doc'), 'description' => $description, 'installexceptions' => array('bin/ethna.sh' => '/', 'bin/ethna.bat' => '/'), 'installas' => array('bin/ethna.sh' => 'ethna', 'bin/ethna.bat' => 'ethna.bat'));
$packagexml = new PEAR_PackageFileManager2();
$packagexml->setOptions($config);
$packagexml->setPackage($package);
$packagexml->setSummary('Ethna PHP Framework Package');
$packagexml->setDescription($description);
$packagexml->setChannel('pear.ethna.jp');
$packagexml->setAPIVersion($version);
$packagexml->setReleaseVersion($version);
$packagexml->setReleaseStability($state);
$packagexml->setAPIStability($state);
$packagexml->setNotes('Ethna PHP Web Application Framework');
$packagexml->setPackageType('php');
$packagexml->addRole('css', 'php');
$packagexml->addRole('tpl', 'php');
$packagexml->addRole('ethna', 'php');
$packagexml->addRole('sh', 'script');
$packagexml->addRole('bat', 'script');
$packagexml->setPhpDep('4.1.0');
$packagexml->setPearinstallerDep('1.3.5');
$packagexml->addMaintainer('lead', 'fujimoto', 'Masaki Fujimoto', 'fujimoto@php.net');
$packagexml->addMaintainer('lead', 'halt', 'halt feits', 'halt.hde@gmail.com');
$packagexml->addMaintainer('lead', 'cocoitiban', 'Keita Arai', 'cocoiti@comio.info');
$packagexml->setLicense('The BSD License', 'http://www.opensource.org/licenses/bsd-license.php');
$packagexml->addReplacement('bin/ethna.bat', 'pear-config', '@PEAR-DIR@', 'php_dir');
$packagexml->addReplacement('bin/ethna.bat', 'pear-config', '@PHP-BIN@', 'bin_dir');
$packagexml->addReplacement('bin/ethna.sh', 'pear-config', '@PEAR-DIR@', 'php_dir');
$packagexml->addReplacement('bin/ethna.sh', 'pear-config', '@PHP-BIN@', 'bin_dir');
$packagexml->addRelease();
开发者ID:BackupTheBerlios,项目名称:delphinus-svn,代码行数:31,代码来源:ethna_make_package.php

示例9: array

$varsion = '1.0.0';
$config = array('baseinstalldir' => 'Ethna/Haste', 'packagedirectory' => dirname(dirname(__FILE__)), 'filelistgenerator' => 'file', 'ignore' => array('CVS/', 'make_package.php', 'package.xml', 'make_doc.php'), 'changelogoldtonew' => false, 'description' => $description, 'simpleoutput' => true);
print "Start Script\n";
$packagexml = new PEAR_PackageFileManager2();
$packagexml->setOptions($config);
$packagexml->setPackage('Ethna_Haste');
$packagexml->setSummary('Haste - Ethna support Pack');
$packagexml->setDescription($description);
$packagexml->setLicense('BSD', 'http://www.opensource.org/licenses/bsd-license.php');
$packagexml->setReleaseVersion($varsion);
$packagexml->setAPIVersion($varsion);
$packagexml->setReleaseStability('alpha');
$packagexml->setAPIStability('alpha');
$packagexml->setNotes('Haste');
$packagexml->setPackageType('php');
$packagexml->addRole('tpl', 'php');
$packagexml->addMaintainer('lead', 'halt', 'halt feits', 'halt.hde@gmail.com');
$packagexml->setPhpDep('4.1.0');
$packagexml->setPearinstallerDep('1.3.5');
$packagexml->setPackageType('php');
//$packagexml->setChannel('channel.php.gr.jp');
$packagexml->setChannel('pear.php.net');
$packagexml->generateContents();
// note use of debugPackageFile() - this is VERY important
if (isset($_GET['make']) || $_SERVER['argv'][1] == 'make') {
    debug_print("writePackageFile\n");
    $result = $packagexml->writePackageFile();
} else {
    $result = $packagexml->debugPackageFile();
    debug_print("debugPackageFile\n");
}
开发者ID:BackupTheBerlios,项目名称:haste-svn,代码行数:31,代码来源:make_package.php


注:本文中的PEAR_PackageFileManager2::addRole方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。