예제 #1
0
파일: Date.php 프로젝트: jasmun/Noco100
 /**
  * Check a given year for leap year.
  *
  * @param  integer|array|IfwPsn_Vendor_Zend_Date  $year  Year to check
  * @return boolean
  */
 public static function checkLeapYear($year)
 {
     if ($year instanceof IfwPsn_Vendor_Zend_Date) {
         $year = (int) $year->toString(self::YEAR, 'iso');
     }
     if (is_array($year)) {
         if (isset($year['year']) === true) {
             $year = $year['year'];
         } else {
             require_once IFW_PSN_LIB_ROOT . 'IfwPsn/Vendor/Zend/Date/Exception.php';
             throw new IfwPsn_Vendor_Zend_Date_Exception("no year given in array");
         }
     }
     if (!is_numeric($year)) {
         require_once IFW_PSN_LIB_ROOT . 'IfwPsn/Vendor/Zend/Date/Exception.php';
         throw new IfwPsn_Vendor_Zend_Date_Exception("year ({$year}) has to be integer for checkLeapYear()", 0, null, $year);
     }
     return (bool) parent::isYearLeapYear($year);
 }
예제 #2
0
 /**
  * Internal method to check if the given cache supports tags
  *
  * @param IfwPsn_Vendor_Zend_Cache $cache
  */
 protected static function _getTagSupportForCache()
 {
     $backend = self::$_cache->getBackend();
     if ($backend instanceof IfwPsn_Vendor_Zend_Cache_Backend_ExtendedInterface) {
         $cacheOptions = $backend->getCapabilities();
         self::$_cacheTags = $cacheOptions['tags'];
     } else {
         self::$_cacheTags = false;
     }
     return self::$_cacheTags;
 }