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


PHP Phar::apiVersion方法代码示例

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


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

示例1: error

        $compress = Phar::BZ2;
        $compress_type = 'bz2';
        break;
    default:
        $compress = Phar::NONE;
        $compress_type = 'none';
        break;
}
if (!empty($base_dir) && !is_dir($base_dir)) {
    error("Dir not Exists!");
}
try {
    $p = new Phar($path, $flags, $alias);
    $p->startBuffering();
    $p->compress($compress);
    info("API Version: " . Phar::apiVersion());
    info("File: {$path}");
    info("Alias: {$alias}");
    info("Compress: {$compress_type}");
    if (!empty($base_dir)) {
        info("Build From: {$base_dir}");
        if ($regex) {
            info("Filter: {$regex}");
        }
        $p->buildFromDirectory($base_dir, $regex);
    }
    if (!empty($files)) {
        foreach (explode(',', $files) as $file) {
            info("Add File: {$file}");
            $p->addFile($file, basename($file));
        }
开发者ID:chchmlml,项目名称:ceshi,代码行数:31,代码来源:phar.php

示例2: die

if (!class_exists("Phar") && !extension_loaded("Phar")) {
    die("Extension phar not present");
}
error_reporting(E_ALL & ~E_DEPRECATED);
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$options = array('filelistgenerator' => 'CVS', 'changelogoldtonew' => false, 'simpleoutput' => true, 'baseinstalldir' => '/', 'packagedirectory' => dirname(__FILE__), 'packagefile' => 'package.xml', 'clearcontents' => true, 'ignore' => array('package*.php', 'package*.xml'), 'dir_roles' => array('docs' => 'doc', 'examples' => 'doc', 'tests' => 'test', 'phar' => 'src'), 'exceptions' => array('CREDITS' => 'doc', 'EXPERIMENTAL' => 'doc', 'LICENSE' => 'doc', 'Makefile.frag' => 'src', 'phar_path_check.re' => 'src', 'TODO' => 'doc', 'phar.phar' => 'script'));
$package = PEAR_PackageFileManager2::importOptions(dirname(__FILE__) . '/package.xml', $options);
$package->clearDeps();
$package->setPhpDep('5.2.1');
$package->setPearInstallerDep('1.4.3');
$package->addPackageDepWithChannel('optional', 'bz2', 'pecl.php.net', false, false, false, false, 'bz2');
// all this false business sets the <providesextension> tag that allows us to have hash built
// in statically
$package->addPackageDepWithChannel('optional', 'hash', 'pecl.php.net', false, false, false, false, 'hash');
$package->addExtensionDep('optional', 'spl');
$package->addExtensionDep('optional', 'zlib');
$package->setPackageType('extsrc');
$package->addRelease();
$package->setReleaseVersion(phpversion('phar'));
$package->setAPIVersion(Phar::apiVersion());
$package->setReleaseStability('beta');
$package->setAPIStability('beta');
$package->setNotes("\n{$notes}\n");
//$package->addGlobalReplacement('package-info', '@package_version@', 'version');
$package->generateContents();
if (isset($_GET['make']) || isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make') {
    $package->writePackageFile();
} else {
    $package->debugPackageFile();
}
开发者ID:browniebraun,项目名称:php-src,代码行数:31,代码来源:package.php

示例3: var_dump

<?php

var_dump(Phar::apiVersion());
?>
===DONE===
开发者ID:badlamer,项目名称:hhvm,代码行数:5,代码来源:001.php


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