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


PHP System::init方法代码示例

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


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

示例1: die

    } else {
        if (file_exists(HELPERS . $file . ".php")) {
            require_once HELPERS . $file . ".php";
        } else {
            if (file_exists(HELPERS . "/Email/" . $file . ".php")) {
                require_once HELPERS . "/Email/" . $file . ".php";
            } else {
                if (file_exists(SYSTEM . $file . ".php")) {
                    require_once SYSTEM . $file . ".php";
                } else {
                    if (file_exists(CONTROLLERS . $file . "Controller.php")) {
                        require_once CONTROLLERS . $file . "Controller.php";
                    } else {
                        if (file_exists(LIB . $file . ".php")) {
                            require_once LIB . $file . ".php";
                        } else {
                            if ($file == "DATABASE_CONFIG") {
                                require_once CONFIG . "database.php";
                            } else {
                                die($file . " não encontrado");
                            }
                        }
                    }
                }
            }
        }
    }
}
$start = new System();
$start->init();
$start->run();
开发者ID:BrunoMoreno,项目名称:Lothus-PHP,代码行数:31,代码来源:index.php

示例2: dirname

* @copyright   (C) 2005-2016 University of Sydney
* @author      Artem Osmakov   <artem.osmakov@sydney.edu.au>
* @license     http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
*/
/*
* Licensed under the GNU License, Version 3.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at http://www.gnu.org/licenses/gpl-3.0.txt
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
* See the License for the specific language governing permissions and limitations under the License.
*/
require_once dirname(__FILE__) . "/../../hserver/System.php";
// init main system class
$system = new System();
$layout_theme = null;
$isSystemInited = $system->init(@$_REQUEST['db'], true);
if ($isSystemInited) {
    $user = $system->getCurrentUser();
    $layout_theme = @$user['ugr_Preferences']['layout_theme'];
    $error_msg = @$_REQUEST['msg'];
    if (!$error_msg) {
        $error_msg = 'Unknown error.';
    }
} else {
    //cannot connect to given database
    $err = $system->getError();
    $error_msg = @$err['message'];
    if (!$error_msg) {
        $error_msg = 'Unknown error. Cannot init Heurist system';
    }
}
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:31,代码来源:errorPage.php

示例3: dirname

 * See the License for the specific language governing permissions and limitations under the License.
 */
require_once dirname(__FILE__) . '/../System.php';
require_once dirname(__FILE__) . '/../dbaccess/db_users.php';
require_once dirname(__FILE__) . '/../dbaccess/db_svs.php';
$response = array();
//"status"=>"fatal", "message"=>"OBLOM");
$res = false;
$action = @$_REQUEST['a'];
//$system->getError();
$system = new System();
if ($action == 'is_logged') {
    //just check only if logged in
    $res = $system->is_logged(@$_REQUEST['db']);
} else {
    if (!$system->init(@$_REQUEST['db'], $action != 'sysinfo')) {
        //the only action that is possible without db
        //get error and response
        //$response = $system->getError();
    } else {
        if ($action == 'usr_log') {
            $system->user_LogActivity(@$_REQUEST['activity'], @$_REQUEST['suplementary']);
            $res = true;
        } else {
            $mysqli = $system->get_mysqli();
            if ($action == "sysinfo") {
                $res = $system->getCurrentUserAndSysInfo();
            } else {
                //no enough permission for guest
                if ($system->get_user_id() < 1 && !($action == 'login' || $action == 'logout' || $action == 'reset_password' || $action == 'svs_savetree' || $action == 'svs_gettree' || $action == 'usr_save' || $action == 'usr_get' || $action == 'svs_get')) {
                    $response = $system->addError(HEURIST_REQUEST_DENIED);
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:31,代码来源:usr_info.php

示例4: define

<?php

// Константы
define("BASE", mb_substr($_SERVER["SCRIPT_FILENAME"], 0, mb_strrpos($_SERVER["SCRIPT_FILENAME"], "/")));
require_once "db-config.php";
require_once "libs/system.class.php";
require_once "libs/router.class.php";
require_once "libs/db.class.php";
require_once "libs/core.class.php";
DB::init();
System::init();
Router::init();
$core = new Core();
$content = $core->run();
echo $content;
开发者ID:Accami,项目名称:BravelCMS,代码行数:15,代码来源:combiner.php

示例5: dirname

* @author      Artem Osmakov   <artem.osmakov@sydney.edu.au>
* @license     http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @version     4.0
*/
/*
* Licensed under the GNU License, Version 3.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at http://www.gnu.org/licenses/gpl-3.0.txt
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
* See the License for the specific language governing permissions and limitations under the License.
*/
// TODO: crosstabulation.php      UNDER DEVELOPMENT    see also /viewers/crosstabs/crosstabs.php (vsn 3 version)
require_once dirname(__FILE__) . "/../System.php";
require_once dirname(__FILE__) . "/../dbaccess/db_structure.php";
$system = new System();
if (!$system->init(@$_REQUEST['db'], true)) {
    //@todo - redirect to error page
    print_r($system->getError(), true);
    exit;
}
?>
<html>
    <head>
        <title><?php 
echo HEURIST_TITLE;
?>
</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

        <link rel="stylesheet" href="../../ext/jquery-ui-1.10.2/themes/base/jquery-ui.css" />
        <link rel="stylesheet" type="text/css" href="../../style.css">
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:31,代码来源:crosstabulation.php

示例6: dirname

 * Licensed under the GNU License, Version 3.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at http://www.gnu.org/licenses/gpl-3.0.txt
 * Unless required by applicable law or agreed to in writing, software distributed under the License is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
 * See the License for the specific language governing permissions and limitations under the License.
 */
require_once dirname(__FILE__) . '/../System.php';
require_once dirname(__FILE__) . '/../dbaccess/db_structure.php';
require_once dirname(__FILE__) . '/../dbaccess/db_structure_tree.php';
/* DEBUG
   $_REQUEST['db'] = 'dos_3';
   $_REQUEST['q'] = 'manly';
   */
$response = array();
$system = new System();
if (!$system->init(@$_REQUEST['db'])) {
    //get error and response
    $response = $system->getError();
} else {
    //$currentUser = $system->getCurrentUser();
    $data = array();
    if (@$_REQUEST['terms']) {
        $data["terms"] = dbs_GetTerms($system);
    }
    if (@$_REQUEST['detailtypes']) {
        $ids = $_REQUEST['detailtypes'] == 'all' ? null : $_REQUEST['detailtypes'];
        $data["detailtypes"] = dbs_GetDetailTypes($system, $ids, intval(@$_REQUEST['mode']));
    }
    if (@$_REQUEST['rectypes']) {
        $ids = $_REQUEST['rectypes'] == 'all' ? null : $_REQUEST['rectypes'];
        $mode = intval(@$_REQUEST['mode']);
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:31,代码来源:sys_structure.php

示例7: define

* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
* See the License for the specific language governing permissions and limitations under the License.
*/
if (!defined('PDIR')) {
    define('PDIR', '../');
}
if (isset($system)) {
    //this is inclusion into index.php
    if (!$isSystemInited) {
        $isSystemInited = $system->init(@$_REQUEST['db'], false);
        //init wihout db
    }
} else {
    require_once dirname(__FILE__) . "/../System.php";
    $system = new System();
    $isSystemInited = $system->init(@$_REQUEST['db'], false);
    //init wihout db
}
if (!$isSystemInited) {
    //cannot init system (apparently connection to Database Server is wrong or server is down)
    $err = $system->getError();
    $error_msg = @$err['message'];
}
if ($system->get_mysqli() != null) {
    //server is connected
    $list = mysql__getdatabases4($system->get_mysqli());
    if (count($list) < 1) {
        //reditrect to create database
        header('Location: ' . HEURIST_BASE_URL . 'admin/setup/dbcreate/createNewDB.php');
        exit;
    }
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:31,代码来源:list_databases.php

示例8: dirname

 * @license     http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
 * @version     4.0
 */
/*
 * Licensed under the GNU License, Version 3.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at http://www.gnu.org/licenses/gpl-3.0.txt
 * Unless required by applicable law or agreed to in writing, software distributed under the License is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
 * See the License for the specific language governing permissions and limitations under the License.
 */
require_once dirname(__FILE__) . '/../System.php';
if (isset($_REQUEST['db'])) {
    $dbName = $_REQUEST['db'];
    // Initialize a System object that uses the requested database
    $system = new System();
    if ($system->init($dbName)) {
        // Result object
        $result = new stdClass();
        $result->HeuristVersion = HEURIST_VERSION;
        $result->HeuristBaseURL = HEURIST_BASE_URL;
        $result->HeuristDBName = $dbName;
        // Retrieving all nodes
        $rectypes = getRectypes($system);
        $result->nodes = $rectypes;
        // Retrieving all links
        $links = getLinks($system, $rectypes);
        $result->links = $links;
        // Returning result as JSON
        header('Content-type: application/json');
        print json_encode($result);
    } else {
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:31,代码来源:rectype_relations.php

示例9: downloadFile

 //@todo - allow Obfuscated id only
 $fileid = @$_REQUEST['thumb'];
 if ($fileid) {
     $system->initPathConstants($db);
     $thumbfile = HEURIST_THUMB_DIR . 'ulf_' . $fileid . '.png';
     if (file_exists($thumbfile)) {
         downloadFile('image/png', $thumbfile);
     } else {
         //@todo - change to the same script in h4
         $thumb_url = HEURIST_BASE_URL . "common/php/resizeImage.php?db=" . $db . "&ulf_ID=" . $fileid;
         header("Location: " . $thumb_url);
         exit;
     }
 } else {
     if (@$_REQUEST['id']) {
         $system->init($db);
         $fileid = @$_REQUEST['id'];
         //find
         $listpaths = fileGetPath_URL_Type($system, $fileid);
         if (is_array($listpaths) && count($listpaths) > 0) {
             $fileinfo = $listpaths[0];
             $filepath = $fileinfo[0];
             $url = $fileinfo[1];
             $mimeType = $fileinfo[2];
             $params = $fileinfo[3];
             $originalFileName = $fileinfo[4];
             $is_video = strpos($mimeType, "video/") === 0 || strpos($params, "video") !== false;
             $is_audio = strpos($mimeType, "audio/") === 0 || strpos($params, "audio") !== false;
             if (@$_REQUEST['player'] && ($is_video || $is_audio)) {
                 if ($url) {
                     $filepath = $url;
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:31,代码来源:file_download.php

示例10: pnInit

/**
 * Initialise Zikula
 * Carries out a number of initialisation tasks to get Zikula up and
 * running.
 *
 * @deprecated Deprecated since version 1.3.0.
 * @see System::init()
 *
 * @returns bool true initialisation successful false otherwise
 */
function pnInit($stages = PN_CORE_ALL)
{
    LogUtil::log(__f('Warning! Function %1$s is deprecated. Please use %2$s instead.', array(__FUNCTION__, 'System::init')), E_USER_DEPRECATED);
    return System::init($stages);
}
开发者ID:projectesIF,项目名称:Sirius,代码行数:15,代码来源:Api.php

示例11: recordSearch

/**
 * put your comment there...
 *
 * @param mixed $system
 * @param mixed $params
 *
 *       FOR RULES
 *       rules - rules queries - to search related records on server side
 *       getrelrecs (=1) - search relationship records (along with related) on server side
 *       topids - list of records ids, it is used to compose 'parentquery' parameter to use in rules (@todo - replace with new rules algorithm)
 *
 *       INTERNAL/recursive
 *       parentquery - sql expression to substiture in rule query
 *       sql - sql expression to execute (used as recursive parameters to search relationship records)
 *
 *       SEARCH parameters that are used to compose sql expression
 *       q - query string (old mode) or json array (new mode)
 *       w (=all|bookmark a|b) - search among all or bookmarked records
 *       limit  - limit for sql query is set explicitely on client side
 *       offset - offset parameter value for sql query
 *       s - sort order
 *
 *       OUTPUT parameters
 *       vo (=h3) - output format in h3 for backward capability (for detail=ids only)
 *       needall (=1) - by default it returns only first 3000, to return all set it to 1,
 *                      it is set to 1 for server-side rules searches
 *       publiconly (=1) - ignore current user and returns only public records
 *
 *       detail (former 'f') - ids       - only record ids
 *                             header    - record header
 *                             timemap   - record header + timemap details
 *                             detail    - record header + all details
 *                             structure - record header + all details + record type structure (for editing) - NOT USED
 *
 *       CLIENT SIDE
 *       id - unque id to sync with client side
 *       source - id of html element that is originator of this search
 *       qname - original name of saved search (for messaging)
 */
function recordSearch($system, $params)
{
    //for error message
    $savedSearchName = @$params['qname'] ? "Saved search: " . $params['qname'] . "<br>" : "";
    if (!@$params['detail']) {
        $params['detail'] = @$params['f'];
        //backward capability
    }
    $istimemap_request = @$params['detail'] == 'timemap';
    $istimemap_counter = 0;
    //total records with timemap data
    $fieldtypes_ids = null;
    if ($istimemap_request) {
        //get date,year and geo fields from structure
        $fieldtypes_ids = dbs_GetDetailTypes($system, array('date', 'year', 'geo'), 3);
        if ($fieldtypes_ids == null || count($fieldtypes_ids) == 0) {
            $fieldtypes_ids = array(DT_GEO_OBJECT, DT_DATE, DT_START_DATE, DT_END_DATE);
            //9,10,11,28';
        }
        $fieldtypes_ids = implode(',', $fieldtypes_ids);
    } else {
        if (!in_array(@$params['detail'], array('header', 'timemap', 'detail', 'structure'))) {
            //specific set of detail fields
            if (is_array($params['detail'])) {
                $fieldtypes_ids = $params['detail'];
            } else {
                $fieldtypes_ids = explode(',', $params['detail']);
            }
            if (is_array($fieldtypes_ids) && (count($fieldtypes_ids) > 1 || is_numeric($fieldtypes_ids[0]))) {
                $fieldtypes_ids = implode(',', $fieldtypes_ids);
                $params['detail'] = 'detail';
            } else {
                $fieldtypes_ids = null;
                $params['detail'] = 'ids';
            }
        }
    }
    $is_ids_only = 'ids' == $params['detail'];
    $return_h3_format = @$params['vo'] == 'h3' && $is_ids_only;
    if (null == $system) {
        $system = new System();
        if (!$system->init(@$_REQUEST['db'])) {
            $response = $system->getError();
            if ($return_h3_format) {
                $response['error'] = $response['message'];
            }
            return $response;
        }
    }
    $mysqli = $system->get_mysqli();
    $currentUser = $system->getCurrentUser();
    if ($system->get_user_id() < 1) {
        $params['w'] = 'all';
        //does not allow to search bookmarks if not logged in
    }
    if ($is_ids_only) {
        $select_clause = 'select SQL_CALC_FOUND_ROWS DISTINCT rec_ID ';
    } else {
        $select_clause = 'select SQL_CALC_FOUND_ROWS DISTINCT ' . 'bkm_ID,' . 'bkm_UGrpID,' . 'rec_ID,' . 'rec_URL,' . 'rec_RecTypeID,' . 'rec_Title,' . 'rec_OwnerUGrpID,' . 'rec_NonOwnerVisibility,' . 'bkm_PwdReminder ';
        /*.'rec_URLLastVerified,'
          .'rec_URLErrorMessage,'
//.........这里部分代码省略.........
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:101,代码来源:db_recsearch.php


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