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


PHP System::__get方法代码示例

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


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

示例1: __get

 /**
  * Return an object property
  * 
  * @param string $strKey The property name
  * 
  * @return mixed The property value
  */
 public function __get($strKey)
 {
     if (isset($this->arrData[$strKey])) {
         return $this->arrData[$strKey];
     }
     return parent::__get($strKey);
 }
开发者ID:rburch,项目名称:core,代码行数:14,代码来源:Feed.php

示例2: __get

 /**
  * Return an object property
  * 
  * Supported keys:
  * 
  * * subject:     the e-mail subject
  * * text:        the text part of the mail
  * * html:        the HTML part of the mail
  * * from:        the sender's e-mail address
  * * fromName:    the sender's name
  * * priority:    the e-mail priority
  * * charset:     the e-mail character set
  * * imageDir:    the base directory to look for internal images
  * * embedImages: whether to embed images inline
  * * logFile:     the log file path
  * * failures:    an array of rejected e-mail addresses
  * 
  * @param string $strKey The property name
  * 
  * @return mixed The property value
  */
 public function __get($strKey)
 {
     switch ($strKey) {
         case 'subject':
             return $this->strSubject;
             break;
         case 'text':
             return $this->strText;
             break;
         case 'html':
             return $this->strHtml;
             break;
         case 'from':
             return $this->strSender;
             break;
         case 'fromName':
             return $this->strSenderName;
             break;
         case 'priority':
             return $this->intPriority;
             break;
         case 'charset':
             return $this->strCharset;
             break;
         case 'imageDir':
             return $this->strImageDir;
             break;
         case 'embedImages':
             return $this->blnEmbedImages;
             break;
         case 'logFile':
             return $this->strLogFile;
             break;
         case 'failures':
             return $this->arrFailures;
             break;
     }
     return parent::__get($strKey);
 }
开发者ID:rikaix,项目名称:core,代码行数:60,代码来源:Email.php

示例3: __get

 /**
  * Return a parameter
  * @return string
  * @throws Exception
  */
 public function __get($strKey)
 {
     switch ($strKey) {
         case 'fortable':
             return $this->forTable;
             break;
         case 'tagtable':
             return $this->strTagTable;
             break;
         case 'tagfield':
             return $this->strTagField;
             break;
         case 'maxtags':
             return $this->intMaxTags;
             break;
         case 'topnumber':
             return $this->intTopNumber;
             break;
         case 'buckets':
             return $this->intBuckets;
             break;
         case 'addNamedClass':
             return $this->boolNamedClass;
             break;
         default:
             return parent::__get($strKey);
             break;
     }
 }
开发者ID:AgentCT,项目名称:tags,代码行数:34,代码来源:TagList.php

示例4: __get

 /**
  * Return an object property
  *
  * @param string $strKey The property name
  *
  * @return mixed The property value
  */
 public function __get($strKey)
 {
     switch ($strKey) {
         case 'hash':
             return $this->getHash();
             break;
         case 'name':
         case 'basename':
             return basename($this->strFolder);
             break;
         case 'path':
         case 'value':
             return $this->strFolder;
             break;
         case 'size':
             return $this->getSize();
             break;
         default:
             return parent::__get($strKey);
             break;
     }
 }
开发者ID:jamesdevine,项目名称:core-bundle,代码行数:29,代码来源:Folder.php

示例5: __get

 /**
  * Return an object property
  * 
  * Supported keys:
  * 
  * * hash: the folder's MD5 hash
  * * path: the path to the folder
  * * size: the folder size
  * 
  * @param string $strKey The property name
  * 
  * @return mixed The property value
  */
 public function __get($strKey)
 {
     $strCacheKey = __METHOD__ . '-' . $this->strFolder . '-' . $strKey;
     if (!\Cache::has($strCacheKey)) {
         switch ($strKey) {
             case 'hash':
                 \Cache::set($strCacheKey, $this->getHash());
                 break;
             case 'path':
             case 'value':
                 \Cache::set($strCacheKey, $this->strFolder);
                 break;
             case 'size':
                 \Cache::set($strCacheKey, $this->getSize());
                 break;
             default:
                 return parent::__get($strKey);
                 break;
         }
     }
     return \Cache::get($strCacheKey);
 }
开发者ID:rburch,项目名称:core,代码行数:35,代码来源:Folder.php

示例6: __get

 /**
  * Return an object property
  * 
  * Supported keys:
  * 
  * * timestamp:  the Unix timestamp
  * * date:       the formatted date
  * * time:       the formatted time
  * * datim:      the formatted date and time
  * * dayBegin:   the beginning of the current day
  * * dayEnd:     the end of the current day
  * * monthBegin: the beginning of the current month
  * * monthEnd:   the end of the current month
  * * yearBegin:  the beginning of the current year
  * * yearEnd:    the end of the current year
  * * format:     the date format string
  * 
  * @param string $strKey The property name
  * 
  * @return mixed The property value
  */
 public function __get($strKey)
 {
     switch ($strKey) {
         case 'tstamp':
         case 'timestamp':
             return $this->strDate;
             break;
         case 'date':
             return $this->strToDate;
             break;
         case 'time':
             return $this->strToTime;
             break;
         case 'datim':
             return $this->strToDatim;
             break;
         case 'dayBegin':
             return $this->arrRange['day']['begin'];
             break;
         case 'dayEnd':
             return $this->arrRange['day']['end'];
             break;
         case 'monthBegin':
             return $this->arrRange['month']['begin'];
             break;
         case 'monthEnd':
             return $this->arrRange['month']['end'];
             break;
         case 'yearBegin':
             return $this->arrRange['year']['begin'];
             break;
         case 'yearEnd':
             return $this->arrRange['year']['end'];
             break;
         case 'format':
             return $this->strFormat;
             break;
     }
     return parent::__get($strKey);
 }
