Esempio n. 1
0
 /**
  * Will count the number of segments in an URL string, returning it as an integer. This method is used to calculate from where
  * we start processing the URL as key/var pairs. It's an internal method that's used only by core developers.
  *
  * @param S $websiteURL The string URL to count segments for
  * @return I The number of segments in the given URL
  * @copyright Elena Ramona <*****@*****.**>
  * @version $Id: 09_URL.php 313 2009-10-09 13:27:52Z catalin.zamfir $
  * @since Version 1.0
  * @access private
  * @static
  * @final
  */
 private static final function countSegments(S $websiteURL)
 {
     // Execute the count;
     if ($websiteURL != _NONE) {
         $k = new I(0);
         foreach (explode(_WS, preg_replace(self::GET_URL_PREG_SEARCH, self::GET_URL_PREG_REPLAC, $websiteURL)) as $v) {
             if ($v != _NONE) {
                 $k->doInc();
             }
         }
         return $k;
     } else {
         $k = new I(0);
         return $k;
     }
 }