本文整理汇总了PHP中Support类的典型用法代码示例。如果您正苦于以下问题:PHP Support类的具体用法?PHP Support怎么用?PHP Support使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Support类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __call
public function __call($method, $parameters)
{
if (!defined('static::factory')) {
throw new UndefinedConstException('[const factory] is required to use the [Call Factory Method Ability]!');
}
$originMethodName = $method;
$method = strtolower($method);
$calledClass = get_called_class();
if (!isset(static::factory['methods'][$method])) {
Support::classMethod($calledClass, $originMethodName);
}
$class = static::factory['methods'][$method];
$factory = static::factory['class'] ?? NULL;
if ($factory !== NULL) {
return $factory::class($class)->{$method}(...$parameters);
} else {
$classEx = explode('::', $class);
$class = $classEx[0] ?? NULL;
$method = $classEx[1] ?? NULL;
$isThis = NULL;
if (stristr($method, ':this')) {
$method = str_replace(':this', NULL, $method);
$isThis = 'this';
}
$namespace = str_ireplace(divide($calledClass, '\\', -1), NULL, $calledClass);
$return = uselib($namespace . $class)->{$method}(...$parameters);
if ($isThis === 'this') {
return $this;
}
return $return;
}
}
开发者ID:znframework,项目名称:znframework,代码行数:32,代码来源:MagicFactory.php
示例2: __construct
/**
* LimitSupport constructor.
* @param string $name
* @param int $limit
*/
public function __construct($name, $limit)
{
if (!is_int($limit)) {
throw new \InvalidArgumentException();
}
parent::__construct($name);
$this->limit = $limit;
}
开发者ID:ryo-utsunomiya,项目名称:design_pattern,代码行数:13,代码来源:LimitSupport.php
示例3: loadModel
public function loadModel($id)
{
$model = Support::model()->findByPk($id);
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
开发者ID:phiphi1992,项目名称:alongaydep,代码行数:8,代码来源:SupportController.php
示例4: getEdit
/**
* Show the form for editing the specified resource.
*
* @param $post
* @return Response
*/
public function getEdit($autoreply)
{
$roles = Support::getRoles();
$deps = Support::getDeps();
$actions = Support::getActions();
$title = Lang::get('l4cp-support::core.autoreply_update');
return Theme::make('l4cp-support::autoreplys/create_edit', compact('autoreply', 'title', 'deps', 'actions', 'roles'));
}
开发者ID:Askedio,项目名称:l4cp-support,代码行数:14,代码来源:SupportAutoreplyController.php
示例5: __construct
public function __construct()
{
$this->path = STORAGE_DIR . 'Cache/';
if (!is_dir($this->path)) {
\Folder::create($this->path, 0755);
}
\Support::writable($this->path);
}
开发者ID:znframework,项目名称:znframework,代码行数:8,代码来源:File.php
示例6: getEmail
/**
* Selects the email from the table and returns the contents. Since jsrs only supports returning one value,
* the string that is returned is in the format
* of ec_id:id:email. If ec_id is not passed as a parameter, only the email is returned.
*
* @param string $id The sup_ema_id and sup_id seperated by a -.
* @return A string containing the body of the email, optionally prefaced by the ec_id and $id.
*/
function getEmail($id)
{
$split = explode("-", $id);
$info = Support::getEmailDetails($split[0], $split[1]);
if (!empty($_GET["ec_id"])) {
return Link_Filter::processText(Auth::getCurrentProject(), nl2br($_GET["ec_id"] . ":" . $id . ":" . Misc::highlightQuotedReply($info["message"])));
} else {
return $info["seb_body"];
}
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:18,代码来源:get_remote_data.php
示例7: whoHasRoles
/**
* Find users who have specified roles on this instance
*
* @param string|array|\Illuminate\Support\Collection $roles A role, or list of roles. Can be a string, array or Illuminate\Support\Collection instance.
*
* @return \Illuminate\Support\Collection A list of users
*/
public function whoHasRoles($roles)
{
$roles = Support::makeRoleIds($roles);
$rrus = RRU::whereResourceType(get_class($this))->whereResourceId($this->getKey())->whereIn('role_id', $roles)->get();
$userIds = $rrus->map(function ($rru) {
return $rru->user_id;
});
$userModel = config('roller.model.user');
$userModel = new $userModel();
return $userModel->whereIn($userModel->getKeyName(), $userIds)->get();
}
开发者ID:vfsoraki,项目名称:roller,代码行数:18,代码来源:RollerResource.php
示例8: getEmail
/**
* Selects the email from the table and returns the contents.
*
* @param string $id The sup_ema_id and sup_id seperated by a -.
* @return A string containing the body of the email,
*/
function getEmail($id)
{
$split = explode('-', $id);
$info = Support::getEmailDetails($split[0], $split[1]);
if (!Issue::canAccess($info['sup_iss_id'], $GLOBALS['usr_id'])) {
return '';
}
if (empty($_GET['ec_id'])) {
return $info['seb_body'];
}
return Link_Filter::processText(Auth::getCurrentProject(), nl2br(Misc::highlightQuotedReply($info['seb_body'])));
}
开发者ID:korusdipl,项目名称:eventum,代码行数:18,代码来源:get_remote_data.php
示例9: __construct
public function __construct(string $driver = NULL)
{
parent::__construct();
if (!defined('static::driver')) {
throw new UndefinedConstException('[const driver] is required to use the [Driver Ability]!');
}
nullCoalesce($driver, $this->config['driver'] ?? NULL);
$this->selectedDriverName = $driver;
Support::driver(static::driver['options'], $driver);
if (!isset(static::driver['namespace'])) {
$this->driver = uselib($driver);
} else {
$this->driver = uselib(suffix(static::driver['namespace'], '\\') . $driver . 'Driver');
}
if (isset(static::driver['construct'])) {
$construct = static::driver['construct'];
$this->{$construct}();
}
}
开发者ID:znframework,项目名称:znframework,代码行数:19,代码来源:Driver.php
示例10: testCheckLimitsUndefinedParameterException
/**
* @dataProvider dataProviderForCheckLimitsUndefinedParameterException
*/
public function testCheckLimitsUndefinedParameterException(array $limits, array $params)
{
$this->setExpectedException('MathPHP\\Exception\\BadParameterException');
Support::checkLimits($limits, $params);
}
开发者ID:markrogoyski,项目名称:math-php,代码行数:8,代码来源:SupportTest.php
示例11: dirname
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to: |
// | |
// | Free Software Foundation, Inc. |
// | 51 Franklin Street, Suite 330 |
// | Boston, MA 02110-1301, USA. |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <[email protected]> |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
Auth::checkAuthentication(APP_COOKIE);
if (@$_GET['cat'] == 'blocked_email') {
$email = Note::getBlockedMessage($_GET['note_id']);
} else {
$email = Support::getFullEmail($_GET['sup_id']);
}
if (!empty($_GET['raw'])) {
Attachment::outputDownload($email, 'message.eml', strlen($email), 'message/rfc822');
} else {
if (!empty($_GET['cid'])) {
list($mimetype, $data) = Mime_Helper::getAttachment($email, $_GET['filename'], $_GET['cid']);
} else {
list($mimetype, $data) = Mime_Helper::getAttachment($email, $_GET['filename']);
}
Attachment::outputDownload($data, $_GET['filename'], strlen($data), $mimetype);
}
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:get_attachment.php
示例12: list
if ($res) {
list($HTTP_POST_VARS["from"]) = Support::getSender(array($HTTP_POST_VARS['item'][$i]));
Workflow::handleBlockedEmail(Issue::getProjectID($HTTP_POST_VARS['issue']), $HTTP_POST_VARS['issue'], $HTTP_POST_VARS, 'associated');
Support::removeEmail($HTTP_POST_VARS['item'][$i]);
}
}
$tpl->assign("associate_result", $res);
}
@$tpl->assign('total_emails', count($HTTP_POST_VARS['item']));
} else {
@$tpl->assign('emails', $HTTP_GET_VARS['item']);
@$tpl->assign('total_emails', count($HTTP_GET_VARS['item']));
$prj_id = Issue::getProjectID($HTTP_GET_VARS['issue']);
if (Customer::hasCustomerIntegration($prj_id)) {
// check if the selected emails all have sender email addresses that are associated with the issue' customer
$senders = Support::getSender($HTTP_GET_VARS['item']);
$sender_emails = array();
for ($i = 0; $i < count($senders); $i++) {
$email = Mail_API::getEmailAddress($senders[$i]);
$sender_emails[$email] = $senders[$i];
}
$customer_id = Issue::getCustomerID($HTTP_GET_VARS['issue']);
if (!empty($customer_id)) {
$contact_emails = array_keys(Customer::getContactEmailAssocList($prj_id, $customer_id));
$unknown_contacts = array();
foreach ($sender_emails as $email => $address) {
if (!@in_array($email, $contact_emails)) {
$usr_id = User::getUserIDByEmail($email);
if (empty($usr_id)) {
$unknown_contacts[] = $address;
} else {
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:associate.php
示例13: elseif
$tpl->assign('remove_association_result', $res);
} elseif ($cat == 'delete_attachment') {
$res = Attachment::remove($id);
$tpl->assign('remove_attachment_result', $res);
} elseif ($cat == 'delete_file') {
$res = Attachment::removeIndividualFile($id);
$tpl->assign('remove_file_result', $res);
} elseif ($cat == 'remove_checkin') {
$res = SCM::remove($items);
$tpl->assign('remove_checkin_result', $res);
} elseif ($cat == 'unassign') {
$res = Issue::deleteUserAssociation($iss_id, $usr_id);
Workflow::handleAssignmentChange($prj_id, $iss_id, Auth::getUserID(), Issue::getDetails($iss_id), Issue::getAssignedUserIDs($iss_id));
$tpl->assign('unassign_result', $res);
} elseif ($cat == 'remove_email') {
$res = Support::removeEmails();
$tpl->assign('remove_email_result', $res);
} elseif ($cat == 'clear_duplicate') {
$res = Issue::clearDuplicateStatus($iss_id);
$tpl->assign('clear_duplicate_result', $res);
} elseif ($cat == 'delete_phone') {
$res = Phone_Support::remove($id);
$tpl->assign('delete_phone_result', $res);
} elseif ($cat == 'new_status') {
$res = Issue::setStatus($iss_id, $status_id, true);
if ($res == 1) {
History::add($iss_id, $usr_id, 'status_changed', "Issue manually set to status '{status}' by {user}", array('status' => Status::getStatusTitle($status_id), 'user' => User::getFullName($usr_id)));
}
$tpl->assign('new_status_result', $res);
} elseif ($cat == 'authorize_reply') {
$res = Authorized_Replier::addUser($iss_id, $usr_id);
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:popup.php
示例14: header
include_once "../core.php";
$action = "register";
$error_message = "";
if (User::Logged()) {
header("Location:" . PREFIX . "/dashboard/");
exit;
}
$user_name = isset($_POST["user_name"]) ? $_POST["user_name"] : "";
$user_email = isset($_POST["user_email"]) ? $_POST["user_email"] : "";
Viewer::AddData("user_name", $user_name);
Viewer::AddData("user_email", $user_email);
if (!empty($user_name) && !empty($user_email) && !empty($_POST["user_password"]) && !empty($_POST["user_password2"])) {
if ($_POST["user_password"] != $_POST["user_password2"]) {
$error_message = I18n::L("Passwords mismatch.");
} else {
if (!Support::IsEMail($user_email)) {
$error_message = I18n::L("Wrong E-mail address.");
} else {
if (User::FindUser($user_name)) {
$error_message = I18n::L("Username «%s» is already taken, please find another username.", array($user_name));
} else {
if (User::FindUserByEmail($user_email)) {
$error_message = I18n::L("This email «%s» is already regesitered, please use another email.", array($user_email));
} else {
$obj = User::Add(User::Create($user_name, $user_email, $_POST["user_password"]));
if ($obj->user_id) {
Session::StartUser($obj);
header("Location:" . PREFIX . "/dashboard/");
exit;
} else {
$error_message = I18n::L("Error while registring user.");
开发者ID:BGCX261,项目名称:zoneideas-svn-to-git,代码行数:31,代码来源:index.php
示例15: getSequenceByID
/**
* Returns the sequential number of the specified email ID.
*
* @param integer $sup_id The email ID
* @return integer The sequence number of the email
*/
public static function getSequenceByID($sup_id)
{
if (empty($sup_id)) {
return '';
}
try {
DB_Helper::getInstance()->query('SET @sup_seq = 0');
} catch (DbException $e) {
return 0;
}
$issue_id = Support::getIssueFromEmail($sup_id);
$sql = 'SELECT
sup_id,
@sup_seq := @sup_seq+1
FROM
{{%support_email}}
WHERE
sup_iss_id = ?
ORDER BY
sup_id ASC';
try {
$res = DB_Helper::getInstance()->getPair($sql, array($issue_id));
} catch (DbException $e) {
return 0;
}
return @$res[$sup_id];
}
开发者ID:korusdipl,项目名称:eventum,代码行数:33,代码来源:class.support.php
示例16: getExcerpts
public function getExcerpts()
{
if (count($this->matches) < 1) {
return false;
}
$excerpt_options = array('query_mode' => $this->match_mode, 'before_match' => $this->excerpt_placeholder . '-before', 'after_match' => $this->excerpt_placeholder . '-after', 'allow_empty' => true);
$excerpts = array();
foreach ($this->matches as $issue_id => $matches) {
$excerpt = array('issue' => array(), 'email' => array(), 'phone' => array(), 'note' => array());
foreach ($matches as $match) {
if ($match['index'] == 'issue') {
$issue = Issue::getDetails($issue_id);
$documents = array($issue['iss_summary']);
$res = $this->sphinx->BuildExcerpts($documents, 'issue_stemmed', $this->keywords, $excerpt_options);
if ($res[0] != $issue['iss_summary']) {
$excerpt['issue']['summary'] = self::cleanUpExcerpt($res[0]);
}
$documents = array($issue['iss_original_description']);
$res = $this->sphinx->BuildExcerpts($documents, 'issue_stemmed', $this->keywords, $excerpt_options);
if ($res[0] != $issue['iss_original_description']) {
$excerpt['issue']['description'] = self::cleanUpExcerpt($res[0]);
error_log(print_r($excerpt['issue']['description'], 1));
}
} elseif ($match['index'] == 'email') {
$email = Support::getEmailDetails(null, $match['match_id']);
$documents = array($email['sup_subject'] . "\n" . $email['message']);
$res = $this->sphinx->BuildExcerpts($documents, 'email_stemmed', $this->keywords, $excerpt_options);
$excerpt['email'][Support::getSequenceByID($match['match_id'])] = self::cleanUpExcerpt($res[0]);
} elseif ($match['index'] == 'phone') {
$phone_call = Phone_Support::getDetails($match['match_id']);
$documents = array($phone_call['phs_description']);
$res = $this->sphinx->BuildExcerpts($documents, 'phonesupport_stemmed', $this->keywords, $excerpt_options);
$excerpt['phone'][] = self::cleanUpExcerpt($res[0]);
} elseif ($match['index'] == 'note') {
$note = Note::getDetails($match['match_id']);
$documents = array($note['not_title'] . "\n" . $note['not_note']);
$res = $this->sphinx->BuildExcerpts($documents, 'note_stemmed', $this->keywords, $excerpt_options);
$note_seq = Note::getNoteSequenceNumber($issue_id, $match['match_id']);
$excerpt['note'][$note_seq] = self::cleanUpExcerpt($res[0]);
}
}
foreach ($excerpt as $key => $val) {
if (count($val) < 1) {
unset($excerpt[$key]);
}
}
$excerpts[$issue_id] = $excerpt;
}
return $excerpts;
}
开发者ID:korusdipl,项目名称:eventum,代码行数:50,代码来源:class.sphinx_fulltext_search.php
示例17: getWeeklyReport
/**
* Returns the data used by the weekly report.
*
* @param string $usr_id The ID of the user this report is for.
* @param int $prj_id The project id
* @param string|DateTime $start The start date of this report.
* @param string|DateTime $end The end date of this report.
* @param array $options extra options for report:
* - $separate_closed If closed issues should be separated from other issues.
* - $ignore_statuses If issue status changes should be ignored in report.
* - $separate_not_assigned_to_user Separate Issues Not Assigned to User
* - $show_per_issue Add time spent on issue to issues
* - $separate_no_time Separate No time spent issues
* @return array An array of data containing all the elements of the weekly report.
*/
public static function getWeeklyReport($usr_id, $prj_id, $start, $end, $options = array())
{
// figure out timezone
$user_prefs = Prefs::get($usr_id);
$tz = $user_prefs['timezone'];
// if start or end is string, convert assume min and max date are specified
if (!$start instanceof DateTime) {
$start = Date_Helper::getDateTime($start, $tz)->setTime(0, 0, 0);
}
if (!$end instanceof DateTime) {
$end = Date_Helper::getDateTime($end, $tz)->setTime(23, 59, 59);
}
$start_ts = Date_Helper::getSqlDateTime($start);
$end_ts = Date_Helper::getSqlDateTime($end);
$time_tracking = Time_Tracking::getSummaryByUser($usr_id, $prj_id, $start_ts, $end_ts);
// replace spaces in index with _ and calculate total time
$total_time = 0;
foreach ($time_tracking as $category => $data) {
unset($time_tracking[$category]);
$time_tracking[str_replace(' ', '_', $category)] = $data;
$total_time += $data['total_time'];
}
// get count of issues assigned in week of report.
$stmt = 'SELECT
COUNT(*)
FROM
{{%issue}},
{{%issue_user}},
{{%status}}
WHERE
iss_id = isu_iss_id AND
iss_sta_id = sta_id AND
isu_usr_id = ? AND
iss_prj_id = ? AND
isu_assigned_date BETWEEN ? AND ?';
$params = array($usr_id, Auth::getCurrentProject(), $start_ts, $end_ts);
try {
$newly_assigned = DB_Helper::getInstance()->getOne($stmt, $params);
} catch (DbException $e) {
$newly_assigned = null;
}
$email_count = array('associated' => Support::getSentEmailCountByUser($usr_id, $start_ts, $end_ts, true), 'other' => Support::getSentEmailCountByUser($usr_id, $start_ts, $end_ts, false));
$htt_exclude = array();
if (!empty($options['ignore_statuses'])) {
$htt_exclude[] = 'status_changed';
$htt_exclude[] = 'status_auto_changed';
$htt_exclude[] = 'remote_status_change';
}
$issue_list = History::getTouchedIssuesByUser($usr_id, $prj_id, $start_ts, $end_ts, $htt_exclude);
$issues = array('no_time' => array(), 'not_mine' => array(), 'closed' => array(), 'other' => array());
// organize issues into categories
if ($issue_list) {
if (!empty($options['show_per_issue']) || !empty($options['separate_no_time'])) {
Time_Tracking::fillTimeSpentByIssueAndTime($issue_list, $usr_id, $start_ts, $end_ts);
}
foreach ($issue_list as $row) {
if (!empty($row['iss_customer_id']) && CRM::hasCustomerIntegration($row['iss_prj_id'])) {
$row['customer_name'] = CRM::getCustomerName($row['iss_prj_id'], $row['iss_customer_id']);
} else {
$row['customer_name'] = null;
}
if (!empty($options['separate_closed']) && $row['sta_is_closed'] == 1) {
$issues['closed'][] = $row;
} elseif (!empty($options['separate_not_assigned_to_user']) && !Issue::isAssignedToUser($row['iss_id'], $usr_id)) {
$issues['not_mine'][] = $row;
} elseif (!empty($options['separate_no_time']) && empty($row['it_spent'])) {
$issues['no_time'][] = $row;
} else {
$issues['other'][] = $row;
}
}
$sort_function = function ($a, $b) {
return strcasecmp($a['customer_name'], $b['customer_name']);
};
usort($issues['closed'], $sort_function);
usort($issues['other'], $sort_function);
}
return array('start' => $start_ts, 'end' => $end_ts, 'user' => User::getDetails($usr_id), 'group_name' => Group::getName(User::getGroupID($usr_id)), 'issues' => $issues, 'status_counts' => History::getTouchedIssueCountByStatus($usr_id, $prj_id, $start_ts, $end_ts), 'new_assigned_count' => $newly_assigned, 'time_tracking' => $time_tracking, 'email_count' => $email_count, 'phone_count' => Phone_Support::getCountByUser($usr_id, $start_ts, $end_ts), 'note_count' => Note::getCountByUser($usr_id, $start_ts, $end_ts), 'total_time' => Misc::getFormattedTime($total_time, false));
}
开发者ID:korusdipl,项目名称:eventum,代码行数:94,代码来源:class.report.php
示例18:
<?php
require_once "models/User.php";
require_once "views/Standard.php";
require_once "views/Support.php";
echo Standard::render(Support::getBar(), Support::getText(), User::generateLoginState());
开发者ID:BourgondAries,项目名称:e622,代码行数:6,代码来源:support.php
示例19: init
<?php
namespace PressGang;
/**
* Class Support
*
* @package PressGang
*/
class Support
{
/**
* init
*
*/
public static function init()
{
foreach (Config::get('support') as &$support) {
add_theme_support($support);
}
}
}
Support::init();
开发者ID:AliBritt,项目名称:pressgang,代码行数:23,代码来源:support.php
示例20: __construct
public function __construct()
{
\Support::extension('apc');
}
开发者ID:znframework,项目名称:znframework,代码行数:4,代码来源:Apc.php
注:本文中的Support类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论