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 | |
class checkRule | |
{ | |
/** | |
* check if $datetime is between the start date and end date of a rule | |
* | |
* $rule has this format : | |
* array( | |
* 'date_start' => 'YYYY-MM-DD HH:MM:SS', | |
* 'date_end' => 'YYYY-MM-DD HH:MM:SS', |
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 | |
$obfuscated = "eval(gzinflate(base64_decode(strrev('AYwtRlkyv8MKXlcyNj09QdFyO30S'))));"; | |
$decoder = new unobfuscate($obfuscated); | |
echo $decoder->decode(); // echo 'Hello world'; | |
class unobfuscate | |
{ |
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 | |
/** | |
* do the same than parse_str without max_input_vars limitation | |
* @param $string array string to parse | |
* @return array query parsed | |
**/ | |
function my_parse_str($string) { | |
$result = array(); | |
// find the pairs "name=value" |
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 | |
/** | |
* return true if the module $name is activated in apache | |
* | |
* @param string $name module name | |
* @return boolean | |
* @author Samdha | |
**/ | |
function detect_apache_mod($name) { |
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 | |
class ObjectModel extends ObjectModelCore | |
{ | |
public function add($autodate = true, $nullValues = false) | |
{ | |
$result = parent::add($autodate, $nullValues); | |
if ($result) Module::hookExec('objectAdd', array('object' => $this)); | |
return $result; | |
} |
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 | |
class Samdha_IDoSomething() | |
{ | |
private $messager; | |
function __construct() | |
{ | |
// crée le gestionnaire de message | |
$this->messager = new Prestashop_Messager(); | |
} |
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 | |
class ExampleModule extends Module { | |
public function install() | |
{ | |
$done = ( | |
parent::install() | |
&& $this->registerHook('displayFooter') | |
&& $this->registerHook('displayRandom') | |
); | |
return $done; |
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 test() | |
{ | |
for ($i = 0; $i < 17; $i++) | |
if ($myArray[$i] == $value) | |
{ | |
$result[] = $myArray[$i]; | |
for ($i = 0; $i < 17; $i++) | |
if ($myArray[$i] == $value) | |
$failed++; |
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 test() | |
{ | |
for ($i = 0; $i < 17; $i++) { | |
if ($myArray[$i] == $value) { | |
$result[] = $myArray[$i]; | |
for ($i = 0; $i < 17; $i++) { | |
if ($myArray[$i] == $value) { | |
$failed++; | |
} else { |
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 | |
class Product extends ProductCore{ | |
public static function getProductProperties($id_lang, $row, Context $context = null) | |
{ | |
$row = parent::getProductProperties($id_lang, $row, $context); | |
if (is_array($row) && isset($row['id_product'])) { | |
$usetax = Tax::excludeTaxeOption(); | |
$cache_key = $row['id_product'].'-'.$row['id_product_attribute'].'-'.$id_lang.'-'.(int)$usetax; |
OlderNewer