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


PHP AppCore::__construct方法代码示例

本文整理汇总了PHP中Railpage\AppCore::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP AppCore::__construct方法的具体用法?PHP AppCore::__construct怎么用?PHP AppCore::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Railpage\AppCore的用法示例。


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

示例1: __construct

 /**
  * Constructor
  * @since Version 3.8.7
  * @param string $type
  */
 public function __construct($type = null)
 {
     parent::__construct();
     $this->Module = new Module("glossary");
     if ($type == null) {
         return $this;
     }
     $this->url = new Url(sprintf("%s?mode=type&type=%s", $this->Module->url, $type));
     $this->id = $type;
     switch ($type) {
         case "code":
         case "acronym":
         case "station":
             $this->name = ucfirst($type . "s");
             break;
         case "slang":
         case "general":
             $this->name = ucfirst($type);
             break;
         case "term":
             $this->name = "Terminology";
             break;
         default:
             $this->name = "General";
             break;
     }
 }
开发者ID:railpage,项目名称:railpagecore,代码行数:32,代码来源:Type.php

示例2: __construct

 /**
  * Constructor
  * @since Version 3.8.7
  * @param string $type
  */
 public function __construct($type = false)
 {
     parent::__construct();
     $this->Module = new Module("glossary");
     if ($type) {
         $this->url = sprintf("%s?mode=type&type=%s", $this->Module->url, $type);
         $this->id = $type;
         switch ($type) {
             case "code":
                 $this->name = "Codes";
                 break;
             case "term":
                 $this->name = "Terminology";
                 break;
             case "acronym":
                 $this->name = "Acronyms";
                 break;
             case "station":
                 $this->name = "Stations";
                 break;
             case "slang":
                 $this->name = "Slang";
                 break;
         }
     }
 }
开发者ID:doctorjbeam,项目名称:railpagecore,代码行数:31,代码来源:Type.php

示例3: __construct

 /**
  * Constructor
  * @since Version 3.8.6
  * @param int|string $id
  */
 public function __construct($id = false)
 {
     parent::__construct();
     if ($id) {
         $mckey = "railpage:fwlink=" . md5($id);
         if ($row = getMemcacheObject($mckey)) {
             $this->id = $row['id'];
             $this->url = $row['url'];
             $this->title = $row['title'];
         } else {
             if (filter_var($id, FILTER_VALIDATE_INT)) {
                 $query = "SELECT * FROM fwlink WHERE id = ?";
             } else {
                 $query = "SELECT * FROM fwlink WHERE url = ?";
             }
             if ($row = $this->db->fetchRow($query, $id)) {
                 $this->id = $row['id'];
                 $this->url = $row['url'];
                 $this->title = $row['title'];
                 setMemcacheObject($mckey, $row, strtotime("+1 month"));
             }
         }
         if (!empty($this->url)) {
             $this->url_canonical = sprintf("http://%s%s", RP_HOST, $this->url);
             $this->url_short = sprintf("http://%s/fwlink?id=%d", RP_HOST, $this->id);
         }
     }
 }
开发者ID:doctorjbeam,项目名称:railpagecore,代码行数:33,代码来源:fwlink.php

示例4: __construct

 /**
  * Constructor
  * @since Version 3.9.1
  * @param int $correction_id
  */
 public function __construct($correction_id = false)
 {
     parent::__construct();
     if ($this->id = filter_var($correction_id, FILTER_VALIDATE_INT)) {
         $this->populate();
     }
 }
开发者ID:railpage,项目名称:railpagecore,代码行数:12,代码来源:Correction.php

示例5: __construct

 /**
  * Constructor
  * @since Version 3.8.7
  * @param int $id
  */
 public function __construct($id = false)
 {
     parent::__construct();
     $this->Module = new Module("glossary");
     if (filter_var($id, FILTER_VALIDATE_INT)) {
         $this->id = $id;
         $this->mckey = sprintf("%s.entry=%d", $this->Module->namespace, $this->id);
         deleteMemcacheObject($this->mckey);
         if ($row = getMemcacheObject($this->mckey)) {
         } else {
             $query = "SELECT type, short, full, example, date, author FROM glossary WHERE id = ?";
             $row = $this->db->fetchRow($query, $this->id);
             setMemcacheObject($this->mckey, $row);
         }
         if (isset($row) && is_array($row)) {
             $this->name = $row['short'];
             $this->text = $row['full'];
             $this->example = $row['example'];
             $this->Type = new Type($row['type']);
             $this->url = sprintf("%s?mode=entry&id=%d", $this->Module->url, $this->id);
             if ($row['date'] == "0000-00-00 00:00:00") {
                 $this->Date = new DateTime();
                 $this->commit();
             } else {
                 $this->Date = new DateTime($row['date']);
             }
             $this->Author = new User($row['author']);
         }
     }
 }
开发者ID:doctorjbeam,项目名称:railpagecore,代码行数:35,代码来源:Entry.php

