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


PHP DEFINED函数代码示例

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


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

示例1: GetServiceConnData

 |  Publisher       :(c)2016 Xaver Bauer                                          |
 |  Contact         :xaver65@gmail.com                                            |
 |  Desc            :PHP Classes to Control Sonos PLAY:3                          |
 |  port            :1400                                                         |
 |  base            :http://192.168.112.54:1400                                   |
 |  scpdurl         :/xml/device_description.xml                                  |
 |  modelName       :Sonos PLAY:3                                                 |
 |  deviceType      :urn:schemas-upnp-org:device:ZonePlayer:1                     |
 |  friendlyName    :192.168.112.54 - Sonos PLAY:3                                |
 |  manufacturer    :Sonos, Inc.                                                  |
 |  manufacturerURL :http://www.sonos.com                                         |
 |  modelNumber     :S3                                                           |
 |  modelURL        :http://www.sonos.com/products/zoneplayers/S3                 |
 |  UDN             :uuid:RINCON_B8E9373DABCE01400                                |
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
if (!DEFINED('RPC2SONOS_STATE_STOP')) {
    DEFINE('RPC2SONOS_STATE_STOP', 0);
    DEFINE('RPC2SONOS_STATE_PREV', 1);
    DEFINE('RPC2SONOS_STATE_PLAY', 2);
    DEFINE('RPC2SONOS_STATE_PAUSE', 3);
    DEFINE('RPC2SONOS_STATE_NEXT', 4);
    DEFINE('RPC2SONOS_STATE_TRANS', 5);
    DEFINE('RPC2SONOS_STATE_ERROR', 6);
}
class rpc2sonos extends RpcDevice
{
    protected $_boRepeat = false;
    protected $_boShuffle = false;
    protected $_boAll = false;
    // Name:string
    protected function GetServiceConnData($name)
开发者ID:TierFreund,项目名称:Ips2rpc,代码行数:31,代码来源:rpc2sonos.class.php

示例2: __construct

 public function __construct()
 {
     if (!DEFINED("EXT")) {
         define("EXT", ".php");
     }
     ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . APPPATH . 'third_party/Twig');
     require_once (string) "Autoloader" . EXT;
     // Fire off the Twig register bootstrap function...
     Twig_Autoloader::register();
     // Get CI instance
     $this->CI = get_instance();
     // Load the Twig config file
     $this->CI->config->load('twig');
     // Add in default Twig locations
     $this->add_template_location($this->CI->config->item('twig.locations'));
     // Get locations
     $this->_set_template_locations();
     $this->_twig_loader = new Twig_Loader_Filesystem($this->_template_directories);
     // Get environment config settings
     $environment = $this->CI->config->item("twig.environment");
     // Set our cache path or status
     $environment["cache"] = $environment["cache_status"] ? $environment["cache_location"] : FALSE;
     $twig_environment = array("cache" => $environment["cache"], "debug" => $environment["debug_mode"], "auto_reload" => $environment["auto_reload"], "autoescape" => $environment["autoescape"], "optimizations" => $environment["optimizations"]);
     $this->_twig = new Twig_Environment($this->_twig_loader, $twig_environment);
     if ($this->CI->config->item("twig.functions")) {
         foreach ($this->CI->config->item("twig.functions") as $function) {
             $this->register_function($function);
         }
     }
     if ($this->CI->config->item("twig.filters")) {
         foreach ($this->CI->config->item("twig.filters") as $filter) {
             $this->register_filter($filter);
         }
     }
 }
开发者ID:JermingFan,项目名称:AdminLTE-CI,代码行数:35,代码来源:Twig.php

示例3: GoogleAnalyticsInline

 public function GoogleAnalyticsInline()
 {
     if (DEFINED('GaTrackingCode')) {
         $gacode = @file_get_contents(dirname(dirname(__FILE__)) . '/javascript/gatracker.js') . $this->GoogleCode();
         $gacode = $this->Compress($gacode);
         Requirements::customScript($gacode);
     }
 }
开发者ID:designcity,项目名称:silverstripe-google-analytics,代码行数:8,代码来源:GaTracker.php

示例4: __construct

 public function __construct(Request $request)
 {
     $segments = $request->segments();
     $locales = LaravelLocalization::getSupportedLanguagesKeys();
     $non_locale_route = '';
     $lang = App::getLocale();
     foreach ($segments as $segment) {
         if (!in_array($segment, $locales)) {
             $non_locale_route .= '/' . $segment;
         }
     }
     DEFINED('NON_LOCALE_ROUTE') or DEFINE('NON_LOCALE_ROUTE', trim($non_locale_route, '/'));
     DEFINED('LANG') or DEFINE('LANG', $lang);
 }
