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

PHP AppConfig类代码示例

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

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



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

示例1: getAppConfig

 /**
  * get the application's config
  *
  * @param unknown_type $app_name
  * @param unknown_type $env
  */
 public static function getAppConfig($app_name, $env)
 {
     $app_conf = new AppConfig();
     $app_conf->setup();
     // init frameowk's dirs
     // TODO Make these dirs configable
     rtConfig::set('rt_apps_dir', rtConfig::get('rt_project_dir') . DS . 'apps');
     rtConfig::set('rt_app_dir', rtConfig::get('rt_apps_dir') . DS . $app_name);
     rtConfig::set('rt_app_config_dir', rtConfig::get('rt_app_dir') . DIRECTORY_SEPARATOR . 'config');
     rtConfig::set('rt_app_controllers_dir', rtConfig::get('rt_app_dir') . DS . 'controllers');
     rtConfig::set('rt_app_components_dir', rtConfig::get('rt_app_controllers_dir') . DS . 'components');
     rtConfig::set('rt_app_views_dir', rtConfig::get('rt_app_dir') . DS . 'views');
     rtConfig::set('rt_app_views_layout_dir', rtConfig::get('rt_app_views_dir') . DS . 'layout');
     rtConfig::set('rt_models_dir', rtConfig::get('rt_project_dir') . DS . 'lib' . DS . 'models');
     rtConfig::set('rt_app_helpers_dir', rtConfig::get('rt_app_dir') . DS . 'helper');
     rtConfig::set('rt_config_dir', rtConfig::get('rt_project_dir') . DS . 'config');
     rtConfig::set('rt_web_dir', rtConfig::get('rt_project_dir') . DS . 'web');
     rtConfig::set('rt_data_dir', rtConfig::get('rt_project_dir') . DS . 'data');
     rtAutoloader::addPath(rtConfig::get('rt_project_dir') . DS . 'lib');
     rtAutoloader::addPath(rtConfig::get('rt_models_dir'), rtConfig::get('rt_models_dir') . DS . 'generated', rtConfig::get('rt_app_controllers_dir'), rtConfig::get('rt_app_components_dir'));
     // setup app config
     require rtConfig::get('rt_app_config_dir') . DS . $app_name . 'AppConfig.class.php';
     $app_class_name = $app_name . 'AppConfig';
     $class = new $app_class_name();
     $class->setup();
     return $class;
 }
开发者ID:reeze,项目名称:rythm,代码行数:33,代码来源:rtAppConfig.class.php


示例2: app_controller

function app_controller()
{
    global $session, $route, $mysqli;
    $result = false;
    include "Modules/app/AppConfig_model.php";
    $appconfig = new AppConfig($mysqli);
    if ($route->format == 'html') {
        if ($route->action == "" && $session['write']) {
            $result = view("Modules/app/client.php", array());
        }
    }
    if ($route->format == 'json') {
        if ($route->action == "setconfig" && $session['write']) {
            $result = $appconfig->set($session['userid'], get('data'));
        }
        if ($route->action == "getconfig" && $session['read']) {
            $result = $appconfig->get($session['userid']);
        }
        if ($route->action == "dataremote") {
            $id = (int) get("id");
            $start = (double) get("start");
            $end = (double) get("end");
            $interval = (int) get("interval");
            $result = json_decode(file_get_contents("http://emoncms.org/feed/data.json?id={$id}&start={$start}&end={$end}&interval={$interval}&skipmissing=0&limitinterval=0"));
        }
        if ($route->action == "valueremote") {
            $id = (int) get("id");
            $result = (double) json_decode(file_get_contents("http://emoncms.org/feed/value.json?id={$id}"));
        }
    }
    return array('content' => $result, 'fullwidth' => true);
}
开发者ID:ReneHezser,项目名称:app,代码行数:32,代码来源:app_controller.php


示例3: __construct

 /**
  * 构造函数
  * @param AppConfig $app_config 应用程序的配置文件
  * @param string $action 要锁定的动作
  * @param string $unique_id 识别的唯一id
  * @return ActionLocker
  */
 public function __construct(AppConfig $app_config, $action, $unique_id = null)
 {
     $this->uid = $unique_id;
     $cache = $app_config->getLockCacheInstance();
     $this->locker = new MemLocker($cache);
     $this->action = $action;
 }
开发者ID:GameCrusherTechnology,项目名称:HeroTowerServer,代码行数:14,代码来源:ActionLocker.class.php


示例4: getActionMethodName

 /**
  * 
  * @param Request $request
  * @param \AppConfig $appConfig
  * @throws \Exception
  * @return string
  */
 public function getActionMethodName(Request $request, \AppConfig $appConfig)
 {
     if (!$appConfig->getApplicationConfig() instanceof ArrayObject) {
         throw new \Exception("Method getApplicationConfig should return Zend\\Stdlib\\ArrayObject instance");
     }
     $it = $appConfig->getApplicationConfig()->getIterator();
     while ($it->valid()) {
         if ($request->getActionName() == $it->key()) {
             return $it->current();
         }
     }
 }
