public function installPackageDir($package, $namespace, $packageAssetsDir)
    {
        $this->log($package->getTarget(), self::LOG_INFO, self::CODE_INSTALLING_DIR, array('namespace' => $namespace));
        if (!isset($this->assetsDirectories[$namespace])) {
            $this->log($package->getTarget(), self::LOG_WARNING, self::CODE_NO_MATCHING_DIR, array('namespace' => $namespace));
            $this->packagesStatuses[$package->getTarget()]['dirs'][$namespace]['status'] = 0;
            return;
        }
        $this->log($package->getTarget(), self::LOG_INFO, self::CODE_MATCHING_DIR, array('namespace' => $namespace));
        // We get the project vendor path
        $vendorPath = $this->getVendorPath();
        // We get the target dir of the iterated package
        $targetDir = $package->getTarget();
        // We get the full path of the current assets directory
        $packagePath = $vendorPath
            . $targetDir . "/" . $packageAssetsDir;
        // We check if this path is a directory
        if ($this->directoryHandler->isDirectory($packagePath)) {
            $this->log($package->getTarget(), self::LOG_INFO, self::CODE_DIRECTORY, array('directory' => $this->assetsDirectories[$namespace]));
            $src = $packagePath;
            $dst = $vendorPath . "../" . $this->assetsDirectories[$namespace] . $targetDir;
            // We delete the remaining directory if any
            // In order to update it
            $this->directoryHandler->deleteDirectory($dst);
            // We finally copy the package assets-dir
            // Into the project assets-dir
            $this->directoryHandler->copyDirectory($src, $dst);
            $this->log($package->getTarget(), self::LOG_INFO, self::CODE_DIR_INSTALLED, array('destination' => $dst));
            $this->packagesStatuses[$package->getTarget()]['dirs'][$namespace]['status'] = 1;
        } else {
            $this->log($package->getTarget(), self::LOG_ERROR, self::CODE_NOT_DIRECTORY, array('directory' => $this->assetsDirectories[$namespace]));
            $this->packagesStatuses[$package->getTarget()]['dirs'][$namespace]['status'] = 0;
        }
    }
public function installPackageDir($package, $namespace, $packageAssetsDir)
    {
        $this->log($package->getTarget(), self::LOG_INFO, self::CODE_INSTALLING_DIR, array('namespace' => $namespace));
        if (!isset($this->assetsDirectories[$namespace])) {
            $this->log($package->getTarget(), self::LOG_WARNING, self::CODE_NO_MATCHING_DIR, array('namespace' => $namespace));
            $this->packagesStatuses[$package->getTarget()]['dirs'][$namespace]['status'] = 0;
            return;
        }
        $this->log($package->getTarget(), self::LOG_INFO, self::CODE_MATCHING_DIR, array('namespace' => $namespace));
        // We get the project vendor path
        $vendorPath = $this->getVendorPath();
        // We get the target dir of the iterated package
        $targetDir = $package->getTarget();
        // We get the full path of the current assets directory
        $packagePath = $vendorPath
            . $targetDir . "/" . $packageAssetsDir;
        // We check if this path is a directory
        if ($this->directoryHandler->isDirectory($packagePath)) {
            $this->log($package->getTarget(), self::LOG_INFO, self::CODE_DIRECTORY, array('directory' => $this->assetsDirectories[$namespace]));
            $src = $packagePath;
            $dst = $vendorPath . "../" . $this->assetsDirectories[$namespace] . $targetDir;
            // We delete the remaining directory if any
            // In order to update it
            $this->directoryHandler->deleteDirectory($dst);
            // We finally copy the package assets-dir
            // Into the project assets-dir
            $this->directoryHandler->copyDirectory($src, $dst);
            $this->log($package->getTarget(), self::LOG_INFO, self::CODE_DIR_INSTALLED, array('destination' => $dst));
            $this->packagesStatuses[$package->getTarget()]['dirs'][$namespace]['status'] = 1;
        } else {
            $this->log($package->getTarget(), self::LOG_ERROR, self::CODE_NOT_DIRECTORY, array('directory' => $this->assetsDirectories[$namespace]));
            $this->packagesStatuses[$package->getTarget()]['dirs'][$namespace]['status'] = 0;
        }
    }
public function installPackageDir ( $ package , $ namespace , $ packageAssetsDir ) { $ this -> log ( $ package -> getTarget ( ) , self :: LOG_INFO , self :: CODE_INSTALLING_DIR , array ( 'namespace' => $ namespace ) ) ; if ( ! isset ( $ this -> assetsDirectories [ $ namespace ] ) ) { $ this -> log ( $ package -> getTarget ( ) , self :: LOG_WARNING , self :: CODE_NO_MATCHING_DIR , array ( 'namespace' => $ namespace ) ) ; $ this -> packagesStatuses [ $ package -> getTarget ( ) ] [ 'dirs' ] [ $ namespace ] [ 'status' ] = 0 ; return ; } $ this -> log ( $ package -> getTarget ( ) , self :: LOG_INFO , self :: CODE_MATCHING_DIR , array ( 'namespace' => $ namespace ) ) ; // We get the project vendor path $ vendorPath = $ this -> getVendorPath ( ) ; // We get the target dir of the iterated package $ targetDir = $ package -> getTarget ( ) ; // We get the full path of the current assets directory $ packagePath = $ vendorPath . $ targetDir . "/" . $ packageAssetsDir ; // We check if this path is a directory if ( $ this -> directoryHandler -> isDirectory ( $ packagePath ) ) { $ this -> log ( $ package -> getTarget ( ) , self :: LOG_INFO , self :: CODE_DIRECTORY , array ( 'directory' => $ this -> assetsDirectories [ $ namespace ] ) ) ; $ src = $ packagePath ; $ dst = $ vendorPath . "../" . $ this -> assetsDirectories [ $ namespace ] . $ targetDir ; // We delete the remaining directory if any // In order to update it $ this -> directoryHandler -> deleteDirectory ( $ dst ) ; // We finally copy the package assets-dir // Into the project assets-dir $ this -> directoryHandler -> copyDirectory ( $ src , $ dst ) ; $ this -> log ( $ package -> getTarget ( ) , self :: LOG_INFO , self :: CODE_DIR_INSTALLED , array ( 'destination' => $ dst ) ) ; $ this -> packagesStatuses [ $ package -> getTarget ( ) ] [ 'dirs' ] [ $ namespace ] [ 'status' ] = 1 ; } else { $ this -> log ( $ package -> getTarget ( ) , self :: LOG_ERROR , self :: CODE_NOT_DIRECTORY , array ( 'directory' => $ this -> assetsDirectories [ $ namespace ] ) ) ; $ this -> packagesStatuses [ $ package -> getTarget ( ) ] [ 'dirs' ] [ $ namespace ] [ 'status' ] = 0 ; } }
Installs a specific directory from the given package
@param Package\Link $package
@param string $namespace
@param string $packageAssetsDir
Installs a specific directory from the given package