本文整理汇总了PHP中repository类的典型用法代码示例。如果您正苦于以下问题:PHP repository类的具体用法?PHP repository怎么用?PHP repository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了repository类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$clientId = $this->userRepository->find(Auth::user()->id)->client->id;
$orders = $this->repository->scopeQuery(function ($query) use($clientId) {
return $query->where('client_id', '=', $clientId);
})->paginate();
return view('customer.order.index', compact('orders'));
}
开发者ID:alissonally,项目名称:ionic-laravel,代码行数:8,代码来源:CheckoutController.php
示例2: shutdown
function shutdown()
{
global $db, $repoinprogress;
if ($repoinprogress) {
echo "DISTRUZIONE REPOSITORY ({$repoinprogress}) in corso...";
$rep = new repository($repoinprogress);
$repoinprogress = 0;
$rep->drop();
echo "REPOSITORY DISTRUTTO.";
}
echo "Chiusura applicazione";
flush();
}
开发者ID:kissthink,项目名称:slakfinder,代码行数:13,代码来源:update.php
示例3: __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
示例4: __construct
public function __construct($repositoryid, $context = SITEID, $options = array())
{
parent::__construct($repositoryid, $context, $options);
// set up webdav client
$this->wd = new webdav_client();
if (empty($this->options['webdav_server'])) {
return;
}
if (empty($this->options['webdav_type'])) {
$this->options['webdav_type'] = '';
} else {
$this->options['webdav_type'] = 'ssl://';
}
$this->wd->set_server($this->options['webdav_server']);
if (empty($this->options['webdav_port'])) {
if (empty($this->options['webdav_type'])) {
$this->wd->set_port(80);
} else {
$this->wd->set_port(443);
}
$port = '';
} else {
$this->wd->set_port($this->options['webdav_port']);
$port = ':' . $this->options['webdav_port'];
}
$this->webdav_host = $this->options['webdav_type'] . $this->options['webdav_server'] . $port;
if (!empty($this->options['webdav_user'])) {
$this->wd->set_user($this->options['webdav_user']);
}
if (!empty($this->options['webdav_password'])) {
$this->wd->set_pass($this->options['webdav_password']);
}
$this->wd->set_protocol(1);
$this->wd->set_debug(false);
}
开发者ID:ajv,项目名称:Offline-Caching,代码行数:35,代码来源:repository.class.php
示例5: xmldb_repository_alfresco_upgrade
/**
* Upgrade function.
*
* @param int $oldversion the version we are upgrading from.
* @return bool result
*/
function xmldb_repository_alfresco_upgrade($oldversion)
{
global $CFG, $DB;
$dbman = $DB->get_manager();
if ($oldversion < 2014020301) {
require_once $CFG->dirroot . '/repository/lib.php';
require_once $CFG->dirroot . '/repository/alfresco/db/upgradelib.php';
$params = array();
$params['context'] = array();
$params['onlyvisible'] = false;
$params['type'] = 'alfresco';
$instances = repository::get_instances($params);
// Notify the admin about the migration process if they are using the repo.
if (!empty($instances)) {
repository_alfresco_admin_security_key_notice();
}
upgrade_plugin_savepoint(true, 2014020301, 'repository', 'alfresco');
}
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.8.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.9.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
开发者ID:mercysmart,项目名称:naikelas,代码行数:32,代码来源:upgrade.php
示例6: createdb
public function createdb()
{
if (!$this->dropdb()) {
return false;
}
if (!$this->db->query(repository::sql())) {
return false;
}
if (!$this->db->query(package::sql())) {
return false;
}
if (!$this->db->query(filelist::sql())) {
return false;
}
if (!$this->db->query(guestbook::sql())) {
return false;
}
if (!$this->db->query("\n\t\t CREATE TABLE IF NOT EXISTS #__mixed (\n\t\t field VARCHAR( 255 ) NOT NULL ,\n value VARCHAR( 255 ) NULL ,\n PRIMARY KEY ( field )\n\t\t ) ENGINE = MyISAM;\n\t\t")) {
return false;
}
if (!$this->db->query("\n\t\t CREATE TABLE IF NOT EXISTS #__searches (\n\t\t dt DATETIME,\n\t\t sname VARCHAR(50),\n\t\t sdesc VARCHAR(50),\n\t\t sfile VARCHAR(50),\n\t\t ip VARCHAR(15),\n\t\t srepo INT,\n\t\t results INT,\n\t\t duration INT\n\t\t ) ENGINE = MyISAM;\n\t ")) {
return false;
}
$this->db->query("INSERT INTO #__mixed (field,value) value ('count_visits','1');");
$this->db->query("INSERT INTO #__mixed (field,value) value ('count_searches','1');");
$this->db->query("INSERT INTO #__mixed (field,value) value ('count_srctxt','1');");
$this->db->query("INSERT INTO #__mixed (field,value) value ('count_srcxml','1');");
return true;
}
开发者ID:kissthink,项目名称:slakfinder,代码行数:29,代码来源:database.inc.php
示例7: __construct
/**
* Constructor, this constructor should be called ONLY from the file_storage class!
*
* @param file_storage $fs file storage instance
* @param stdClass $file_record description of file
* @param string $filedir location of file directory with sh1 named content files
*/
public function __construct(file_storage $fs, stdClass $file_record, $filedir)
{
global $DB, $CFG;
$this->fs = $fs;
$this->file_record = clone $file_record;
// prevent modifications
$this->filedir = $filedir;
// keep secret, do not expose!
if (!empty($file_record->repositoryid)) {
require_once "{$CFG->dirroot}/repository/lib.php";
$this->repository = repository::get_repository_by_id($file_record->repositoryid, SYSCONTEXTID);
if ($this->repository->supported_returntypes() & FILE_REFERENCE != FILE_REFERENCE) {
// Repository cannot do file reference.
throw new moodle_exception('error');
}
} else {
$this->repository = null;
}
// make sure all reference fields exist in file_record even when it is not a reference
foreach (array('referencelastsync', 'referencefileid', 'reference', 'repositoryid') as $key) {
if (empty($this->file_record->{$key})) {
$this->file_record->{$key} = null;
}
}
}
开发者ID:qanuj,项目名称:moodle,代码行数:32,代码来源:stored_file.php
示例8: __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
示例9: __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
示例10: __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
示例11: __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}/[email protected]";
$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
示例12: __construct
public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array())
{
parent::__construct($repositoryid, $context, $options);
$this->keyword = optional_param('wikimedia_keyword', '', PARAM_RAW);
if (empty($this->keyword)) {
$this->keyword = optional_param('s', '', PARAM_RAW);
}
}
开发者ID:vuchannguyen,项目名称:web,代码行数:8,代码来源:lib.php
示例13: get_listing
/**
*
* @global <type> $CFG
* @param <type> $encodedpath
* @param <type> $search
* @return <type>
*/
public function get_listing($encodedpath = '', $page = '', $search = '')
{
global $CFG;
try {
return repository::get_user_file_tree($search);
} catch (Exception $e) {
throw new repository_exception('emptyfilelist', 'repository_local');
}
}
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:16,代码来源:repository.class.php
示例14: __construct
/**
* Constructor
*
* @param int $repositoryid repository instance id
* @param int|stdClass $context a context id or context object
* @param array $options repository options
*/
public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array()) {
parent::__construct($repositoryid, $context, $options);
if (isset($this->options['mimetypes'])) {
$mt = $this->options['mimetypes'];
if (!empty($mt) && is_array($mt) && !in_array('*', $mt)) {
$this->mimetypes = array_unique(array_map(array($this, 'to_mime_type'), $mt));
}
}
}
开发者ID:Burick,项目名称:moodle,代码行数:17,代码来源:lib.php
示例15: toHtml
public function toHtml()
{
global $CFG, $COURSE, $USER, $PAGE, $OUTPUT;
$id = $this->_attributes['id'];
$elname = $this->_attributes['name'];
if ($this->_flagFrozen) {
return $this->getFrozenHtml();
}
if (!($draftitemid = (int) $this->getValue())) {
// no existing area info provided - let's use fresh new draft area
$draftitemid = file_get_unused_draft_itemid();
$this->setValue($draftitemid);
}
if ($COURSE->id == SITEID) {
$context = context_system::instance();
} else {
$context = context_course::instance($COURSE->id);
}
$client_id = uniqid();
$args = new stdClass();
// Need these three to filter repositories list.
$args->accepted_types = $this->_options['accepted_types'] ? $this->_options['accepted_types'] : '*';
$args->return_types = $this->_options['return_types'];
$args->itemid = $draftitemid;
$args->maxbytes = 0;
$args->context = $PAGE->context;
$args->buttonname = $elname . 'choose';
$args->elementname = $elname;
// We can only tell the filepicker that we want FILE_REFERENCE repos
// and which specific repo types we don't want. So here we build a list
// of all FILE_REFERENCE supplying repos that aren't thebox to force
// it to only display that one.
$refrepos = repository::get_instances(array('currentcontext' => $PAGE->context, 'return_types' => FILE_REFERENCE));
$disabled = array();
foreach ($refrepos as $repo) {
if (($name = $repo->get_typename()) != $this->repo) {
$disabled[] = $name;
}
}
$args->disable_types = $disabled;
$html = $this->_getTabs();
$fp = new file_picker($args);
$options = $fp->options;
$options->context = $PAGE->context;
$html .= $OUTPUT->render($fp);
$html .= '<input type="hidden" name="' . $elname . '" id="' . $id . '" value="' . $draftitemid . '" class="filepickerhidden"/>';
$module = array('name' => 'form_filepicker', 'fullpath' => '/lib/form/filepicker.js', 'requires' => array('core_filepicker', 'node', 'node-event-simulate', 'core_dndupload'));
$PAGE->requires->js_init_call('M.form_filepicker.init', array($fp->options), true, $module);
$nonjsfilepicker = new moodle_url('/repository/draftfiles_manager.php', array('env' => 'filepicker', 'action' => 'browse', 'itemid' => $draftitemid, 'subdirs' => 0, 'maxbytes' => 0, 'maxfiles' => 1, 'ctx_id' => $PAGE->context->id, 'course' => $PAGE->course->id, 'sesskey' => sesskey()));
// non js file picker
$html .= '<noscript>';
$html .= "<div><object type='text/html' data='{$nonjsfilepicker}' height='160' width='600' style='border:1px solid #000'></object></div>";
$html .= '</noscript>';
return $html;
}
开发者ID:eSrem,项目名称:moodle-mod_mediagallery,代码行数:55,代码来源:uploader.php
示例16: redefrepo
function redefrepo($reposelected = 0)
{
global $defrepo, $classes, $npackages;
$defrepo = array();
$classes = array();
$repo = new repository();
$nrepos = $repo->find();
while ($repo->fetch()) {
$id = $repo->id;
$defrepo[$id] = (array) $repo;
unset($defrepo[$id]["db"]);
$defrepo[$id]['selected'] = $id == $reposelected;
$classes[$repo->class]['class'] = $repo->class;
$classes[$repo->class]['arch'] = $repo->arch;
$classes[$repo->class]['version'] = $repo->version;
$classes[$repo->class]['selected'] = $repo->class == $reposelected;
$classes[$repo->class]['repo'][] = $repo->id;
$npackages += $repo->npkgs;
}
echo "<table border='0' width='100%'>";
echo "<tr>";
echo "<td>";
echo "You are the " . $_SESSION['searcher_visitor'] . "st visitor<br />";
echo "Searched " . $GLOBALS['db']->counter_get('searches') . " packages from 24 Apr 2012<br /><br />";
echo "<code>{$nrepos} repositories ({$npackages} packages)</code><br><br>\n";
echo "</td>";
$stats = new stats();
$names = $stats->lastsearch(15);
echo "<td>";
echo "<table border=1 cellspacing=0>";
echo "<tr><td colspan=3 align=center><code><b><a href='stats.php'>Recents</a></b></code></td></tr>";
echo "<tr><td><code>", $names[0] . "<br />" . $names[1] . "<br />" . $names[2] . "<br />" . $names[3] . "<br />" . $names[4] . "</code></td>";
echo "<td><code>", $names[5] . "<br />" . $names[6] . "<br />" . $names[7] . "<br />" . $names[8] . "<br />" . $names[9] . "</code></td>";
echo "<td><code>", $names[10] . "<br />" . $names[11] . "<br />" . $names[12] . "<br />" . $names[13] . "<br />" . $names[14] . "</code></td></tr>";
echo "</table>";
echo "</td>";
echo "<td>";
echo "<table border=1 cellspacing=0 cellpadding=0>";
echo "<tr><td><a href='stats.php'><img border=0 src='stats.php?gdaily&y=95&time=60&mid=0'></a></td></tr>";
echo "</table>";
echo "</tr></table>";
}
开发者ID:kissthink,项目名称:slakfinder,代码行数:42,代码来源:defrepo.inc.php
示例17: type_config_form
public static function type_config_form($mform, $classname = 'repository')
{
$a = new stdClass();
$a->callbackurl = google_oauth::callback_url()->out(false);
$mform->addElement('static', null, '', get_string('oauthinfo', 'repository_skydrive', $a));
parent::type_config_form($mform);
$strrequired = get_string('required');
$mform->addElement('text', 'clientid', get_string('clientid', 'repository_skydrive'));
$mform->addElement('text', 'secret', get_string('secret', 'repository_skydrive'));
$mform->addRule('clientid', $strrequired, 'required', null, 'client');
$mform->addRule('secret', $strrequired, 'required', null, 'client');
}
开发者ID:nadavkav,项目名称:Moodle2-Hebrew-plugins,代码行数:12,代码来源:lib.php
示例18: getServiceByCode
public function getServiceByCode($code)
{
$criteria = array(new Criterion\ContentTypeIdentifier(array('service_link')), new Criterion\Visibility(Criterion\Visibility::VISIBLE), new Criterion\Field('code', Criterion\Operator::EQ, $code));
$query = new Query();
$query->filter = new Criterion\LogicalAnd($criteria);
$searchResult = $this->repository->getSearchService()->findContent($query);
if (isset($searchResult->searchHits)) {
return $searchResult->searchHits;
} else {
return array();
}
}
开发者ID:Open-Wide,项目名称:OwPublishServiceBundle,代码行数:12,代码来源:FetchByLegacy.php
示例19: getPublicClientFromSession
public static function getPublicClientFromSession($repositoryid)
{
global $SESSION;
// Get the Soap Client connection to the Hive web services from the session
$publicClient = unserialize($SESSION->{'publicClient' . $repositoryid});
if (empty($publicClient)) {
$options = repository::get_instance($repositoryid)->options;
$publicClient = self::getPublicClient($options['hwsurl']);
}
$SESSION->{'publicClient' . $repositoryid} = serialize($publicClient);
return $publicClient;
}
开发者ID:harvestroad,项目名称:moodle-repository_hive,代码行数:12,代码来源:webservice.class.php
示例20: xmldb_repository_boxnet_upgrade
/**
* Upgrade function.
*
* @param int $oldversion the version we are upgrading from.
* @return bool result
*/
function xmldb_repository_boxnet_upgrade($oldversion)
{
global $CFG, $DB;
$dbman = $DB->get_manager();
if ($oldversion < 2013110503) {
// Delete old user preferences containing auth tokens.
$DB->delete_records('user_preferences', array('name' => 'boxnet__auth_token'));
upgrade_plugin_savepoint(true, 2013110503, 'repository', 'boxnet');
}
if ($oldversion < 2013110700) {
require_once $CFG->dirroot . '/repository/lib.php';
require_once $CFG->dirroot . '/repository/boxnet/db/upgradelib.php';
$clientid = get_config('boxnet', 'clientid');
$clientsecret = get_config('boxnet', 'clientsecret');
// Only proceed if the repository hasn't been set for APIv2 yet.
if ($clientid === false && $clientsecret === false) {
$params = array();
$params['context'] = array();
$params['onlyvisible'] = false;
$params['type'] = 'boxnet';
$instances = repository::get_instances($params);
// Notify the admin about the migration process if they are using the repo.
if (!empty($instances)) {
repository_boxnet_admin_upgrade_notification();
}
// Hide the repository.
$repositorytype = repository::get_type_by_typename('boxnet');
if (!empty($repositorytype)) {
$repositorytype->update_visibility(false);
}
}
upgrade_plugin_savepoint(true, 2013110700, 'repository', 'boxnet');
}
// Moodle v2.6.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.7.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.8.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v2.9.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v3.0.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
开发者ID:alanaipe2015,项目名称:moodle,代码行数:51,代码来源:upgrade.php
注:本文中的repository类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论