You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

42 lines
973 B

<?php
function print_s($var){
echo "<pre>".print_r($var)."</pre>";
}
//** Compilacion de css a less **//
function autoCompileLess($inputFile, $outputFile) {
// load the cache
$cacheFile = $inputFile.".cache";
if (file_exists($cacheFile)) {
$cache = unserialize(file_get_contents($cacheFile));
} else {
$cache = $inputFile;
}
$less = new lessc;
$less->setFormatter("compressed");
$newCache = $less->cachedCompile($cache);
if (!is_array($cache) || $newCache["updated"] > $cache["updated"]) {
file_put_contents($cacheFile, serialize($newCache));
file_put_contents($outputFile, $newCache['compiled']);
}
}
//** Validacion del cliente AngularJS **/
function validatedKey($user) {
try {
$veri = User::where('id', '=', $user['id'])->first();
$encriptedKey = hash('sha512', $veri->id.$veri->email.$veri->created_at);
if($user['key'] == $encriptedKey) {
return true;
} else {
return false;
}
} catch (Exception $e) {
return false;
}
}