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 | |
$rootPath = realpath(dirname(__FILE__) . '/../') . '/'; | |
function takeMutex($name) { | |
global $rootPath; | |
$filename = $rootPath . 'tmp/cron_' . $name . '.lock'; | |
if (($handle = @fopen($filename, 'x')) === false) { | |
die('Une autre instance de cette tâche est en cours d\'exécution, ou impossible de créer le fichier "' . $filename . '", vérifiez les droits d\'écriture !'); | |
} |
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 | |
// @see http://fr2.php.net/manual/en/function.mb-convert-encoding.php#103300 | |
function memory_usage() { | |
$mem_usage = memory_get_usage(true); | |
if ($mem_usage < 1024) { | |
$mem_usage .= ' bytes'; | |
} elseif ($mem_usage < 1048576) { | |
$mem_usage = round($mem_usage/1024,2) . ' kilobytes'; | |
} else { | |
$mem_usage = round($mem_usage/1048576,2) . ' megabytes'; |
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
Gmap Locations Configuration | Configuration de Gmap Locations | |
---|---|---|
Google Map API key | Clé d'API Google Map | |
You can get it here http://code.google.com/apis/maps/signup.html. eg.ABQIAAAA8Y84y7AfnkshoyWtI5fyShQikMkOUW3vCdojO3o0Jxipwb7AThTTtKgn8GKXuPGojAtR759m5cLSww | Vous pouvez en obtenir une ici http://code.google.com/apis/maps/signup.html. ex:ABQIAAAA8Y84y7AfnkshoyWtI5fyShQikMkOUW3vCdojO3o0Jxipwb7AThTTtKgn8GKXuPGojAtR759m5cLSww | |
Search Configuration | Configuration de la Recherche | |
Show Search block | Afficher le bloc de Recherche | |
Show Search Radius Circle | Afficher le Cercle du Rayon de Recherche | |
in search mode shows colored circle for searched radius on map | lors du mode de recherche afficher un cercle de couleur pour le rayon recherché sur la carte | |
Search Circle Radius Color | Couleur du Cercle du Rayon de Recherche | |
Front End Title | Titre Front End | |
You can leave it blank if not need | Laissez vide si vous n'en n'avez pas besoin |
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
## | |
# CakePHP deployment recipe | |
# TODO Implement a way to revert migrations given the map.php files of a previous release | |
# TODO Make a difference between tmp files and others | |
# TODO Give a way to the application to define its own custom directories | |
## | |
_cset (:app_symlinks) { [ | |
"/webroot/cache_css", "/webroot/cache_js", | |
"/tmp" | |
] } |
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
/** | |
* Class allowing to call a method only after a specific delay if no other call was made | |
* It is useful to prevent triggering the same callback multiple times quickly. For instance | |
* ajax calls on keyup. It introduces a delay before triggering the callback | |
* | |
* Usage: | |
* var refreshResults = new DelayedCall(1000, function() { alert('Mouse not moved for 1 second'); }) | |
* $('body').mousemove(function() { refreshResults.trigger(); }) | |
* | |
* @param delay Inactivity delay in millisecond before triggering the callback |
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 | |
App::import('Core', 'Controller'); | |
App::import('Component', 'Email'); | |
/** | |
* Task permitting to use the Email component from a shell | |
* @see http://bakery.cakephp.org/articles/view/emailcomponent-in-a-cake-shell | |
*/ | |
class EmailTask extends Shell { | |
/** | |
* Controller class |
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
## | |
# CakePHP2.x deployment recipe | |
# TODO Implement a way to revert migrations given the map.php files of a previous release | |
# TODO Make a difference between tmp files and others | |
# TODO Give a way to the application to define its own custom directories | |
## | |
_cset (:app_symlinks) { [ | |
"/webroot/cache_css", "/webroot/cache_js", | |
"/tmp" | |
] } |
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
## | |
# HTTP Authentification deployment Recipe | |
# => Add htaccess password protection when deploying, with the correct htpassword file for the passed users | |
## | |
_cset (:http_auth_users) {[ | |
["admin", "password"] | |
]} | |
_cset (:http_auth_path) { "" } # Path of the directory to add http auth, from the release root | |
namespace :httpAuth do |
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 | |
/** | |
* Action Helper | |
* Allows to generate simple CRUD links for a given object and customize its rendering | |
* It only works for default baked urls | |
* | |
* Usage: | |
* <code> | |
* $this->Actions->setActionsOptions($order['Order']['id'], true); | |
* echo $this->Actions->view(); |
OlderNewer