• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Liten\Liten类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Liten\Liten的典型用法代码示例。如果您正苦于以下问题:PHP Liten类的具体用法?PHP Liten怎么用?PHP Liten使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: updateCronjobs

/**
 * Updates a cronjob handler.
 *
 * @since 6.0.00
 */
function updateCronjobs($id = '')
{
    $app = \Liten\Liten::getInstance();
    $cronDir = cronDir() . 'cron/';
    if (file_put_contents($cronDir . 'cronjobs.dat.php', '<' . '?php /*' . base64_encode(serialize($_SESSION['cronjobs'])) . '*/')) {
        $app->flash('success_message', _t('Database saved.'));
        // create 'backup'
        file_put_contents($cronDir . 'cronjobs.backup-' . date('Y-m-d') . '.php', '<' . '?php /*' . base64_encode(serialize($_SESSION['cronjobs'])) . '*/');
    } else {
        $app->flash('error_message', _t('Database not saved, could not create database file on server, please check write rights of this script.'));
    }
    // remove old cronjob backup files
    $files = glob($cronDir . 'cronjobs.backup*.php');
    if (is_array($files)) {
        foreach ($files as $file) {
            if (is_file($file) && time() - filemtime($file) >= 2 * 24 * 60 * 60) {
                // 2 days
                unlink($file);
            }
        }
    }
    if ($id != '' && is_numeric($id)) {
        redirect(get_base_url() . 'cron/view' . '/' . $id);
    } else {
        redirect($app->req->server['HTTP_REFERER']);
    }
    exit;
}
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:33,代码来源:cron.router.php


示例2: eae_encode_emails

/**
 * Searches for plain email addresses in given $string and
 * encodes them (by default) with the help of eae_encode_str().
 *
 * Regular expression is based on based on John Gruber's Markdown.
 * http://daringfireball.net/projects/markdown/
 *
 * @param string $string
 *            Text with email addresses to encode
 * @return string $string Given text with encoded email addresses
 */
