Jump to content

Firemankurt

Members
  • Posts

    56
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://iaff106.org
  • Yahoo
    firemankurt

Profile Information

  • Gender
    Male
  • Location
    Washington State

Firemankurt's Achievements

Member

Member (2/5)

1

Reputation

  1. Oops... Duh! I was starting to think I was loosing my mind. Well then again I guess I was. :-)
  2. My foreach loop is skipping an element? How is this possible? echo '<p>-- Begining of Vardump --</p> '; var_dump($EventTotals); echo ' <p>-- End of Vardump --</p> <p>-- Begining of Just echo --</p> <p>'.$EventTotals[1]['TITLE'].'</p> <p>'.$EventTotals[2]['TITLE'].'</p> <p>-- End of Just echo --</p> <p>-- Begining of Foreach --</p> '; foreach ($EventTotals as $DATA); { echo '<p>'.$DATA['TITLE']."</p>\n"; } echo '<p>-- End of Foreach --</p> '; Gives me this output: <p>-- Begining of Vardump --</p> array(2) { [2]=> array(3) { ["TITLE"]=> string(9) "Book Sale" ["TARGETHOURS"]=> string(4) "0.00" ["HOURS"]=> float(4) } [1]=> array(3) { ["TITLE"]=> string(15) "Spring Jogathon" ["TARGETHOURS"]=> string(5) "10.00" ["HOURS"]=> float(7) } } <p>-- End of Vardump --</p> <p>-- Begining of Just echo --</p> <p>Spring Jogathon</p> <p>Book Sale</p> <p>-- End of Just echo --</p> <p>-- Begining of Foreach --</p> <p>Spring Jogathon</p> <p>-- End of Foreach --</p> Why does the foreach skip one of the elements of the array? Bug or am I missing something obvious?
  3. I am transferring DB entries for some short articles from an old DB to my new Symfony project. The fields have <p>,<br />, etc... in them. When I try display the fields in twig template they are rendered as <p>, <br />, etc... Is there a setting in Symfony that I can change for this?
  4. I want to add an Error handler library to my framework but I would like to find one already made rather than rolling my own. I would like to be able to view errors when logged in as an admin but otherwise display only simple output to regular visitors. Any Recommendations?
  5. What is output if you add die in these two places? if($setting['seo'] == 'yes'){ $forumurl = $setting['siteurl'].'forum.html'; die("setting['seo'] = yes"); } else { $forumurl = $setting['siteurl'].'index.php?act=forum'; die("setting['seo'] = NOT yes"); } Just a guess that $setting['siteurl'] is your problem but you do not show how you form that array.
  6. I am moving my framework to use Pimple Is there any advantage to storing things like SITEPATH or SITE_DOMAIN in Pimple vs in a defined constant? When is one a better choice than the other or is it just personal preference and expected use?
  7. Good enough for me. I will use pimple as there seems to be more tutorials and documentation available and it seems simpler.
  8. Getting ready to implement Pimple Dependency Injection on a large project. I have read several tutorials for Pimple Dependency Injection. One comment in a tutorial I was reading for Pimple mentioned a project called Auryn Injector ( https://github.com/rdlowrey/Auryn ). The comment claimed that Auryn Injector was a TRUE dependency injection container. Anyone use Auryn or have a comment on it's use over Pimple.
  9. Thank you both for your patients and responses. Being a lone developer of a large project has serious limitations and being a member here sure helps. I think DI containers are the next concept for me to grasp and use to solve my problem here. It is tough finding time to learn all these concepts and harder to learn what has changed between PHP versions. I have tried to set some time aside from actual coding to educate myself but there is always something new to cram into my little CPU and memory. This is what I love about coding.... Always something new to learn.
  10. Here is a little test of the structure that represents a simplistic model of what I am concerned about: <?php class LCMScore { public $Access = null; public function __construct(){} public function CreateAccess($var1,$var2) { $this->Access = new myAccess($this , $var1, $var2); } public function addit($var1,$var2) { return $var1+$var2; } } class myAccess { private $var1 = null; private $var2 = null; private $LCMS = null; public function __construct(&$LCMS, $var1,$var2) { $this->LCMS = $LCMS; $this->var1 = $var1; $this->var2 = $var2; } public function doAdd() { return $this->LCMS->addit($this->var1,$this->var2); } } $a = new LCMScore(); $a->CreateAccess(4,5); echo $a->Access->doAdd().'<br />'; sleep ( 10); echo memory_get_peak_usage (true); ?> I set the sleep ( 10) to sleep ( 1) and I always get a result of 262144 from memory_get_peak_usage (true). Does this mean I am in the clear?
  11. Not much experience in this area but I have used "imagemagick" with PHP and I did find a possible lead for you: Searching Google for "php imagemagick ocr" Found: http://stackoverflow.com/questions/11978986/ocr-getting-text-from-image-using-tesseract-3-0-and-imagemagick-6-6-5
  12. My Project is called Ladder CMS. "Core" is actually called "ladderCore" but I did not think that was really significant to my issue here so I renamed it for this post. "ladderCore" and many of it's properties needs to be globally accessable. My issue boils down to the fact that "ladderCore" handles orchestration of DB connection, queries, Log-in, Error collection, module loading, Output variables into template, module access, etc. "access" is another class that is used in just about every module and "ladderCore" to decide weather users have acces to that module and it's resources. So it flows kinda like this: index.php loads:Ini.php (finds install location, sets some constants, parses config for Ladder CMS installation) it loads:LadderCore.php ( main class created as $LCMS by Ini.php) class.access.php ( access checker class dependant on $LCMS->DBquery() and $LCMS->_ERROR ) class.DBSession.php ( Database driven Session handler dependant on $LCMS->DBquery() and $LCMS->_ERROR ) protect.php ( Handles login forms, cookies, sessions )protect.php creates access checker class as $LCMSAccess and injects values based on log in. index.php then uses $LCMSAccess, $LCMS->FilterMods() , $LCMS->_MODTOINCLUDE, $LCMS->_TEMPLATE and other ladderCore or module methods to create content. I know it is not perfect. I have been consolidating 8-10 projects into this framework over the past 8 years and I am still refining things. One of the problems I am trying to solve is the global keyword used to grant access to the methods of $LCMSAccess in just about every file and many classes. I would like to put it into a class property like $LCMS->Access since $LCMS class is available just about everywhere. Since $LCMS->Access contains the 'access' class and 'access' class contains $LCMS, am I creating a memory leak here or other catastrophic situation? Have I been staring at this so long that I am loosing my mind or will this work just fine?
  13. replace: <input type="checkbox" name="homepage" value="1" <?php echo ($homepage == 1) ? 'checked="checked"' : ''; ?>/> With: <input type="checkbox" name="homepage" value="1" <?php echo ($row1['homepage'] == 1) ? 'checked="checked"' : ''; ?>/>
  14. Your database value is not in the variable. How are you getting the value from Database? How are you storing the value in Database?
  15. Try change condition just for test by adding NOT: if ( ! $_SERVER['PATH_INFO'] == "/playlist.m3u") OR Add: echo $playlist; under : srand(make_seed()); and see what it outputs.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.