Example #1
0
 /**
  * Run analysis on a file and vardump the output to stdout
  *
  * Show what describr was able to work out about this file
  *
  * @param type $file Path to the file that is to be analysed
  */
 protected function analyseFile($file)
 {
     try {
         $response = $this->facade->describeFileAsArray($file);
         var_dump($response);
     } catch (FileNotFoundException $e) {
         echo "\nUnable to read file {$file}";
     }
 }
 public function testCanUseShortNamesToAccessPluginResults()
 {
     $facade = new Facade();
     $results = $facade->describeFile(dirname(__FILE__) . '/../../../../resources/test.wmv');
     $this->assertTrue($results->hasPlugin('BoxUK\\General'));
     $this->assertTrue(\is_array($results->getPluginResults('BoxUK\\General')));
     $this->assertContains('BoxUK\\General', $results->listPlugins());
     $this->assertNotContains('BoxUK\\General', $results->listFullPluginNames());
     $this->assertEquals(count($results->listPlugins()), count($results->listFullPluginNames()));
 }
Example #3
0
 public function testDescribeFileTakesAFile3()
 {
     $facade = new Facade();
     $aResults = $facade->describeFileAsArray(dirname(__FILE__) . '/../../../../resources/test.wmv');
     $this->assertArrayHasKey('BoxUK\\General', $aResults);
     $this->assertArrayHasKey('BoxUK\\AudioVideo\\AsfVideo', $aResults);
     $this->assertArrayNotHasKey('BoxUK\\AudioVideo\\MpegVideo', $aResults);
     $this->assertArrayNotHasKey('BoxUK\\AudioVideo\\Audio', $aResults);
     $this->assertArrayNotHasKey('BoxUK\\Image', $aResults);
     $this->assertArrayNotHasKey('BoxUK\\PlainText', $aResults);
 }
 public function initializeFacade()
 {
     parent::initializeFacade();
     $sCommandName = 'DjControlCommand';
     require_once "{$sCommandName}.php";
     $this->registerCommand(self::SEND_DJ_COMMAND, $sCommandName);
 }
 protected function initializeController()
 {
     parent::initializeController();
     $this->registerCommand(AppFacade::STARTUP, 'StartupCommand');
     $this->registerCommand(AppFacade::DELETE_USER, 'DeleteUserCommand');
     $this->registerCommand(AppFacade::ADD_ROLE_RESULT, 'AddRoleResultCommand');
 }
 /**
  * {@inheritDoc}
  */
 public static function process($assets)
 {
     if (self::getOutputDirectory()) {
         $filename = '';
         $sourceFiles = array();
         for ($i = 0; $i < count($assets); $i++) {
             $asset = $assets[$i];
             $filename .= $asset->getAssetHashKey();
             $sourceFiles[] = $asset->getAssetURL();
         }
         $filename = sha1($filename);
         $app = Facade::getFacadeApplication();
         $ah = $app->make('helper/assets');
         $paths = array();
         foreach ($assets as $asset) {
             $paths[] = $asset->getAssetPath();
         }
         $relativePath = $ah->javascriptPath($paths, array('name' => $filename, 'skipDigest' => true));
         $assetDir = Config::get('concrete.cache.directory');
         $asset = new JavascriptAsset();
         $asset->setAssetURL($relativePath);
         $asset->setAssetPath($assetDir . $relativePath);
         $asset->setCombinedAssetSourceFiles($sourceFiles);
         return array($asset);
     }
     return $assets;
 }
 /**
  * Constructor
  */
 public function __construct($proxyName = null, $data = null)
 {
     $this->facade = Facade::getInstance();
     $this->proxyName = !empty($proxyName) ? $proxyName : self::NAME;
     if (!is_null($data)) {
         $this->setData($data);
     }
 }
Example #8
0
 public static function fire($eventName, $event = null)
 {
     $app = Facade::getFacadeApplication();
     $args = func_get_args();
     // legacy support
     if (!$event instanceof \Symfony\Component\EventDispatcher\Event) {
         array_shift($args);
         $event = new \Symfony\Component\EventDispatcher\GenericEvent();
         $event->setArgument('arguments', $args);
     }
     $app['director']->dispatch($eventName, $event);
 }
 /**
  * Facade Singleton Factory method
  * 
  * @return the Singleton instance of the Facade
  */
 public static function getInstance()
 {
     if (is_null(Facade::$instance)) {
         Facade::$instance = new Facade();
     }
     return Facade::$instance;
 }
