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


PHP Settings::init方法代码示例

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


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

示例1: basic

 /** Basic initialization - preload settings and locales
  * @return void
  */
 public static function basic()
 {
     Loader::init();
     Status::init();
     Settings::init();
     Locales::init();
     Router::update_rewrite();
 }
开发者ID:just-paja,项目名称:fudjan,代码行数:11,代码来源:init.php

示例2: __construct

 public function __construct() {          // the constructor function
  $this->settings = Settings::init();     // load settings file
  new SessionSaveHandler(getrootdirsrv().$this->settings->sessionsavepath);
  
  date_default_timezone_set($this->settings->timezone);       // set the default timezone. may be we need to customize it for particular user
  $this->model       = new Model($this->settings);            // instantiate the Model class
  $this->less        = new lessc;
  $this->StringForge = new StringForge($this->settings);
 }
开发者ID:serega011,项目名称:izumrud,代码行数:9,代码来源:Controller.php

示例3: PerformClean

 /**
  * Perform the cleaning
  *
  * @return void
  * @author Franck Royer
  */
 public static function PerformClean()
 {
     if (!isset(Settings::$photos_dir) || !isset(Settings::$thumbs_dir)) {
         Settings::init();
     }
     if (!is_dir(Settings::$photos_dir) || !is_dir(Settings::$thumbs_dir)) {
         error_log("ERROR/Cleaning::PerformClean: " . $photos_dir . " or " . $thumbs_dir . " do not exit, cannot proceed.");
         return;
     }
     //TODO Windows
     // Clean Old thumbnails
     exec("cd " . Settings::$thumbs_dir . " && find . -type f -iregex '.*[^\\(xml\\)\\(job\\)]\$' 2>&1", $output, $ret_var);
     if ($ret_var != 0) {
         error_log("ERROR/Cleaning::PerformClean: Execution failed: " . print_r($output));
     }
     foreach ($output as $file) {
         if (!file_exists(Settings::$photos_dir . '/' . $file)) {
             error_log('DEBUG/Cleaning::PerformClean: erase ' . Settings::$thumbs_dir . '/' . $file . "\n");
             unlink(Settings::$thumbs_dir . '/' . $file);
         }
     }
     // Now cleaning Pending jobs
     unset($output);
     unset($ret_var);
     exec("cd " . Settings::$thumbs_dir . " && find . -type f -name '*job' 2>&1", $output, $ret_var);
     if ($ret_var != 0) {
         error_log("ERROR/Cleaning::PerformClean: Execution failed: " . print_r($output));
         return;
     }
     foreach ($output as $jobfilename) {
         // need the absolute path of the video file
         //error_log('DEBUG/Cleaning::PerformClean: processing job '.$jobfilename."\n");
         $jobfile = new File(Settings::$thumbs_dir . '/' . $jobfilename);
         $filename_no_ext = Settings::$photos_dir . '/' . dirname($jobfilename) . '/' . $jobfile->name;
         $files = glob($filename_no_ext . '.*');
         if (empty($files)) {
             error_log("ERROR/Cleaning::PerformClean: no file found for job " . $jobfilename . ", deleting\n");
             unlink(Settings::$thumbs_dir . '/' . $jobfilename);
             continue;
         }
         //error_log('DEBUG/Cleaning::PerformClean: calling NoJob with '.$files[0]."\n");
         Video::NoJob($files[0]);
     }
     // Finally clean empty files
     unset($output);
     unset($ret_var);
     exec("cd " . Settings::$thumbs_dir . " && find . -size 0b 2>&1", $output, $ret_var);
     if ($ret_var != 0) {
         error_log("ERROR/Cleaning::PerformClean: Execution failed: " . print_r($output));
         return;
     }
     foreach ($output as $emptyfile) {
         unlink(Settings::$thumbs_dir . '/' . $emptyfile);
     }
 }
开发者ID:inscriptionweb,项目名称:PhotoShow,代码行数:61,代码来源:Cleaning.php

示例4: __construct

 function __construct()
 {
     require_once dirname(__FILE__) . '/../XRL/src/Autoload.php';
     /// Initialize variables
     Settings::init();
     /// Initialize CurrentUser
     CurrentUser::init();
     $this->server = new XRL_Server();
     $this->server["XRL_DecoderFactoryInterface"] = new XRL_NonValidatingDecoderFactory();
     foreach (get_class_methods('API') as $c) {
         if ($c == '__construct') {
             continue;
         }
         $this->server->{$c} = array('API', $c);
     }
     $this->server->foo = array('API', 'foo');
     $this->server->handle()->publish();
 }
开发者ID:inscriptionweb,项目名称:PhotoShow,代码行数:18,代码来源:API.php

示例5: tab_work_days

        return $tabs;
    }
    /**
     * Render the workdays tab
     *
     * @return void
     */
    public function tab_work_days()
    {
        include WPERP_HRM_VIEWS . '/settings/tab-workdays.php';
    }
    /**
     * Save work days from settings
     *
     * @return void
     */
    public function save_work_days()
    {
        if (!wp_verify_nonce($_POST['_wpnonce'], 'erp-settings')) {
            die;
        }
        $company_id = erp_get_current_company_id();
        $option_key = 'erp_hr_work_days_' . $company_id;
        $days = array_map('absint', $_POST['day']);
        if (count($days) == 7) {
            update_option($option_key, $days);
        }
    }
}
Settings::init();
开发者ID:nizamuddin,项目名称:wp-erp,代码行数:30,代码来源:class-settings.php

