2016-03-15 16:28:38 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @package Widgets
|
|
|
|
*
|
|
|
|
* @file AdminTest.php
|
|
|
|
* This file is part of Movim.
|
|
|
|
*
|
|
|
|
* @brief The Admin Pest part
|
|
|
|
*
|
|
|
|
* @author Jaussoin Timothée <edhelas@movim.eu>
|
|
|
|
|
|
|
|
* Copyright (C)2014 Movim project
|
|
|
|
*
|
|
|
|
* See COPYING for licensing information.
|
|
|
|
*/
|
2016-04-12 10:29:33 +02:00
|
|
|
|
2016-03-29 14:12:33 +02:00
|
|
|
class AdminTest extends \Movim\Widget\Base
|
2016-03-15 16:28:38 +01:00
|
|
|
{
|
|
|
|
function load() {
|
|
|
|
$this->addjs('admintest.js');
|
|
|
|
$this->addcss('admintest.css');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function version()
|
|
|
|
{
|
2016-04-12 10:29:33 +02:00
|
|
|
return (version_compare(PHP_VERSION, '5.4.0') >= 0);
|
2016-03-15 16:28:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testDir($dir)
|
|
|
|
{
|
|
|
|
return (file_exists($dir) && is_dir($dir) && is_writable($dir));
|
|
|
|
}
|
2016-04-12 10:29:33 +02:00
|
|
|
|
2016-03-15 16:28:38 +01:00
|
|
|
public function testFile($file)
|
|
|
|
{
|
|
|
|
return (file_exists($file) && is_writable($file));
|
|
|
|
}
|
|
|
|
|
|
|
|
function display()
|
|
|
|
{
|
2016-04-12 10:29:33 +02:00
|
|
|
$md = \Modl\Modl::getInstance();
|
2016-03-15 16:28:38 +01:00
|
|
|
$supported = $md->getSupportedDatabases();
|
|
|
|
|
|
|
|
$this->view->assign('dbconnected', $md->_connected);
|
|
|
|
$this->view->assign('dbinfos', sizeof($md->check()));
|
|
|
|
}
|
|
|
|
}
|