Esempio n. 1
0
<?php

echo "<h3>\\Rhonda\\Mysql</h3>";
// Mysql escape
$object = json_decode('{
  "connections": {
    "local": {
      "host": "192.168.99.100"
    , "database": "core_elguapo"
    , "port": "3306"
    , "user": "******"
    , "password": "******"
    }
  }
}');
\Rhonda\Config::load_object('DB', $object);
echo \Rhonda\Mysql::real_escape("that's all folks");
$object = new \stdClass();
$object->obj = "it's fo sho";
$object->obj2 = "escape's this one too";
$array = array("ray" => "it's escaping arrays", "ray2" => "escape's this one too");
echo "<pre>" . print_r(\Rhonda\Mysql::real_escape($object), true) . "</pre>";
echo "<pre>" . print_r(\Rhonda\Mysql::real_escape($array), true) . "</pre>";
echo "</br>Convert 'TRUE' to string: " . \Rhonda\Mysql::bool_to_string('TRUE');
echo "</br>Convert 'FALSE' to string: " . \Rhonda\Mysql::bool_to_string('FALSE');
echo "</br>Convert 'true' to string: " . \Rhonda\Mysql::bool_to_string('true');
echo "</br>Convert 'false' to string: " . \Rhonda\Mysql::bool_to_string('false');
echo "</br>Convert '0' to string: " . \Rhonda\Mysql::bool_to_string('0');
echo "</br>Convert '1' to string: " . \Rhonda\Mysql::bool_to_string('1');
echo "</br>Convert 'asdfghq' to string: " . \Rhonda\Mysql::bool_to_string('asdfhg');
echo "</br>Convert '' to string: " . \Rhonda\Mysql::bool_to_string('');
Esempio n. 2
0
<?php

echo "<h3>\\Rhonda\\Config</h3>";
// Load an object into memory for later retrieval
$object = new stdClass();
$object->thing_1 = 'something one';
$object->thing_2 = 'something two';
\Rhonda\Config::load_object('test_one', $object);
// Retrieve a configuration object from memory
echo "<pre>";
print_r(\Rhonda\Config::get('test_one'));
echo "</pre>";
$config = new \Rhonda\Config();
$config->load_object('test_two', $object);
echo "<pre>";
print_r($config->get('test_two'));
echo "</pre>";