• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP includeIfExists函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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<[email protected]>
 *
 * 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 <[email protected]>
 *     Jordi Boggiano <[email protected]>
 *
 * 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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP includeJs函数代码示例发布时间:2022-05-15
下一篇:
PHP includeGuard函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap