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


PHP repository::__construct方法代码示例

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


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

示例1: __construct

    public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array()) {
        global $SESSION, $CFG, $DB, $PAGE;
        if (!is_numeric($repositoryid)) {
            // ELIS-8550: were constructing these with repositoryid = 'elisfiles'
            $sql = 'SELECT MIN(ri.id)
                      FROM {repository} r
                      JOIN {repository_instances} ri
                        ON r.id = ri.typeid
                     WHERE r.type = ?';
            $repositoryid = $DB->get_field_sql($sql, array($repositoryid));
        }
        parent::__construct($repositoryid, $context, $options);

        require_once dirname(__FILE__). '/ELIS_files_factory.class.php';

        if (is_object($context)) {
            $this->context = $context;
        } else {
            $this->context = context::instance_by_id($context);
        }

        /// ELIS files class
        $this->elis_files = repository_factory::factory();
        $this->config = get_config('elisfiles');
        $this->current_node = null;

        // jQuery files required for file picker - just for this repository
        $PAGE->requires->js('/repository/elisfiles/js/jquery-1.6.2.min.js');
        $PAGE->requires->js('/repository/elisfiles/js/jquery-ui-1.8.16.custom.min.js');
        $PAGE->requires->js('/repository/elisfiles/js/fileuploader.js');
        $PAGE->requires->js('/repository/elisfiles/lib/HTML_TreeMenu-1.2.0/TreeMenu.js', true);
    }
开发者ID:jamesmcq,项目名称:elis,代码行数:32,代码来源:lib.php

示例2: __construct

 /**
  * @param int $repositoryid
  * @param object $context
  * @param array $options
  */
 public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array())
 {
     global $CFG;
     parent::__construct($repositoryid, $context, $options);
     $this->file_url = optional_param('file', '', PARAM_RAW);
     $this->file_url = $this->escape_url($this->file_url);
 }
开发者ID:evltuma,项目名称:moodle,代码行数:12,代码来源:lib.php

示例3: __construct

 public function __construct($repositoryid, $context = SITEID, $options = array())
 {
     global $SESSION, $CFG;
     parent::__construct($repositoryid, $context, $options);
     $this->sessname = 'alfresco_ticket_' . $this->id;
     if (class_exists('SoapClient')) {
         require_once $CFG->libdir . '/alfresco/Service/Repository.php';
         require_once $CFG->libdir . '/alfresco/Service/Session.php';
         require_once $CFG->libdir . '/alfresco/Service/SpacesStore.php';
         require_once $CFG->libdir . '/alfresco/Service/Node.php';
         // setup alfresco instance
         $this->instance = new Alfresco_Repository($this->options['alfresco_url']);
         $this->username = optional_param('al_username', '', PARAM_RAW);
         $this->password = optional_param('al_password', '', PARAM_RAW);
         try {
             // deal with user logging in
             if (empty($SESSION->{$this->sessname}) && !empty($this->username) && !empty($this->password)) {
                 $this->ticket = $this->instance->authenticate($this->username, $this->password);
                 $SESSION->{$this->sessname} = $this->ticket;
             } else {
                 if (!empty($SESSION->{$this->sessname})) {
                     $this->ticket = $SESSION->{$this->sessname};
                 }
             }
             $this->user_session = $this->instance->createSession($this->ticket);
             $this->store = new SpacesStore($this->user_session);
         } catch (Exception $e) {
             $this->logout();
         }
         $this->current_node = null;
     } else {
         $this->disabled = true;
     }
 }
开发者ID:ajv,项目名称:Offline-Caching,代码行数:34,代码来源:repository.class.php

示例4: __construct

 /**
  * Constructor
  * @param int $repositoryid
  * @param object $context
  * @param array $options
  */
 public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array())
 {
     global $CFG;
     parent::__construct($repositoryid, $context, $options);
     $this->access_key = get_config('s3', 'access_key');
     $this->secret_key = get_config('s3', 'secret_key');
     $this->endpoint = get_config('s3', 'endpoint');
     if ($this->endpoint === false) {
         // If no endpoint has been set, use the default.
         $this->endpoint = 's3.amazonaws.com';
     }
     $this->s = new S3($this->access_key, $this->secret_key, false, $this->endpoint);
     $this->s->setExceptions(true);
     // Port of curl::__construct().
     if (!empty($CFG->proxyhost)) {
         if (empty($CFG->proxyport)) {
             $proxyhost = $CFG->proxyhost;
         } else {
             $proxyhost = $CFG->proxyhost . ':' . $CFG->proxyport;
         }
         $proxytype = CURLPROXY_HTTP;
         $proxyuser = null;
         $proxypass = null;
         if (!empty($CFG->proxyuser) and !empty($CFG->proxypassword)) {
             $proxyuser = $CFG->proxyuser;
             $proxypass = $CFG->proxypassword;
         }
         if (!empty($CFG->proxytype) && $CFG->proxytype == 'SOCKS5') {
             $proxytype = CURLPROXY_SOCKS5;
         }
         $this->s->setProxy($proxyhost, $proxyuser, $proxypass, $proxytype);
     }
 }
开发者ID:rushi963,项目名称:moodle,代码行数:39,代码来源:lib.php

示例5: __construct

 public function __construct($repositoryid, $context, array $options, $readonly)
 {
     global $SESSION, $PAGE;
     parent::__construct($repositoryid, $context, $options, $readonly);
     $this->config = get_config('entermedia');
     $PAGE->requires->js('/repository/entermedia/javascript/jquery.sumoselect.min.js');
     $PAGE->requires->yui_module('moodle-repository_entermedia-filepicker', 'M.repository_entermedia.filepicker.init');
     $PAGE->requires->strings_for_js(array('search_placeholder', 'search_selectall'), 'repository_entermedia');
     // Handle login
     if ($this->config->autologin_enable == 1) {
         $username = $this->config->autologin_user;
         $password = $this->config->autologin_password;
     } else {
         $username = optional_param('entermedia_username', '', PARAM_RAW);
         $password = optional_param('entermedia_password', '', PARAM_RAW);
     }
     try {
         if (empty($SESSION->entermediakey) && !empty($username) && !empty($password)) {
             $maybeKey = $this->try_login($username, $password);
             if ($maybeKey) {
                 $this->entermediakey = $SESSION->entermediakey = $maybeKey;
             } else {
                 // TODO Handle error
             }
         } else {
             if (!empty($SESSION->entermediakey)) {
                 $this->entermediakey = $SESSION->entermediakey;
             }
         }
     } catch (GuzzleException $e) {
         $this->logout();
     }
 }
开发者ID:IT-Kartellet,项目名称:moodle-repository_entermedia,代码行数:33,代码来源:lib.php

示例6: __construct

 public function __construct($repositoryid = 9, $context = SYSCONTEXTID, $options = array(), $readonly = 0)
 {
     global $USER, $COURSE, $DB;
     $this->repositoryid = $repositoryid;
     $this->context = $context;
     $this->options = $options;
     $this->readonly = $readonly;
     $this->useremail = $COURSE->shortname . '@luther.edu';
     if (!($this->admin = get_config('morsle', 'google_admin'))) {
         throw new moodle_exception('Google admin not setup');
     }
     parent::__construct($this->repositoryid, $this->context, $this->options, $this->readonly);
     // days past last enrollment day that morsle resources are retained
     $this->expires = get_config('morsle', 'morsle_expiration') == 0 ? 600 * 24 * 60 * 60 : get_config('blocks/morsle', 'morsle_expiration') * 24 * 60 * 60;
     $this->curtime = time();
     // set basefeeds
     $this->user_auth = "https://www.googleapis.com/auth/admin.directory.user";
     $this->site_feed = "https://sites.google.com/feeds/site/{$this->domain}";
     $this->drive_auth = 'https://www.googleapis.com/auth/drive ';
     $this->file_auth = 'https://www.googleapis.com/auth/drive.file ';
     $this->alias_feed = "https://apps-apis.google.com/a/feeds/alias/2.0/{$this->domain}/?start=aaaarnold@luther.edu";
     $this->group_auth = 'https://www.googleapis.com/auth/admin.directory.group';
     $this->id_feed = 'https://docs.google.com/feeds/id/';
     $this->cal_auth = 'https://www.googleapis.com/auth/calendar';
     $this->owncalendars_feed = 'https://www.google.com/calendar/feeds/default/owncalendars/full';
     // skip marked for delete, unapproved and past term
     $this->disregard = "'Past Term','DELETED'";
 }
开发者ID:rlorenzo,项目名称:moodle-repository_morsle,代码行数:28,代码来源:lib.php

示例7: __construct

 /**
  * Constructor of dropbox plugin
  *
  * @param int $repositoryid
  * @param stdClass $context
  * @param array $options
  */
 public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array())
 {
     global $CFG;
     $options['page'] = optional_param('p', 1, PARAM_INT);
     parent::__construct($repositoryid, $context, $options);
     $this->setting = 'dropbox_';
     $this->dropbox_key = $this->get_option('dropbox_key');
     $this->dropbox_secret = $this->get_option('dropbox_secret');
     // one day
     $this->cachedfilettl = 60 * 60 * 24;
     if (isset($options['access_key'])) {
         $this->access_key = $options['access_key'];
     } else {
         $this->access_key = get_user_preferences($this->setting . '_access_key', '');
     }
     if (isset($options['access_secret'])) {
         $this->access_secret = $options['access_secret'];
     } else {
         $this->access_secret = get_user_preferences($this->setting . '_access_secret', '');
     }
     if (!empty($this->access_key) && !empty($this->access_secret)) {
         $this->logged = true;
     }
     $callbackurl = new moodle_url($CFG->wwwroot . '/repository/repository_callback.php', array('callback' => 'yes', 'repo_id' => $repositoryid));
     $args = array('oauth_consumer_key' => $this->dropbox_key, 'oauth_consumer_secret' => $this->dropbox_secret, 'oauth_callback' => $callbackurl->out(false), 'api_root' => 'https://api.dropbox.com/1/oauth');
     $this->dropbox = new dropbox($args);
 }
开发者ID:krysnuvadga,项目名称:moodle,代码行数:34,代码来源:lib.php

示例8: __construct

 public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array())
 {
     parent::__construct($repositoryid, $context, $options);
     $this->keyword = optional_param('merlot_keyword', '', PARAM_RAW);
     $this->author = optional_param('merlot_author', '', PARAM_RAW);
     $this->licensekey = trim(get_config('merlot', 'licensekey'));
 }
开发者ID:EmmanuelYupit,项目名称:educursos,代码行数:7,代码来源:lib.php

示例9: __construct

 public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array())
 {
     parent::__construct($repositoryid, $context, $options);
     $this->list_url = "https://media.heanet.ie/api/1.0/media_list.php?";
     $this->check_login_url = "https://media.heanet.ie/api/1.0/media_list.php?";
     $this->bind_url = "https://media.heanet.ie/secure/account/user_setguid.php?";
 }
开发者ID:heanet,项目名称:moodle_media,代码行数:7,代码来源:lib.php

示例10: __construct

 /**
  * Constructor
  * @param int $repositoryid
  * @param object $context
  * @param array $options
  */
 public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array()) {
     parent::__construct($repositoryid, $context, $options);
     $this->access_key = get_config('s3', 'access_key');
     $this->secret_key = get_config('s3', 'secret_key');
     $this->s = new S3($this->access_key, $this->secret_key);
     $this->s->setExceptions(true);
 }
开发者ID:Burick,项目名称:moodle,代码行数:13,代码来源:lib.php

示例11: __construct

 public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array())
 {
     parent::__construct($repositoryid, $context, $options);
     // set up webdav client
     if (empty($this->options['webdav_server'])) {
         return;
     }
     if ($this->options['webdav_auth'] == 'none') {
         $this->options['webdav_auth'] = false;
     }
     $this->dav = new webdav_client($this->options['webdav_server'], $this->options['webdav_user'], $this->options['webdav_password'], $this->options['webdav_auth']);
     if (empty($this->options['webdav_type'])) {
         $this->webdav_type = '';
     } else {
         $this->webdav_type = 'ssl://';
     }
     if (empty($this->options['webdav_port'])) {
         if (empty($this->webdav_type)) {
             $this->dav->port = 80;
         } else {
             $this->dav->port = 443;
         }
         $port = '';
     } else {
         $this->dav->port = $this->options['webdav_port'];
         $port = ':' . $this->options['webdav_port'];
     }
     $this->webdav_host = $this->webdav_type . $this->options['webdav_server'] . $port;
     $this->dav->debug = false;
 }
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:30,代码来源:lib.php

示例12: __construct

 /**
  * Youtube plugin constructor
  * @param int $repositoryid
  * @param object $context
  * @param array $options
  */
 public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array())
 {
     $this->start = 1;
     $this->max = 27;
     $this->sort = optional_param('youtube_sort', 'relevance', PARAM_TEXT);
     parent::__construct($repositoryid, $context, $options);
 }
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:13,代码来源:lib.php

