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


PHP Site类代码示例

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


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


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