Compila archivos de configuracion. Es necesario indicar path absoluto
@param type $name
@param type $absolute Si es true hay que indicar el path absoluto del archivo
766958
public function compileConfigurationFile($file){
        //CARGAMOS LA DEPENDENCIA POR SI ES NECESARIA
        require_once $this->pathFra . 'Support/Spyc.php';
        
        $info= new \SplFileInfo($file);
        $path= $info->getPath() . '/';
        $name= $info->getBasename('.' . $info->getExtension());
        $config= $this->readFileSpecific($path . $name . '.' . $info->getExtension(), $info->getExtension());
        file_put_contents($path . $name . '.php', '<?php $config = ' . var_export($config, true) . ';');
    }
160776
public function delete($dir, $path, $name, $type = 'file'){
    if ( ($cfg = $this->dir($dir)) &&
      ($root = $this->get_root_path($dir))
    ){
      $is_file = $type === 'file';
      $wtype = $is_file ? 'file' : 'directory';
      $delete = [];
      if ( !empty($cfg['tabs']) ){
        foreach ( $cfg['tabs'] as $t ){
          if ( empty($t['fixed']) ){
            $real = $root . $t['path'];
            if ( dirname($path) !== '.' ){
              $real .= dirname($path) . '/';
            }
            if ( $is_file ){
              foreach ( $t['extensions'] as $e ){
                $tmp = $real . $name . '.' . $e['ext'];
                if ( file_exists($tmp) && !\in_array($tmp, $delete) ){
                  array_push($delete, $tmp);
                  if ( $t['url'] === 'php' ){
                    $del_perm = $tmp;
                  }
                }
              }
            }
            else {
              $real .= $name;
              if ( file_exists($real) && !\in_array($real, $delete) ){
                array_push($delete, $real);
                if ( $t['url'] === 'php' ){
                  $del_perm = $real;
                }
              }
            }
          }
        }
      }
      else {
        $real = $root . $path;
        if ( file_exists($real) ){
          array_push($delete, $real);
        }
      }
      $files = [];
      // Remove permissions
      if ( !empty($del_perm) ){
        $this->delete_perm($del_perm, $type);
      }
      foreach ( $delete as $d ){
        if ( $is_file ){
          // Add it to files to be closed
          array_push($files, $this->real_to_url($d));
          // Delete file
          if ( !unlink($d) ){
            $this->error("Impossible to delete the file $d");
            return false;
          }
          // Remove file's options
          $this->options->remove($this->options->from_code($this->real_to_id($d), $this->_files_pref()));
        }
        else {
          $f = $this->rem_dir_opt($d);
          $files = array_merge($files, $f);
          // Delete directory
          if ( !bbn\file\dir::delete($d) ){
            $this->error("Impossible to delete the directory $d");
            return false;
          }
        }
      }
      return ['files' => $files];
    }
    return false;
  }
910595
public function routeIf($condition, string $name, string $text, array $parameters = [], bool $absolute = true)
    {
        return $this->addIf($condition, Link::toRoute($name, $text, $parameters, $absolute));
    }
520219
protected function importAsset($absolutePath, $relativePath)
    {
        /** @var AssetHandler $assetHandler */
        foreach ($this->assetHandlers as $assetHandler) {
            if ($assetHandler->isApplicable($relativePath)) {
                $info = $assetHandler->handle($absolutePath, $relativePath);

                if ($relativePath != ltrim($info['uri'], '/')) {
                    $this->setItemContent(str_replace($relativePath, $info['uri'], $this->getItemContent()));
                }

                //Break chain of asset handler, first applicable is taken
                return;
            }
        }
        throw new AssetManagerException('Unable to import auxiliary & dependency files. No asset handler applicable to file : ' . $relativePath);
    }
183686
public function installRepository(string $name, string $type, string $url)
    {
        if (array_key_exists('repositories', $this->definition)
            && array_key_exists($name, $this->definition['repositories'])
        ) {
            return;
        }

        $application = new Application();
        $command     = new ConfigCommand();

        $definition = clone $application->getDefinition();
        $definition->addArguments($command->getDefinition()->getArguments());
        $definition->addOptions($command->getDefinition()->getOptions());

        $input = new ArrayInput(
            [
                'command' => 'config',
                'setting-key' => 'repositories.' . $name,
                'setting-value' => [
                    $type,
                    $url
                ],
                '--working-dir' => $this->workingDir
            ],
            $definition
        );

        $application->setAutoExit(false);
        $application->run($input, $this->output);
    }
1306732
public function bind($name, \Closure $type)
    {
        $name = '\\'.ltrim($name, '\\');
        $this->bindings[$name] = $type;
    }
963452
public function addPath($name, $argument = null)
    {
        $this->path[] = $name;
        if ($argument !== null) {
            $this->path[] = $argument;
        }

        return $this;
    }
859197
protected function _mkdir($path, $name) {
		
		$newkey = $this->_normpath($path);
		$newkey = preg_replace("/\/$/", "", $newkey);
		$newkey = "$newkey/$name/";

		try {
			$obj = $this->s3->PutObjectInline(array('Bucket' => $this->options['bucket'], 'Key' => $newkey , 'ContentLength' => 0, 'Data' => ''));
		} catch (Exception $e) {
		
		}
		
		if (isset($obj)) {
			return "$path/$name";
		}
		
		return false;
	}