示例13: __construct

 public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array())
 {
     $options['page'] = optional_param('p', 1, PARAM_INT);
     parent::__construct($repositoryid, $context, $options);
     // if moodle is telling us what kind of mimetypes it wants, we check to see if it happens to be just ZIP.
     // If that's the case, we know we're on a SCORM page, because in all other cases supported_filetypes() will return web_image
     // this allows us to override our own type and act like a SCORM supplier.
     if (isset($options['mimetypes'])) {
         if (in_array(".zip", $options['mimetypes'])) {
             $this->fileTypes = "zipscorm";
             $this->fileExtension = ".zip";
         }
     }
     $this->setting = 'elevator_';
     $elevatorURL = get_config('elevator', 'elevatorURL');
     $apiKey = get_config('elevator', 'apiKey');
     $apiSecret = get_config('elevator', 'apiSecret');
     if (isset($options['userId'])) {
         $this->userId = $options['userId'];
     } else {
         $this->userId = get_user_preferences($this->setting . '_userId', '');
     }
     $this->repositoryId = $repositoryid;
     // initiate an instance of the elevator API, which handles all the backend communication.
     $this->elevatorAPI = new elevatorAPI($elevatorURL, $apiKey, $apiSecret, $this->userId);
     $this->elevatorAPI->fileTypes = $this->fileTypes;
     if ($this->userId) {
         $this->loggedIn = $this->testUserId();
         $this->manageURL = $this->elevatorAPI->getManageURL();
     }
 }
开发者ID:UMN-LATIS,项目名称:moodle-repository_elevator,代码行数:31,代码来源:lib.php

示例14: __construct

 public function __construct($repositoryid, $context = SITEID, $options = array())
 {
     parent::__construct($repositoryid, $context, $options);
     if (empty($this->root_path)) {
         return;
     }
     $this->root_path = trim($this->root_path);
     if (!empty($options['ajax'])) {
         // if created from filepicker
         if (empty($this->root_path)) {
             $ret = array();
             $ret['msg'] = get_string('invalidpath', 'repository_filesystem');
             $ret['nosearch'] = true;
             echo json_encode($ret);
             exit;
         } else {
             if (!is_dir($this->root_path)) {
                 $ret = array();
                 $ret['msg'] = get_string('invalidpath', 'repository_filesystem');
                 $ret['nosearch'] = true;
                 if ($options['ajax']) {
                     echo json_encode($ret);
                     exit;
                 }
             }
         }
         if ($this->root_path[strlen($this->root_path) - 1] !== '/') {
             $this->root_path .= '/';
         }
     }
 }
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:repository.class.php

示例15: __construct

    /**
     * constructor method
     *
     * @global object $CFG
     * @global object $SESSION
     * @param int $repositoryid
     * @param int $context
     * @param array $options
     * @param boolean $readonly
     */
    public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array(), $readonly=0) {
        global $CFG, $SESSION;
        parent::__construct($repositoryid, $context, $options,$readonly);
        $this->api_key = $this->get_option('api_key');
        $this->flickr  = new phpFlickr($this->api_key);
        $this->flickr_account = $this->get_option('email_address');
        $this->usewatermarks = $this->get_option('usewatermarks');

        $account  = optional_param('flickr_account', '', PARAM_RAW);
        $fulltext = optional_param('flickr_fulltext', '', PARAM_RAW);
        if (empty($fulltext)) {
            $fulltext = optional_param('s', '', PARAM_RAW);
        }
        $tag      = optional_param('flickr_tag', '', PARAM_RAW);
        $license  = optional_param('flickr_license', '', PARAM_RAW);

        $this->sess_account = 'flickr_public_'.$this->id.'_account';
        $this->sess_tag     = 'flickr_public_'.$this->id.'_tag';
        $this->sess_text    = 'flickr_public_'.$this->id.'_text';

        if (!empty($account) or !empty($fulltext) or !empty($tag) or !empty($license)) {
            $SESSION->{$this->sess_tag}  = $tag;
            $SESSION->{$this->sess_text} = $fulltext;
            $SESSION->{$this->sess_account} = $account;
        }
    }
开发者ID:nigeli,项目名称:moodle,代码行数:36,代码来源:lib.php


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