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


PHP Kohana::config_load方法代码示例

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


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

示例1: __construct

    public function __construct()
    {
        // Set the request data
        $this->request = ($_SERVER['REQUEST_METHOD'] == 'POST')
            ? $_POST
            : $_GET;
        
        // Load the API configuration file
        Kohana::config_load('api');
        
        // Get the IP Address of the client submitting the API request

        // Check if the IP is from a shared internet connection
        if ( ! empty($_SERVER['HTTP_CLIENT_IP']))
        {
            $this->request_ip_address = $_SERVER['HTTP_CLIENT_IP'];
        }
        // Check if the IP address is passed from a proxy server such as Nginx
        elseif ( ! empty($_SERVER['HTTP_X_FORWARDED_FOR']))
        {
            $this->request_ip_address  = $_SERVER['HTTP_X_FORWARDED_FOR'];
        }
        else
        {
            $this->request_ip_address = $_SERVER['REMOTE_ADDR'];
        }
        
        // Unpack the URL parameters
        $this->api_parameters = serialize(array_keys($this->request));
        
        // Instantiate the database
        $this->db = new Database();
    }
开发者ID:rindou240,项目名称:Ushahidi_Web,代码行数:33,代码来源:Api_Service.php

示例2: __construct

 /**
  * constructor; set up listeners
  *
  * @author Andy Bennett
  */
 public function __construct()
 {
     $this->init();
     Kohana::config_load('steamauth');
     $this->conf = Kohana::config('steamauth.steamauth');
     Event::add('steamauth.login_success', array('steamauth_listeners', 'login_success'));
     Event::add('steamauth.logged_in', array('steamauth_listeners', 'logged_in'));
     Event::add('steamauth.show_login_form', array('steamauth_listeners', 'login_form'));
     Event::add('steamauth.logged_out', array('steamauth_listeners', 'logged_out'));
     Event::add('steamform_auth_register.complete', array('steamauth_listeners', 'register_complete'));
     Event::add('steamform_auth_register.complete', array('auth_email_events', 'register_complete_email'));
     Event::add('steamform_auth_register.show_form', array('steamauth_listeners', 'register_show_form'));
     Event::add('steamform_auth_profile.complete', array('steamauth_listeners', 'profile_complete'));
     Event::add('steamform_auth_profile.show_form', array('steamauth_listeners', 'profile_show_form'));
     Event::add('steamauth.change_credential_form', array('steamauth_listeners', 'change_credential_form'));
     Event::add('steamauth.change_credential_email', array('auth_email_events', 'change_credential_email'));
     Event::add('steamauth.change_credential_success', array('steamauth_listeners', 'change_credential_success'));
     Event::add('steamauth.forgotten_credential_form', array('steamauth_listeners', 'forgotten_credential_form'));
     Event::add('steamauth.forgotten_credential_email', array('auth_email_events', 'forgotten_credential_email'));
     Event::add('steamauth.forgotten_credential_sent', array('steamauth_listeners', 'forgotten_credential_sent'));
     Event::add('steamauth.forgotten_identity_form', array('steamauth_listeners', 'forgotten_identity_form'));
     Event::add('steamauth.forgotten_identity_email', array('auth_email_events', 'forgotten_identity_email'));
     Event::add('steamauth.forgotten_identity_sent', array('steamauth_listeners', 'forgotten_identity_sent'));
     Event::add('steamauth.activated', array('auth_email_events', 'activation_email'));
     Event::add('steamauth.activated', array('steamauth_listeners', 'activation_complete'));
     Event::add('steamauth.activation_error', array('steamauth_listeners', 'activation_error'));
     Event::add('steamauth.forgotten_credential_reset_email', array('auth_email_events', 'forgotten_credential_reset_email'));
     Event::add('steamauth.forgotten_credential_reset', array('steamauth_listeners', 'forgotten_credential_reset'));
     Event::add('steamauth.forgotten_credential_reset_error', array('steamauth_listeners', 'forgotten_credential_reset_error'));
     // Singleton instance
     self::$instance = $this;
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:37,代码来源:Steamauth.php

示例3: __construct

 public function __construct($options = array())
 {
     $default = array("width" => "100", "height" => "100", "images" => array(), "class" => "square_thumb", "view" => null, "thickbox" => true);
     $config = Kohana::config_load('zest');
     $config = arr::overwrite($default, $config['gallery']);
     $this->config = arr::overwrite($config, $options);
 }
开发者ID:sydlawrence,项目名称:SocialFeed,代码行数:7,代码来源:Gallery.php

示例4: render

 public function render($options = null)
 {
     if (!$options) {
         $config = Kohana::config_load('zest');
         $options = $config['comment'];
     }
     $array = array("date_format" => 'D jS M Y', "image" => array(50, 50), "html" => '{AVATAR}{DATE} by {AUTHOR}<br/><p>{TEXT}</p><a href="{DELETE_LINK}" title="delete comment"></a><div class="spacer">&nbsp;</div>', "default_image" => 'http://' . $_SERVER['HTTP_HOST'] . '/zest/images/user_icon.gif', "template" => '');
     $array = arr::overwrite($array, $options);
     if (isset($array['template']) && $array['template'] != "") {
         $html = zest::template_to_html('snippets/' . $array['template']);
     } else {
         $html = $array['html'];
     }
     $html = str_replace('{DATE}', date($array['date_format'], strtotime($this->date)), $html);
     $html = str_replace('{AVATAR}', gravatar::render($this->email, $array['image'][0], $array['default_image']), $html);
     if ($this->fl_deleted == 1) {
         $html = str_replace('{TEXT}', '<i>This comment has been deleted.</i>', $html);
     } else {
         $html = str_replace('{TEXT}', $this->title, $html);
     }
     $html = str_replace('{AUTHOR}', $this->display_name, $html);
     if ($this->can_modify()) {
         $html = str_replace('{DELETE_LINK}', $this->delete_url(), $html);
     }
     return $html;
 }
开发者ID:sydlawrence,项目名称:SocialFeed,代码行数:26,代码来源:zest_comment.php

示例5: render_summary

 /**
  * Returns the formatted html
  *
  * html example
  * e.g <h1>{TITLE}</h1><h2>{DATE}</h2><h3>by {AUTHOR}</h3>{IMAGE}{TEXT}<div class="spacer">&nbsp;</div>
  *
  * @param   array	$options	Options for the rendering array('count', 'date_format','image' = array($width,$height), 'word_count', 'html')
  * @return	string	$html		Formatted HTML
  */
 public function render_summary($options = null, $feedpost_options = null)
 {
     $array = array('per_page' => 5, 'pagination' => 'classic', 'template' => 'feed', 'html' => '{FEEDPOSTS}{PAGINATION}');
     if (!$options) {
         $config = Kohana::config_load('zest');
         $options = $config['feed.summary'];
     }
     $array = arr::overwrite($array, $options);
     $uri = uri::instance();
     $page = $uri->segment('page', 1);
     $feedposts = "";
     $posts = $this->get_posts($array['per_page'], ($page - 1) * $array['per_page']);
     foreach ($posts as $post) {
         $feedposts .= $post->render_summary($feedpost_options);
     }
     $pagination = new Pagination(array('uri_segment' => 'page', 'total_items' => count($this->get_posts()), 'items_per_page' => $array['per_page'], 'style' => $array['pagination']));
     if ($array['template'] != '') {
         $html = zest::template_to_html('snippets/' . $array['template']);
     } else {
         $html = $array['html'];
     }
     $html = str_replace("{RSS_LINK}", $this->get_rss(), $html);
     $html = str_replace("{FEEDPOSTS}", $feedposts, $html);
     $html = str_replace("{PAGINATION}", $pagination, $html);
     $html = str_replace("{FEED_LINK}", $this->get_url(), $html);
     return $html;
 }
开发者ID:sydlawrence,项目名称:SocialFeed,代码行数:36,代码来源:feed.php

示例6: __construct

 public function __construct($options = array())
 {
     $default = array("width" => 900, "height" => 150, "view" => "includes/banner", "images" => array());
     $config = Kohana::config_load('zest');
     $config = arr::overwrite($default, $config['banner']);
     $this->config = arr::overwrite($config, $options);
 }
开发者ID:sydlawrence,项目名称:SocialFeed,代码行数:7,代码来源:Banner.php

示例7: __construct

 public function __construct()
 {
     // Set the request data
     $this->request = $_SERVER['REQUEST_METHOD'] == 'POST' ? $_POST : $_GET;
     // Load the API configuration file
     Kohana::config_load('api');
 }
开发者ID:kh411d,项目名称:Ushahidi_Web,代码行数:7,代码来源:Api_Service.php

示例8: __construct

 public function __construct()
 {
     $this->zest = new Zest_admin();
     parent::__construct();
     $this->config = Kohana::config_load('zest');
     $this->__setup();
     if (request::is_ajax()) {
         $this->auto_render = FALSE;
         Event::add('system.post_controller', array($this, '_json_render'));
     }
 }
开发者ID:xig,项目名称:SocialFeed,代码行数:11,代码来源:zest_admin.php

示例9: __construct

 public function __construct($config = array())
 {
     // Check for GD library before doing anything
     if (extension_loaded('gd')) {
         $config += Kohana::config_load('dynamicimage');
         $this->config = $config;
         // Check for a filename and check it is a file
         if ($this->config['filename'] && is_file($this->config['filename'])) {
             // Set filename
             $this->filename = $this->config['filename'];
             $this->gd_data = getimagesize($this->filename);
             $this->gd_image_out = FALSE;
             // Get filesize
             $this->filesize = filesize($this->filename);
             // Get the Mimetype
             $this->mime_type = $this->gd_data['mime'];
             // Get dimensions
             $this->width = $this->gd_data[0];
             $this->height = $this->gd_data[1];
             $this->background_colour = $this->config['background'];
             $this->maintain_transparency = $this->config['maintain_transparency'];
             // Setup GD object
             switch ($this->gd_data['mime']) {
                 // If image is PNG, load PNG file
                 case "image/png":
                     $this->gd_image = imagecreatefrompng($this->filename);
                     break;
                     // If image is JPG, load JPG file
                 // If image is JPG, load JPG file
                 case "image/jpg":
                     $this->gd_image = imagecreatefromjpeg($this->filename);
                     break;
                     // If image is GIF, load GIF file
                 // If image is GIF, load GIF file
                 case "image/gif":
                     $this->gd_image = imagecreatefromgif($this->filename);
                     break;
                     // Otherwise image is not supported in this version (more to follow)
                 // Otherwise image is not supported in this version (more to follow)
                 default:
                     throw new Kohana_Exception("DynamicImage.__construct() Filetype {$this->mime_type} not supported yet.");
                     return;
             }
             $this->print_image($this->config['width'], $this->config['height'], $this->config['maintain_ratio'], $this->config['format']);
         } else {
             // Otherwise die horribly
             return FALSE;
         }
     } else {
         // Die informing user of lack of extentions
         throw new Kohana_Exception('GD Library not installed');
         return;
     }
 }
开发者ID:sydlawrence,项目名称:SocialFeed,代码行数:54,代码来源:DynamicImage.php

示例10: __construct

 /**
  * Instantiate the class and setup connection parameters.
  *
  * @param $BasecampUrl
  *   Your Basecamp Url. Should begin with http or https
  * @param $username
  *   Your Basecamp username.
  * @param $password
  *   Your Basecamp password.
  */
 public function __construct($username = null, $password = null, $basecampUserId = null, $BasecampUrl = null)
 {
     $config = Kohana::config_load('basecamp');
     $this->config = $config;
     $BasecampUrl = $config['basecamp.url'];
     $this->setBasecampUrl($BasecampUrl);
     $this->setUsername($username);
     $this->setPassword($password);
     $this->setAuthorId($basecampUserId);
     $this->setCategoryId($config['basecamp.categoryID']);
     $this->setProjectId($config['basecamp.projectID']);
 }
开发者ID:sydlawrence,项目名称:SocialFeed,代码行数:22,代码来源:Basecamp.php

示例11: __construct

 public function __construct()
 {
     parent::__construct();
     Kohana::config_load('workermgmt');
     $this->profiler = IN_DEV_MODE ? new Profiler() : null;
     $requested_area = strtolower(Router::$controller . "::" . Router::$method);
     if (!in_array($requested_area, $this->non_authed_areas)) {
         // run authentication
         if (!Bugzilla::instance(Kohana::config('workermgmt'))->authenticated()) {
             url::redirect('login');
         }
     }
 }
开发者ID:samkeen,项目名称:workermgmt-k,代码行数:13,代码来源:MY_Controller.php

示例12: __construct

 public function __construct()
 {
     // Set the request data
     $this->request = ($_SERVER['REQUEST_METHOD'] == 'POST')
         ? $_POST
         : $_GET;
     
     // Load the API configuration file
     Kohana::config_load('api');
     
     // Get the IP Address of the client submitting the API request
     $this->request_ip_address = $_SERVER['REMOTE_ADDR'];
     
     // Unpack the URL parameters
     $this->api_parameters = serialize(array_keys($this->request));
     
     // Instantiate the database
     $this->db = new Database();
 }
开发者ID:rkabir,项目名称:Ushahidi_Web,代码行数:19,代码来源:Api_Service.php

示例13: __construct

 public function __construct()
 {
     // AJAX requests don't need an outer template
     if (request::is_ajax()) {
         $this->template = 'templates/blank';
     }
     parent::__construct();
     // assign view array with system information
     //
     $this->template->system = Kohana::config_load('version');
     $this->db = Database::instance();
     $this->auth = new Auth();
     $this->session = new Session();
     if ($this->auth->logged_in()) {
         $this->template->menu = self::get_menu();
     }
     $title = kohana::config('indicia.warehouse_title');
     $this->template->warehouseTitle = $title ? $title : 'Indicia Warehouse';
 }
开发者ID:BirenRathod,项目名称:indicia-code,代码行数:19,代码来源:indicia.php

示例14: save

 public function save()
 {
     // This array maps the telephony returns to the telephony file
     $telephonyOptions = array('cfg_root' => rtrim($this->session->get('installer.ast_root'), '/'), 'AmiHost' => $this->session->get('installer.ami_host'), 'AmiPort' => $this->session->get('installer.ami_port'), 'AmiUser' => $this->session->get('installer.ami_user'), 'AmiPass' => $this->session->get('installer.ami_pass'));
     if (!is_dir($telephonyOptions['cfg_root'])) {
         message::set('Unable to access directory <pre>' . $telephonyOptions['cfg_root'] . '</pre>');
         return false;
     }
     // Write $telephonyOptions to asterisk.php
     if (!Installer_Controller::updateConfig($telephonyOptions, 'asterisk')) {
         return false;
     }
     // Set the driver name in telephony.php
     if (!Installer_Controller::updateConfig(array('driver' => 'Asterisk'), 'telephony')) {
         return false;
     }
     // Reload the new asterisk options
     Kohana::config_clear('asterisk');
     Kohana::config_load('asterisk');
     $this->session->set('installer.default_packages', kohana::config('asterisk.default_packages'));
     return true;
 }
开发者ID:swk,项目名称:bluebox,代码行数:22,代码来源:asterisk.php

示例15: __construct

 public function __construct()
 {
     // Set the request data
     $this->request = $_SERVER['REQUEST_METHOD'] == 'POST' ? $_POST : $_GET;
     // Reset the session - API should be stateless
     $_SESSION = array();
     // Especially reset auth
     Session::instance()->set(Kohana::config('auth.session_key'), null);
     // Load the API configuration file
     Kohana::config_load('api');
     // Get the IP Address of the client submitting the API request
     // Check if the IP is from a shared internet connection
     if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
         $this->request_ip_address = $_SERVER['HTTP_CLIENT_IP'];
     } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
         $this->request_ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];
     } else {
         $this->request_ip_address = $_SERVER['REMOTE_ADDR'];
     }
     // Unpack the URL parameters
     $this->api_parameters = serialize(array_keys($this->request));
     // Instantiate the database
     $this->db = new Database();
 }
开发者ID:nanangsyaifudin,项目名称:HAC-2012,代码行数:24,代码来源:Api_Service.php


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