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


PHP YiiBase::import方法代码示例

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


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

示例1: realpath

<?php

YiiBase::setPathOfAlias('ygin', realpath(dirname(__FILE__) . '/../'));
YiiBase::setPathOfAlias('ngin', realpath(dirname(__FILE__) . '/../'));
// TODO придется оставить на какое-то время для совместимости.
//Название хоста, для отправки отчетов об ошибках
$errorSubjectHost = '';
if (isset($_SERVER['HTTP_HOST'])) {
    //Если пришло в punicode
    if (strpos($_SERVER['HTTP_HOST'], 'xn--') !== false) {
        YiiBase::import('ygin.lib.IDNA', true);
        $idna = new Net_IDNA_php4();
        $errorSubjectHost = $idna->decode($_SERVER['HTTP_HOST']);
    } else {
        $errorSubjectHost = $_SERVER['HTTP_HOST'];
    }
} else {
    $errorSubjectHost = realpath(dirname(__FILE__) . '/../../');
}
return array('basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '../../protected', 'aliases' => array('temp' => 'webroot.temp', 'xupload' => 'ygin.ext.xupload', 'fileUpload' => 'ygin.components.fileUpload'), 'preload' => array('log'), 'import' => array('ygin.helpers.*', 'ygin.components.*', 'ygin.interface.*'), 'components' => array('session' => array('autoStart' => false, 'cookieParams' => array('timeout' => '7200')), 'db' => array('nullConversion' => PDO::NULL_EMPTY_STRING), 'log' => array('class' => 'CLogRouter', 'routes' => array('email_error' => array('class' => 'ygin.components.DaEmailLogRoute', 'levels' => 'error, warning', 'filter' => array('class' => 'ygin.components.DaLogFilter', 'ignoreCategories' => array('exception.CHttpException.404', 'exception.DaHttpException.*')), 'subject' => 'Ошибка на сайте (' . $errorSubjectHost . ')', 'enabled' => YII_DEBUG == false), 'mailErrorLog' => array('class' => 'DaFileLogRoute', 'categories' => 'application.sendMail.error', 'logFile' => 'mail_error_log.log'), 'errorLog' => array('class' => 'CFileLogRoute', 'levels' => 'error, warning', 'logFile' => 'error_log.log', 'filter' => array('class' => 'ygin.components.DaLogFilter', 'ignoreCategories' => array('exception.CHttpException.404', 'exception.DaHttpException.*', 'application.sendMail.error'), 'logVars' => array('_GET', '_POST', '_FILES', '_COOKIE', '_SESSION', '_SERVER'))), 'loginLog' => array('class' => 'DaFileLogRoute', 'levels' => 'info', 'categories' => 'application.login.*', 'logFile' => 'login.log', 'filter' => array('class' => 'CLogFilter', 'logVars' => array()))))));
开发者ID:Cranky4,项目名称:npfs,代码行数:20,代码来源:core.php

示例2: getItems

<?php

YiiBase::import('application.extensions.treeMenu.TreeMenu');
class BrickMenu extends TreeMenu
{
    protected function getItems()
    {
        $items = array(array('label' => 'Главная', 'url' => array('/site/index')));
        foreach (Yii::app()->getModules() as $id => $m) {
            $moduleObj = Yii::app()->getModule($id);
            if ($moduleObj instanceof CBrick) {
                $items = array_merge($items, $moduleObj->getMenuItems());
            }
        }
        return $items;
    }
}
开发者ID:hit-shappens,项目名称:testapp,代码行数:17,代码来源:BrickMenu.php

示例3: yiiVersion

 /**
  * Initialize Yii and return Yii version
  *
  * @param bool $refresh
  * @return bool|string Yii version or false if Yii is not found
  */
 public static function yiiVersion($refresh = false)
 {
     static $yiiVersion;
     if ($yiiVersion !== null && !$refresh) {
         return $yiiVersion;
     }
     $yii_file = self::yiiPath($refresh) . '/framework/YiiBase.php';
     if (!file_exists($yii_file)) {
         return $yiiVersion = false;
     }
     require_once $yii_file;
     YiiBase::setPathOfAlias('yii_embed', YII_EMBED_PATH . 'app');
     YiiBase::import('yii_embed.components.*');
     YiiBase::import('yii_embed.models.*');
     YiiBase::$enableIncludePath = false;
     return $yiiVersion = YiiBase::getVersion();
 }
开发者ID:cornernote,项目名称:yii-embed-wordpress,代码行数:23,代码来源:YiiEmbed.php

示例4: __set

<?php

/**
 * @file nameQRCodeComponent.php
 * @username jiangmin.sun@cgtz.com
 * @date 14-10-21
 * @time 下午3:48
 */
YiiBase::import('application.extensions.phpqrcode.phpqrcode', true);
class QRCodeComponent extends CApplicationComponent
{
    public $data;
    public $width;
    public $height;
    public function __set($key, $value)
    {
        $this->{$key} = $value;
    }
    public function __get($name)
    {
        return $this->{$name};
    }
    public function png()
    {
        // 二维码数据
        $data = $this->url;
        // 生成的文件名
        $filename = Yii::app()->params['up_path'] . "/" . time() . ".png";
        // 纠错级别:L、M、Q、H
        $errorCorrectionLevel = 'L';
        // 点的大小:1到10
开发者ID:kl0428,项目名称:admin,代码行数:31,代码来源:QRCodeComponent.php


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