开发者ID:NickMomchev,项目名称:bautech,代码行数:14,代码来源:Controller.php

示例5: dechiffre

 static function dechiffre($texte, $cle = '')
 {
     // Récupération de la clé si elle n'est pas passée en paramètre.
     if (!$cle) {
         // On la récupère depuis une constante si possible.
         if (DEFINED("CLEAPPLI")) {
             $cle = CLEAPPLI;
         } else {
             $cle = "leJambonCtresbon";
         }
     }
     // A améliorer...........
     $temp = base64_decode($texte);
     return $temp;
 }
开发者ID:jeromecc,项目名称:tuv2,代码行数:15,代码来源:XhamTools.php

示例6: launch_model

 static function launch_model()
 {
     if (DEFINED(MODULES_APP)) {
         $inc = MODULES_PATH . SL . MODULES_APP . SL . 'models' . SL . ucfirst(CONTROLLER_APP) . 'Model.php';
         if (file_exists($inc) && is_readable($inc)) {
             /** @noinspection PhpIncludeInspection */
             include $inc;
         }
     } else {
         $inc = MODEL_PATH . SL . ucfirst(CONTROLLER_APP) . 'Model.php';
         if (file_exists($inc) && is_readable($inc)) {
             /** @noinspection PhpIncludeInspection */
             include $inc;
         }
     }
 }
开发者ID:BostonLee,项目名称:EaT-CMS,代码行数:16,代码来源:model.php

示例7: launch_view

 static function launch_view($layout = null)
 {
     global $customLayout;
     if (DEFINED('MODULES_APP')) {
         foreach (glob(MODULES_PATH . SL . MODULES_APP . SL . 'viewHelpers' . SL . '*.php') as $file) {
             /** @noinspection PhpIncludeInspection */
             include_once $file;
         }
         if (isset($customLayout)) {
             $path = MODULES_PATH . SL . MODULES_APP . SL . 'view/layouts' . SL . $customLayout . '.php';
             if (file_exists($path) && is_readable($path)) {
                 /** @noinspection PhpIncludeInspection */
                 include_once $path;
             } else {
                 echo 'No Such Layout: ' . $customLayout . '!';
             }
         } else {
             if (file_exists(MODULES_PATH . SL . MODULES_APP . SL . 'views/layouts/' . LAYOUT) && is_readable(MODULES_PATH . SL . MODULES_APP . SL . 'views/layouts/' . LAYOUT)) {
                 /** @noinspection PhpIncludeInspection */
                 include_once MODULES_PATH . SL . MODULES_APP . SL . 'views/layouts/' . LAYOUT;
             } else {
                 echo 'No Such Layout: ' . MODULES_PATH . SL . MODULES_APP . SL . 'view/layouts/' . LAYOUT . '!';
             }
         }
     } else {
         foreach (glob(APP_PATH . SL . 'viewHelpers' . SL . '*.php') as $file) {
             /** @noinspection PhpIncludeInspection */
             include_once $file;
         }
         if (isset($customLayout)) {
             $path = LAYOUT_PATH . SL . $customLayout . '.php';
             if (file_exists($path) && is_readable($path)) {
                 /** @noinspection PhpIncludeInspection */
                 include_once $path;
             } else {
                 echo 'No Such Layout: ' . $customLayout . '!';
             }
         } else {
             if (file_exists(DEF_LAYOUT) && is_readable(DEF_LAYOUT)) {
                 /** @noinspection PhpIncludeInspection */
                 include_once DEF_LAYOUT;
             } else {
                 echo 'No Such Layout: ' . DEF_LAYOUT . '!';
             }
         }
     }
 }
开发者ID:BostonLee,项目名称:EaT-CMS,代码行数:47,代码来源:view.php

示例8: __construct

 public function __construct()
 {
     $siteurl = trailingslashit(get_option('siteurl'));
     if (DEFINED('WP_PLUGIN_URL')) {
         $this->plugin_path = WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)) . '/';
     } else {
         if (DEFINED('WP_PLUGIN_DIR')) {
             $this->plugin_path = $siteurl . '/' . WP_PLUGIN_DIR . '/' . basename(dirname(__FILE__)) . '/';
         } else {
             $this->plugin_path = $siteurl . 'wp-content/plugins/' . basename(dirname(__FILE__)) . '/';
         }
     }
     if (is_ssl()) {
         $siteurl = str_replace('http:', 'https:', $siteurl);
         $this->plugin_path = str_replace('http:', 'https:', $this->plugin_path);
     }
     $this->plugin_path .= 'syntaxhighlight/';
 }
开发者ID:rinodung,项目名称:kenhcongdong,代码行数:18,代码来源:syntaxHighlighter-ckeditor-button.php

