private function run($type) {
        //getting the defined array of assets
        //this method will define in the children classes
        $this->init();
        
        //making the base path of public dir
        $this->getTarget();
        
        //duplication check
        if ($type == 'del') {
            return Asset::delAsset($this->name);
        }
        
        //find all of them between patterns and folders
        $this->boot();
        
        //check for those that have to copy to their cache folders
        foreach ($this->loop as $kind => $contents) {
            if ( ! empty($contents)) {
                foreach ($contents as $index => $content) {
                    if ( ! $this->isPublic($this->baseDir . $content)) {
                        $index                     = $this->baseDir . $content;
                        $this->copy[$kind][$index] = public_path() . $this->target . $content;
                    } else {
                        $this->target = '';
                    }
                    $this->destination[$kind][] = $this->target . $content;
                }
            }
        }
        
        //remove the ignored items from all other kinds
        if ( ! empty($this->loop['ignore'])) {
            foreach ($this->loop as $kind => $contents) {
                if ($kind != 'ignore' && ! empty($contents)) {
                    $this->copy[$kind]        = array_diff($this->copy[$kind], $this->copy['ignore']);
                    $this->destination[$kind] = array_diff($this->destination[$kind], $this->destination['ignore']);
                }
            }
            unset($this->copy['ignore']);
            unset($this->destination['ignore']);
        }
        
        //un setting the include index from destination
        if (array_key_exists('include', $this->destination)) {
            unset($this->destination['include']);
        }
        
        //flatting the copy array
        $copyTemp = [];
        foreach ($this->copy as $kind => $contents) {
            foreach ($contents as $from => $to) {
                $copyTemp[$from] = $to;
            }
        }
        $this->copy = $copyTemp;
        
        //detect type of command and then we pass the data to the AssetHolder
        if ($type == 'add') {
            $result = array_merge($this->destination, [
                'name'      => $this->name,
                'copy'      => $this->copy,
                'forceCopy' => $this->forceCopy,
                'chmod'     => $this->chmod,
                'style'     => $this->style,
                'script'    => $this->script,
                'cssOption' => $this->cssOption,
                'jsOption'  => $this->jsOption,
            ]);
            Asset::addAsset($result);
        }
        
        //we must destroy the previous object!
        self::$instance = null;
    }
private function run($type) {
        //getting the defined array of assets
        //this method will define in the children classes
        $this->init();
        
        //making the base path of public dir
        $this->getTarget();
        
        //duplication check
        if ($type == 'del') {
            return Asset::delAsset($this->name);
        }
        
        //find all of them between patterns and folders
        $this->boot();
        
        //check for those that have to copy to their cache folders
        foreach ($this->loop as $kind => $contents) {
            if ( ! empty($contents)) {
                foreach ($contents as $index => $content) {
                    if ( ! $this->isPublic($this->baseDir . $content)) {
                        $index                     = $this->baseDir . $content;
                        $this->copy[$kind][$index] = public_path() . $this->target . $content;
                    } else {
                        $this->target = '';
                    }
                    $this->destination[$kind][] = $this->target . $content;
                }
            }
        }
        
        //remove the ignored items from all other kinds
        if ( ! empty($this->loop['ignore'])) {
            foreach ($this->loop as $kind => $contents) {
                if ($kind != 'ignore' && ! empty($contents)) {
                    $this->copy[$kind]        = array_diff($this->copy[$kind], $this->copy['ignore']);
                    $this->destination[$kind] = array_diff($this->destination[$kind], $this->destination['ignore']);
                }
            }
            unset($this->copy['ignore']);
            unset($this->destination['ignore']);
        }
        
        //un setting the include index from destination
        if (array_key_exists('include', $this->destination)) {
            unset($this->destination['include']);
        }
        
        //flatting the copy array
        $copyTemp = [];
        foreach ($this->copy as $kind => $contents) {
            foreach ($contents as $from => $to) {
                $copyTemp[$from] = $to;
            }
        }
        $this->copy = $copyTemp;
        
        //detect type of command and then we pass the data to the AssetHolder
        if ($type == 'add') {
            $result = array_merge($this->destination, [
                'name'      => $this->name,
                'copy'      => $this->copy,
                'forceCopy' => $this->forceCopy,
                'chmod'     => $this->chmod,
                'style'     => $this->style,
                'script'    => $this->script,
                'cssOption' => $this->cssOption,
                'jsOption'  => $this->jsOption,
            ]);
            Asset::addAsset($result);
        }
        
        //we must destroy the previous object!
        self::$instance = null;
    }
private function run ( $ type ) { //getting the defined array of assets //this method will define in the children classes $ this -> init ( ) ; //making the base path of public dir $ this -> getTarget ( ) ; //duplication check if ( $ type == 'del' ) { return Asset :: delAsset ( $ this -> name ) ; } //find all of them between patterns and folders $ this -> boot ( ) ; //check for those that have to copy to their cache folders foreach ( $ this -> loop as $ kind => $ contents ) { if ( ! empty ( $ contents ) ) { foreach ( $ contents as $ index => $ content ) { if ( ! $ this -> isPublic ( $ this -> baseDir . $ content ) ) { $ index = $ this -> baseDir . $ content ; $ this -> copy [ $ kind ] [ $ index ] = public_path ( ) . $ this -> target . $ content ; } else { $ this -> target = '' ; } $ this -> destination [ $ kind ] [ ] = $ this -> target . $ content ; } } } //remove the ignored items from all other kinds if ( ! empty ( $ this -> loop [ 'ignore' ] ) ) { foreach ( $ this -> loop as $ kind => $ contents ) { if ( $ kind != 'ignore' && ! empty ( $ contents ) ) { $ this -> copy [ $ kind ] = array_diff ( $ this -> copy [ $ kind ] , $ this -> copy [ 'ignore' ] ) ; $ this -> destination [ $ kind ] = array_diff ( $ this -> destination [ $ kind ] , $ this -> destination [ 'ignore' ] ) ; } } unset ( $ this -> copy [ 'ignore' ] ) ; unset ( $ this -> destination [ 'ignore' ] ) ; } //un setting the include index from destination if ( array_key_exists ( 'include' , $ this -> destination ) ) { unset ( $ this -> destination [ 'include' ] ) ; } //flatting the copy array $ copyTemp = [ ] ; foreach ( $ this -> copy as $ kind => $ contents ) { foreach ( $ contents as $ from => $ to ) { $ copyTemp [ $ from ] = $ to ; } } $ this -> copy = $ copyTemp ; //detect type of command and then we pass the data to the AssetHolder if ( $ type == 'add' ) { $ result = array_merge ( $ this -> destination , [ 'name' => $ this -> name , 'copy' => $ this -> copy , 'forceCopy' => $ this -> forceCopy , 'chmod' => $ this -> chmod , 'style' => $ this -> style , 'script' => $ this -> script , 'cssOption' => $ this -> cssOption , 'jsOption' => $ this -> jsOption , ] ) ; Asset :: addAsset ( $ result ) ; } //we must destroy the previous object! self :: $ instance = null ; }
run all the process and give the result to AssetHolder

@param $type
run all the process and give the result to AssetHolder