Example #10
0
 /**
  * @return \Concrete\Core\Url\Resolver\Manager\ResolverManagerInterface
  */
 public static function getFacadeRoot()
 {
     return parent::getFacadeRoot();
 }
    $producto->setNombreProducto($_POST['nombreProducto']);
    $producto->setDescripcion($_POST['descriptionProducto']);
    $producto->setUnidadMedida($_POST['unidadProducto']);
    $producto->setIva($_POST['ivaProducto']);
    $producto->setValorUnitario($_POST['valorProducto']);
    $producto->setPresentacion($_POST['presentacionProducto']);
    $producto->setCategoria($_POST['categoriaProducto']);
    $producto->setImagenProducto('../images/' . $name);
    $mensaje = $fachada->actualizarProducto($producto, $idviejo);
    if ($mensaje == 1) {
        move_uploaded_file($file['tmp_name'], $path);
    }
    header("Location: ../views/productoListar.php?" . $mensaje);
}
if (isset($_POST['deleteProducto'])) {
    $fachada = new Facade();
    $msg = $fachada->cancelarProducto($_POST['deleteProducto']);
    echo json_encode($msg);
}
if (isset($_POST['search'])) {
    $mensaje = $_POST['searchProduct'];
    header("Location: ../views/productoListar.php?resultado=" . $mensaje);
}
if (isset($_GET['buscar'])) {
    $criterio = $_POST['criterio'];
    $busqueda = $_POST['busqueda'];
    $comobuscar = $_POST['comobuscar'];
    $resul = $fachada->buscarConCriterio($criterio, $busqueda, $comobuscar);
    $_SESSION['consulta'] = $resul;
    if ($resul == null) {
        header("Location: ../views/productoListar.php?encontrados=false&criterio=" . $criterio . "&busqueda=" . $busqueda . "&comobuscar=" . $comobuscar);
Example #12
0
                                <p>

                                <h2 class="box-title">Listado de Productos </h2></p>

                                <!-- /.box-header -->

                                <table id="example" class="table table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <th></th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php 
require '../facades/FacadeProducto.php';
$producto = new Facade();
if (isset($_GET['resultado'])) {
    $Productos = $producto->buscarProducto($_GET['resultado']);
} else {
    $Productos = $producto->getProductos();
}
foreach ($Productos as $iterator) {
    ?>


                                               <ul class="col-xs-6 col-centered" style="list-style-type: none">
                                                    <li class="span4">
                                                        <div class="thumbnail" style="text-align: center">
                                                            <span
                                                                class="badge badge-inverse pull-right price">$<?php 
    echo $iterator['ValorBase'];
Example #13
0
 /**
  * Returns the controller class for the currently selected captcha library.
  *
  * @return mixed
  */
 public function getController()
 {
     $class = overrideable_core_class('Core\\Antispam\\' . camelcase($this->saslHandle) . 'Controller', DIRNAME_CLASSES . '/Antispam/' . camelcase($this->saslHandle) . 'Controller.php', $this->getPackageHandle());
     $app = Facade::getFacadeApplication();
     $cl = $app->make($class);
     return $cl;
 }
Example #14
0
/*----------  Design Patterns: Decorator Pattern  ----------*/
print "<br/><br/>";
$bbcode_enabled = 0;
$emoticon_enabled = 1;
$post = new Post();
$comment = new Comment();
$post->filter("Test Title: A Test", "Lorem Ipsum Amet");
$comment->filter("Dolot avenus persina olatus");
if ($bbcode_enabled == false && $emoticon_enabled == false) {
    $postcontent = $post->getContent();
    $commentcontent = $comment->getContent();
} elseif ($bbcode_enabled == true && $emoticon_enabled == false) {
    $bb = new BBCodeParser($post);
    // Passing the Post() object to BBCodeParser()
    $postcontent = $bb->getContent();
    $bb = new BBCodeParser($comment);
    $commentcontent = $bb->getContent();
} elseif ($bbcode_enabled == false && $emoticon_enabled == true) {
    $em = new EmoticonParser($post);
    $postcontent = $em->getContent();
    $em = new EmoticonParser($comment);
    $commentcontent = $em->getContent();
}
/*----------  Design Patterns: Facade Pattern  ----------*/
$F = new Facade();
$F->findApartments("London, Greater London", "mapdiv");
/**

	Sumary:
	- Design Pattern are an essential part of OOP
*/
Example #15
0
class SystemC
{
    function C1() : string
    {
        return "SystemC , Method C1\n";
    }
}
class Facade
{
    static function Operation1()
    {
        $a = new SystemA();
        $b = new SystemB();
        $c = new SystemC();
        echo "Operation 1 \n";
        echo " ", $a->A1();
        echo " ", $b->B1();
        echo " ", $c->C1();
    }
    static function Operation2()
    {
        $b = new SystemB();
        $c = new SystemC();
        echo "Operation 2 \n";
        echo " ", $b->B1();
        echo " ", $c->C1();
    }
}
Facade::Operation1();
Facade::Operation2();
                              <th><i class="fa fa-bookmark"></i>Tema</th>
                              <th><i class=" fa fa-edit"></i>Lugar</th>
                              <th><i class=" fa fa-actions"></i>Estado</th>
                              <th><i class=" fa fa-actions"></i>Fecha</th>
                              <th>Acciónes</th>
                          </tr>
                          </thead>
                          <tbody>
                          <?php 
require '../facades/FacadeGestion.php';
require '../utilities/Conexion.php';
require_once '../models/GestionDao.php';
require_once '../models/ProductoDao.php';
require_once '../facades/FacadeProducto.php';
$gestion = new FacadeGestion();
$productos = new Facade();
$gestiones = $gestion->getGestiones();
foreach ($gestiones as $iterator) {
    ?>
                          <tr>
                              <td><?php 
    echo $iterator['Tipo'];
    ?>
 <a href="#"></a></td>

                              <td><?php 
    if (is_numeric($iterator['Asunto'])) {
        echo $productos->obtenerProducto($iterator['Asunto'])['Nombre'];
    }
    if (!is_numeric($iterator['Asunto'])) {
        echo $iterator['Asunto'];
Example #17
0
                          </div>
                          </div>



                          <div class="form-group">
                          <!-- InicioLabel poner class="col-sm-2 col-sm-2 control-label" -->
                          <label class="col-sm-2 col-sm-2 control-label" for="presentacionProducto">Presentación</label>
                          <!--FinLabel-->
                          <div class="col-sm-6">
                            <!-- InicioInput poner class="form-control"-->
                              <select class="form-control" name="presentacionProducto" id="presentacionProducto" type="text" required title="Este campo es requerido" >

                                  <?php 
    $producto = new Facade();
    $Productos = $producto->obtenerPresentacionProducto();
    $especifico = $producto->presentacionId($iterator['Presentacion_IdPresentacion']);
    foreach ($especifico as $name) {
        ?>
                                      <option value="<?php 
        echo $name['IdPresentacion'];
        ?>
"><?php 
        echo $name['Nombre'];
        ?>
</option>
                                  <?php 
    }
    ?>
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
include_once "../src/Facade/Facade.php";
include_once "../src/DTO/Intalacion_DAO.php";
include_once "../src/DTO/Residencial_DTO.php";
include_once "../src/DTO/Distribucion_DTO.php";
include_once "../src/DTO/Transformacion_DTO.php";
include_once "../src/DTO/Industrial_DTO.php";
include_once "../src/DTO/Especial_DTO.php";
include_once "../src/DTO/UsoFinal_DTO.php";
$fac = new Facade();
//Id del Proyecto
$proyecto_id = $_POST["proyectoid"];
//Fecha de registro
date_default_timezone_set('UTC');
$fecha = date("Y-m-d");
//tipo Cotizacion RETIE
$tipo_cotizacion = 0;
//instalacion tipo
$instalacion = htmlspecialchars($_POST["instalacion"]);
$instalacion = "0";
if (isset($_POST["instalacion_adc"])) {
    $instalacion_adc = htmlspecialchars($_POST["instalacion_adc"]);
}
//VARIABLES PARA USO FINAL
$calibre = "";
Example #19
0
 public function testFacade()
 {
     $facade = new Facade();
     $facade->methodOne();
     $facade->methodTwo();
 }
Example #20
0
 public function notifyObservers($notification)
 {
     return parent::notifyObservers($notification);
 }
    echo '$' . (int) $total;
    ?>
</h4>
                                    <hr>
                                <?php 
}
?>
                                <div class="box-body">

                                    <div class="form-group">
                                        <label for="cc">Seleccione el producto*</label>
                                        <select class="form-control select2" name="idproducto" id="idproducto" required>
                                            <option value="">Seleccionar producto</option>
                                            <?php 
include_once '../facades/FacadeProducto.php';
$facade = new Facade();
$listado = $facade->getProductos();
$existe = false;
foreach ($listado as $clientes) {
    foreach ($_SESSION['productoDatos'] as $comparar) {
        if ($comparar->getId() == $clientes['IdProducto']) {
            $existe = true;
        }
    }
    if ($existe == false) {
        ?>
                                                    <option class="pro" value="<?php 
        echo $clientes['IdProducto'];
        ?>
"><?php 
        echo $clientes['IdProducto'] . ' | ' . $clientes['NombreProducto'];
Example #22
0
                return $instance->{$method}();
            case 1:
                return $instance->{$method}($args[0]);
            case 2:
                return $instance->{$method}($args[0], $args[1]);
            case 3:
                return $instance->{$method}($args[0], $args[1], $args[2]);
            case 4:
                return $instance->{$method}($args[0], $args[1], $args[2], $args[3]);
            default:
                return call_user_func_array(array($instance, $method), $args);
        }
    }
}
// Set the container on our facade class
Facade::setContainer($container);
// And our static classes
//class Cache extends Facade { protected static $key = 'cache'; }
class DB extends Facade
{
    protected static $key = 'db';
}
class Lang extends Facade
{
    protected static $key = 'translator';
}
class Validator extends Facade
{
    protected static $key = 'validator';
}
//class Paginator extends Facade { protected static $key = 'paginator'; }
 /**
  * Test hasCommand method.
  */
 public function testHasCommand()
 {
     // register the ControllerTestCommand to handle 'hasCommandTest' notes
     $facade = Facade::getInstance();
     $facade->registerCommand('facadeHasCommandTest', new FacadeTestCommand());
     // test that hasCommand returns true for hasCommandTest notifications
     $this->assertTrue($facade->hasCommand('facadeHasCommandTest') == true, "Expecting facade->hasCommand('facadeHasCommandTest') == true");
     // Remove the Command from the Controller
     $facade->removeCommand('facadeHasCommandTest');
     // test that hasCommand returns false for hasCommandTest notifications
     $this->assertTrue($facade->hasCommand('facadeHasCommandTest') == false, "Expecting facade->hasCommand('facadeHasCommandTest') == false");
 }
Example #24
0
> ASESORIA</option>
                                            <option value="CAPACITACION" <?php 
if ($empresas['TipoGestiones'] == 'CAPACITACION') {
    echo 'selected';
}
?>
>CAPACITACIÓN</option>

                                        </select>

                                    </div>
                                    <div class="form-group" id="producto">
                                        <label for="cargo">Producto*</label>
                                        <select  class="form-control select2" name="temaproducto">
                                            <?php 
$producto = new Facade();
$productos = $producto->getProductos();
foreach ($productos as $iterator2) {
    ?>
                                                <option value="<?php 
    echo $iterator2['IdProducto'];
    ?>
" <?php 
    if (is_numeric($empresas['Asunto']) && $empresas['Asunto'] == $iterator2['IdProducto']) {
        echo ' selected';
    }
    ?>
><?php 
    echo $iterator2['NombreProducto'];
    ?>
</option>
    }
    ?>
"><?php 
    echo $iterator['Nombre'];
    ?>
</option>
                                               <?php 
}
?>
                                           </select>
                                       </div>
                                       <div class="form-group">
                                           <label for="categoriaProducto">Categoria producto*</label>
                                           <select class="form-control" name="categoriaProducto" id="cargo">
                                               <?php 
$producto = new Facade();
$Productos = $producto->obtenerCategoriaProducto();
foreach ($Productos as $iterator) {
    ?>
                                               <option value="<?php 
    echo $iterator['IdCategoria'];
    if ($iterator['IdCategoria'] == $p['IdCategoria']) {
        echo 'selected';
    }
    ?>
"><?php 
    echo $iterator['Nombre'];
    ?>
</option>
                                               <?php 
}
Example #26
0
include_once '../src/DTO/Cliente_DTO.php';
//informacion cliente
$cedula = $_POST["num_documento"];
$nombre = $_POST["nombre"];
$cargo = $_POST["profesion"];
$rsocial = $_POST["rsocial"];
$dir1 = $_POST["direccion"];
$dpto1 = $_POST["departamento"];
$mun1 = $_POST["municipio"];
$fijo = $_POST["telefono_fijo"];
$celular = $_POST["celular"];
$email = $_POST["email"];
//Creo objeto de la clase Cliente y guardo la información capturada
$cliente = new Cliente_DTO($cedula, $nombre, $dir1, $dpto1, $mun1, $fijo, $celular, $email, $cargo, $rsocial);
//echo $cliente->toString();
$fac = new Facade();
if ($fac->registrarCliente($cliente)) {
    $idCliente = $fac->consultarIdCliente($cedula);
    echo '<script>
                                            document.getElementById("cedula").value="' . $idCliente . '";
                                            document.getElementById("Continuar").disabled=false;
                                            document.getElementById("rgC").disabled=true;
                                            document.getElementById("form1").reset();                                            
                                        </script>
                                        <div class="alert alert-success alert-dismissable">                    
                    <h4><i class="icon fa fa-check"></i> BIEN!</h4>
                    Presione continuar
                  </div>';
} else {
    $idCliente = $fac->consultarIdCliente($cedula);
    echo '<script>
    $mensaje = $fachada->registrarProducto($producto);
    header("Location: ../views/productoListar.php?" . $mensaje);
}
if (isset($_POST['modificar'])) {
    $file = $_FILES['ImagenProducto'];
    $name = uniqid() . $file['name'];
    $path = "../images/" . basename($name);
    if (move_uploaded_file($file['tmp_name'], $path)) {
        echo "move succeed";
    } else {
        echo 'fail to upload image';
    }
    $idviejo = $_GET['idv'];
    $producto = new ProductosDto();
    //$producto->setIdProducto($_POST['codigoProducto']);
    $producto->setNombreProducto($_POST['nombreProducto']);
    $producto->setDescripcion($_POST['descriptionProducto']);
    $producto->setUnidadMedida($_POST['unidadProducto']);
    $producto->setIva($_POST['ivaProducto']);
    $producto->setValorUnitario($_POST['valorProducto']);
    $producto->setPresentacion($_POST['presentacionProducto']);
    $producto->setCategoria($_POST['categoriaProducto']);
    $producto->setImagenProducto('../images/' . $name);
    $mensaje = $fachada->actualizarProducto($producto, $idviejo);
    header("Location: ../views/productoListar.php?" . $mensaje);
}
if (isset($_GET['idproducto'])) {
    $fachada = new Facade();
    $fachada->cancelarProducto($_GET['idproducto']);
    echo 'borre';
}
Example #28
0
echo $_SESSION['datosLogin']['NombreRol'];
?>
</a>
                    </div>
                </div>

                <!-- Sidebar Menu -->
                <ul class="sidebar-menu">
                    <li class="header">Menu</li>
                    <!-- Optionally, you can add icons to the links -->
                    <li class="active"><a href="index.php"><i class="fa fa-desktop"></i> <span>Inicio</span></a></li>
                    <?php 
require '../facades/FacadeEmpleado.php';
require '../facades/FacadeProducto.php';
$facade = new FacadeEmpleado();
$facadeProducto = new Facade();
$titulos = $facade->obtenerMenu($_SESSION['rol']['rol']);
foreach ($titulos as $menu) {
    ?>
                        <li class="treeview">
                            <a href="#"><i class="<?php 
    echo $menu['Icono'];
    ?>
"></i> <span><?php 
    echo $menu['Nombre'];
    ?>
</span> <i class="fa fa-angle-left pull-right"></i></a>
                            <ul class="treeview-menu">
                                <?php 
    $subtitulos = $facade->obtenerSubMenu($menu['IdCategoria']);
    foreach ($subtitulos as $submenu) {
 public function __construct()
 {
     $this->facade = Facade::getInstance();
 }
 /**
  * Tests the hasCore and removeCore methods
  */
 public function testHasCoreAndRemoveCore()
 {
     // assert that the Facade.hasCore method returns false first
     $this->assertTrue(Facade::hasCore('FacadeTestKey11') == false, "Expecting Facade::hasCore('FacadeTestKey11') == false");
     // register a Core
     $facade = Facade::getInstance('FacadeTestKey11');
     // assert that the Facade.hasCore method returns true now that a Core is registered
     $this->assertTrue(Facade::hasCore('FacadeTestKey11') == true, "Expecting Facade::hasCore('FacadeTestKey11') == true");
     // remove the Core
     Facade::removeCore('FacadeTestKey11');
     // assert that the Facade.hasCore method returns false now that the core has been removed.
     $this->assertTrue(Facade::hasCore('FacadeTestKey11') == false, "Expecting Facade::hasCore('FacadeTestKey11') == false");
 }