src/CarteBlanche/Controller/DefaultController.php
public function check_systemAction()
    {
        $errs=$ctt=array();
        $sqlite=$php=null;
        $_altdb = $this->getContainer()->get('request')->getUrlArg('altdb');

        // directories ?
        $required_dirs = CarteBlanche::getConfig('carte_blanche.required_dirs', null, true);
        foreach ($required_dirs as $_dir) {
            $_fulldir = CarteBlanche::getPath($_dir);
            if ($ok_file = file_exists($_fulldir)) {
                $ctt[] = $this->trans('Directory "%dirname%" exists.', array('dirname'=>$_dir));
            } else {
                $errs[] = $this->trans('Directory "%dirname%" does not exist!', array('dirname'=>$_dir))
                     . $this->trans('Please create it manually.');
            }
        }

        $writable_dirs = CarteBlanche::getConfig('carte_blanche.writable_dirs', null, true);
        foreach ($writable_dirs as $_dir) {
            $_fulldir = CarteBlanche::getPath($_dir);
            if (!file_exists($_fulldir)) {
                $ok_file = mkdir($_fulldir);
            } else {
                $ok_file = true;
            }
            if ($ok_file) {
                if (is_dir($_fulldir) && is_writable($_fulldir)) {
                    $ctt[] = $this->trans('Directory "%dirname%" is writable.', array('dirname'=>$_dir));
                } else {
                    $errs[] = $this->trans('Directory "%dirname%" is not writable!', array('dirname'=>$_dir))
                        . $this->trans('Please authorize system\'s web user to write in it.');
                }
            } else {
                $errs[] = $this->trans('Directory "%dirname%" doesn\'t exist and can not be created!', array('dirname'=>$_dir))
                    . $this->trans('Please create it manually and authorize system\'s web user to write in it.');
            }
        }

        // PHP ?
        if (function_exists('phpversion')) {
            $ctt[] = $this->trans('PHP version: %version%', array('version'=>phpversion()));
        } else {
            $errs[] = $this->trans('Your PHP version is not enough. Please check the <a href="http://www.php.net/manual/en/">PHP manual</a>.');
        }
        // SQLite ?
        if (function_exists('sqlite_libversion')) {
            $ctt[] = $this->trans('SQLite version: %version%', array('version'=>sqlite_libversion()));
        } else {
            $errs[] = $this->trans('SQLite is not installed. Please check the <a href="http://www.php.net/manual/en/book.sqlite.php">PHP manual</a>.');
        }

        return array(self::$views_dir.'check_system', array(
            'title' => $this->trans("System checker"),
            'errors'=>$errs,
            'contents'=>$ctt
        ));
    }
public function check_systemAction()
    {
        $errs=$ctt=array();
        $sqlite=$php=null;
        $_altdb = $this->getContainer()->get('request')->getUrlArg('altdb');

        // directories ?
        $required_dirs = CarteBlanche::getConfig('carte_blanche.required_dirs', null, true);
        foreach ($required_dirs as $_dir) {
            $_fulldir = CarteBlanche::getPath($_dir);
            if ($ok_file = file_exists($_fulldir)) {
                $ctt[] = $this->trans('Directory "%dirname%" exists.', array('dirname'=>$_dir));
            } else {
                $errs[] = $this->trans('Directory "%dirname%" does not exist!', array('dirname'=>$_dir))
                     . $this->trans('Please create it manually.');
            }
        }

        $writable_dirs = CarteBlanche::getConfig('carte_blanche.writable_dirs', null, true);
        foreach ($writable_dirs as $_dir) {
            $_fulldir = CarteBlanche::getPath($_dir);
            if (!file_exists($_fulldir)) {
                $ok_file = mkdir($_fulldir);
            } else {
                $ok_file = true;
            }
            if ($ok_file) {
                if (is_dir($_fulldir) && is_writable($_fulldir)) {
                    $ctt[] = $this->trans('Directory "%dirname%" is writable.', array('dirname'=>$_dir));
                } else {
                    $errs[] = $this->trans('Directory "%dirname%" is not writable!', array('dirname'=>$_dir))
                        . $this->trans('Please authorize system\'s web user to write in it.');
                }
            } else {
                $errs[] = $this->trans('Directory "%dirname%" doesn\'t exist and can not be created!', array('dirname'=>$_dir))
                    . $this->trans('Please create it manually and authorize system\'s web user to write in it.');
            }
        }

        // PHP ?
        if (function_exists('phpversion')) {
            $ctt[] = $this->trans('PHP version: %version%', array('version'=>phpversion()));
        } else {
            $errs[] = $this->trans('Your PHP version is not enough. Please check the <a href="http://www.php.net/manual/en/">PHP manual</a>.');
        }
        // SQLite ?
        if (function_exists('sqlite_libversion')) {
            $ctt[] = $this->trans('SQLite version: %version%', array('version'=>sqlite_libversion()));
        } else {
            $errs[] = $this->trans('SQLite is not installed. Please check the <a href="http://www.php.net/manual/en/book.sqlite.php">PHP manual</a>.');
        }

        return array(self::$views_dir.'check_system', array(
            'title' => $this->trans("System checker"),
            'errors'=>$errs,
            'contents'=>$ctt
        ));
    }
Page of system check

@return string The view content