开发者ID:6975usa,项目名称:liteframe_old,代码行数:19,代码来源:ActionProxy.php


示例5: __construct

 public function __construct()
 {
     $this->redis = new Redis();
     if (!$this->redis->connect(AppConfig::getValue('redis_socket'))) {
         AppController::fatalError('unable to connect to Redis server');
     }
 }
开发者ID:bitcalc,项目名称:allspark,代码行数:7,代码来源:redisconnection.php


示例6: getInstance

 /**
  * @return AppConfig
  */
 public static function getInstance()
 {
     if (!self::$_instance) {
         self::$_instance = new AppConfig();
     }
     return self::$_instance;
 }
开发者ID:Codealist,项目名称:patterns,代码行数:10,代码来源:AppConfig.php


示例7: getDB

 public static function getDB()
 {
     if (is_null(self::$db)) {
         self::$db = self::getMongo()->{AppConfig::get("db.mongodb.name")};
     }
     return self::$db;
 }
开发者ID:aommiez,项目名称:allianzsteel,代码行数:7,代码来源:MongoDB.php


示例8: get_table

 function get_table($paged = 0)
 {
     /* Execute a prepared statement by passing an array of values */
     $dbh = new PDO('mysql:dbname=' . AppConfig::gacv("AC_db") . ';host=' . AppConfig::gacv("AC_server"), AppConfig::gacv("AC_user"), AppConfig::gacv("AC_pass"));
     $sql = sprintf("select * from %s WHERE " . $this->lookup_tbl_id_col . " = :lookup_tbl_id_col OR 1 = :lookup_not_set order by %s", $this->tbl_name, $this->lookup_value_col);
     if ($paged) {
         $sql .= MyEDB_Pager::get_sql_limit_clause();
     }
     $sth = $dbh->prepare($sql, array(PDO::ATTR_CURSOR, PDO::CURSOR_FWDONLY));
     //
     //$sth->execute(array(':lookup_tbl_id_col' => ($_REQUEST[$this->lookup_tbl_id_col])? $_REQUEST[$this->lookup_tbl_id_col] : $this->lookup_tbl_id_col));
     $sth->bindParam(':lookup_tbl_id_col', $lookup_tbl_id_col);
     $sth->bindParam(':lookup_not_set', $lookup_not_set);
     $lookup_tbl_id_col = $_REQUEST[$this->lookup_tbl_id_col];
     $lookup_not_set = $_REQUEST[$this->lookup_tbl_id_col] ? 0 : 1;
     $sth->execute();
     $res = $sth->fetchAll(PDO::FETCH_BOTH);
     //echo $sql.$this->lookup_tbl_id_col;//
     $table_hash = array();
     //print_r($res);
     foreach ($res as $ar) {
         //echo $sql."-".$lookup_tbl_id_col." ".$lookup_not_set;
         $table_hash[$ar[0]] = array($ar[1], "lookup_table_id" => $ar[$this->lookup_tbl_id_col], "disabled" => $ar['disabled']);
     }
     return $table_hash;
 }
开发者ID:awgtek,项目名称:myedb,代码行数:26,代码来源:SubLookupTable.php


示例9: get_config_data

 public static function get_config_data()
 {
     if (!($config = AppConfig::get()->first())) {
         return [];
     }
     return $config->forAPI();
 }
开发者ID:ehyland,项目名称:some-painter-cms,代码行数:7,代码来源:AppConfigDataUtil.php


示例10: process

 public function process(Vtiger_Request $request)
 {
     $shortURL = str_replace('index.php', '', AppConfig::main('site_URL'));
     $viewer = $this->getViewer($request);
     $viewer->assign('URLCSS', $shortURL . Yeti_Layout::getLayoutFile('modules/AJAXChat/Chat.css'));
     $viewer->assign('URL', $shortURL . "libraries/AJAXChat/index.php");
     $viewer->view('Index.tpl', 'AJAXChat');
 }
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:8,代码来源:Index.php


示例11: getDefaultViewComments

 static function getDefaultViewComments()
 {
     if (AppConfig::module('ModComments', 'DEFAULT_VIEW') == 'Timeline') {
         return 'Timeline';
     } else {
         return 'List';
     }
 }
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:8,代码来源:Module.php


示例12: __construct

 public function __construct()
 {
     $this->config = AppConfig::getInstance()->get();
     $this->api = new DigitalOcean($this->config->config->token);
     while (true) {
         $this->checkDroplets();
         sleep(self::UPDATE_TIME * 60);
     }
 }
开发者ID:nic-d,项目名称:digitalocean-elasticity,代码行数:9,代码来源:ServerManager.php


示例13: __construct

 public function __construct()
 {
     if (AppConfig::read('Smtp.enabled')) {
         $config = array('transport' => 'Smtp', 'from' => array(AppConfig::read('Smtp.email') => AppConfig::read('Smtp.name')), 'host' => AppConfig::read('Smtp.host'), 'port' => AppConfig::read('Smtp.port'), 'timeout' => 30, 'username' => AppConfig::read('Smtp.login'), 'password' => AppConfig::read('Smtp.password'), 'client' => null, 'log' => false, 'charset' => 'utf-8', 'headerCharset' => 'utf-8');
     } else {
         $config = array('transport' => 'Mail', 'from' => array(AppConfig::read('Smtp.email') => AppConfig::read('Smtp.name')), 'charset' => 'utf-8', 'headerCharset' => 'utf-8');
     }
     $this->default = $config;
 }