示例6: __construct

 /**
  * Constructor
  *
  * @since Version 3.8.7
  *
  * @param string $module
  */
 public function __construct($module)
 {
     parent::__construct();
     if (!is_string($module)) {
         return;
     }
     $this->Colours = new stdClass();
     $this->Colours->primary = "#666";
     $this->Colours->accent = "#ddd";
     $this->Colours->inverse = "#333";
     $module = self::getModuleAlternateName($module);
     $this->name = ucwords($module);
     $this->url = self::getModuleUrl($module);
     if (self::getModuleId($module)) {
         $this->id = self::getModuleId($module);
     }
     switch (strtolower($module)) {
         case "images.competitions":
             $this->name = "Photo competitions";
             $this->namespace = "railpage.images.competitions";
             break;
         case "locations":
             $this->Colours->primary = "#116416";
             $this->Colours->accent = "#54A759";
             $this->Colours->inverse = "#004304";
             break;
         case "locos":
             $this->Colours->primary = "#3D0CE8";
             $this->Colours->accent = "#576BFF";
             $this->Colours->inverse = "#1B054E";
             break;
         case "news":
             $this->Colours->primary = "#8A2E60";
             $this->Colours->accent = "#CE8AAF";
             $this->Colours->inverse = "#450026";
             break;
         case "privatemessages":
             $this->name = "Private Messages";
             break;
     }
     /**
      * Lazy populate the namespace
      */
     if (empty($this->namespace) && !empty($this->name)) {
         $this->namespace = sprintf("railpage.%s", strtolower($this->name));
     }
     /**
      * Lazy populate the URL
      */
     if (empty($this->url) && !empty($this->name)) {
         $this->url = sprintf("modules.php?name=%s", $this->name);
     }
     /**
      * Create and populate the filesystem paths
      */
     $this->Paths = new stdClass();
     $this->Paths->module = sprintf("%s/modules/%s", RP_SITE_ROOT, $this->name);
     $this->Paths->html = sprintf("%s/modules/%s/html", RP_SITE_ROOT, $this->name);
 }
开发者ID:railpage,项目名称:railpagecore,代码行数:66,代码来源:Module.php

示例7: __construct

 /**
  * Constructor
  * @since Version 3.9.1
  * @param string $url
  */
 public function __construct($url = false)
 {
     parent::__construct();
     $this->GuzzleClient = new Client();
     if ($url) {
         $this->addFeed($url);
     }
 }
开发者ID:railpage,项目名称:railpagecore,代码行数:13,代码来源:Consume.php

示例8: __construct

 /**
  * Constructor
  * @since Version 3.9
  */
 public function __construct()
 {
     parent::__construct();
     $this->Module = new Module("timetables");
     $this->url = new Url($this->Module->url);
     $this->url->import = sprintf("%s?mode=import", $this->url->url);
     $this->url->location = sprintf("%s?mode=location", $this->url->url);
 }
开发者ID:doctorjbeam,项目名称:railpagecore,代码行数:12,代码来源:Timetables.php

示例9: __construct

 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     /**
      * Record this in the debug log
      */
     debug_recordInstance(__CLASS__);
 }
开发者ID:doctorjbeam,项目名称:railpagecore,代码行数:11,代码来源:Images.php

示例10: __construct

 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     /**
      * Record this in the debug log
      */
     Debug::recordInstance();
 }
开发者ID:railpage,项目名称:railpagecore,代码行数:11,代码来源:Breadcrumb.php

示例11: __construct

 /**
  * Constructor
  * @since Version 3.2
  * @param string $dir The download directory to use. If null we'll use the preset one. 
  */
 public function __construct($dir = null)
 {
     parent::__construct();
     $this->Module = new Module("Downloads");
     if ($dir == null) {
         $dir = RP_DOWNLOAD_DIR;
     }
     $this->dir = $dir;
 }
开发者ID:railpage,项目名称:railpagecore,代码行数:14,代码来源:Base.php

示例12: __construct

 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     Debug::RecordInstance();
     /**
      * Load the Module object
      */
     $this->Module = new Module("glossary");
 }
开发者ID:railpage,项目名称:railpagecore,代码行数:12,代码来源:Glossary.php

示例13: __construct

 /**
  *
  * Constructor
  * @param object $db 
  * @param int $db
  * @since Version 3.0
  * @version 3.0
  *
  */
 public function __construct()
 {
     parent::__construct();
     foreach (func_get_args() as $arg) {
         if (filter_var($arg, FILTER_VALIDATE_INT)) {
             $this->id = $arg;
         }
     }
 }
开发者ID:doctorjbeam,项目名称:railpagecore,代码行数:18,代码来源:SiteMessage.php

示例14: __construct

 /**
  * Constructor
  * @since Version 3.2
  * @param string $dir The download directory to use. If null we'll use the preset one. 
  */
 public function __construct($dir = NULL)
 {
     parent::__construct();
     if (is_null($dir)) {
         // Try to set the directory
         $this->dir = RP_DOWNLOAD_DIR;
     } else {
         $this->dir = $dir;
     }
 }
开发者ID:doctorjbeam,项目名称:railpagecore,代码行数:15,代码来源:Base.php

示例15: __construct

 /**
  * Constructor
  * @since Version 3.3
  * @param object $db
  */
 public function __construct($db = false, $user = false)
 {
     parent::__construct();
     $this->Module = new Module("privatemessages");
     foreach (func_get_args() as $arg) {
         if ($arg instanceof User) {
             $this->setUser($arg);
         }
     }
 }
开发者ID:railpage,项目名称:railpagecore,代码行数:15,代码来源:PrivateMessages.php


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