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


PHP Phar::mapPhar方法代码示例

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


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

示例1:

<?php

/**
 * Core
 * Platform for rapid application development.
 *
 * @package core
 * @author stefano.azzolini@caffeina.com
 * @copyright Caffeina srl - 2015-2016 - http://caffeina.com
 */
Phar::mapPhar(__FILE__);
require 'phar://' . __FILE__ . '/classes/Loader.php';
__halt_compiler();?>
开发者ID:caffeina-core,项目名称:core,代码行数:13,代码来源:stub.php

示例2: fwrite

#!/usr/bin/env php
<?php 
/*
 * This file is part of the PHP CS utility.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */
if (defined('HHVM_VERSION_ID')) {
    if (HHVM_VERSION_ID < 30500) {
        fwrite(STDERR, "HHVM needs to be a minimum version of HHVM 3.5.0\n");
        exit(1);
    }
} elseif (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50306) {
    fwrite(STDERR, "PHP needs to be a minimum version of PHP 5.3.6\n");
    exit(1);
}
set_error_handler(function ($severity, $message, $file, $line) {
    if ($severity & error_reporting()) {
        throw new ErrorException($message, 0, $severity, $file, $line);
    }
});
Phar::mapPhar('php-cs-fixer-checker.phar');
require_once 'phar://php-cs-fixer-checker.phar/vendor/autoload.php';
use Boekkooi\CS\Console\Application;
$application = new Application();
$application->run();
__halt_compiler();
开发者ID:boekkooi,项目名称:PHP-CS-Checker,代码行数:30,代码来源:phar-stub.php

示例3: define

<?php

require_once 'vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php';
if (!defined('MOJIO_FILE_PREFIX')) {
    define('MOJIO_FILE_PREFIX', 'phar://mojio.phar');
}
Phar::mapPhar('mojio.phar');
$classLoader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$classLoader->registerNamespaces(array('Mojio' => MOJIO_FILE_PREFIX . '/src', 'Guzzle' => MOJIO_FILE_PREFIX . '/vendor/guzzle/guzzle/src', 'Symfony\\Component\\EventDispatcher' => MOJIO_FILE_PREFIX . '/vendor/symfony/event-dispatcher', 'Doctrine' => MOJIO_FILE_PREFIX . '/vendor/doctrine/common/lib', 'Monolog' => MOJIO_FILE_PREFIX . '/vendor/monolog/monolog/src'));
$classLoader->register();
__halt_compiler();
开发者ID:i3-hackathon,项目名称:bmw-php-sdk,代码行数:11,代码来源:phar-stub.php

示例4:

<?php

Phar::mapPhar('hash.phar');
require 'phar://hash.phar/Autoload.php';
__halt_compiler();

?>
开发者ID:spriebsch,项目名称:Hash,代码行数:7,代码来源:PharStub.php

示例5: ini_set

#!/usr/bin/env php
<?php 
ini_set('memory_limit', '-1');
Phar::mapPhar("git-deploy");
/**
 * PSR-4 autoloader.
 *      
 * @param string $class The fully-qualified class name.
 * @return void
 */
