Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Thursday, October 15, 2026

Diff for phpWebFileManager/lib/Attic/fnc.glue_url.php between version 1.1 and 1.2

version 1.1, 2002/04/20 23:03:15 version 1.2, 2002/04/21 23:23:43
Line 1 
Line 1 
 <?php  <?php
   
 /*  /*
  * glue_url()   * phpPlatonLib - Platon software development group PHP library
  *  
  * Creates URL string from components.  
  * $url - the result array from the parse_url()  
  *   *
    * common/url/fnc.glue_url.php - create URL string from components;
    * components are array as it is returned from glue_url() function
  * Author: Tomas V.V.Cox <cox@idecnet.com> [19-Feb-2001]   * Author: Tomas V.V.Cox <cox@idecnet.com> [19-Feb-2001]
    * ____________________________________________________________
    *
    * Developed by Ondrej Jombik <nepto@pobox.sk>
    * Copyright (c) 2001-2002 Platon SDG, http://www.platon.sk/
    * All rights reserved.
    *
    * See README file for more information about this software.
    * See COPYING file for license information.
    *
    * Download the latest version from
    * http://www.platon.sk/projects/phpPlatonLib/
  */   */
   
 function glue_url($url)  /* $Id$ */
 {  
         if (! is_array($url))  if (! defined('phpPlatonLib_fnc_glue_url')) {
                 return false;          define('phpPlatonLib_fnc_glue_url', 1);
   
         // scheme          function glue_url($url)
         $uri = empty($url['scheme']) ? '' : $url['scheme'] . '://';          {
                   if (! is_array($url))
         // user and pass                          return false;
         if (! empty($url['user'])) {  
                 $uri .= $url['user'].':'.$url['pass'].'@';                  // scheme
         }                  $uri = empty($url['scheme']) ? '' : $url['scheme'] . '://';
   
         // host                  // user and pass
         $uri .= $url['host'];                  if (! empty($url['user'])) {
                           $uri .= $url['user'].':'.$url['pass'].'@';
         // port                  }
         $port = empty($url['port']) ? '' : ':'.$url['port'];  
         $uri .= $port;                  // host
                   $uri .= $url['host'];
         // path  
         $uri .= $url['path'];                  // port
                   $port = empty($url['port']) ? '' : ':'.$url['port'];
         // fragment or query                  $uri .= $port;
         if (isset($url['fragment'])) {  
                 $uri .= '#' . $url['fragment'];                  // path
         }                  $uri .= $url['path'];
         elseif (isset($url['query'])) {  
                 $uri .= '?' . $url['query'];                  // fragment or query
         }                  if (isset($url['fragment'])) {
                           $uri .= '#' . $url['fragment'];
                   }
                   elseif (isset($url['query'])) {
                           $uri .= '?' . $url['query'];
                   }
   
                   return $uri;
           }
   
         return $uri;  
 }  }
   
 ?>  ?>

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top