addFile() public method

Add a file to the list.
public addFile ( string $file, array $params ) : null
$file string The file name.
$params array Additional file parameters.
return null
示例#1
0
文件: Contents.php 项目: horde/horde
 /**
  * Add a file to the list.
  *
  * @param string $file   The file name.
  * @param array  $params Additional file parameters.
  *
  * @return NULL
  */
 public function add($file, $params)
 {
     $this->_dir_list->addFile($file, $params);
     if (!in_array($file, array_keys($this->_install_list))) {
         $point = $this->_getInstallInsertionPoint($file);
         if ($point === null) {
             $point = $this->_filelist->lastChild;
         } else {
             if ($point->previousSibling) {
                 $ws = trim($point->previousSibling->textContent);
                 if (empty($ws)) {
                     $point = $point->previousSibling;
                 }
             }
         }
         $this->_install_list[$file] = $this->_xml->insert(array("\n   ", 'install' => array('as' => $params['as'], 'name' => substr($file, 1))), $point);
     }
 }