private function runCopy() {
        if ( ! $this->run) {
            foreach ($this->holder as $name => $contents) {
                //checking the copy index
                if (array_key_exists('copy', $contents)) {
                    
                    //forceCopy flag check
                    if ( ! array_key_exists('forceCopy', $contents)) {
                        $contents['forceCopy'] = false;
                    }
                    
                    //chmod flag check
                    if ( ! array_key_exists('chmod', $contents)) {
                        $contents['chmod'] = 0777;
                    }
                    
                    //iterating
                    foreach ($contents['copy'] as $from => $to) {
                        $this->copy($from, $to, $contents['forceCopy'], $contents['chmod']);
                    }
                }
                
                //some scripts have to initialized before they call statements
                if (array_key_exists('script', $contents)) {
                    $this->addScriptBefore($contents['script']);
                }
                
                if (array_key_exists('style', $contents)) {
                    $this->addStyle($contents['style']);
                }
                
                if (array_key_exists('css', $contents)) {
                    $this->addCss($contents['css']);
                }
                
                if (array_key_exists('js', $contents)) {
                    $this->addJs($contents['js']);
                }
            }
            
            //all css
            if (array_key_exists('css', $this->obsolete)) {
                $this->css = array_diff($this->css, $this->obsolete['css']);
            }
            $this->css = array_unique($this->css);
            
            //all js
            if (array_key_exists('js', $this->obsolete)) {
                $this->js = array_diff($this->js, $this->obsolete['js']);
            }
            $this->js = array_unique($this->js);
            
            //all scripts
            if (array_key_exists('script', $this->obsolete)) {
                $this->script = str_replace($this->obsolete['script'], '', $this->script);
            }
            
            //all styles
            if (array_key_exists('style', $this->obsolete)) {
                $this->style = str_replace($this->obsolete['style'], '', $this->style);
            }
            
            //the copy has been executed!
            $this->run = true;
        }
    }
private function runCopy() {
        if ( ! $this->run) {
            foreach ($this->holder as $name => $contents) {
                //checking the copy index
                if (array_key_exists('copy', $contents)) {
                    
                    //forceCopy flag check
                    if ( ! array_key_exists('forceCopy', $contents)) {
                        $contents['forceCopy'] = false;
                    }
                    
                    //chmod flag check
                    if ( ! array_key_exists('chmod', $contents)) {
                        $contents['chmod'] = 0777;
                    }
                    
                    //iterating
                    foreach ($contents['copy'] as $from => $to) {
                        $this->copy($from, $to, $contents['forceCopy'], $contents['chmod']);
                    }
                }
                
                //some scripts have to initialized before they call statements
                if (array_key_exists('script', $contents)) {
                    $this->addScriptBefore($contents['script']);
                }
                
                if (array_key_exists('style', $contents)) {
                    $this->addStyle($contents['style']);
                }
                
                if (array_key_exists('css', $contents)) {
                    $this->addCss($contents['css']);
                }
                
                if (array_key_exists('js', $contents)) {
                    $this->addJs($contents['js']);
                }
            }
            
            //all css
            if (array_key_exists('css', $this->obsolete)) {
                $this->css = array_diff($this->css, $this->obsolete['css']);
            }
            $this->css = array_unique($this->css);
            
            //all js
            if (array_key_exists('js', $this->obsolete)) {
                $this->js = array_diff($this->js, $this->obsolete['js']);
            }
            $this->js = array_unique($this->js);
            
            //all scripts
            if (array_key_exists('script', $this->obsolete)) {
                $this->script = str_replace($this->obsolete['script'], '', $this->script);
            }
            
            //all styles
            if (array_key_exists('style', $this->obsolete)) {
                $this->style = str_replace($this->obsolete['style'], '', $this->style);
            }
            
            //the copy has been executed!
            $this->run = true;
        }
    }
private function runCopy ( ) { if ( ! $ this -> run ) { foreach ( $ this -> holder as $ name => $ contents ) { //checking the copy index if ( array_key_exists ( 'copy' , $ contents ) ) { //forceCopy flag check if ( ! array_key_exists ( 'forceCopy' , $ contents ) ) { $ contents [ 'forceCopy' ] = false ; } //chmod flag check if ( ! array_key_exists ( 'chmod' , $ contents ) ) { $ contents [ 'chmod' ] = 0777 ; } //iterating foreach ( $ contents [ 'copy' ] as $ from => $ to ) { $ this -> copy ( $ from , $ to , $ contents [ 'forceCopy' ] , $ contents [ 'chmod' ] ) ; } } //some scripts have to initialized before they call statements if ( array_key_exists ( 'script' , $ contents ) ) { $ this -> addScriptBefore ( $ contents [ 'script' ] ) ; } if ( array_key_exists ( 'style' , $ contents ) ) { $ this -> addStyle ( $ contents [ 'style' ] ) ; } if ( array_key_exists ( 'css' , $ contents ) ) { $ this -> addCss ( $ contents [ 'css' ] ) ; } if ( array_key_exists ( 'js' , $ contents ) ) { $ this -> addJs ( $ contents [ 'js' ] ) ; } } //all css if ( array_key_exists ( 'css' , $ this -> obsolete ) ) { $ this -> css = array_diff ( $ this -> css , $ this -> obsolete [ 'css' ] ) ; } $ this -> css = array_unique ( $ this -> css ) ; //all js if ( array_key_exists ( 'js' , $ this -> obsolete ) ) { $ this -> js = array_diff ( $ this -> js , $ this -> obsolete [ 'js' ] ) ; } $ this -> js = array_unique ( $ this -> js ) ; //all scripts if ( array_key_exists ( 'script' , $ this -> obsolete ) ) { $ this -> script = str_replace ( $ this -> obsolete [ 'script' ] , '' , $ this -> script ) ; } //all styles if ( array_key_exists ( 'style' , $ this -> obsolete ) ) { $ this -> style = str_replace ( $ this -> obsolete [ 'style' ] , '' , $ this -> style ) ; } //the copy has been executed! $ this -> run = true ; } }
does all the copying and making the last cleaned arrays for use
this method run only once per request
does all the copying and making the last cleaned arrays for use this method run only once per request