开发者ID:rburch,项目名称:core,代码行数:61,代码来源:Date.php

示例7: __get

 /**
  * Return an object property
  * 
  * Supported keys:
  * 
  * * size:      the file size
  * * name:      the file name without extension
  * * dirname:   the path of the parent folder
  * * extension: the file extension
  * * filename:  the file name and extension
  * * mime:      the file's mime type
  * * hash:      the file's MD5 checksum
  * * ctime:     the file's ctime
  * * mtime:     the file's mtime
  * * atime:     the file's atime
  * * icon:      the name of the corresponding mime icon
  * * path:      the path to the file
  * * width:     the file width (images only)
  * * height:    the file height (images only)
  * * isGdImage: true if the file can be handled by the GDlib
  * * handle:    the file handle (returned by fopen())
  * 
  * @param string $strKey The property name
  * 
  * @return mixed The property value
  */
 public function __get($strKey)
 {
     $strCacheKey = __METHOD__ . '-' . $this->strFile . '-' . $strKey;
     if (!\Cache::has($strCacheKey)) {
         switch ($strKey) {
             case 'size':
             case 'filesize':
                 \Cache::set($strCacheKey, filesize(TL_ROOT . '/' . $this->strFile));
                 break;
             case 'name':
             case 'basename':
                 if (!isset($this->arrPathinfo[$strKey])) {
                     $this->arrPathinfo = pathinfo(TL_ROOT . '/' . $this->strFile);
                 }
                 \Cache::set($strCacheKey, $this->arrPathinfo['basename']);
                 break;
             case 'dirname':
                 if (!isset($this->arrPathinfo[$strKey])) {
                     $this->arrPathinfo = pathinfo(TL_ROOT . '/' . $this->strFile);
                 }
                 \Cache::set($strCacheKey, $this->arrPathinfo['dirname']);
                 break;
             case 'extension':
                 if (!isset($this->arrPathinfo['extension'])) {
                     $this->arrPathinfo = pathinfo(TL_ROOT . '/' . $this->strFile);
                 }
                 \Cache::set($strCacheKey, strtolower($this->arrPathinfo['extension']));
                 break;
             case 'filename':
                 \Cache::set($strCacheKey, basename($this->basename, '.' . $this->extension));
                 break;
             case 'mime':
                 \Cache::set($strCacheKey, $this->getMimeType());
                 break;
             case 'hash':
                 \Cache::set($strCacheKey, $this->getHash());
                 break;
             case 'ctime':
                 \Cache::set($strCacheKey, filectime(TL_ROOT . '/' . $this->strFile));
                 break;
             case 'mtime':
                 \Cache::set($strCacheKey, filemtime(TL_ROOT . '/' . $this->strFile));
                 break;
             case 'atime':
                 \Cache::set($strCacheKey, fileatime(TL_ROOT . '/' . $this->strFile));
                 break;
             case 'icon':
                 \Cache::set($strCacheKey, $this->getIcon());
                 break;
             case 'path':
             case 'value':
                 \Cache::set($strCacheKey, $this->strFile);
                 break;
             case 'width':
                 if (empty($this->arrImageSize)) {
                     $this->arrImageSize = @getimagesize(TL_ROOT . '/' . $this->strFile);
                 }
                 \Cache::set($strCacheKey, $this->arrImageSize[0]);
                 break;
             case 'height':
                 if (empty($this->arrImageSize)) {
                     $this->arrImageSize = @getimagesize(TL_ROOT . '/' . $this->strFile);
                 }
                 \Cache::set($strCacheKey, $this->arrImageSize[1]);
                 break;
             case 'isGdImage':
                 \Cache::set($strCacheKey, in_array($this->extension, array('gif', 'jpg', 'jpeg', 'png')));
                 break;
             case 'handle':
                 if (!is_resource($this->resFile)) {
                     $this->resFile = fopen(TL_ROOT . '/' . $this->strFile, 'rb');
                 }
                 return $this->resFile;
                 break;
//.........这里部分代码省略.........
开发者ID:rburch,项目名称:core,代码行数:101,代码来源:File.php

示例8: __get

 /**
  * Return an object property
  *
  * @param string $strKey The property name
  *
  * @return mixed The property value
  */
 public function __get($strKey)
 {
     switch ($strKey) {
         case 'hash':
             return $this->getHash();
             break;
         case 'name':
         case 'basename':
             if (!isset($this->arrPathinfo[$strKey])) {
                 $this->arrPathinfo = $this->getPathinfo();
             }
             return $this->arrPathinfo['basename'];
             break;
         case 'dirname':
         case 'filename':
             if (!isset($this->arrPathinfo[$strKey])) {
                 $this->arrPathinfo = $this->getPathinfo();
             }
             return $this->arrPathinfo[$strKey];
             break;
         case 'path':
         case 'value':
             return $this->strFolder;
             break;
         case 'size':
             return $this->getSize();
             break;
         case 'ctime':
             return filectime(TL_ROOT . '/' . $this->strFolder);
             break;
         case 'mtime':
             return filemtime(TL_ROOT . '/' . $this->strFolder);
             break;
         case 'atime':
             return fileatime(TL_ROOT . '/' . $this->strFolder);
             break;
         default:
             return parent::__get($strKey);
             break;
     }
 }
开发者ID:contao,项目名称:core-bundle,代码行数:48,代码来源:Folder.php

示例9: __get

 /**
  * Return an object property
  *
  * @param string $strKey The property name
  *
  * @return mixed The property value
  */
 public function __get($strKey)
 {
     switch ($strKey) {
         case 'size':
         case 'filesize':
             return filesize(TL_ROOT . '/' . $this->strFile);
             break;
         case 'name':
         case 'basename':
             if (!isset($this->arrPathinfo[$strKey])) {
                 $this->arrPathinfo = $this->getPathinfo();
             }
             return $this->arrPathinfo['basename'];
             break;
         case 'dirname':
         case 'filename':
             if (!isset($this->arrPathinfo[$strKey])) {
                 $this->arrPathinfo = $this->getPathinfo();
             }
             return $this->arrPathinfo[$strKey];
         case 'extension':
             if (!isset($this->arrPathinfo['extension'])) {
                 $this->arrPathinfo = $this->getPathinfo();
             }
             return strtolower($this->arrPathinfo['extension']);
             break;
         case 'origext':
             if (!isset($this->arrPathinfo['extension'])) {
                 $this->arrPathinfo = $this->getPathinfo();
             }
             return $this->arrPathinfo['extension'];
             break;
         case 'tmpname':
             return basename($this->strTmp);
             break;
         case 'path':
         case 'value':
             return $this->strFile;
             break;
         case 'mime':
             return $this->getMimeType();
             break;
         case 'hash':
             return $this->getHash();
             break;
         case 'ctime':
             return filectime(TL_ROOT . '/' . $this->strFile);
             break;
         case 'mtime':
             return filemtime(TL_ROOT . '/' . $this->strFile);
             break;
         case 'atime':
             return fileatime(TL_ROOT . '/' . $this->strFile);
             break;
         case 'icon':
             return $this->getIcon();
             break;
         case 'imageSize':
             if (empty($this->arrImageSize)) {
                 if ($this->isGdImage) {
                     $this->arrImageSize = @getimagesize(TL_ROOT . '/' . $this->strFile);
                 } elseif ($this->isSvgImage) {
                     $doc = new \DOMDocument();
                     if ($this->extension == 'svgz') {
                         $doc->loadXML(gzdecode($this->getContent()));
                     } else {
                         $doc->loadXML($this->getContent());
                     }
                     $svgElement = $doc->documentElement;
                     if ($svgElement->getAttribute('width') && $svgElement->getAttribute('height') && substr(rtrim($svgElement->getAttribute('width')), -1) != '%' && substr(rtrim($svgElement->getAttribute('height')), -1) != '%') {
                         $this->arrImageSize = array(\Image::getPixelValue($svgElement->getAttribute('width')), \Image::getPixelValue($svgElement->getAttribute('height')));
                     }
                     if ($this->arrImageSize && $this->arrImageSize[0] && $this->arrImageSize[1]) {
                         $this->arrImageSize[2] = 0;
                         // replace this with IMAGETYPE_SVG when it becomes available
                         $this->arrImageSize[3] = 'width="' . $this->arrImageSize[0] . '" height="' . $this->arrImageSize[1] . '"';
                         $this->arrImageSize['bits'] = 8;
                         $this->arrImageSize['channels'] = 3;
                         $this->arrImageSize['mime'] = $this->getMimeType();
                     } else {
                         $this->arrImageSize = false;
                     }
                 }
             }
             return $this->arrImageSize;
             break;
         case 'width':
             return $this->imageSize[0];
             break;
         case 'height':
             return $this->imageSize[1];
             break;
         case 'imageViewSize':
//.........这里部分代码省略.........
开发者ID:eknoes,项目名称:core,代码行数:101,代码来源:File.php

示例10: __get

 /**
  * Return a cache entry
  * 
  * @param string $strKey The cache key
  * 
  * @return mixed|null The cached data
  * 
  * @deprecated Use Cache::get() instead
  */
 public function __get($strKey)
 {
     if (static::has($strKey)) {
         return static::get($strKey);
     }
     return parent::__get($strKey);
 }
开发者ID:rikaix,项目名称:core,代码行数:16,代码来源:Cache.php


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