This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Umpirsky\Doctrine\Common\Persistance; | |
use Doctrine\Common\Persistence\AbstractManagerRegistry; | |
use Silex\Application; | |
/** | |
* References Doctrine connections and entity/document managers. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\Doctrine; | |
use Doctrine\ORM\EntityManagerInterface; | |
use Doctrine\ORM\Repository\DefaultRepositoryFactory; | |
use Doctrine\ORM\Repository\RepositoryFactory; | |
class MyCustomRepositoryFactory implements RepositoryFactory | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$message = <<<EOF | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Untitled Document</title> | |
</head> | |
<body> | |
<center> | |
<div><img src="http://www.site.com/imagen.jpg" width="200" height="100" /></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//archivo que se ejecuta al realizar el login (el mismo le da el estatus de logeo al user) | |
$_SESSION['logged_in'] = true; // en teoria indica que esta logueado | |
$_SESSION['last_activity'] = time(); //ultima actividad | |
$_SESSION['expire_time'] = 3*60*60; //espira en 3 minutos lo cambias al tiempo que quieras | |
$_SESSION['ip'] = $_SERVER['REMOTE_ADRESS']; | |
?> | |
<?php | |
//archivo que verifica la session |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int array[2][3] = {{1,2,3}, {1,2,3}}; | |
int array2[2][3] = {{1,2,3}, {1,2,3}}; | |
int arrayResultado[2][3]; | |
for (int i = 0; i < 2; i++) { | |
for (int j = 0; j < 3; j++) { | |
resultado[i][j] = array[i][j] + array2[i][j]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface Driver | |
{ | |
// lo comun que tienen los driver | |
public function crearBd(); | |
} | |
class Mysql implements Driver | |
{ | |
//implementas tus métodos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function filtrarPrograma($dia, $hora, $programa = false) | |
{ | |
$configuracion = Configuracion::model() | |
->find('dia = :dia AND hora = :hora', array(':dia' => $dia, ':hora' => $hora)); | |
if (!$configuracion) { | |
throw new Exception('no existe configuracion'); | |
} | |
if (!$programa) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//... la declaración del grid | |
array( | |
'name'=>'image', | |
'value'=> CHtml::image(Yii::app()->request->baseUrl.'/images/image.jpg'), | |
'type'=>'raw', | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf8" /> | |
<title>Title Page</title> | |
<style type="text/css"> | |
.block { | |
display: block; | |
} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf8" /> | |
<title>Title Page</title> | |
<style type="text/css"> | |
.block { | |
display: block; | |
} | |
</style> |