示例9: __construct

 public function __construct(Request $request)
 {
     $segments = $request->segments();
     $locales = LaravelLocalization::getSupportedLanguagesKeys();
     $non_locale_route = '';
     $lang = App::getLocale();
     foreach ($segments as $segment) {
         if (!in_array($segment, $locales)) {
             $non_locale_route .= '/' . $segment;
         }
     }
     DEFINED('NON_LOCALE_ROUTE') or DEFINE('NON_LOCALE_ROUTE', trim($non_locale_route, '/'));
     DEFINED('LANG') or DEFINE('LANG', $lang);
     $categories[1] = ProductCategory::getByBrand(5);
     $categories[2] = ProductCategory::getByBrand(6);
     $categories[3] = ProductCategory::getByBrand(7);
     $this->categories = $categories;
 }
开发者ID:NickMomchev,项目名称:bautech,代码行数:18,代码来源:BaseCatalogController.php

示例10: define

    define('APPPATH', BASEPATH . $application_folder . '/');
}
/*
|---------------------------------------------------------------
| LOAD THE FRONT CONTROLLER
|---------------------------------------------------------------
|
| And away we go...
|
*/
require "system/security.php";
require_once APPPATH . '/libraries/Smarty.class.php';
require_once APPPATH . '/libraries/system.php';
require APPPATH . "libraries/POT/OTS.php";
require_once BASEPATH . 'codeigniter/CodeIgniter' . EXT;
if (!DEFINED("SYSTEM_STOP")) {
    /* Check the server's compatybility with the engine. */
    if (!is_php($config['engine']['PHPversion'])) {
        show_error("Your server runs verion of PHP older than " . $config['engine']['PHPversion'] . ". Please update in order to use this system. Err code: 140704042010");
    }
    $contents = ob_get_contents();
    ob_end_clean();
    require_once APPPATH . 'config/database.php';
    /* Some basic actions */
    if (empty($_SESSION['logged'])) {
        $_SESSION['logged'] = 0;
    }
    $smarty = new Smarty();
    $smarty->template_dir = "templates/" . $template;
    $smarty->config_dir = ' configs';
    $smarty->cache_dir = 'cache';
开发者ID:Alexy234,项目名称:modernaac,代码行数:31,代码来源:index.php

示例11: processLogs

 public function processLogs($logs)
 {
     $app = Yii::app();
     $config = array();
     $ip = $app->request->getUserHostAddress();
     $allowed = false;
     foreach ($this->allowedIPs as $pattern) {
         // if found any char other than [0-9] and dot, treat pattern as a regexp
         if (preg_match('/[^0-9:\\.]/', $pattern)) {
             if (preg_match('/' . $pattern . '/', $ip)) {
                 $allowed = true;
                 break;
             }
         } else {
             if ($pattern === $ip) {
                 $allowed = true;
                 break;
             }
         }
     }
     if (!$allowed) {
         return;
     }
     foreach (explode(',', $this->config) as $value) {
         $value = trim($value);
         $config[$value] = true;
     }
     //Checking for an AJAX Requests
     if (!$app instanceof CWebApplication || $app->getRequest()->getIsAjaxRequest()) {
         return;
     }
     //Checking for an DEBUG mode of running app
     if (isset($config['runInDebug']) && (!DEFINED('YII_DEBUG') || YII_DEBUG == false)) {
         return;
     }
     $items = array();
     $items[] = yiiDebugConfig::getInfo($logs, $config);
     $items[] = yiiDebugMem::getInfo($logs);
     $items[] = yiiDebugTime::getInfo($logs);
     $items[] = yiiDebugDB::getInfo($logs);
     $items[] = yiiDebugTrace::getInfo($logs);
     $panel = new yiiDebugPanel();
     $panel->render($items, $config);
 }
开发者ID:niranjan2m,项目名称:Voyanga,代码行数:44,代码来源:XWebDebugRouter.php

示例12: handle

<?php

if (!DEFINED('haXMS_HERE')) {
    die;
}
if (!isset($_GET['act'])) {
    handle(IDX);
} else {
    handle($_GET['act']);
}
function handle($module)
{
    switch ($module) {
        case "login":
            //{
            $v = Engine::loadmod('login', 'login.class.php', 'Login');
            $v->fetchtemplate('login', 'index.php');
            //Module directory, template filename
            if (isset($_POST["login"])) {
                $username = $_POST["username"];
                $password = $_POST["password"];
                $han = $v->doLogin($username, $password);
                //sanitize and try to login
                if ($han == true) {
                    echo 'Login successful!';
                } else {
                    echo 'Login invalid!';
                }
                //$v->dx($username,$password);
            }
            //}
开发者ID:39845987559038,项目名称:haXMS,代码行数:31,代码来源:handler.php

示例13: processLogs

 public function processLogs($logs)
 {
     $app = Yii::app();
     $config = array();
     if ($this->allowedIPs && !in_array($app->request->getUserHostAddress(), $this->allowedIPs)) {
         return;
     }
     foreach (explode(',', $this->config) as $value) {
         $value = trim($value);
         $config[$value] = true;
     }
     //Checking for an AJAX Requests
     if (!$app instanceof CWebApplication || $app->getRequest()->getIsAjaxRequest()) {
         return;
     }
     //Checking for an DEBUG mode of running app
     if (isset($config['runInDebug']) && (!DEFINED('YII_DEBUG') || YII_DEBUG == false)) {
         return;
     }
     $items = array();
     $items[] = yiiDebugConfig::getInfo($logs, $config);
     $items[] = yiiDebugMem::getInfo($logs);
     $items[] = yiiDebugTime::getInfo($logs);
     $items[] = yiiDebugDB::getInfo($logs);
     $items[] = yiiDebugTrace::getInfo($logs);
     $panel = new yiiDebugPanel();
     $panel->render($items, $config);
 }
开发者ID:nassimrehali,项目名称:yiisite,代码行数:28,代码来源:XWebDebugRouter.php

示例14: convertImage

 function convertImage($type)
 {
     /* check the converted image type availability,
        if it is not available, it will be casted to jpeg :) */
     $validtype = $this->validateType($type);
     if ($this->output) {
         /* show the image  */
         switch ($validtype) {
             case 'jpeg':
                 // Added jpe
             // Added jpe
             case 'jpe':
             case 'jpg':
                 header("Content-type: image/jpeg");
                 if ($this->imtype == 'gif' or $this->imtype == 'png') {
                     $image = $this->replaceTransparentWhite($this->im);
                     @imageJPEG($image);
                 } else {
                     @imageJPEG($this->im);
                 }
                 break;
             case 'gif':
                 header("Content-type: image/gif");
                 @imageGIF($this->im);
                 break;
             case 'png':
                 header("Content-type: image/png");
                 @imagePNG($this->im);
                 break;
             case 'wbmp':
                 header("Content-type: image/vnd.wap.wbmp");
                 @imageWBMP($this->im);
                 break;
             case 'swf':
                 header("Content-type: application/x-shockwave-flash");
                 $this->imageSWF($this->im);
                 break;
         }
     } else {
         // Added Support vor different directory
         if (DEFINED('V_TEMP_DIR')) {
             $this->newimname = V_TEMP_DIR . $this->imname . '.' . $validtype;
         } else {
             $this->newimname = $this->imname . '.' . $validtype;
         }
         /* save the image  */
         switch ($validtype) {
             case 'jpeg':
                 // Added jpe
             // Added jpe
             case 'jpe':
             case 'jpg':
                 if ($this->imtype == 'gif' or $this->imtype == 'png') {
                     /* replace transparent with white */
                     $image = $this->replaceTransparentWhite($this->im);
                     @imageJPEG($image, $this->newimname);
                 } else {
                     @imageJPEG($this->im, $this->newimname);
                 }
                 break;
             case 'gif':
                 @imageGIF($this->im, $this->newimname);
                 break;
             case 'png':
                 @imagePNG($this->im, $this->newimname);
                 break;
             case 'wbmp':
                 @imageWBMP($this->im, $this->newimname);
                 break;
             case 'swf':
                 $this->imageSWF($this->im, $this->newimname);
                 break;
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:75,代码来源:class.imageconverter.php

示例15: DEFINED

<?php

/**************************************************************************************************
config.php
    This file defines variable constants for use
***************************************************************************************************/
DEFINED('DS') ? null : define('DS', DIRECTORY_SEPARATOR);
DEFINED('ROOT') ? null : define('ROOT', '..');
DEFINED('LIB') ? null : define('LIB', ROOT . DS . 'lib');
DEFINED('VIEW') ? null : define('VIEW', ROOT . DS . 'views');
DEFINED('DB_SERVER') ? null : define('DB_SERVER', '');
DEFINED('DB_USER') ? null : define('DB_USER', '');
DEFINED('DB_PASS') ? null : define('DB_PASS', '');
DEFINED('DB_NAME') ? null : define('DB_NAME', '');
DEFINED('MAILER_SMTP') ? null : define('MAILER_SMTP', '');
DEFINED('MAILER_NAME') ? null : define('MAILER_NAME', '');
DEFINED('MAILER_PW') ? null : define('MAILER_PW', '');
开发者ID:pat-liu,项目名称:stock,代码行数:17,代码来源:config.php


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