开发者ID:knyk,项目名称:kAdmin,代码行数:9,代码来源:email.php


示例14: getMySql

 /**
  * @return \Doctrine\ORM\EntityManager
  */
 public static function getMySql()
 {
     if (is_null(self::$mysql)) {
         $paths = array('src/Main/Entity');
         $config = \Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration($paths, true);
         self::$mysql = \Doctrine\ORM\EntityManager::create(array('driver' => 'pdo_mysql', 'user' => AppConfig::get("db.mysql.host"), 'password' => AppConfig::get("db.mysql.password"), 'dbname' => AppConfig::get("db.mysql.name"), 'charset' => 'utf8', 'driverOptions' => array(1002 => 'SET NAMES utf8')), $config);
     }
     return self::$mysql;
 }
开发者ID:aommiez,项目名称:allianzsteel,代码行数:12,代码来源:MySql.php


示例15: saveData

 public function saveData($data)
 {
     foreach ($data as $parent => $values) {
         foreach ($values as $key => $value) {
             AppConfig::write($parent . '.' . $key, $value);
         }
     }
     return true;
 }
开发者ID:knyk,项目名称:kAdmin,代码行数:9,代码来源:Setting.php


示例16: getLayoutFile

 public static function getLayoutFile($name)
 {
     $basePath = 'layouts' . '/' . AppConfig::main('defaultLayout') . '/';
     $filePath = Vtiger_Loader::resolveNameToPath('~' . $basePath . $name);
     if (is_file($filePath)) {
         return $basePath . $name;
     }
     $basePath = 'layouts' . '/' . Vtiger_Viewer::getDefaultLayoutName() . '/';
     return $basePath . $name;
 }
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:10,代码来源:Layout.php


示例17: process

 public function process(Vtiger_Request $request)
 {
     $mode = $request->getMode();
     $viewer = $this->getViewer($request);
     $currentUserModel = Users_Record_Model::getCurrentUserModel();
     $viewer->assign('CURRENT_USER', $currentUserModel);
     $viewer->assign('EVENT_LIMIT', AppConfig::module('Calendar', 'EVENT_LIMIT'));
     $viewer->assign('WEEK_VIEW', AppConfig::module('Calendar', 'SHOW_TIMELINE_WEEK') ? 'agendaWeek' : 'basicWeek');
     $viewer->assign('DAY_VIEW', AppConfig::module('Calendar', 'SHOW_TIMELINE_DAY') ? 'agendaDay' : 'basicDay');
     $viewer->view('CalendarView.tpl', $request->getModule());
 }
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:11,代码来源:Calendar.php


示例18: unauthorised

 public static function unauthorised($message = null)
 {
     if ($message) {
         (new Log(SECURITY_LOG))->setFatal(true)->logMessage($message);
     }
     // Show a Friendly Error Page
     $view = new HTMLView(true);
     $view->includeTemplate('error.unauthorised', ['app_name' => AppConfig::getValue('app_name')]);
     $view->render(true);
     exit;
     // terminate script (regardless of location)
 }
开发者ID:bitcalc,项目名称:allspark,代码行数:12,代码来源:appcontroller.php


示例19: checkPermission

 public function checkPermission(Vtiger_Request $request)
 {
     $currentUserModel = Users_Record_Model::getCurrentUserModel();
     $record = $request->get('record');
     if (!AppConfig::security('SHOW_MY_PREFERENCES')) {
         throw new NoPermittedToRecordException('LBL_PERMISSION_DENIED');
     }
     if ($currentUserModel->isAdminUser() == true || $currentUserModel->get('id') == $record) {
         return true;
     } else {
         throw new NoPermittedToRecordException('LBL_PERMISSION_DENIED');
     }
 }
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:13,代码来源:PreferenceDetail.php


示例20: ShowLoginDialog

function ShowLoginDialog($facebook)
{
    $facebook->setAccessToken(null);
    $cookieName = 'fbsr_' . AppConfig::GetAppId();
    setcookie($cookieName, "", 1);
    $loginUrl = $facebook->getLoginUrl(array('canvas' => 1, 'fbconnect' => 0, 'req_perms' => 'email'));
    $redirectScript = "<script type=\"text/javascript\">\n";
    $redirectScript .= "if (parent != self) \n";
    $redirectScript .= "top.location.href = \"" . $loginUrl . "\";\n";
    $redirectScript .= "else self.location.href = \"" . $loginUrl . "\";\n";
    $redirectScript .= "</script>";
    echo $redirectScript;
}
开发者ID:evinw,项目名称:project_yess,代码行数:13,代码来源:index.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP AppContext类代码示例发布时间:2022-05-23
下一篇:
PHP AppCache类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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