示例6: avo_add_options_page

/**
 * Display the settings panel
 *
 */
function avo_add_options_page()
{
    $options = new Settings();
    // width field
    $options->add_field(array('name' => 'width', 'label' => __('Embed Width', 'avo'), 'type' => 'text'));
    // height field
    $options->add_field(array('name' => 'height', 'label' => __('Embed Height', 'avo'), 'type' => 'text'));
    // Render the page
    $options->init();
}
开发者ID:Troetelbiertje,项目名称:avo,代码行数:14,代码来源:options.inc.php

示例7: __construct

 function __construct()
 {
     /// Initialize variables
     Settings::init();
     /// Initialize CurrentUser
     try {
         CurrentUser::init();
     } catch (Exception $e) {
         $page = new RegisterPage(true);
         $page->toHTML();
         return;
     }
     /// Check what to do
     switch (CurrentUser::$action) {
         case "Judge":
             // Same as page
         // Same as page
         case "Page":
             $page = new MainPage();
             $page->toHTML();
             break;
         case "Log":
             $page = new LoginPage();
             $page->toHTML();
             break;
         case "Reg":
             $page = new RegisterPage();
             $page->toHTML();
             break;
         case "JS":
             $page = new JS();
             break;
         case "Img":
             Provider::Image(CurrentUser::$path);
             break;
         case "BDl":
             Provider::Image(CurrentUser::$path, false, true, true, true);
             break;
         case "Big":
             Provider::Image(CurrentUser::$path, false, true);
             break;
         case "Thb":
             Provider::Image(CurrentUser::$path, true);
             break;
         case "Zip":
             Provider::Zip(CurrentUser::$path);
             break;
         case "Acc":
             if (CurrentUser::$admin && isset($_POST['login'])) {
                 $acc = new Account($_POST['login']);
             } else {
                 $acc = CurrentUser::$account;
             }
             $acc->toHTML();
             break;
         case "Adm":
             $page = new Admin();
             $page->toHTML();
             break;
     }
 }
开发者ID:nemtos,项目名称:PhotoShow,代码行数:61,代码来源:Index.php

示例8: header

$db->debug = $config['db']['debug'];
$db->persistent = $config['db']['persistent'];
$db->file = $config['db']['file'];
$db->user = $config['db']['user'];
$db->pass = $config['db']['pass'];
$db->name = $config['db']['name'];
$db->socket = $config['db']['socket'];
$db->host = $config['db']['host'];
if (!$db->init()) {
    header('HTTP/1.1 500 Internal Server Error');
    die('DBE');
}
/* read settings, determine virtual host  */
require classes_dir . 'settings.php';
$settings = new Settings();
if (!$settings->init() && !preg_match('/^\\/_\\//', $_SERVER['REQUEST_URI'])) {
    header('HTTP/1.1 500 Internal Server Error');
    die('VHE');
}
/* initialise memcache */
require classes_dir . 'memcache.php';
$memcache = new Memcache();
$memcache->enabled = $config['memcache']['enabled'];
$memcache->server = $config['memcache']['server'];
$memcache->port = $config['memcache']['port'];
$memcache->prefix = $config['memcache']['prefix'] ? $config['memcache']['prefix'] : 'fearqdb';
$memcache->debug = $config['memcache']['debug'];
$memcache->init();
/* encoding */
if ($db->type == 'mysql') {
    $db->query(sprintf('SET NAMES utf8 COLLATE %s', $settings->collate));
开发者ID:RDash21,项目名称:fearqdb,代码行数:31,代码来源:init.php

示例9: set

 /**
  * Save new settings
  *
  * @return void
  * @author Thibaud Rohmer
  */
 public static function set()
 {
     $var = array("name", "site_address", "like", "plusone", "fbappid", "max_comments", "noregister", "forcehttps", "nocomments", "nodownload", "loc", "l33t", "reverse_menu", "encode_video", "ffmpeg_path", "ffmpeg_option", "user_theme", "thumbs_size", "rss");
     $f = fopen(Settings::$admin_settings_file, "w");
     foreach ($var as $v) {
         if (isset($_POST["{$v}"])) {
             fwrite($f, "{$v} = \"" . $_POST["{$v}"] . "\"\n");
         }
     }
     fclose($f);
     Settings::init(true);
 }
开发者ID:inscriptionweb,项目名称:PhotoShow,代码行数:18,代码来源:Settings.php

示例10: init_config

 /**
  * Load the config
  */
 public static function init_config()
 {
     Settings::init(false, $GLOBALS['config_file']);
     try {
         CurrentUser::init();
     } catch (Exception $e) {
         // Yes I know, no account file found
     }
 }
开发者ID:inscriptionweb,项目名称:PhotoShow,代码行数:12,代码来源:TestUnit.php


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