Example #1
0
 /**
  * @covers ::add
  */
 public function testAddReturnInfo()
 {
     ReturnInfo::add('mensaje de prueba', 'Titulo de prueba');
     $this->assertArrayHasKey('returnInfo', $_SESSION);
     $this->assertArrayHasKey('title', $_SESSION['returnInfo'][0]);
     $this->assertArrayHasKey('msg', $_SESSION['returnInfo'][0]);
     return $_SESSION['returnInfo'];
 }
Example #2
0
 private function CrearClase($class, $ruta)
 {
     //$ruta=RUTA_APP."server/clases/Logic/";
     $stdObjTableInfo = $this->getTableInfo($class);
     if (!file_exists($ruta . ucfirst($stdObjTableInfo->tableName) . ".php")) {
         $objCreadora = new \Creadora($ruta, ucfirst($stdObjTableInfo->tableName), $stdObjTableInfo->arrAttrs, $stdObjTableInfo->tableName, $stdObjTableInfo->arrFksFrom, $stdObjTableInfo->arrFksTo);
         //$objCreadora=new Creadora (ucfirst($tableName), $arrAttrs, $tableName);
         //$objCreadora->creadoraJS (ucfirst($tableName), $arrAttrs, $tableName);
         //$objCreadora->frmSimple($arrAttrs,ucfirst($tableName));
         $title = 'Clase ' . $class . ' creada';
         $msg = '<h2 title="' . print_r($stdObjTableInfo->arrAttrs, true) . '">Creando clase ' . ucfirst($stdObjTableInfo->tableName) . ' (tooltip)</h2>';
         $msg .= "<h3>Atributos</h3><pre>" . print_r($stdObjTableInfo->arrAttrs, true) . "</pre>";
         $msg .= "<h3>FKs</h3><pre>" . print_r($stdObjTableInfo->arrFksTo, true) . "</pre>";
         $msg .= "<hr /><hr /><hr />";
         ReturnInfo::add($msg, $title);
     } else {
         $title = 'Clase ' . $class . ' NO re-creada';
         $msg = 'La clase ya existe.';
         ReturnInfo::add($msg, $title);
     }
 }
Example #3
0
 switch ($acTipo) {
     case "std":
     case "stdAssoc":
         if (get_class($e) == "ActionException") {
             //Excepción lanzada voluntariamente
             if (!ReturnInfo::existe()) {
                 $msg = $e->getMessage();
                 $title = "La operacion no ha sido completada";
                 ReturnInfo::add($msg, $title);
             }
             $location = $acReturnURI;
         } else {
             //Excepcion no controlada
             $msg = $infoExc;
             $title = "Situación de excepción no controlada";
             ReturnInfo::add($msg, $title);
             $location = BASE_DIR . FILE_APP . "?page=error";
         }
         error_log('redireccionando a (' . $location . ')');
         $firephp->info($location, 'redireccionando a ($location)');
         if (in_array($_SERVER['REMOTE_ADDR'], unserialize(IPS_DEV))) {
             echo '<a href="' . $location . '">Continuar a: ' . $location . '</a>';
         } else {
             header("Location: " . $location);
         }
         break;
     case "ajax":
     case "ajaxAssoc":
         ReturnInfo::clear();
         $actionData = new \stdClass();
         if (get_class($e) == "ActionException") {