public function processFontArchive()
    {
        $this->init();

        //return array('error' => __('Unable to read the file : ') . $archiveDir . '/style.css');

        // upload result is either the path to the zip file or an array with errors
        $uploadResult = $this->uploadArchive();
        if (!empty($uploadResult['error'])) {
            $this -> returnJson($uploadResult);
            return false;
        }

        // extract result is either the path to the extracted files or an array with errors
        $extractResult = $this->extractArchive($uploadResult);
        if (!empty($extractResult['error'])) {
            $this -> returnJson($extractResult);
            return false;
        }

        // check if the new font contains at least al glyphs from the previous version
        $currentSelection = json_decode(file_get_contents($extractResult . '/selection.json'));
        $oldSelection     = json_decode(file_get_contents($this->currentSelection));
        $integrityCheck   = $this->checkIntegrity($currentSelection, $oldSelection);
        if (!empty($integrityCheck['error'])) {
            $this -> returnJson($integrityCheck);
            return false;
        }

        //generate tao scss
        $scssGenerationResult = $this->generateTaoScss($extractResult, $currentSelection->icons);
        if (!empty($scssGenerationResult['error'])) {
            $this -> returnJson($scssGenerationResult);
            return false;
        }

        $ckGenerationResult = $this->generateCkScss($extractResult, $currentSelection->icons);
        if (!empty($ckGenerationResult['error'])) {
            $this -> returnJson($ckGenerationResult);
            return false;
        }

        // php generation result is either the path to the php class or an array with errors
        $phpGenerationResult = $this->generatePhpClass($currentSelection->icons);
        if (!empty($phpGenerationResult['error'])) {
            $this -> returnJson($phpGenerationResult);
            return false;
        }

        $distribution = $this->distribute($extractResult);
        if (!empty($distribution['error'])) {
            $this -> returnJson($distribution);
            return false;
        }

        chdir($this -> taoDir . '/views/build');

        $compilationResult = $this -> compileCss();
        if(!empty($compilationResult['error'])) {
            $this -> returnJson($compilationResult);
            return false;
        }

        $this -> returnJson(array('success' => 'The TAO icon font has been updated'));
        return  true;

    }
public function processFontArchive()
    {
        $this->init();

        //return array('error' => __('Unable to read the file : ') . $archiveDir . '/style.css');

        // upload result is either the path to the zip file or an array with errors
        $uploadResult = $this->uploadArchive();
        if (!empty($uploadResult['error'])) {
            $this -> returnJson($uploadResult);
            return false;
        }

        // extract result is either the path to the extracted files or an array with errors
        $extractResult = $this->extractArchive($uploadResult);
        if (!empty($extractResult['error'])) {
            $this -> returnJson($extractResult);
            return false;
        }

        // check if the new font contains at least al glyphs from the previous version
        $currentSelection = json_decode(file_get_contents($extractResult . '/selection.json'));
        $oldSelection     = json_decode(file_get_contents($this->currentSelection));
        $integrityCheck   = $this->checkIntegrity($currentSelection, $oldSelection);
        if (!empty($integrityCheck['error'])) {
            $this -> returnJson($integrityCheck);
            return false;
        }

        //generate tao scss
        $scssGenerationResult = $this->generateTaoScss($extractResult, $currentSelection->icons);
        if (!empty($scssGenerationResult['error'])) {
            $this -> returnJson($scssGenerationResult);
            return false;
        }

        $ckGenerationResult = $this->generateCkScss($extractResult, $currentSelection->icons);
        if (!empty($ckGenerationResult['error'])) {
            $this -> returnJson($ckGenerationResult);
            return false;
        }

        // php generation result is either the path to the php class or an array with errors
        $phpGenerationResult = $this->generatePhpClass($currentSelection->icons);
        if (!empty($phpGenerationResult['error'])) {
            $this -> returnJson($phpGenerationResult);
            return false;
        }

        $distribution = $this->distribute($extractResult);
        if (!empty($distribution['error'])) {
            $this -> returnJson($distribution);
            return false;
        }

        chdir($this -> taoDir . '/views/build');

        $compilationResult = $this -> compileCss();
        if(!empty($compilationResult['error'])) {
            $this -> returnJson($compilationResult);
            return false;
        }

        $this -> returnJson(array('success' => 'The TAO icon font has been updated'));
        return  true;

    }
public function processFontArchive ( ) { $ this -> init ( ) ; //return array('error' => __('Unable to read the file : ') . $archiveDir . '/style.css'); // upload result is either the path to the zip file or an array with errors $ uploadResult = $ this -> uploadArchive ( ) ; if ( ! empty ( $ uploadResult [ 'error' ] ) ) { $ this -> returnJson ( $ uploadResult ) ; return false ; } // extract result is either the path to the extracted files or an array with errors $ extractResult = $ this -> extractArchive ( $ uploadResult ) ; if ( ! empty ( $ extractResult [ 'error' ] ) ) { $ this -> returnJson ( $ extractResult ) ; return false ; } // check if the new font contains at least al glyphs from the previous version $ currentSelection = json_decode ( file_get_contents ( $ extractResult . '/selection.json' ) ) ; $ oldSelection = json_decode ( file_get_contents ( $ this -> currentSelection ) ) ; $ integrityCheck = $ this -> checkIntegrity ( $ currentSelection , $ oldSelection ) ; if ( ! empty ( $ integrityCheck [ 'error' ] ) ) { $ this -> returnJson ( $ integrityCheck ) ; return false ; } //generate tao scss $ scssGenerationResult = $ this -> generateTaoScss ( $ extractResult , $ currentSelection -> icons ) ; if ( ! empty ( $ scssGenerationResult [ 'error' ] ) ) { $ this -> returnJson ( $ scssGenerationResult ) ; return false ; } $ ckGenerationResult = $ this -> generateCkScss ( $ extractResult , $ currentSelection -> icons ) ; if ( ! empty ( $ ckGenerationResult [ 'error' ] ) ) { $ this -> returnJson ( $ ckGenerationResult ) ; return false ; } // php generation result is either the path to the php class or an array with errors $ phpGenerationResult = $ this -> generatePhpClass ( $ currentSelection -> icons ) ; if ( ! empty ( $ phpGenerationResult [ 'error' ] ) ) { $ this -> returnJson ( $ phpGenerationResult ) ; return false ; } $ distribution = $ this -> distribute ( $ extractResult ) ; if ( ! empty ( $ distribution [ 'error' ] ) ) { $ this -> returnJson ( $ distribution ) ; return false ; } chdir ( $ this -> taoDir . '/views/build' ) ; $ compilationResult = $ this -> compileCss ( ) ; if ( ! empty ( $ compilationResult [ 'error' ] ) ) { $ this -> returnJson ( $ compilationResult ) ; return false ; } $ this -> returnJson ( array ( 'success' => 'The TAO icon font has been updated' ) ) ; return true ; }
Process the font archive

@return bool
Process the font archive