spl_autoload_register(function ($class) {
    // project-specific namespace prefix
    $prefix = 'Brunodebarros\\Gitdeploy\\';
    // base directory for the namespace prefix
    $base_dir = 'phar://git-deploy/src/';
    // does the class use the namespace prefix?
    $len = strlen($prefix);
    if (strncmp($prefix, $class, $len) !== 0) {
        // no, move to the next registered autoloader
        return;
    }
    // get the relative class name
    $relative_class = substr($class, $len);
    // replace the namespace prefix with the base directory, replace namespace
    // separators with directory separators in the relative class name, append
    // with .php
    $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
    // if the file exists, require it
    if (file_exists($file)) {
        require $file;
    }
开发者ID:Tornskaden,项目名称:git-deploy-php,代码行数:31,代码来源:index.php

示例6: fwrite

#!/usr/bin/env php

<?php 
if (defined('HHVM_VERSION_ID')) {
    if (HHVM_VERSION_ID < 30600) {
        fwrite(STDERR, "HHVM needs to be a minimum version of HHVM 3.6.0\n");
        exit(1);
    }
} elseif (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50600) {
    fwrite(STDERR, "PHP needs to be a minimum version of PHP 5.6.0\n");
    exit(1);
}
set_error_handler(function ($severity, $message, $file, $line) {
    if ($severity & error_reporting()) {
        throw new ErrorException($message, 0, $severity, $file, $line);
    }
});
Phar::mapPhar('phpstd.phar');
require_once 'phar://phpstd.phar/vendor/autoload.php';
use SellerLabs\Standards\Console\Application;
$app = new Application();
$app->run();
__halt_compiler();
开发者ID:sellerlabs,项目名称:php-standard,代码行数:23,代码来源:phar.php

示例7:

<?php

Phar::mapPhar('/var/lib/jenkins/jobs/t41/workspace/tests/rapports/myproject.phar');
spl_autoload_register(function ($className) {
    $libPath = 'phar://T41.phar/lib/';
    $classFile = str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php';
    $classPath = $libPath . $classFile;
    if (file_exists($classPath)) {
        require $classPath;
    }
});
__halt_compiler();

?>
开发者ID:crapougnax,项目名称:t41,代码行数:14,代码来源:stub.php

示例8: putenv

#!/usr/bin/env php
<?php 
$appName = 'phpCompatInfo';
Phar::mapPhar(strtolower($appName) . '.phar');
if (!getenv("BARTLETTRC")) {
    putenv("BARTLETTRC=" . strtolower($appName) . '.json');
}
/**
 * Ability to use global composer packages installed, then include_path,
 * for optional dependencies not provided by the phar distribution (e.g: pear/Net_Growl)
 */
$home = getenv('COMPOSER_HOME');
if (!$home) {
    if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
        if (getenv('APPDATA')) {
            $home = strtr(getenv('APPDATA'), '\\', '/') . '/Composer';
        }
    } else {
        if (getenv('HOME')) {
            $home = rtrim(getenv('HOME'), '/') . '/.composer';
        }
    }
}
if ($home) {
    $fallbackNetGrowlDir = $home . '/vendor/pear-pear.php.net/Net_Growl';
    $fallbackClassMap = function ($classMap, $classPrefix) {
        array_walk($classMap, function (&$value, $key, $userData) {
            if (strpos($key, $userData) !== false) {
                // will remove this entry in class map
                $value = null;
            }
开发者ID:bjork,项目名称:php-compat-info,代码行数:31,代码来源:phar-stub.php

示例9:

#!/usr/bin/env php
<?php 
/*
 * This file is part of Composer.
 *
 * (c) Nils Adermann <naderman@naderman.de>
 *     Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view
 * the license that is located at the bottom of this file.
 */
Phar::mapPhar('composer.phar');
define('COMPOSER_DEV_WARNING_TIME', 1380296886);
require 'phar://composer.phar/bin/composer';
__halt_compiler(); ?>
8b1
composer.pharsrc/bootstrap.php��R���2��src/Composer/IO/ConsoleIO.php�R�a�q�src/Composer/IO/NullIO.php%�R%~`��src/Composer/IO/IOInterface.php��R�A&�˶src/Composer/IO/BaseIO.php��R�k+�]�src/Composer/IO/BufferIO.php+�R+]�)src/Composer/Command/RunScriptCommand.phpk�Rk �߶(src/Composer/Command/DiagnoseCommand.php'�R'ģ
��'src/Composer/Command/ArchiveCommand.php{�R{oқ|� src/Composer/Command/Command.php��R��L�v�-src/Composer/Command/CreateProjectCommand.phph,�Rh,W�ʶ%src/Composer/Command/AboutCommand.php��R��M�*�$src/Composer/Command/ShowCommand.php+�R+%�5�&src/Composer/Command/UpdateCommand.php��R�3��&src/Composer/Command/ConfigCommand.php�'�R�'5Xq�'src/Composer/Command/InstallCommand.php��R�����(src/Composer/Command/ValidateCommand.phpG�RG�;r�'src/Composer/Command/DependsCommand.phpo	�Ro	T�.r�&src/Composer/Command/SearchCommand.php]�R]�7�2�*src/Composer/Command/SelfUpdateCommand.phpt	�Rt	�K�
�(src/Composer/Command/LicensesCommand.php�	�R�	��nz�'src/Composer/Command/RequireCommand.php�R�U�$�,src/Composer/Command/DumpAutoloadCommand.phpy�RyR-=Ҷ&src/Composer/Command/GlobalCommand.php��R�����,src/Composer/Command/Helper/DialogHelper.php��R����&�&src/Composer/Command/StatusCommand.php��R�w�tR�$src/Composer/Command/InitCommand.php;1�R;1��T��)src/Composer/Downloader/VcsDownloader.phpM�RM-E&ʶ*src/Composer/Downloader/FileDownloader.php��R�?�[�)src/Composer/Downloader/SvnDownloader.phpx
�Rx
�N[�0src/Composer/Downloader/PearPackageExtractor.phpe�ReסP��+src/Composer/Downloader/DownloadManager.php��R���Ŷ/src/Composer/Downloader/DownloaderInterface.php��R�gs!l�.src/Composer/Downloader/TransportException.php��R��8͊�*src/Composer/Downloader/PharDownloader.php��R����)src/Composer/Downloader/TarDownloader.php��R�͒X?�(src/Composer/Downloader/HgDownloader.php$�R$�c��1src/Composer/Downloader/ChangeReportInterface.php��R��ਿ�-src/Composer/Downloader/ArchiveDownloader.php��R���|��/src/Composer/Downloader/FilesystemException.php�R]T���)src/Composer/Downloader/ZipDownloader.php"
�R"
���3�)src/Composer/Downloader/GitDownloader.php�2�R�2Ӿ��6src/Composer/Repository/InvalidRepositoryException.phpn�Rn��똶+src/Composer/Repository/ArrayRepository.php�Rk�b�0src/Composer/Repository/FilesystemRepository.php��R��Y�z�7src/Composer/Repository/WritableRepositoryInterface.php��R��/s�*src/Composer/Repository/PearRepository.php�Rb�E��-src/Composer/Repository/RepositoryManager.php��R�r�_��3src/Composer/Repository/WritableArrayRepository.php�R�G*�,src/Composer/Repository/Vcs/GitHubDriver.phpf"�Rf"�7�8�2src/Composer/Repository/Vcs/GitBitbucketDriver.php��R���DѶ)src/Composer/Repository/Vcs/GitDriver.php��R�b��¶)src/Composer/Repository/Vcs/SvnDriver.php�R�@��2src/Composer/Repository/Vcs/VcsDriverInterface.phpC�RC�F���(src/Composer/Repository/Vcs/HgDriver.php��R�M�A�)src/Composer/Repository/Vcs/VcsDriver.php��R��xK:�1src/Composer/Repository/Vcs/HgBitbucketDriver.php�
�R�
1�Ӷ4src/Composer/Repository/InstalledArrayRepository.php��R�/�~>�7src/Composer/Repository/RepositorySecurityException.phpo�Ropի��9src/Composer/Repository/StreamableRepositoryInterface.php��R�8���)src/Composer/Repository/VcsRepository.php��R��/ʖ�.src/Composer/Repository/PlatformRepository.php�R��|�9src/Composer/Repository/InstalledFilesystemRepository.php��R�V
�_�/src/Composer/Repository/CompositeRepository.php	�R	4�E�8src/Composer/Repository/InstalledRepositoryInterface.php��R��9p�.src/Composer/Repository/ComposerRepository.php8�R8�<�/src/Composer/Repository/Pear/DependencyInfo.phpq�Rqf�T�8src/Composer/Repository/Pear/PackageDependencyParser.php!�R!=��F�,src/Composer/Repository/Pear/ChannelInfo.php��R�:T*ɶ.src/Composer/Repository/Pear/ChannelReader.phpn�Rn�8�,src/Composer/Repository/Pear/PackageInfo.php��R��
��5src/Composer/Repository/Pear/DependencyConstraint.phpq�Rq9=�4src/Composer/Repository/Pear/ChannelRest11Reader.php&	�R&	�Ub�,src/Composer/Repository/Pear/ReleaseInfo.php��R�o��ö2src/Composer/Repository/Pear/BaseChannelReader.php6�R6.fi!�4src/Composer/Repository/Pear/ChannelRest10Reader.php�	�R�	O��/src/Composer/Repository/RepositoryInterface.php��R��ɶ.src/Composer/Repository/ArtifactRepository.phpF�RF�8��-src/Composer/Repository/PackageRepository.phpG�RG�:k�(src/Composer/Package/CompletePackage.php��R�8Gl]�+src/Composer/Package/Dumper/ArrayDumper.phpe
�Re
�����7src/Composer/Package/Loader/InvalidPackageException.phpE�RExb��*src/Composer/Package/Loader/JsonLoader.php��R�!~�{�/src/Composer/Package/Loader/LoaderInterface.php��R��}�ζ+src/Composer/Package/Loader/ArrayLoader.php��R���0�5src/Composer/Package/Loader/ValidatingArrayLoader.php0)�R0)�_�Ӷ1src/Composer/Package/Loader/RootPackageLoader.php~�R~�#�src/Composer/Package/Locker.php��R��ӬJ�)src/Composer/Package/PackageInterface.phpg�Rg`�XĶ$src/Composer/Package/BasePackage.php[
�R[
$�Ҷ.src/Composer/Package/Version/VersionParser.php�$�R�$8I��1src/Composer/Package/CompletePackageInterface.php��R���2��-src/Composer/Package/RootPackageInterface.php��R��qKж$src/Composer/Package/RootPackage.phpn�Rn�ACO�3src/Composer/Package/Archiver/ArchiverInterface.php��R�<ʸ�7src/Composer/Package/Archiver/ComposerExcludeFilter.php�R�SZ0�.src/Composer/Package/Archiver/PharArchiver.php[�R[�5���3src/Composer/Package/Archiver/BaseExcludeFilter.php��R���#&�2src/Composer/Package/Archiver/GitExcludeFilter.phpw�RwLgU��7src/Composer/Package/Archiver/ArchivableFilesFinder.phpe�ReT�z�0src/Composer/Package/Archiver/ArchiveManager.php
开发者ID:afaltz,项目名称:hhvm,代码行数:31,代码来源:composer.php

示例10: switch

 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 * The views and conclusions contained in the software and documentation are
 * those of the authors and should not be interpreted as representing official
 * policies, either expressed or implied, of the copyright holder.
 *
 * @copyright Copyright 2012 Bas de Nooijer <solarium@raspberry.nl>
 * @license http://github.com/basdenooijer/solarium/raw/master/COPYING
 * @link http://www.solarium-project.org/
 */
Phar::mapPhar("solarium.phar");
require_once 'phar://solarium.phar/Autoloader.php';
Solarium_Autoloader::register();
if ('cli' === php_sapi_name() && basename(__FILE__) === basename($_SERVER['argv'][0]) && isset($_SERVER['argv'][1])) {
    switch ($_SERVER['argv'][1]) {
        case 'version':
            echo "Solarium version " . Solarium_Version::VERSION . "\n";
            break;
        default:
            echo "Unknown command '" . $_SERVER['argv'][1] . "' (Supported commands: version)\n";
    }
    exit(0);
}
__halt_compiler();
?>
开发者ID:lhess,项目名称:solarium,代码行数:30,代码来源:stub.php

示例11:

<?php

/**
 * Stub.
 *
 * @since 150424 Initial release.
 */
namespace WebSharks\CliTools;

\Phar::mapPhar('websharks-cli-tools.phar');
require_once 'phar://websharks-cli-tools.phar/src/includes/stub.php';
__halt_compiler();
开发者ID:websharks,项目名称:cli-tools,代码行数:12,代码来源:phar-stub.php

示例12: set_error_handler

#!/usr/bin/env php
<?php 
set_error_handler(function ($severity, $message, $file, $line) {
    if ($severity & error_reporting()) {
        throw new ErrorException($message, 0, $severity, $file, $line);
    }
});
Phar::mapPhar('jane.phar');
require_once 'phar://jane.phar/vendor/autoload.php';
$application = new \Joli\Jane\Application();
$application->run();
__halt_compiler();
开发者ID:stof,项目名称:jane,代码行数:12,代码来源:phar-stub.php

示例13: date_default_timezone_set

// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// Set up default timezone
date_default_timezone_set('GMT');
$newIncludePath = null;
// For non pear packaged versions use relative include path
if (strpos('@php_bin@', '@php_bin') === 0) {
    $newIncludePath = __DIR__ . DIRECTORY_SEPARATOR . 'library';
}
// When being executed inside a valid Phar archive use it instead
if (class_exists('Phar')) {
    try {
        Phar::mapPhar('protobuf.phar');
        $newIncludePath = 'phar://protobuf.phar';
    } catch (PharException $e) {
    }
}
// Modify the include path if needed
if (NULL !== $newIncludePath) {
    set_include_path($newIncludePath . PATH_SEPARATOR . get_include_path());
}
// Disable strict errors for the compiler
error_reporting(error_reporting() & ~E_STRICT);
// Setup autoloader
require_once 'vendor/autoload.php';
try {
    $application = new \DrSlump\Protobuf\Compiler\Cli(__FILE__);
    $status = $application->run();
开发者ID:sooncj,项目名称:Protobuf-PHP,代码行数:31,代码来源:protoc-gen-php.php

示例14:

<?php

Phar::mapPhar('deep.phar');
require 'phar://deep.phar/vendor/autoload.php';
__halt_compiler();
开发者ID:khaliqgant,项目名称:Deep,代码行数:5,代码来源:phar-stub.php

示例15: trigger_error

<?php

trigger_error('The neo4jphp PHAR archive is no longer supported and will be removed in the future. Use Composer to install the library.', E_USER_DEPRECATED);
Phar::mapPhar('neo4jphp.phar');
spl_autoload_register(function ($className) {
    if (strpos($className, 'Everyman\\Neo4j\\') !== 0) {
        return;
    }
    $libPath = 'phar://neo4jphp.phar/lib/';
    $classFile = str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php';
    $classPath = $libPath . $classFile;
    if (file_exists($classPath)) {
        require $classPath;
    }
});
if ('cli' === php_sapi_name() && basename(__FILE__) === basename($_SERVER['argv'][0])) {
    $command = empty($_SERVER['argv'][1]) ? '-help' : $_SERVER['argv'][1];
    $me = new Phar('neo4jphp.phar');
    $meta = $me->getMetaData();
    if ($command == '-help') {
        echo <<<HELP
Neo4jPHP version {$meta['version']}

{$_SERVER['argv'][0]} [-help|-license|-readme|-version|<host>] <port>
    -help            Display help text
    -license         Display software license
    -readme          Display README
    -version         Display version information
    <host> (<port>)  Test connection to Neo4j instance on host (port defaults to 7474)

HELP;
开发者ID:MobilityMaster,项目名称:neo4jphp,代码行数:31,代码来源:stub.php


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