597655
public static function IsRemovable($Type, $Name) {
      
      switch ($Type) {
         case self::TYPE_APPLICATION:
            $ApplicationManager = Gdn::Factory('ApplicationManager');
            
            if ($IsRemovable = !array_key_exists($Name, $ApplicationManager->EnabledApplications())) {
               $ApplicationInfo   = ArrayValue($Name, $ApplicationManager->AvailableApplications(), array());
               $ApplicationFolder = ArrayValue('Folder', $ApplicationInfo, '');
               
               $IsRemovable = IsWritable(PATH_APPLICATIONS . DS . $ApplicationFolder);
            }
         break;
         case self::TYPE_PLUGIN:
            if ($IsRemovable = !array_key_exists($Name, Gdn::PluginManager()->EnabledPlugins())) {
               $PluginInfo   = ArrayValue($Name, Gdn::PluginManager()->AvailablePlugins(), FALSE);
               $PluginFolder = ArrayValue('Folder', $PluginInfo, FALSE);
               
               $IsRemovable = IsWritable(PATH_PLUGINS . DS . $PluginFolder);
            }
         break;
         case self::TYPE_THEME:
            // TODO
            $IsRemovable = FALSE;
         break;
      }
      
      return $IsRemovable;
   }
984169
public static function get($name, $var = [], $absolute = false) {
        $routes = self::resolveStatic(RESOLVE_ROUTE, $name);

        if (isset($routes[0]['' . $routes[1] . ''])) {
            $route = $routes[0]['' . $routes[1] . ''];

            $url = preg_replace('#\((.*)\)#isU', '<($1)>', $route['url']);
            $urls = explode('<', $url);
            $result = '';
            $i = 0;

            foreach ($urls as $url) {
                if (preg_match('#\)>#', $url)) {
                    if (count($var) > 0) {
                        if (isset($var[$i])) {
                            $result .= preg_replace('#\((.*)\)>#U', $var[$i], $url);
                        }
                        else {
                            $result .= preg_replace('#\((.*)\)>#U', '', $url);
                        }

                        $i++;
                    }
                }
                else {
                    $result .= $url;
                }
            }

            $result = preg_replace('#\\\.#U', '.', $result);

            if (Config::config()['user']['framework']['folder'] != '') {
                $folder = Config::config()['user']['framework']['folder'];

                if ($absolute == false) {
                    return '/' . substr($folder, 0, strlen($folder) - 1) . $result;
                }
                else {
                    if (Config::config()['user']['output']['https'])
                        return 'https://' . $_SERVER['HTTP_HOST'] . $folder . $result;
                    else
                        return 'http://' . $_SERVER['HTTP_HOST'] . $folder . $result;
                }
            }
            else {
                if ($absolute == false) {
                    if ($result == '') {
                        return '/';
                    }
                    else {
                        return $result;
                    }
                }
                else {
                    if (Config::config()['user']['output']['https'])
                        return 'https://' . $_SERVER['HTTP_HOST'] . $result;
                    else
                        return 'http://' . $_SERVER['HTTP_HOST'] . $result;
                }
            }
        }

        return null;
    }
757913
public function route(string $name, array $parameters = [], bool $absolute = true): self
    {
        $this->route = route($name, $parameters, $absolute);

        $this->active([$this->route, $this->route.'/*']);

        return $this;
    }
1002811
public function configure($name)
    {
        if (isset($this->loadedConfigurations[$name])) {
            return;
        }

        $this->loadedConfigurations[$name] = true;

        $path = $this->getConfigurationPath($name);

        if (! \is_null($path)) {
            $this->make('config')->set(Arr::dot([
                $name => require $path,
            ]));
        }
    }
33813
protected function mapCustomInstallPaths(array $paths, $name, $type, $vendor = NULL)
  {
    foreach ($paths as $path => $names) {
      if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
        return $path;
      }
    }

    return false;
  }
1343364
public function route($name, $parameters = [], $absolute = true)
    {
        return app('url')->route($this->prefixRoute($name), $parameters, $absolute);
    }
864199
protected function toRoute($route, $parameters, $absolute)
    {
        $parameters = $this->formatParameters($parameters);

        $domain = $this->getRouteDomain($route, $parameters);

        // Verificar se ainda tem parametros par atraduzir
        $params_orign = $parameters;
        $parameters = [];
        preg_match_all('%\\{(.*?)\\}%', $route->uri(), $params, PREG_PATTERN_ORDER);
        for ($i = 0; $i < count($params[0]); $i++) {
            $key = str_replace('?', '', $params[1][$i]);
            $val = $this->getParameterContext($key);
            if (array_key_exists($key, $params_orign)) {
                $parameters[$key] = $params_orign[$key];
            } elseif (! is_null($val)) {
                $parameters[$key] = $val;
            }
        }

        $uri = $this->addQueryString($this->trimUrl(
            $root = $this->replaceRoot($route, $domain, $parameters),
            $this->replaceRouteParameters($route->uri(), $parameters)
        ), $parameters);

        // Se ainda tiver parametros gerar erro
        if (preg_match('/\{.*?\}/', $uri)) {
            throw UrlGenerationException::forMissingParameters($route);
        }

        $uri = strtr(rawurlencode($uri), $this->dontEncode);

        return $absolute ? $uri : '/' . ltrim(str_replace($root, '', $uri), '/');
    }
770276
public static function clearAllActive(string $absolutePathAndFilename = null)
    {
        if (self::$clearCacheCallbacks === null) {
            self::initialize();
        }
        foreach (self::$clearCacheCallbacks as $clearCacheCallback) {
            $clearCacheCallback($absolutePathAndFilename);
        }
    }
271149
public function addType(string $name, string $type): void{
        $this->types[$name] = new Type($type);
    }