public function save() { if ($_POST) { $data = new Other(1); if ($_POST["facebook"]) { $data->facebook = $_POST["facebook"]; } if ($_POST["twitter"]) { $data->twitter = $_POST["twitter"]; } if ($_POST["email"]) { $data->email = $_POST["email"]; } $data->save(); } redirect("admin/settings/social"); }
/** * Test CustomTypeHandler Oui/Non */ function testInsertInlineCustomTypeHandlerV2() { $this->initScript('other-init.sql'); $this->initScript('account-init.sql'); $other = new Other(); $other->setInt(99); $other->setLong(1966); $other->setBool(true); $other->setBool2(false); $this->sqlmap->Insert("InsertInlineCustomTypeHandlerV2", $other); $anOther = $this->sqlmap->QueryForObject("SelectByInt", 99); $this->assertNotNull($anOther); $this->assertIdentical(99, (int) $anOther->getInt()); $this->assertIdentical(1966, (int) $anOther->getLong()); $this->assertIdentical(true, (bool) $anOther->getBool()); $this->assertIdentical(false, (bool) $anOther->getBool2()); }
include "includes/color.class.php"; include "includes/other.class.php"; include "includes/email.class.php"; include "includes/backup.class.php"; include "includes/plesk.class.php"; include "includes/dns.class.php"; include "includes/config.inc.php"; // Do not log notices and warnings (imap_open logs notices and warnings on wrong login) error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); if (VERSION != 5) { echo "Version mismatch. You need to update your configuration file\n"; exit; } $backup = new Backup(BACKUP_PATH, IGNORE_DB_NAMES, IGNORE_DB_USERS, IGNORE_SITES, DEBUG); // backup_path is a constant from the config file containing untarred DA backup $other = new Other(MAIL_FROM_ADDR, MAIL_FROM_NAME, SEND_MAIL, DEBUG); $mail = new Email(BACKUP_PATH, DEBUG); // backup_path is all we need, rest is relative $plesk = new Plesk(); $dns = new DNS(NS_API_DOUPDATE, NS_API_UP, NS_API_DATA, NS_API_URL, unserialize(NS_OUR_CONTROL), IPv4, IPv6, DEBUG); $arguments = $other->parseArguments($argv); if (array_key_exists("reseller", $arguments)) { $reseller = $arguments['reseller']; if (!$plesk->isValidReseller($reseller)) { echo "Invalid reseller username given. Exiting...\n"; exit; } } else { $reseller = FALSE; } $sp = $plesk->getServicePlans($reseller);
<?php // function __autoload($class_name) // { // $file_name = "./" . $class_name . ".php"; // include_once ($file_name); // } function my_autoload($class_name) { $file_name = dirname(__FILE__) . '/' . $class_name . ".php"; if (file_exists($file_name)) { include_once $file_name; } } function my_autoload2($class_name) { $file_name = dirname(__FILE__) . "/other/" . strtolower($class_name) . ".php"; if (file_exists($file_name)) { include_once $file_name; } } spl_autoload_register('my_autoload'); spl_autoload_register('my_autoload2'); $obj = new Demo('gang'); $obj->sayName(); $obj2 = new Other('yue'); $obj2->sayName();