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

PHP Site类代码示例

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

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



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

示例1: exportSite

 /**
  * Writes a <site> tag representing the given Site object.
  *
  * @param Site $site
  */
 private function exportSite(Site $site)
 {
     if ($site->getType() !== Site::TYPE_UNKNOWN) {
         $siteAttr = ['type' => $site->getType()];
     } else {
         $siteAttr = null;
     }
     fwrite($this->sink, "\t" . Xml::openElement('site', $siteAttr) . "\n");
     fwrite($this->sink, "\t\t" . Xml::element('globalid', null, $site->getGlobalId()) . "\n");
     if ($site->getGroup() !== Site::GROUP_NONE) {
         fwrite($this->sink, "\t\t" . Xml::element('group', null, $site->getGroup()) . "\n");
     }
     if ($site->getSource() !== Site::SOURCE_LOCAL) {
         fwrite($this->sink, "\t\t" . Xml::element('source', null, $site->getSource()) . "\n");
     }
     if ($site->shouldForward()) {
         fwrite($this->sink, "\t\t" . Xml::element('forward', null, '') . "\n");
     }
     foreach ($site->getAllPaths() as $type => $path) {
         fwrite($this->sink, "\t\t" . Xml::element('path', ['type' => $type], $path) . "\n");
     }
     foreach ($site->getLocalIds() as $type => $ids) {
         foreach ($ids as $id) {
             fwrite($this->sink, "\t\t" . Xml::element('localid', ['type' => $type], $id) . "\n");
         }
     }
     // @todo: export <data>
     // @todo: export <config>
     fwrite($this->sink, "\t" . Xml::closeElement('site') . "\n");
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:35,代码来源:SiteExporter.php


示例2: FormSiteIpExclude

 function FormSiteIpExclude(&$template, $siteAdmin)
 {
     parent::Form($template);
     $this->siteAdmin = $siteAdmin;
     $o_site = new Site($siteAdmin);
     $this->a_ips = $o_site->getIpArray();
 }
开发者ID:ber5ien,项目名称:www.jade-palace.co.uk,代码行数:7,代码来源:FormSiteIpExclude.class.php


示例3: load

 public function load()
 {
     parent::load();
     $model = new SupportCenters();
     $scs = $model->getindex();
     $this->view->scs = array();
     foreach ($this->sc_ids as $sc_id) {
         $this->view->scs[$sc_id] = $scs[$sc_id][0];
     }
     if (isset($_REQUEST["summary_attrs_showcontact"])) {
         $this->view->contacts = array();
         $cmodel = new SupportCenterContact();
         $contacts = $cmodel->getindex();
         //group by contact_type_id
         foreach ($this->sc_ids as $sc_id) {
             $types = array();
             if (isset($contacts[$sc_id])) {
                 foreach ($contacts[$sc_id] as $contact) {
                     if (!isset($types[$contact->contact_type])) {
                         $types[$contact->contact_type] = array();
                     }
                     $types[$contact->contact_type][] = $contact;
                 }
                 $this->view->contacts[$sc_id] = $types;
             }
         }
     }
     if (isset($_REQUEST["summary_attrs_showsites"])) {
         $model = new Site();
         $this->view->sites = $model->getgroupby("sc_id");
     }
 }
开发者ID:wangfeilong321,项目名称:myosg,代码行数:32,代码来源:ScsummaryController.php


示例4: getSiteCollection

 public function getSiteCollection(array $where)
 {
     global $dRep, $INK_User;
     $values = array();
     $innerjoin = '';
     if (isset($where['userId'])) {
         $innerjoin = "INNER JOIN ink_sites_in_roles B on (A.siteId = B.SiteId)\n\t\t\t\t\t\t  INNER JOIN ink_user_in_roles C ON (B.roleId = C.roleId AND C.userId = ?)";
         $values[] = $where['userId'];
         unset($where['userId']);
     } else {
         if (isset($where['roleId'])) {
             $innerjoin = "INNER JOIN ink_sites_in_roles B on (A.siteId = B.SiteId AND B.roleId = ?)";
             $values[] = $where['roleId'];
             unset($where['roleId']);
         }
     }
     $where = count($where) > 0 ? 'WHERE ' . $this->sqlBuilder->createWhere($where, 'A') : '';
     $sql = "SELECT * FROM ink_customer_sites A {$innerjoin} {$where} AND softdelete  = ?;";
     $values[] = false;
     $data = $this->runManyQuery($sql, $values);
     $sites = array();
     foreach ($data as $index => $row) {
         $properties = array('id' => $row['siteId'], 'name' => $row['sitename'], 'url' => $row['siteurl'], 'templates' => $dRep->getTemplateCollection(array('site' => $row['siteId'])), 'ftp_url' => $row['ftp_url'], 'ftp_username' => $row['ftp_username'], 'ftp_password' => $row['ftp_password'], 'ftp_root' => $row['ftp_root'], 'ftp_passive' => $row['ftp_passv'], 'ftp_mode' => $row['ftp_mode'], 'ftp_port' => $row['ftp_port']);
         $site = new Site();
         $site->setProperties($properties);
         $sites[] = $site;
     }
     return $sites;
 }
开发者ID:ruffen,项目名称:Pixcel-CMS,代码行数:29,代码来源:site.repository.php


示例5: getUpstreamUpdates

 /**
  * Return the upstream for the given site
  *
  * @param Site $site
  * @return object The upstream information
  * @throws TerminusException
  */
 protected function getUpstreamUpdates($site)
 {
     if (empty($upstream = $site->getUpstream()->getUpdates())) {
         throw new TerminusException('There was a problem checking your upstream status. Please try again.');
     }
     return $upstream;
 }
开发者ID:pantheon-systems,项目名称:terminus,代码行数:14,代码来源:UpdatesCommand.php


示例6: FormSiteUrls

 function FormSiteUrls(&$template, $siteAdmin)
 {
     parent::Form($template);
     $this->siteAdmin = $siteAdmin;
     $o_site = new Site($siteAdmin);
     $this->a_urls = $o_site->getUrls();
 }
开发者ID:ber5ien,项目名称:www.jade-palace.co.uk,代码行数:7,代码来源:FormSiteUrls.class.php


示例7: createSampleSite

 public static function createSampleSite($label)
 {
     $site = new Site();
     $v4PK = new PrimaryKey();
     $site->setPrimaryKey($v4PK->getId());
     $site->setShortName($label);
     return $site;
 }
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:8,代码来源:TestUtil.php


示例8: create

 public function create($data, $save = true)
 {
     $site = new Site($this, $data);
     if ($save) {
         $site->save();
     }
     return $site;
 }
开发者ID:bandwidthcom,项目名称:php-bandwidth-iris,代码行数:8,代码来源:Sites.php


示例9: preSetElement

 /**
  * @see GenericArrayObject::preSetElement
  *
  * @since 1.21
  *
  * @param int|string $index
  * @param Site $site
  *
  * @return boolean
  */
 protected function preSetElement($index, $site)
 {
     if ($this->hasSite($site->getGlobalId())) {
         $this->removeSite($site->getGlobalId());
     }
     $this->byGlobalId[$site->getGlobalId()] = $index;
     $this->byInternalId[$site->getInternalId()] = $index;
     return true;
 }
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:19,代码来源:SiteList.php


示例10: getSiteKey

 public static function getSiteKey(Site $site = null)
 {
     if ($site) {
         $siteKey = "site_" . $site->getId();
     } else {
         $siteKey = "default";
     }
     return $siteKey;
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:9,代码来源:Analytics.php


示例11: testClear

 /**
  * @covers HashSiteStore::clear
  */
 public function testClear()
 {
     $store = new HashSiteStore();
     $site = new Site();
     $site->setGlobalId('arwiki');
     $store->saveSite($site);
     $this->assertCount(1, $store->getSites(), '1 site in store');
     $store->clear();
     $this->assertCount(0, $store->getSites(), '0 sites in store');
 }
开发者ID:eliagbayani,项目名称:LiteratureEditor,代码行数:13,代码来源:HashSiteStoreTest.php


示例12: FormSiteNewsletter

 function FormSiteNewsletter(&$template, $siteAdmin, $newsletterId = null)
 {
     parent::Form($template);
     $this->siteAdmin = $siteAdmin;
     // case modify a newsletter
     if (!is_null($newsletterId)) {
         $o_site = new Site($siteAdmin);
         $this->newsletterId = $newsletterId;
         $this->newsletterName = $o_site->getNewsletterName($newsletterId);
     }
 }
开发者ID:ber5ien,项目名称:www.jade-palace.co.uk,代码行数:11,代码来源:FormSiteNewsletter.class.php


示例13: needANewsletter

 function needANewsletter($idSite)
 {
     $idNewsletter = $this->request->getAdminNewsletter();
     if (!$idNewsletter) {
         $o_site = new Site($idSite);
         $this->tpl->assign('newsletters_available', $o_site->getNewslettersSite());
         $this->tpl->template = "admin/newsletter_selection.tpl";
         return false;
     } else {
         return $idNewsletter;
     }
 }
开发者ID:ber5ien,项目名称:www.jade-palace.co.uk,代码行数:12,代码来源:AdminSiteNewsletters.class.php


示例14: drawMoveSite

/**
 *  Draws a form to move a service
 *  @param \Site $oldSite Site to which the service to be moved belongs
 *  @return null
 */
function drawMoveSite(\Site $oldSite)
{
    //Check the user has permission to see the page, will throw exception
    //if the user is not an admin
    checkUserIsAdmin();
    //Get a list of services and list of sites to select from
    $sites = \Factory::getSiteService()->getSitesBy();
    $services = $oldSite->getServices();
    //Put into an array to be passed to view
    $params = array('Sites' => $sites, 'Services' => $services, 'OldSite' => $oldSite->getShortName());
    show_view("admin/move_service_end_point.php", $params);
}
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:17,代码来源:move_service_end_point.php


示例15: FormSitePartner

 function FormSitePartner(&$template, $siteAdmin, $partnerId = null)
 {
     parent::Form($template);
     $this->siteAdmin = $siteAdmin;
     // case modify a newsletter
     if (!is_null($partnerId)) {
         $o_site = new Site($siteAdmin);
         $this->partnerId = $partnerId;
         $this->partnerName = $o_site->getPartnerNameFromId($partnerId);
         $this->partnerUrls = $o_site->getPartnerUrlsId($partnerId);
     }
 }
开发者ID:ber5ien,项目名称:www.jade-palace.co.uk,代码行数:12,代码来源:FormSitePartner.class.php


示例16: needAPartner

 function needAPartner($idSite)
 {
     $idPartner = $this->request->getAdminPartner();
     if (!$idPartner) {
         $o_site = new Site($idSite);
         $this->tpl->assign('partners_available', $o_site->getPartnerSite());
         $this->tpl->template = "admin/partner_selection.tpl";
         return false;
     } else {
         return $idPartner;
     }
 }
开发者ID:ber5ien,项目名称:www.jade-palace.co.uk,代码行数:12,代码来源:AdminSitePartners.class.php


示例17: __construct

 public function __construct(Site $site, &$session, $post)
 {
     $users = new Users($site);
     $email = strip_tags($post['email']);
     $password = strip_tags($post['password']);
     $root = $site->getRoot();
     if (isset($post['submitLogin'])) {
         $user = $users->login($email, $password);
         //$user = null;
         if ($user === null) {
             // Login failed
             $this->redirect = "/index.php?e";
             $session[View::ERROR_MSG] = "Incorrect username or password";
             return;
         } else {
             $session[User::SESSION_NAME] = $user;
             $this->redirect = "/tasks.php";
         }
     } else {
         if (isset($post['submitCreate'])) {
             $confirm = strip_tags($post['confirm-password']);
             $name = $post['name'];
             if ($name == "") {
                 $session[View::ERROR_MSG] = "Please enter your name";
                 $this->redirect = "/create-account.php?e";
                 return;
             }
             if ($email == "") {
                 $session[View::ERROR_MSG] = "Please enter your email address";
                 $this->redirect = "/create-account.php?e";
                 return;
             }
             if ($password !== $confirm) {
                 $session[View::ERROR_MSG] = "Passwords do not match";
                 $this->redirect = "/create-account.php?e";
                 return;
             }
             if (strlen($password) < 8) {
                 $session[View::ERROR_MSG] = "Password is too short";
                 $this->redirect = "/create-account.php?e";
                 return;
             }
             $ret = $users->createAccount($name, $email, $password);
             if ($ret !== null) {
                 $session[View::ERROR_MSG] = $ret;
                 $this->redirect = "/create-account.php?e";
                 return;
             }
             $this->redirect = "/";
         }
     }
 }
开发者ID:patelas7,项目名称:mi362ss16,代码行数:52,代码来源:LoginController.php


示例18: submit

function submit(\Site $site, \User $user = null)
{
    //Only administrators can delete sites, double check user is an administrator
    checkUserIsAdmin();
    //save name to display later
    $params['Name'] = $site->getName();
    //remove Site
    try {
        \Factory::getSiteService()->deleteSite($site, $user);
    } catch (\Exception $e) {
        show_view('error.php', $e->getMessage());
        die;
    }
    show_view('/site/deleted_site.php', $params);
}
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:15,代码来源:delete_site.php


示例19: getSiteParameterField

 public static function getSiteParameterField()
 {
     $source = Site::get()->map('ID', 'Title')->toArray();
     $source = array('0' => 'All') + $source;
     // works around ajax bug
     return DropdownField::create('Site', 'Site', $source)->setHasEmptyDefault(false);
 }
开发者ID:silverstripe-australia,项目名称:silverstripe-multisites,代码行数:7,代码来源:MultisitesReport.php


示例20: get_bookmarklet

 /**
  * Create the bookmarklet that is appropriate for the client's User Agent
  *
  * @return array The array of actions to attach to the specified $plugin_id
  */
 private function get_bookmarklet()
 {
     $admin_url = Site::get_url('admin');
     $link_name = Options::get('title');
     $bookmarklet = "\n\t\t<p>Bookmark this link to leave the page when quoting:\n\t\t<a href=\"javascript:var w=window,d=document,gS='getSelection';location.href='{$admin_url}/publish?quote='+encodeURIComponent((''+(w[gS]?w[gS]():d[gS]?d[gS]():d.selection.createRange().text)).replace(/(^\\s+|\\s+\$)/g,''))+'&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(d.title);\">Quote on {$link_name}</a>\n\t\t<br>\n\t\tBookmark this link to open a new tab or window when quoting:\n\t\t<a href=\"javascript:var w=window,d=document,gS='getSelection';window.open('{$admin_url}/publish?quote='+encodeURIComponent((''+(w[gS]?w[gS]():d[gS]?d[gS]():d.selection.createRange().text)).replace(/(^\\s+|\\s+\$)/g,''))+'&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(d.title));void(0);\">Quote on {$link_name}</a>\n\t\t</p>";
     return $bookmarklet;
 }
开发者ID:habari-extras,项目名称:publish_quote,代码行数:12,代码来源:publish_quote.plugin.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP SiteConfig类代码示例发布时间:2022-05-23
下一篇:
PHP Singleton类代码示例发布时间: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