Re: EAV attribtutes
Posted: Tue Sep 23, 2008 3:07 pm
Ahhhhh ... you mean it spelled driver but it's pronounced 'Throatwobbler Mangrove' ... and yes, it's spelled adapter but it's pronounced 'Luxury Yacht' ... 
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
I don't use the methods you've described, and not only is there no performance hit, when used in a simple hash table stored in memory, blows RDBMS away. I simply use MySQL for convenience, and even then it's faster than traditional table structure.arborint wrote: Or you could use it like powerofq has where it becomes the entire system. He seems to like standardizing/simplifying the development side and does not mind the performance hit in his applications.
Well ... we now know you use a cache to get around the performance issues. Not that I could understand it...powerofq wrote:I don't use the methods you've described, and not only is there no performance hit, when used in a simple hash table stored in memory, blows RDBMS away. I simply use MySQL for convenience, and even then it's faster than traditional table structure.
Code: Select all
public function createTable($tableName, array $fields = array(), array $options = array())
public function dropTable($tableName)
public function renameTable($oldTableName, $newTableName)
public function createConstraint($tableName, $constraintName, array $definition)
public function dropConstraint($tableName, $constraintName, $primary = false)
public function createForeignKey($tableName, array $definition)
public function dropForeignKey($tableName, $fkName)
public function addColumn($tableName, $columnName, $type, array $options = array())
public function renameColumn($tableName, $oldColumnName, $newColumnName)
public function changeColumn($tableName, $columnName, $type, array $options = array())
public function removeColumn($tableName, $columnName)
public function addIndex($tableName, $indexName, array $options = array())
public function removeIndex($tableName, $indexName)
They also not only abstracted the modified pre-order tree, but materialized paths:Sometimes you may need to alter the data in the database with your models. Since you may create a table
or make a change, you have to do the data altering after the up() or down() method is processed. We have
hooks in place for this named preUp(), postUp(), preDown(), and postDown(). Define these methods and
they will be triggered after the migration version is executed.
Yes, Doctrine is awesome.jshpro2 wrote:I think Doctrine_Migration does everything I had in mind
and the icing on the cake
From my reading of those docs they only do nested set.jshpro2 wrote:They also not only abstracted the modified pre-order tree, but materialized paths:
http://www.doctrine-project.org/documen ... hical-data
I don't use a cache to get around performance at all. I thought my post was pretty clear.. my framework used with standard SQL has better performance than traditional table structure, and better again when using the data in a hash table.arborint wrote:Well ... we now know you use a cache to get around the performance issues. Not that I could understand it...powerofq wrote:I don't use the methods you've described, and not only is there no performance hit, when used in a simple hash table stored in memory, blows RDBMS away. I simply use MySQL for convenience, and even then it's faster than traditional table structure.
Yeah, you have been pretty clear. And I think I have also been pretty clear that I don't believe your boasts.powerofq wrote:I don't use a cache to get around performance at all. I thought my post was pretty clear.. my framework used with standard SQL has better performance than traditional table structure, and better again when using the data in a hash table.
just went to your sitepowerofq wrote:Have I walked into a local PHP conference with exactly two other participants? I'm clearly in the wrong forum.
Code: Select all
<?
include "db.php";
function e($order){
$order = strtolower($order);
$order = str_replace(' ', '', $order);
$getI= mysql_query("select value from atoms where subject ='$order' and predicate= 'order'");
$getIr = mysql_fetch_row($getI);
Eval ($getIr[0]);
}
$subject = $_GET['k'];
$loginemail= $_COOKIE['lastuser'];
e('singlevalue');
e('vofsandp');
e('atomexists');
e('getsite');
$thehost = $_SERVER['HTTP_HOST'];
//$thehost = explode(".", $thehost);
//if((count($thehost)) > 2){$thehost = $thehost[1];} else { $thehost = $thehost[0]; }
//--------THE GRID ------------------
$firstdash = strpos($_REQUEST['k'], '-');
//if ($firstdash != false)
//{
$siteurl = str_replace('www.','',$thehost);
$siteurlsplit = split('\.',$siteurl);
$sitename = str_replace('-','', $siteurlsplit[0]);
$firstarg = substr($_REQUEST['k'], 0, $firstdash);
$defaultpage = $sitename.'-'.$_REQUEST['k'];
if (atomexists($defaultpage,'isa','page'))
{
$newsubject = $defaultpage;
} else if (atomexists($_REQUEST['k'], 'isa','page'))
{
$pagesite = getsite($_REQUEST['k']);
$thissite = getsite();
// make sure it belongs to the domain here when possible
if ($pagesite == $thissite || (!$pagesite) || (!$thissite))
{
$newsubject = $_REQUEST['k'];
} else {
die ('invalid page');
}
}
//die();
/*
echo getsite($newsubject);
if (atomexists($sitename,'isa','site'))
{
if (getsite($newsubject) != $sitename)
{
die("not on this site");
}
}
*/
$subject = $newsubject;
//}
//-----------------------SEO----------------------------------
$seosubject = $subject;
/*
if($thehost != "kommonwealth"){
//$hostsub = $thehost."*";
//$subject = str_replace($hostsub, '', $subject);
//$subject = $thehost."*".$subject;
$seosubject = $thehost."*".$subject;
}
*/
$seopagetitle ="$subject";
$seopagedesc = "";
$seopagekeywords ="kommonwealth redwerks social networking";
$allwidgets = vofsandp($seosubject, 'haswidget');
$noscriptcontent = '';
$rssno = 1;
$rssheader = '';
foreach($allwidgets as $widget)
{
//SEE IF WIDGET IS RSS -- add to header
$widgetorder = singlevalue($widget, 'widgetorder');
if($widgetorder == 'aggregator'){
$rssfeedurl = singlevalue($widget, 'feedurl');
$rssheader.= '<link rel="alternate" type="application/rss+xml" title="'.$subject.' '.$rssno.'" href="'.$feedurl.'"/>';
}
$content = singlevalue($widget, 'content');
$content = strip_tags($content);
$noscriptcontent.=$content."<br>";
}
$allarchivepages = vofsandp($seosubject, 'haspagearchive');
$pagearchivelinks = '';
foreach($allarchivepages as $archive){
$archivename = singlevalue($archive, 'name');
$pagearchivelinks.='<a href="'.$archive.'">'.$archivename.'</a><br>';
}
$seopagetitle = singlevalue($seosubject, 'seopagetitle');
$seopagedesc = singlevalue($seosubject, 'seopagedesc');
$seopagekeywords = singlevalue($seosubject, 'seopagekeywords');
$seokeywords = '<meta name="keywords" content="'.$seopagekeywords.'">';
$seodesc = '<meta name="description" content="'.$seopagedesc.'">';
/*
$journalentries = vofsandp($seosubject, 'journalentry');
$journals = '<h3>Journal</h3><br>';
foreach($journalentries as $journalentry){
$journaltitle = singlevalue($journalentry, 'journalmsgtitle');
$journalcontent = singlevalue($journalentry, 'content');
$journals.=$journaltitle."<br>".$journalcontent;
}
*/
//-----------------------GOOGLE ANALYTICS
//$googleanalytics = singlevalue($subject, 'googleanalytics');
$googleanalytics = '';
$cachedate = gmdate("D, d M Y H:i:s", time() + 172800) . " GMT";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<META HTTP-EQUIV="expires" CONTENT="<? echo "$cachedate" ?>">
<META http-equiv="X-UA-Compatible" content="IE=7" />
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><? echo"$seopagetitle"; ?></title>
<? echo"$seodesc"; ?>
<? echo"$seokeywords"; ?>
<noscript>
<? echo "$pagearchivelinks"; ?>
<? echo "$noscriptcontent"; ?>
<? echo "$rssheader"; ?>
</noscript>
<? echo "$rssheader"; ?>
<style>
a{text-decoration: none;}
img{border-style: none;}
</style>
<script src="js/mootools.v1.00.js" type="text/javascript"></script>
<script src="js/redwerks.js" type="text/javascript"></script>
<script src="js/picker.js" type="text/javascript"></script>
<script type="text/javascript">
var timeouts= new Array();
function clearalltimeouts()
{
for (key in timeouts)
{
var hasit = key.indexOf('droptimeout');
if(hasit > -1)
{
clearTimeout(timeouts[key]);
}
}
}
</script>
<script>
function fadeout(el)
{
var fadez = new Fx.Style(el, 'opacity', {}).start(1,0);
}
function fadeoutin(el,html)
{
var fadez = new Fx.Style(el, 'opacity', {duration:2000,wait:false}).start(1,0);
}
</script>
<script>
var panel5;
</script>
<script>
function iframepanel(panelid, panelwidth)
{
$('iframepanelid').value = panelid;
$('iframepanelwidth').value = panelwidth;
command('iframepanelform');
}
</script>
<!-- EXPERIMENTAL -->
<script type="text/javascript">
var isCtrl = false;
document.onkeyup=function(e){
if(e.which == 17) isCtrl=false; }
document.onkeydown=function(e){
if(e.which == 17) isCtrl=true;
if(e.which == 81 && isCtrl == true) {
command('qform');
}
}
</script>
<style>
.tool-tip{
background-color:#FFF;
z-index:12000;
margin: 10px;
border: 1px solid #ccc;
}
.tool-text{
padding: 4px 8px 8px;
z-index:12000;
}
.tool-title{
color:#FFF;
}
</style>
<link rel="shortcut icon" href="favicon.ico" >
<!--
<script src="js/posteditor.js" type="text/javascript"></script>
<script src="js/language.FORUM.js" type="text/javascript"></script>
-->
<link rel="stylesheet" type="text/css" href="css/main.css" />
<script type="text/javascript">
/*<![CDATA[*/
function IEHoverPseudo() {
var navItems = document.getElementById("primary-nav").getElementsByTagName("li");
for (var i=0; i<navItems.length; i++) {
if(navItems[i].className == "menuparent") {
navItems[i].onmouseover=function() { this.className += " over"; }
navItems[i].onmouseout=function() { this.className = "menuparent"; }
}
if(navItems[i].className == "menuparent2") {
navItems[i].onmouseover=function() { this.className += " over"; }
navItems[i].onmouseout=function() { this.className = "menuparent2"; }
}
}
}
/*]]>*/
</script>
</head>
<body onload="command('loader');">
<div id="navbar" style='z-index:999;'>
<span id="buttonset"></span>
<span id='navbar2' style=''></span>
</div>
<form id="qform" action="commander.php">
<input type="hidden" name="order" value="q" />
</form>
<form id="pauseform" action="commander.php">
<input type="hidden" name="order" value="pause" />
<input type="hidden" name="pausetime" id="pausetime" />
</form>
<form id="jframechangeform" action="commander.php">
<input type="hidden" name="order" value="jframechange" />
<input type="hidden" name="jframe2change" id="jframe2change" />
<input type="hidden" name="page2change2" id="page2change2" />
</form>
<form id='loader' name='loader' action='commander.php'>
<input type='hidden' name='order' value="<?=$subject;?>" />
<input type='hidden' name='ordertype' value='page' />
<input type='hidden' name='security1' id='security1' />
</form>
<form id='iframepanelform' name='iframepanelform' action='commander.php'>
<input type='hidden' name='order' value='iframepanel' />
<input type='hidden' name='iframepanelid' id='iframepanelid' />
<input type='hidden' name='iframepanelwidth' id='iframepanelwidth' />
</form>
<form id='updateposform' name='updateposform' action='commander.php'>
<input type='hidden' name='order' value='updatepos' />
<input type='hidden' name='theDiv' id='theDiv' value='' />
<input type='hidden' name='widgetwidth' id='widgetwidth' value='' />
<input type='hidden' name='widgetheight' id='widgetheight' value='' />
<input type='hidden' name='xposval' id='xposval' value='' />
<input type='hidden' name='yposval' id='yposval' value='' />
</form>
<form id='editproform' name='editproform' action='commander.php'>
<input type='hidden' name='order' value='editpro' />
<input type='hidden' id='editprosubnpred' name='editprosubnpred' value='' />
<input type='hidden' id='editprovalue' name='editprovalue' value='' />
</form>
<form id='editcform' name='editproform' action='commander.php'>
<input type='hidden' name='order' value='editc' />
<input type='hidden' id='editcsub' name='editcsub' value='' />
<input type='hidden' id='editcvalue' name='editcvalue' value='' />
</form>
<form id="check4messgesform" action="commander.php">
<input type="hidden" name="order" value="check4messages" />
</form>
<form id="forgotpasswordform" action="commander.php">
<input type="hidden" name="order" value="sendforgotpassword" />
</form>
<form id="controlpanelform" action="commander.php">
<input type="hidden" name="order" value="controlpanel" />
<input type="hidden" id="controlpanelwid" name="widgetid" />
</form>
<form id="pollingmanagerform" action="commander.php">
<input type="hidden" name="order" value="pollingmanager">
</form>
<div style="position:absolute;top:56px;z-index:999;left:0px;cursor:pointer;">
<div id="panel1" style="
width:190px;
height:180px;
border: 1px solid #ccc;
background:url(img/200grad.png) repeat-x;
color:#333;
left:0px;
padding:5px;"/>
<center>
<form id='loginform' action='commander.php'><b>Please sign in:</b><br />
Email<br>
<input type="text" name="id" value="<?=$loginemail?>" /><br />
Password<br> <input type='password' name='password' />
<input type='hidden' name='order' value='login' /><span id="loginresponse"></span><br />
<input name='sendbutton' type='button' value='submit' onClick="command('loginform');">
</form> <br>
<br> <a href="#" onclick="command('forgotpasswordform');return false;">Forgot your password?</a><br>
or <a href='join'>Join</a>
</center>
</div>
</div>
<div style="position:absolute;top:0px;z-index:10000;left:0px;cursor:pointer;">
<div id="panel2" style="
width:150px;
height:100%;
background-color: #FFF;
background-repeat: no-repeat;
color:#777;
left:10px;
padding:10px;
font-size: 14px;
"/>
</div>
</div>
<div style="position:absolute;top:57px;z-index:999;left:0px;">
<div id="panel3" style="
width:1000px;
height:1000px;
background-color:white;
color:#000;
left:0px;
border-right: 2px #ccc solid;
border-bottom: 2px #ccc solid;
"/>
<div style="position:relative;top:0px;height:103px;width:100%;background:url(img/subpan3slice.png) repeat-x;">
<div style="float:right;position:relative;top:0px;margin-right:2px;">
<img src="img/controlpanelclose.png" style="cursor:pointer;z-index:999;" onclick="panel3.slideOut();" />
</div>
</div>
<div id="panel3content"></div>
</div>
</div>
<script type="text/javascript">
window.onload = function() {
command('loader');
mySlider2 = new Fx.Slide('panel1', {
duration: 500,
mode:'horizontal'
});
mySlider2.hide();
panel3 = new Fx.Slide('panel3', {
duration: 750,
mode:'horizontal',
transition: Fx.Transitions.quartInOut
});
panel3.hide();
response = new Fx.Slide('panel2', {
duration: 500,
mode:'horizontal'
});
response.hide();
}
</script>
<?=$googleanalytics?>
<div id="temp"></div>
</body>
</html>
So you stumbled upon my development server while I was reconfiguring PHP to work with a new web server we've developed (running now), and managed to expose some old code that's getting sourced anyway. And then feel to post it here? You must be some kind of l33t hax0r huh? The code you're looking has little to do with anything. Line 295 might clue you in a bit.jshpro2 wrote:
Ah line 10, the patented secret to the framework.. now its out in the open
That code also does not follow MVC or any other design pattern that I can recognize, theres no separation of application logic and design
That's an excellent idea.jshpro2 wrote: like I said in another thread though I'm busy learning TDD