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


PHP Support类代码示例

本文整理汇总了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;
     }
 }
开发者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 <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);
}
开发者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 &laquo;%s&raquo; is already taken, please find another username.", array($user_name));
            } else {
                if (User::FindUserByEmail($user_email)) {
                    $error_message = I18n::L("This email &laquo;%s&raquo; 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


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