/**
  * 
  * @access public
  * @author "Lionel Lecaque, <*****@*****.**>"
  */
 public static function isDesignModeEnabled()
 {
     $returnValue = true;
     $extensions = common_ext_ExtensionsManager::singleton()->getInstalledExtensions();
     if (!isset($extensions['generisHard'])) {
         return false;
     }
     $optimizableClasses = Optimization::getOptimizableClasses();
     foreach ($optimizableClasses as $class) {
         if (isset($class['status'])) {
             $returnValue &= $class['status'] == Optimization::DECOMPILED;
         } else {
             common_Logger::e('Problem occcurs when checking if design mode enable');
             return false;
         }
     }
     return $returnValue;
 }
Exemplo n.º 2
0
<?php

/**  
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; under version 2
 * of the License (non-upgradable).
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 * 
 * Copyright (c) 2014 (original work) Open Assessment Technologies SA;
 *               
 * 
 */
use oat\generisHard\helpers\Optimization;
require_once dirname(__FILE__) . '/../../tao/includes/raw_start.php';
foreach (Optimization::getOptimizableClasses() as $class) {
    $class = new core_kernel_classes_Class($class['classUri']);
    $result = Optimization::compileClass($class);
    echo ($result['success'] ? '[  ]' : '[EE]') . ' Compiled ' . $result['count'] . ' resources for ', $class->getLabel() . PHP_EOL;
}
Exemplo n.º 3
0
 /**
  * Returns the classes that are optimizable as a JSON array. 
  * An example of such a structure:
  * 
  * [
  * 		{
  * 			"class": "User",
  * 			"classUri": "http://www.tao.lu/Ontologies/generis.rdf#User",
  * 			"status": "compiled",
  * 			"action": ""
  * 		},
  * 		...
  * 		...
  * ]
  */
 public function optimizeClasses()
 {
     echo json_encode(Optimization::getOptimizableClasses());
 }