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


PHP includeIfExists函数代码示例

本文整理汇总了PHP中includeIfExists函数的典型用法代码示例。如果您正苦于以下问题:PHP includeIfExists函数的具体用法?PHP includeIfExists怎么用?PHP includeIfExists使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: runBehatCommand

 /**
  * Run behat original command
  * 
  * @param array $args
  */
 private function runBehatCommand(array $args = array())
 {
     define('BEHAT_BIN_PATH', $this->getContainer()->getParameter('kernel.root_dir') . '/../bin/behat');
     function includeIfExists($file)
     {
         if (file_exists($file)) {
             return include $file;
         }
     }
     if (!($loader = includeIfExists($this->getContainer()->getParameter('kernel.root_dir') . '/../vendor/autoload.php')) && !($loader = includeIfExists($container->getParameter('kernel.root_dir') . '/../../../../autoload.php'))) {
         fwrite(STDERR, 'You must set up the project dependencies, run the following commands:' . PHP_EOL . 'curl -s http://getcomposer.org/installer | php' . PHP_EOL . 'php composer.phar install' . PHP_EOL);
         exit(1);
     }
     $factory = new ApplicationFactory();
     $factory->createApplication()->run(new ArrayInput($args));
 }
开发者ID:pigroupe,项目名称:SfynxBehatBundle,代码行数:21,代码来源:BehatCommand.php

示例2: includeIfExists

<?php

/*
 * This file is part of composer/statis.
 *
 * (c) Composer <https://github.com/composer>
 *
 * For the full copyright and license information, please view
 * the LICENSE file that was distributed with this source code.
 */
function includeIfExists($file)
{
    if (file_exists($file)) {
        return include $file;
    }
}
if (!($loader = includeIfExists(__DIR__ . '/../vendor/autoload.php')) && !($loader = includeIfExists(__DIR__ . '/../../../autoload.php'))) {
    print 'You must set up the project dependencies, run the following commands:' . PHP_EOL . 'curl -s http://getcomposer.org/installer | php' . PHP_EOL . 'php composer.phar install' . PHP_EOL;
    die(1);
}
return $loader;
开发者ID:ausger,项目名称:satis,代码行数:21,代码来源:bootstrap.php

示例3: includeIfExists

<?php

/**
 * This file is part of the "cosma/testing-bundle" project
 *
 * (c) Cosmin Voicu<cosmin.voicu@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * Date: 11/07/14
 * Time: 23:33
 */
function includeIfExists($file)
{
    if (file_exists($file)) {
        return include $file;
    }
}
if (!($loader = includeIfExists(__DIR__ . '/../vendor/autoload.php')) && !($loader = includeIfExists(__DIR__ . '/../../../../../autoload.php'))) {
    die('You must set up the project dependencies, run the following commands:' . PHP_EOL . 'curl -s http://getcomposer.org/installer | php' . PHP_EOL . 'php composer.phar install' . PHP_EOL);
}
includeIfExists(__DIR__ . '/Entities.php');
$loader->add('Cosma\\Bundle\\TestingBundle\\', __DIR__);
开发者ID:stevepop,项目名称:testing-bundle,代码行数:24,代码来源:bootstrap.php

示例4: includeIfExists

<?php

/**
 * Inclur file php if exists
 * @param $file
 * @return bool|mixed
 */
function includeIfExists($file)
{
    return file_exists($file) ? include $file : false;
}
// Try loading the file vendor/autoload.php
$loader = includeIfExists(__DIR__ . '/../vendor/autoload.php');
if ($loader !== false) {
    return $loader;
}
// Try loading the file autoload.php
$loader = includeIfExists(__DIR__ . '/../../vendor/autoload.php');
if ($loader !== false) {
    return $loader;
}
// Shor message
echo 'You must set up the project dependencies, run the following commands:' . PHP_EOL . 'php consolle.phar install' . PHP_EOL;
exit(1);
开发者ID:consolle,项目名称:consolle,代码行数:24,代码来源:autoload.php

示例5: error_reporting

<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);
function includeIfExists($file)
{
    return file_exists($file) ? include $file : false;
}
if (!includeIfExists(__DIR__ . '/../vendor/autoload.php')) {
    echo 'You must set up the project dependencies, run the following commands:' . PHP_EOL . 'curl -sS https://getcomposer.org/installer | php' . PHP_EOL . 'php composer.phar install' . PHP_EOL;
    exit(1);
}
开发者ID:baardbaard,项目名称:bb-twitterfeed,代码行数:12,代码来源:bootstrap.php

示例6: includeIfExists

<?php

/*
 * This file is part of Satis.
 *
 * (c) Nils Adermann <naderman@naderman.de>
 *     Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Drupal\ParseComposer;

function includeIfExists($file)
{
    if (file_exists($file)) {
        return include $file;
    }
}
if (!includeIfExists(__DIR__ . '/vendor/drupal/drupal/includes/common.inc') && !includeIfExists(__DIR__ . '/../../drupal/drupal/includes/common.inc')) {
    die('You must set up the project dependencies, run the following commands:' . PHP_EOL . 'curl -s http://getcomposer.org/installer | php' . PHP_EOL . 'php composer.phar install' . PHP_EOL);
}
开发者ID:bojanz,项目名称:drupal-parse-composer,代码行数:22,代码来源:bootstrap.php

示例7: includeIfExists

<?php

function includeIfExists($file)
{
    if (file_exists($file)) {
        return include $file;
    }
}
$vendor = realpath(__DIR__ . '/../vendor');
if (!($loader = includeIfExists($vendor . '/autoload.php'))) {
    die('You must set up the project dependencies, run the following commands:' . PHP_EOL . 'curl -s http://getcomposer.org/installer | php' . PHP_EOL . 'php composer.phar install' . PHP_EOL);
}
$loader->add('Ali', __DIR__);
开发者ID:tiraeth,项目名称:AliDatatableBundle,代码行数:13,代码来源:bootstrap.php


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