예제 #1
0
 /**
  * This function is used to create the connection from the database
  * @return <Connection>
  */
 public static function createConnection()
 {
     $con = mysql_connect(Database::server, Database::username, Database::password);
     if (!$con) {
         NetDebug::trace('Could not connect');
         die('could not connect' . mysql_error());
     }
     mysql_select_db(Database::databasename, $con);
     return $con;
 }
예제 #2
0
function twistResultsFilter(&$amf)
{
    $GLOBALS['amfphp']['encoding'] = "amf3";
    $bodycount = $amf->numBody();
    for ($i = 0; $i < $bodycount; $i++) {
        $amfbody =& $amf->getBodyAt($i);
        $results = $amfbody->getResults();
        NetDebug::trace("result: " . serialize($results));
        $serializer = new AMFSerializer();
        $serializer->writeAmf3Data($results);
        $data = $serializer->outBuffer;
        $data = gzcompress($data);
        $outBa = new ByteArray($data);
        $amfbody->setResults($outBa);
        //$amfbody->setResults($data);
        //echo "<br>$results";
        return true;
    }
}
예제 #3
0
 /**
  * Get the list of services
  * @returns An array of array ready to be bound to a Tree
  */
 function getServices()
 {
     NetDebug::trace("In getServices");
     $this->_omit = array();
     $this->_path = dirname(dirname(realpath(__FILE__))) . '/';
     $services = $this->_listServices();
     //Now sort on key
     ksort($services);
     $out = array();
     foreach ($services as $key => $val) {
         if ($key == "zzz_default") {
             foreach ($val as $key2 => $val2) {
                 $out[] = array("label" => Inflector::camelize($val2[0]), "data" => $val2[1]);
             }
         } else {
             $children = array();
             foreach ($val as $key2 => $val2) {
                 $children[] = array("label" => $val2[0], "data" => $val2[1]);
             }
             $out[] = array("label" => $key, "children" => $children, "open" => true);
         }
     }
     return $out;
 }
예제 #4
0
 private function testDB()
 {
     $dbh = dbconnect();
     NetDebug::trace($dbh);
     $query = "INSERT INTO images(owner_id, quadrant) VALUES (12, 00)";
     $count = $dbh->exec($query);
     $insert_id = $dbh->lastInsertId();
     NetDebug::trace("insert_id: {$insert_id}");
     return true;
 }
예제 #5
0
파일: Admin.php 프로젝트: nimigeanu/hollow
 /**
  * Stupid dummy comment
  * 
  * @access private
  * @roles administrator
  */
 function getAverageStupidityFactor()
 {
     NetDebug::trace("inside stupid");
     return "huge";
 }