function eae_encode_emails($string)
{
    $app = \Liten\Liten::getInstance();
    // abort if $string doesn't contain a @-sign
    if ($app->hook->apply_filter('eae_at_sign_check', true)) {
        if (strpos($string, '@') === false) {
            return $string;
        }
    }
    // override encoding function with the 'eae_method' filter
    $method = $app->hook->apply_filter('eae_method', 'eae_encode_str');
    // override regex pattern with the 'eae_regexp' filter
    $regexp = $app->hook->apply_filter('eae_regexp', '{
			(?:mailto:)?
			(?:
				[-!#$%&*+/=?^_`.{|}~\\w\\x80-\\xFF]+
			|
				".*?"
			)
			\\@
			(?:
				[-a-z0-9\\x80-\\xFF]+(\\.[-a-z0-9\\x80-\\xFF]+)*\\.[a-z]+
			|
				\\[[\\d.a-fA-F:]+\\]
			)
		}xi');
    return preg_replace_callback($regexp, create_function('$matches', 'return ' . $method . '($matches[0]);'), $string);
}
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:39,代码来源:email-address-encoder.php


示例3: _etsis_cache_init

/**
 * Sets up object cache global scope and assigns it based on
 * the type of caching system used.
 *
 * @since 6.2.0
 */
function _etsis_cache_init()
{
    $app = \Liten\Liten::getInstance();
    $driver = $app->hook->apply_filter('etsis_cache_driver', 'file');
    $cache = new \app\src\Core\Cache\etsis_Object_Cache($driver);
    return $cache;
}
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:13,代码来源:global-function.php


示例4: etsis_push_notify

/**
 * Desktop Push Notification
 * 
 * Notifications that can be pushed at a delayed time.
 * 
 * @since 6.2.11
 * @param string $title Give title of notification.
 * @param string $message Message that should be displayed.
 */
function etsis_push_notify($title, $message)
{
    $app = \Liten\Liten::getInstance();
    // Create a Notifier
    $notifier = NotifierFactory::create();
    // Create your notification
    $notification = (new Notification())->setTitle($title)->setBody($message)->setIcon(BASE_PATH . 'static/assets/imgages/icon-success.png');
    // Send it
    return $app->hook->apply_filter('push_notify', $notifier->send($notification));
}
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:19,代码来源:notify-function.php


示例5: __construct

 public function __construct($personID = '')
 {
     $this->_app = \Liten\Liten::getInstance();
     if ($personID != '') {
         $this->_personID = floatval($personID);
     } else {
         $this->_personID = floatval(get_persondata('personID'));
     }
     $this->_userRoles = $this->getUserRoles('ids');
     $this->buildACL();
 }
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:11,代码来源:ACL.php


示例6: update_prog_crse_column

function update_prog_crse_column($data)
{
    $app = \Liten\Liten::getInstance();
    if (count($data)) {
        $id = $data['rid'];
        unset($data['rid']);
        $sql = $app->db->query("UPDATE prog_crse SET " . key($data) . "='" . $data[key($data)] . "' WHERE ID = ? LIMIT 1", [$id]);
        if ($sql->update()) {
            return $id;
        }
        return 0;
    }
}
开发者ID:parkerj,项目名称:degree-audit,代码行数:13,代码来源:functions.php


示例7: __construct

 public function __construct(\Liten\Liten $liten = null)
 {
     $this->app = !empty($liten) ? $liten : \Liten\Liten::getInstance();
     if (!extension_loaded('apc') && !ini_get('apc.enabled') || !function_exists('apc_fetch')) {
         return new \app\src\Core\Exception\Exception(_t('APC requires PHP APC extension to be installed and loaded.'), 'php_apc_extension');
     }
     /**
      * Filter sets whether caching is enabled or not.
      *
      * @since 6.2.0
      * @var bool
      */
     $this->enable = $this->app->hook->apply_filter('enable_caching', true);
 }
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:14,代码来源:etsis_Cache_APC.php


示例8: __construct

 public function __construct($driver, \Liten\Liten $liten = null)
 {
     $this->app = !empty($liten) ? $liten : \Liten\Liten::getInstance();
     if ($driver == 'file') {
         $this->_cache = new \app\src\Core\Cache\etsis_Cache_Filesystem();
     } elseif ($driver == 'apc') {
         $this->_cache = new \app\src\Core\Cache\etsis_Cache_APC();
     } elseif ($driver == 'memcache') {
         /**
          * Filter whether to use `\Memcache`|`\Memcached`.
          *
          * @since 6.2.0
          * @param
          *            bool false Use `\Memcache`|`\Memcached`. Default is false.
          */
         $useMemcached = $this->app->hook->apply_filter('use_memcached', false);
         $this->_cache = new \app\src\Core\Cache\etsis_Cache_Memcache($useMemcached);
         $pool = [['host' => '127.0.0.1', 'port' => 11211, 'weight' => 20]];
         /**
          * Filter the `\Memcache`|`\Memcached` server pool.
          *
          * @since 6.2.0
          * @param array $pool
          *            Array of servers to add to the connection pool.
          */
         $servers = $this->app->hook->apply_filter('memcache_server_pool', $pool);
         $this->_cache->addServer($servers);
     } elseif ($driver == 'external') {
         /**
          * Fires when being used to call another caching system not
          * native to eduTrac SIS.
          *
          * @since 6.2.0
          */
         $this->_cache = $this->app->hook->do_action('external_cache_driver');
     } elseif ($driver == 'xcache') {
         $this->_cache = new \app\src\Core\Cache\etsis_Cache_XCache();
     } elseif ($driver == 'cookie') {
         $this->_cache = new \app\src\Core\Cache\etsis_Cache_Cookie();
     } elseif ($driver == 'json') {
         $this->_cache = new \app\src\Core\Cache\etsis_Cache_JSON();
     } elseif ($driver == 'memory') {
         $this->_cache = new \app\src\Core\Cache\etsis_Cache_Memory();
     }
     if (is_etsis_exception($this->_cache)) {
         return $this->_cache->getMessage();
     }
     return $this->_cache;
 }
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:49,代码来源:etsis_Object_Cache.php


示例9: convertCourseSec

/**
 *
 * @since 4.4
 */
function convertCourseSec($sect)
{
    $app = \Liten\Liten::getInstance();
    $section = $app->db->course_sec()->select('courseSecCode')->where('courseSecID = ?', $sect);
    $q = $section->find(function ($data) {
        $array = [];
        foreach ($data as $d) {
            $array[] = $d;
        }
        return $array;
    });
    foreach ($q as $r) {
        $section = $r['courseSecCode'];
    }
    return $section;
}
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:20,代码来源:section-function.php


示例10: subject_code_dropdown

/**
 * Subject dropdown: shows general list of subjects and
 * if $subjectCode is not NULL, shows the subject attached
 * to a particular record.
 *
 * @deprecated since release 6.1.12
 * @see table_dropdown
 * @since 1.0.0
 * @param string $subjectCode
 *            - optional
 * @return string Returns the record key if selected is true.
 */
function subject_code_dropdown($subjectCode = NULL)
{
    _deprecated_function(__FUNCTION__, '6.1.12', 'table_dropdown');
    $app = \Liten\Liten::getInstance();
    $subj = $app->db->subject()->select('subjectCode,subjectName')->where('subjectCode <> "NULL"');
    $q = $subj->find(function ($data) {
        $array = [];
        foreach ($data as $d) {
            $array[] = $d;
        }
        return $array;
    });
    foreach ($q as $v) {
        echo '<option value="' . _h($v['subjectCode']) . '"' . selected($subjectCode, _h($v['subjectCode']), false) . '>' . _h($v['subjectCode']) . ' ' . _h($v['subjectName']) . '</option>' . "\n";
    }
}
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:28,代码来源:deprecated-function.php


示例11: courseList

/**
 * Prints a list of active courses.
 */
function courseList($id = '')
{
    $app = \Liten\Liten::getInstance();
    $crse = $app->db->course()->select('courseCode')->where('courseID <> ?', $id)->_and_()->where('currStatus = "A"')->_and_()->where('endDate <= "0000-00-00"');
    $q = $crse->find(function ($data) {
        $array = [];
        foreach ($data as $d) {
            $array[] = $d;
        }
        return $array;
    });
    $a = [];
    foreach ($q as $r) {
        $a[] = $r['courseCode'];
    }
    return $a;
}
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:20,代码来源:course-function.php


示例12: degree_audit_tables

function degree_audit_tables()
{
    $app = \Liten\Liten::getInstance();
    $now = date('Y-m-d h:i:s');
    $hd = $app->db->query('SHOW TABLES LIKE "da_group"');
    $q = $hd->find(function ($data) {
        $array = [];
        foreach ($data as $d) {
            $array[] = $d;
        }
        return $array;
    });
    if (count($q) <= 0) {
        $sql = [];
        $sql = "";
        foreach ($sql as $query) {
            $app->db->query($query);
        }
    }
}
开发者ID:parkerj,项目名称:degree-audit,代码行数:20,代码来源:degree-audit.plugin.php


示例13: __construct

 public function __construct($useMemcached, \Liten\Liten $liten = null)
 {
     $this->app = !empty($liten) ? $liten : \Liten\Liten::getInstance();
     $this->useMemcached = $useMemcached;
     $ext = $this->useMemcached ? 'memcached' : 'memcache';
     if ($ext == 'memcached' && !class_exists('memcached')) {
         return new \app\src\Core\Exception\Exception(sprintf(_t('Memcached requires PHP <strong>%s</strong> extension to be loaded.'), $ext), 'php_memcache_extension');
     }
     if ($ext == 'memcache' && !function_exists('memcache_connect')) {
         return new \app\src\Core\Exception\Exception(sprintf(_t('Memcached requires PHP <strong>%s</strong> extension to be loaded.'), $ext), 'php_memcache_extension');
     }
     if ($ext == 'memcache') {
         $this->connection = new \Memcache();
     } else {
         $this->connection = new \Memcached('etsis');
     }
     /**
      * Filter sets whether caching is enabled or not.
      *
      * @since 6.2.0
      * @var bool
      */
     $this->enable = $this->app->hook->apply_filter('enable_caching', true);
 }
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:24,代码来源:etsis_Cache_Memcache.php


示例14: url

/**
 * Returns the url based on route.
 */
function url($route)
{
    $app = \Liten\Liten::getInstance();
    $url = $app->req->url_for($route);
    return $url;
}
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:9,代码来源:functions.php


示例15: etsis_nodeq_change_address

/**
 * Change of Address Email
 * 
 * Function used to send change of address to
 * appropriate staff member.
 * 
 * @since 6.2.11
 */
function etsis_nodeq_change_address()
{
    $app = \Liten\Liten::getInstance();
    $email = _etsis_email();
    $host = $app->req->server['HTTP_HOST'];
    $site = _t('myeduTrac :: ') . _h(get_option('institution_name'));
    // Creates node's schema if does not exist.
    Node::dispense('change_address');
    try {
        $sql = Node::table('change_address')->where('sent', '=', 0)->findAll();
        if ($sql->count() == 0) {
            Node::table('change_address')->delete();
        }
        $numItems = $sql->count();
        $i = 0;
        if ($sql->count() > 0) {
            foreach ($sql as $r) {
                $message = _escape(get_option('coa_form_text'));
                $message = str_replace('#uname#', _h($r->uname), $message);
                $message = str_replace('#fname#', _h($r->fname), $message);
                $message = str_replace('#lname#', _h($r->lname), $message);
                $message = str_replace('#name#', get_name(_h($r->personid)), $message);
                $message = str_replace('#id#', _h($r->personid), $message);
                $message = str_replace('#address1#', _h($r->address1), $message);
                $message = str_replace('#address2#', _h($r->address2), $message);
                $message = str_replace('#city#', _h($r->city), $message);
                $message = str_replace('#state#', _h($r->state), $message);
                $message = str_replace('#zip#', _h($r->zip), $message);
                $message = str_replace('#country#', _h($r->country), $message);
                $message = str_replace('#phone#', _h($r->phone), $message);
                $message = str_replace('#email#', _h($r->email), $message);
                $message = str_replace('#adminemail#', _h(get_option('system_email')), $message);
                $message = str_replace('#url#', get_base_url(), $message);
                $message = str_replace('#helpdesk#', _h(get_option('help_desk')), $message);
                $message = str_replace('#currentterm#', _h(get_option('current_term_code')), $message);
                $message = str_replace('#instname#', _h(get_option('institution_name')), $message);
                $message = str_replace('#mailaddr#', _h(get_option('mailing_address')), $message);
                $headers = "From: {$site} <auto-reply@{$host}>\r\n";
                $headers .= "X-Mailer: PHP/" . phpversion();
                $headers .= "MIME-Version: 1.0" . "\r\n";
                $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
                $email->etsis_mail(_h(get_option('contact_email')), _t('Change of Address Request'), $message, $headers);
                $upd = Node::table('change_address')->find(_h($r->id));
                $upd->sent = 1;
                $upd->save();
                if (++$i === $numItems) {
                    //If we reach the last item, send user a desktop notification.
                    etsis_push_notify('Change of Address', 'Request has been submitted.');
                }
            }
        }
    } catch (\Exception $e) {
        return new \app\src\Core\Exception\Exception($e->getMessage(), 'NodeQ');
    }
}
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:63,代码来源:nodeq-function.php


示例16: _etsis_student_router

/**
 * Student router function.
 * 
 * Includes student router filter (student_router).
 *
 * @since 6.2.7
 */
function _etsis_student_router()
{
    $app = \Liten\Liten::getInstance();
    $router = $app->config('routers_dir') . 'student.router.php';
    if (!$app->hook->has_filter('student_router')) {
        require $router;
    }
    return $app->hook->apply_filter('student_router', $router);
}
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:16,代码来源:hook-function.php


示例17: __construct

 public function __construct(\Liten\Liten $liten = null)
 {
     $this->app = !empty($liten) ? $liten : \Liten\Liten::getInstance();
     if (ETSIS_FILE_CACHE_LOW_RAM && function_exists('memory_get_usage')) {
         $limit = _trim(ini_get('memory_limit'));
         $mod = strtolower($limit[strlen($limit) - 1]);
         switch ($mod) {
             case 'g':
                 $limit *= 1073741824;
                 break;
             case 'm':
                 $limit *= 1048576;
                 break;
             case 'k':
                 $limit *= 1024;
                 break;
         }
         if ($limit <= 0) {
             $limit = 0;
         }
         $this->_memory_limit = $limit;
         $limit = _trim(ETSIS_FILE_CACHE_LOW_RAM);
         $mod = strtolower($limit[strlen($limit) - 1]);
         switch ($mod) {
             case 'g':
                 $limit *= 1073741824;
                 break;
             case 'm':
                 $limit *= 1048576;
                 break;
             case 'k':
                 $limit *= 1024;
                 break;
         }
         $this->_memory_low = $limit;
     } else {
         $this->_memory_limit = 0;
         $this->_memory_low = 0;
     }
     /**
      * Filter sets whether caching is enabled or not.
      *
      * @since 6.2.0
      * @var bool
      */
     $this->enable = $this->app->hook->apply_filter('enable_caching', true);
     $this->persist = $this->enable && true;
     /**
      * File system cache directory.
      */
     $dir = $this->app->config('file.savepath') . 'cache';
     /**
      * Fiter the file cache directory in order to override it
      * in case some systems are having issues.
      *
      * @since 6.2.0
      * @param string $dir
      *            The directory where file system cache files are saved.
      */
     $cacheDir = $this->app->hook->apply_filter('filesystem_cache_dir', $dir);
     /**
      * If the cache directory does not exist, the create it first
      * before trying to call it for use.
      */
     if (!is_dir($cacheDir) || !file_exists($cacheDir)) {
         _mkdir($cacheDir);
     }
     /**
      * If the directory isn't writable, throw an exception.
      */
     if (!etsis_is_writable($cacheDir)) {
         return new \app\src\Core\Exception\Exception(_t('Could not create the file cache directory.'), 'cookie_cache');
     }
     /**
      * Cache directory is set.
      */
     $this->_dir = $cacheDir . DS;
 }
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:78,代码来源:etsis_Cache_Cookie.php


示例18: etsis_sanitize_string

/**
 * Sanitizes a string, or returns a fallback string.
 *
 * Specifically, HTML and PHP tags are stripped. Further actions can be added
 * via the plugin API. If $string is empty and $fallback_string is set, the latter
 * will be used.
 *
 * @since 6.2.10
 *
 * @param string $string          The string to be sanitized.
 * @param string $fallback_string Optional. A string to use if $string is empty.
 * @param string $context        Optional. The operation for which the string is sanitized
 * @return string The sanitized string.
 */
function etsis_sanitize_string($string, $fallback_string = '', $context = 'save')
{
    $app = \Liten\Liten::getInstance();
    $raw_string = $string;
    if ('save' == $context) {
        $string = etsis_remove_accents($string);
    }
    /**
     * Filters a sanitized string.
     *
     * @since 6.2.10
     *
     * @param string $string        Sanitized string.
     * @param string $raw_string    The string prior to sanitization.
     * @param string $context       The context for which the string is being sanitized.
     */
    $string = $app->hook->apply_filter('sanitize_string', $string, $raw_string, $context);
    if ('' === $string || false === $string) {
        $string = $fallback_string;
    }
    return $string;
}
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:36,代码来源:textdomain-function.php


示例19: etsis_login_form_show_message

/**
 * Shows error messages on login form.
 * 
 * @since 6.2.5
 */
function etsis_login_form_show_message()
{
    $app = \Liten\Liten::getInstance();
    $flash = new \app\src\Core\etsis_Messages();
    echo $app->hook->apply_filter('login_form_show_message', $flash->showMessage());
}
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:11,代码来源:auth-function.php


示例20: qt

/**
 * Custom function to query any eduTrac SIS
 * database table.
 *
 * @since 6.0.00
 * @param string $table            
 * @param mixed $field            
 * @param mixed $where            
 * @return mixed
 */
function qt($table, $field, $where = null)
{
    $app = \Liten\Liten::getInstance();
    if ($where !== null) {
        $query = $app->db->query("SELECT * FROM {$table} WHERE {$where}");
    } else {
        $query = $app->db->query("SELECT * FROM {$table}");
    }
    $result = $query->find(function ($data) {
        $array = [];
        foreach ($data as $d) {
            $array[] = $d;
        }
        return $array;
    });
    foreach ($result as $r) {
        return _h($r[$field]);
    }
}
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:29,代码来源:db-function.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP action\Dispatcher类代码示例发布时间:2022-05-23
下一篇:
PHP Utility\Helper类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap