本文整理汇总了PHP中Support类的典型用法代码示例。如果您正苦于以下问题:PHP Support类的具体用法?PHP Support怎么用?PHP Support使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Support类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
示例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;
}
示例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;
}
示例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'));
}
示例5: __construct
public function __construct()
{
$this->path = STORAGE_DIR . 'Cache/';
if (!is_dir($this->path)) {
\Folder::create($this->path, 0755);
}
\Support::writable($this->path);
}
示例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"];
}
}
示例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();
}
示例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'])));
}
示例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}();
}
}
示例10: testCheckLimitsUndefinedParameterException
/**
* @dataProvider dataProviderForCheckLimitsUndefinedParameterException
*/
public function testCheckLimitsUndefinedParameterException(array $limits, array $params)
{
$this->setExpectedException('MathPHP\\Exception\\BadParameterException');
Support::checkLimits($limits, $params);
}
示例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 <jpm@mysql.com> |
// +----------------------------------------------------------------------+
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);
}
示例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 {
示例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);
示例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.");
示例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];
}