Commit bc657c3f authored by Ana's avatar Ana

cambios

parent df0c569d
......@@ -13,7 +13,7 @@ class AppKernel extends Kernel
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
// new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new AppBundle\AppBundle(),
new Propel\PropelBundle\PropelBundle(),
......
......@@ -389,7 +389,7 @@ class SymfonyRequirements extends RequirementCollection
{
/* mandatory requirements follow */
$installedPhpVersion = phpversion();
$installedPhpVersion = PHP_VERSION;
$requiredPhpVersion = $this->getPhpRequiredVersion();
$this->addRecommendation(
......@@ -448,15 +448,8 @@ class SymfonyRequirements extends RequirementCollection
}
if (false !== $requiredPhpVersion && version_compare($installedPhpVersion, $requiredPhpVersion, '>=')) {
$timezones = array();
foreach (DateTimeZone::listAbbreviations() as $abbreviations) {
foreach ($abbreviations as $abbreviation) {
$timezones[$abbreviation['timezone_id']] = true;
}
}
$this->addRequirement(
isset($timezones[@date_default_timezone_get()]),
in_array(@date_default_timezone_get(), DateTimeZone::listIdentifiers(), true),
sprintf('Configured default timezone "%s" must be supported by your installation of PHP', @date_default_timezone_get()),
'Your default timezone is not supported by PHP. Check for typos in your <strong>php.ini</strong> file and have a look at the list of deprecated timezones at <a href="http://php.net/manual/en/timezones.others.php">http://php.net/manual/en/timezones.others.php</a>.'
);
......@@ -633,12 +626,6 @@ class SymfonyRequirements extends RequirementCollection
'Install and enable the <strong>mbstring</strong> extension.'
);
$this->addRecommendation(
function_exists('iconv'),
'iconv() should be available',
'Install and enable the <strong>iconv</strong> extension.'
);
$this->addRecommendation(
function_exists('utf8_decode'),
'utf8_decode() should be available',
......@@ -737,7 +724,7 @@ class SymfonyRequirements extends RequirementCollection
'Install and/or enable a <strong>PHP accelerator</strong> (highly recommended).'
);
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) {
$this->addRecommendation(
$this->getRealpathCacheSize() >= 5 * 1024 * 1024,
'realpath_cache_size should be at least 5M in php.ini',
......@@ -780,7 +767,11 @@ class SymfonyRequirements extends RequirementCollection
{
$size = ini_get('realpath_cache_size');
$size = trim($size);
$unit = '';
if (!ctype_digit($size)) {
$unit = strtolower(substr($size, -1, 1));
$size = (int) substr($size, 0, -1);
}
switch ($unit) {
case 'g':
return $size * 1024 * 1024 * 1024;
......
<?php
use Doctrine\Common\Annotations\AnnotationRegistry;
//use Doctrine\Common\Annotations\AnnotationRegistry;
use Composer\Autoload\ClassLoader;
/** @var ClassLoader $loader */
$loader = require __DIR__.'/../vendor/autoload.php';
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
//AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
return $loader;
......@@ -37,15 +37,15 @@ twig:
strict_variables: "%kernel.debug%"
# Doctrine Configuration
doctrine:
dbal:
driver: pdo_mysql
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
#doctrine:
#dbal:
# driver: pdo_mysql
# host: "%database_host%"
# port: "%database_port%"
# dbname: "%database_name%"
# user: "%database_user%"
# password: "%database_password%"
# charset: UTF8
# if using pdo_sqlite as your database driver:
# 1. add the path in parameters.yml
# e.g. database_path: "%kernel.root_dir%/data/data.db3"
......@@ -53,10 +53,10 @@ doctrine:
# 3. Uncomment next line:
# path: "%database_path%"
orm:
auto_generate_proxy_classes: "%kernel.debug%"
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
#orm:
# auto_generate_proxy_classes: "%kernel.debug%"
# naming_strategy: doctrine.orm.naming_strategy.underscore
# auto_mapping: true*/
# Swiftmailer Configuration
swiftmailer:
......
......@@ -20,4 +20,16 @@
<parameter name="Engine" value="InnoDB"/>
</vendor>
</table>
<table name="respuestas_sms" phpName="RespuestasSms" idMethod="native">
<column name="res_id" phpName="ResId" type="INTEGER" primaryKey="true" required="true"/>
<column name="res_proveedor_sms" phpName="ResProveedorSms" type="INTEGER" required="true"/>
<column name="res_emisor" phpName="ResEmisor" type="INTEGER" required="true"/>
<column name="res_mensaje" phpName="ResMensaje" type="LONGVARCHAR" required="true"/>
<column name="res_http_code_respuesta_peticion" phpName="ResHttpCodeRespuestaPeticion" type="INTEGER" required="true"/>
<column name="created_at" phpName="CreatedAt" type="TIMESTAMP" required="true" defaultExpr="CURRENT_TIMESTAMP"/>
<column name="updated_at" phpName="UpdatedAt" type="TIMESTAMP" required="true" defaultValue="0000-00-00 00:00:00"/>
<vendor type="mysql">
<parameter name="Engine" value="InnoDB"/>
</vendor>
</table>
</database>
This source diff could not be displayed because it is too large. You can view the blob instead.
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 12-07-2019 a las 04:32:49
-- Versión del servidor: 10.1.26-MariaDB
-- Versión de PHP: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `apidb`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `respuestas_sms`
--
CREATE TABLE `respuestas_sms` (
`res_id` int(11) NOT NULL,
`res_proveedor_sms` int(11) NOT NULL,
`res_emisor` int(11) NOT NULL,
`res_mensaje` text NOT NULL,
`res_http_code_respuesta_peticion` int(11) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `respuestas_sms`
--
ALTER TABLE `respuestas_sms`
ADD PRIMARY KEY (`res_id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<?php
namespace AppBundle\Model;
use AppBundle\Model\om\BaseRespuestasSms;
class RespuestasSms extends BaseRespuestasSms
{
}
<?php
namespace AppBundle\Model;
use AppBundle\Model\om\BaseRespuestasSmsPeer;
class RespuestasSmsPeer extends BaseRespuestasSmsPeer
{
}
<?php
namespace AppBundle\Model;
use AppBundle\Model\om\BaseRespuestasSmsQuery;
class RespuestasSmsQuery extends BaseRespuestasSmsQuery
{
}
<?php
namespace AppBundle\Model\map;
use \RelationMap;
use \TableMap;
/**
* This class defines the structure of the 'respuestas_sms' table.
*
*
*
* This map class is used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package propel.generator.src.AppBundle.Model.map
*/
class RespuestasSmsTableMap extends TableMap
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'src.AppBundle.Model.map.RespuestasSmsTableMap';
/**
* Initialize the table attributes, columns and validators
* Relations are not initialized by this method since they are lazy loaded
*
* @return void
* @throws PropelException
*/
public function initialize()
{
// attributes
$this->setName('respuestas_sms');
$this->setPhpName('RespuestasSms');
$this->setClassname('AppBundle\\Model\\RespuestasSms');
$this->setPackage('src.AppBundle.Model');
$this->setUseIdGenerator(false);
// columns
$this->addPrimaryKey('res_id', 'ResId', 'INTEGER', true, null, null);
$this->addColumn('res_proveedor_sms', 'ResProveedorSms', 'INTEGER', true, null, null);
$this->addColumn('res_emisor', 'ResEmisor', 'INTEGER', true, null, null);
$this->addColumn('res_mensaje', 'ResMensaje', 'LONGVARCHAR', true, null, null);
$this->addColumn('res_http_code_respuesta_peticion', 'ResHttpCodeRespuestaPeticion', 'INTEGER', true, null, null);
$this->addColumn('created_at', 'CreatedAt', 'TIMESTAMP', true, null, 'CURRENT_TIMESTAMP');
$this->addColumn('updated_at', 'UpdatedAt', 'TIMESTAMP', true, null, '0000-00-00 00:00:00');
// validators
} // initialize()
/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{
} // buildRelations()
} // RespuestasSmsTableMap
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<database name="default" defaultIdMethod="native" namespace="AppBundle\Model">
<table name="notifica" phpName="Notifica" idMethod="native">
<column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
......@@ -20,4 +19,16 @@
<parameter name="Engine" value="InnoDB"/>
</vendor>
</table>
<table name="respuestas_sms" phpName="RespuestasSms" idMethod="native">
<column name="res_id" phpName="ResId" type="INTEGER" primaryKey="true" required="true"/>
<column name="res_proveedor_sms" phpName="ResProveedorSms" type="INTEGER" required="true"/>
<column name="res_emisor" phpName="ResEmisor" type="INTEGER" required="true"/>
<column name="res_mensaje" phpName="ResMensaje" type="LONGVARCHAR" required="true"/>
<column name="res_http_code_respuesta_peticion" phpName="ResHttpCodeRespuestaPeticion" type="INTEGER" required="true"/>
<column name="created_at" phpName="CreatedAt" type="TIMESTAMP" required="true" defaultExpr="CURRENT_TIMESTAMP"/>
<column name="updated_at" phpName="UpdatedAt" type="TIMESTAMP" required="true" defaultValue="0000-00-00 00:00:00"/>
<vendor type="mysql">
<parameter name="Engine" value="InnoDB"/>
</vendor>
</table>
</database>
\ No newline at end of file
......@@ -31,7 +31,7 @@ class EnvioSmsController extends FOSRestController {
* @Method({"POST"})
*/
public function enviarSmsAction() {
print_r('Enviando mensaje');
$campana = $_POST['campana'];
$telefono = $_POST['telefono'];
$mensaje = $_POST['mensaje'];
......@@ -51,6 +51,7 @@ class EnvioSmsController extends FOSRestController {
if ($idmetodo == 1) { //nrsgateway
// $log->debug('mensajeee: ' . $mensaje);
$log->debug('Selecciona nrsgateway');
$usuario = Utiles::getParametroConfiguracion('nrsgateway_user');
$password = Utiles::getParametroConfiguracion('nrsgateway_pws');
$url = Utiles::getParametroConfiguracion('nrsgateway_url');
......@@ -58,11 +59,13 @@ class EnvioSmsController extends FOSRestController {
} else { //teltech
if ($idmetodo == 2) {
$log->debug('Selecciona Teltech');
$usuario = Utiles::getParametroConfiguracion('teltech_user');
$password = Utiles::getParametroConfiguracion('teltech_pws');
$url = Utiles::getParametroConfiguracion('teltech_url');
return $this->enviarMensaje($campana, $telefono, $mensaje, $usuario, $password, $url);
} else { //Amazon
$log->debug('Selecciona Amazon');
return $this->enviarMensajeAmazon($telefono, $mensaje);
}
}
......@@ -99,14 +102,15 @@ class EnvioSmsController extends FOSRestController {
$resp = "";
if (isset($array['error']['code'])) {
$log->debug('Api Devuelve error');
$resp = array(
'success' => false,
'statusCode' => $array['error']['code']
);
return $resp;
} else {
$log = Utiles::setLog('BackendBundle', 'backend/backend');
$log->debug('Api envio exitoso');
$notifica = NotificaQuery::create()->filterByCampana($campana)->filterByTelefono($movil)->find();
$resp = "";
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment