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
<rewrite> | |
<rules> | |
<rule name="Rewriter" stopProcessing="true"> | |
<match url="^(.*)$" ignoreCase="false" /> | |
<conditions> | |
<add input="{R:1}" pattern="^(app\\.php|favicon\\.ico)" ignoreCase="false" negate="true" /> | |
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> | |
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> | |
</conditions> | |
<action type="Rewrite" url="./app.php/{R:1}" appendQueryString="true" /> |
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 | |
function unzip($path_zip, $tmp_folder = "/tmp/") { | |
$all_files = array(); | |
$zip = zip_open($path_zip); | |
if ($zip) { | |
$stream = zip_read($zip); | |
while ($stream) { | |
var_dump($zip_name); | |
$zip_name = zip_entry_name($stream); |
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 | |
function execute ($sql_query, $id = null, $delay = 3600) { | |
//On déclare une instance de cache | |
$cacheDriver = new \Doctrine\Common\Cache\XcacheCache(); | |
$results = null; | |
//Si un ID a été saisie et que le système de cache contient des données pour un ID "x" | |
if ($id != null && $cacheDriver->contains($id)) { | |
//Alors on prend les données en cache pour un ID "x" | |
$results = $cacheDriver->fetch($id); |
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
services: | |
namespace.x.yManager: | |
class: Namespace\NameBundle\Manager\NameManager | |
arguments: [@service_container] |
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
services: | |
namespace.x.yManager: | |
class: Namespace\NameBundle\Manager\NameManager | |
arguments: [@doctrine.orm.entity_manager] |
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
# config.yml | |
framework: | |
# … | |
session: | |
# La session sera déportée dans app/var/sessions/ | |
# N'oubliez pas de créer les deux dossiers, sinon Symfony2 n'arrivera pas à écrire dans votre répertoire | |
save_path: %kernel.root_dir%/var/sessions | |
# … |
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 | |
mb_convert_encoding($string, "UTF-8", mb_detect_encoding($string)); | |
?> |
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 | |
gc_disable(); | |
$content = file_get_contents("db.csv"); | |
if ($content === false) { | |
echo "ERROR: impossible to read the file."; | |
die(); | |
} |
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 | |
use JMS\SecurityExtraBundle\Annotation\Secure; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Symfony\Component\HttpFoundation\Request; |
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 Namespace\MyBundle\Security\User; | |
use Doctrine\ORM\EntityManager; | |
use Doctrine\Common\Collections\Criteria; | |
use Doctrine\Common\Collections\Expr\Comparison; | |
use Symfony\Component\Security\Core\Exception\DisabledException; | |
use Symfony\Component\Security\Core\Exception\LockedException; |
OlderNewer