SitePoint Sponsor

User Tag List

Page 5 of 7 FirstFirst 1234567 LastLast
Results 101 to 125 of 175
  1. #101
    Coding and Breathing CoderMaya's Avatar
    Join Date
    Feb 2008
    Location
    Atlit, Israel
    Posts
    470
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll see if it works with Postgre. BTW MySQL is so much faster anyway. For most uses it's just better.
    Learn about the new Retro Framework
    Code PHP the way it was meant to be coded!

  2. #102
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    PostgreSQL would be very nice, because MySQL is really piece of ****. Only a few notes for dates, could I afford them? - Supported range for DATETIME from 1000-01-01. Ugh. Forget the Rome empire and the ancient world. Shocking check for date values (2008-02-32 goes through as zero value.) No timestamp with time zone. Ugh. No fraction of seconds. Forget sport.
    The types are just the most likely to be needed.

    For rarer things like pre-1970 and split-second, you use integer types and perform calculations.

    Its not hard - and MySQL runs alot faster because of how it handles things.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #103
    Coding and Breathing CoderMaya's Avatar
    Join Date
    Feb 2008
    Location
    Atlit, Israel
    Posts
    470
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Retro Dev Build 7.4 uploaded - Includes a sample Blog Application
    http://code.google.com/p/retrophpmvc/downloads/list

    Side note: The nice thing about retro, I think, is that it doesn't make you study a bunch of different objects and classes and figure out how to make them interact, but (while it actually includes those classes and objects and uses them) it makes you work with only a few extra simple (but incredibly powerful, since they use classes behind them) PHP-like keywords. find,single,dt2d, sqldatetime, upload, email, validate, etc.

    Video tutorials (The making of the sample Blog Application in Build 7.4)
    Best to watch them one by one, 38 minutes and you can use Retro.

    Config & Startup:
    http://serialize.us/chapters/config/config.html

    Form, DB Insert and Validation:
    http://serialize.us/chapters/Validation/Validation.html

    Delete, Edit, Add comments, Lazy validation, DB relationships, etc:
    http://serialize.us/chapters/Untitled/Untitled.html

    SAMPLE BLOG NOTES
    1) I should have used 'class' instead of 'id' for the post options
    2) In the comment 'lazy validation', after setting the validations, before saving the record I should have done
    PHP Code:
    if(post_valid()) $comment->save(); 
    3) In posts.header.tpl I could and probably should have added at the very top <?=xhtml_transitional()?>
    Learn about the new Retro Framework
    Code PHP the way it was meant to be coded!

  4. #104
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looking good CoderMaya, it's really starting to come together.

    I don't mean to be a pain, but when can we expect to see it in SVN?

  5. #105
    Coding and Breathing CoderMaya's Avatar
    Join Date
    Feb 2008
    Location
    Atlit, Israel
    Posts
    470
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When a Beta version comes out
    Learn about the new Retro Framework
    Code PHP the way it was meant to be coded!

  6. #106
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Just as an amusing diversion chaps.....
    Attached Images Attached Images
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  7. #107
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Made a fix for static function Record::find().

    The problem was that even if the passed item was an array, it attempted to run it through $db->escape().

    I've made a fix for that and it also leaves the value unquoted if it's a number. Also, it uses the IN() function when using an array, rather than looping through possible values (for efficiency and ease).

    PHP Code:
        public static function escape_and_quote($value){
                if(
    is_array($value)){
                    
    $value array_map(array('self''escape_and_quote'), $value);
                }else{
                    
    $value self::$db->escape($value);
                    if(!
    is_numeric($value))
                        
    $value '\'' $value '\'';
                }
                return 
    $value;
            }
        
    /* Find records from the RecordBase */
        
    public static function find($type$filters null$count null$start null)
        {
            if(!
    self::$db->isConnected)
                throw new 
    Exception('Can not find records while disconnected');

            
    $query 'SELECT * FROM '.$type;

            if(
    is_array($filters))
            {
                
    $query .= ' WHERE ';
                foreach(
    $filters as $filter => $value)
                {
                    
    $value self::escape_and_quote($value);
                    if(!
    is_array($value))
                        
    $query .= $filter ' = ' .$value ' AND ';
                    else
                    {
                        
    $query .= $filter ' IN (' implode(', '$value) . ') AND ';
                    }
                }
                
    $query .= '1 = 1 ';
            }
            if(
    $count != null)
            {
                
    $query .= ' LIMIT ';
                
                if(
    $start != null)
                    
    $query .= $start ', ';
                
                
    $query .= $count;
            }
            
            
    $resource self::$db->query($query);

            
    $results self::$db->fetchAll($resource);
            
            
            
    $records = new Records($type);
            
    $i 0;
            foreach(
    $results as $result)
            {
                
    $record = new self($typefalse);
                
    $record->setValues($result);
                
    $records[$i] = $record;
                
    $i++;
            }

            if(
    $count == 1)
                return 
    $records[0];

            return 
    $records;
        } 
    (escape_and_quote() is a new function).

    Off Topic:

    Love it spike! Any chance of a bigger medalion?
    Last edited by Jake Arkinstall; Sep 29, 2008 at 09:04. Reason: Fixed a small error - and tested it.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  8. #108
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Fix for redirect function, to stop any accidental double-backlashes:
    PHP Code:
    /* server redirect */
    function redirect($url)
    {
        while(
    substr($url01) == '/'){
            
    $url substr($url1);
        }
        if(!
    preg_match('~^https?://~'$url))
        {
            
    $url $GLOBALS['rooturi'].$url;
        }
        
    header('Location: '.$url);
        exit;

    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  9. #109
    Coding and Breathing CoderMaya's Avatar
    Join Date
    Feb 2008
    Location
    Atlit, Israel
    Posts
    470
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll take a look at those fixes... I also fixed quite a few things yesterday.

    Meanwhile, I'm pretty sure this will be our logo, tell me what you think (I think it delivers the message well)
    Attached Images Attached Images
    Learn about the new Retro Framework
    Code PHP the way it was meant to be coded!

  10. #110
    Coding and Breathing CoderMaya's Avatar
    Join Date
    Feb 2008
    Location
    Atlit, Israel
    Posts
    470
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok Jake I added your fix along with a phpdoc @author credit, but I put it in RecordBase::escape_and_quote and called it like self::$db->escape_and_quote.

    Good job!

    Lots of fixes and changes BTW.

    I also noticed yesterday that while our naming convention for methods AND functions is lowercase+underscores, our actions were still (optionally) set like indexAction.

    So now it goes like this

    First it looks for index, then index_action and then indexAction.

    I also added a prebuilt route in routes.xml:
    Code:
    <route>
       <pattern>^.+?/new(/.*)?$</pattern>
       <action>_new</action>
    </route>
    Who can guess what it does?

    It's just an example for using suffix-less action names with routes.

    So from now on, if you want to have a URI like /posts/new you have 2 options:
    1) call the method by another name, example: _new, and then set a specific pattern route for any action in the called controller, or just statically set the URI without a complex pattern and redirect it to your preferred controller and action.

    The lazy method is to just call the action new_action($request)
    Learn about the new Retro Framework
    Code PHP the way it was meant to be coded!

  11. #111
    We're from teh basements.
    Join Date
    Apr 2007
    Posts
    1,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by spikeZ View Post
    Just as an amusing diversion chaps.....
    Very nice!

  12. #112
    PHP/Rails Developer Czaries's Avatar
    Join Date
    May 2004
    Location
    Central USA
    Posts
    806
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about adding a file() function to that email class of yours to handle file attachments? That's always a pain the in butt with PHP's built-in mail() function.

  13. #113
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Meanwhile, I'm pretty sure this will be our logo, tell me what you think (I think it delivers the message well)
    To be honest I think it looks too much like the PHP logo. I know it needs to convey a message but I think it goes too far in that sense.

    It needs something unique.

    Think about it this way. Cadbury's chocolate is a very well known brand of chocolate, at least in the UK anyway. It's logo is memorable, so they did a few adverts deliberately keeping the same first letter but changing the word Cadbury to other key words. Most people didn't even notice. So by putting that logo as a 'powered by' logo on a website - not only may it get the PHP development team angry, but it might simply be mistaken for 'powered by php'.

    I think something suiting the name retro but not of the PHP logo would be better.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  14. #114
    Coding and Breathing CoderMaya's Avatar
    Join Date
    Feb 2008
    Location
    Atlit, Israel
    Posts
    470
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ^ Good point.

    From now on please discuss Retro development (logo, bug fixes, new suggestions) in http://groups.google.com/group/retro-developers
    Learn about the new Retro Framework
    Code PHP the way it was meant to be coded!

  15. #115
    Coding and Breathing CoderMaya's Avatar
    Join Date
    Feb 2008
    Location
    Atlit, Israel
    Posts
    470
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Beta 1 released...
    Learn about the new Retro Framework
    Code PHP the way it was meant to be coded!

  16. #116
    Coding and Breathing CoderMaya's Avatar
    Join Date
    Feb 2008
    Location
    Atlit, Israel
    Posts
    470
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Beta 2 released with built-in + custom error pages, SQLITE support and more.
    Learn about the new Retro Framework
    Code PHP the way it was meant to be coded!

  17. #117
    Coding and Breathing CoderMaya's Avatar
    Join Date
    Feb 2008
    Location
    Atlit, Israel
    Posts
    470
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    RC1 uploaded with a sample Blog application using SQLite (meaning you can run it the minute you put it in your server, just make sure SQLite is enabled in your PHP.ini if it doesn't work)

    http://code.google.com/p/retrophpmvc...l?name=rc1.zip

    Please test this version and let me know if there are any bugs, it would be very helpful!
    Learn about the new Retro Framework
    Code PHP the way it was meant to be coded!

  18. #118
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Any chance of a live version of the blog?
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  19. #119
    Coding and Breathing CoderMaya's Avatar
    Join Date
    Feb 2008
    Location
    Atlit, Israel
    Posts
    470
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tried, but... you're not gonna believe this, my host doesn't support mod_rewrite.

    Anyway, the blog will run as soon as you copy it to your document root. It doesn't need a MySQL set up or anything.
    Learn about the new Retro Framework
    Code PHP the way it was meant to be coded!

  20. #120
    SitePoint Wizard
    Join Date
    Jan 2005
    Location
    blahblahblah
    Posts
    1,447
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    Extensive use of keywords to get what you want instead of object methods... 
    I'd be very interested in learning more about it... Tried to search php.net, with no success

  21. #121
    SitePoint Enthusiast snajt's Avatar
    Join Date
    May 2008
    Location
    Kalmar, Sweden
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Seriously, the blog looks great.

    One thing I think you should do is a tutorial for user authenticaton, as I think most frameworks fail here, and it is pretty common in every application.

  22. #122
    Coding and Breathing CoderMaya's Avatar
    Join Date
    Feb 2008
    Location
    Atlit, Israel
    Posts
    470
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll work on creating some helpers for authentication and then make a vid tut about it.

    Lots of stuff has changed, btw, in RC2. Lots and lots of stuff.
    Learn about the new Retro Framework
    Code PHP the way it was meant to be coded!

  23. #123
    Coding and Breathing CoderMaya's Avatar
    Join Date
    Feb 2008
    Location
    Atlit, Israel
    Posts
    470
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://code.google.com/p/retrophpmvc/downloads/list

    RC 3 released

    CHANGE LOG
    Code:
    RC3
    
    [Config]
    - Config files are now of INI type instead of XML
    - Same with validation files (also INI now with sections, just like php.ini IE: [title] \n min-chars = 4)
    - the config/routes file is still in XML for full compatibility with route regex patterns.
    
    
    [Database]
    - SQLite still contains an error with string escaping. It falls into an escape-loop with quote characters.
    - MySQL RecordBase seems to be working perfectly well and exploit-free, after many tests and bug fixes.
    
    [Directory Structure]
    - 'system' changed to 'app'
    - 'tpl' changed to 'views'
    - 'public' folder is now inside the 'app' folder
    
    [Forms]
    - Added new tag helpers: form_tag, input_tag (includes 'textarea' option), submit_tag in tags.php. TODO: select_tag.
    - if_error function changed name to error_of, but is the same identical function.
    
    [Custom Pages]
    - Added built-in error pages in 'root' directory.
    - Added custom pages to the 'app/pages' directory to let you have customized special pages.
    
    [Http]
    - Added the 'flash' function in http.php. The function uses a template found either in 'app/pages' or the 'root'
    directory and displays a message to the user along with a delayed redirect, and exists. Basically a "redirect page"
    that contains confirmation to the user about his action.
    Learn about the new Retro Framework
    Code PHP the way it was meant to be coded!

  24. #124
    SitePoint Zealot Amenthes's Avatar
    Join Date
    Oct 2006
    Location
    Bucharest, Romania
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have one little complain about RC2. It was full of E_NOTICEs, so maybe you set an appropriate error_reporting value when developing.
    I'm under construction | http://igstan.ro/

  25. #125
    Coding and Breathing CoderMaya's Avatar
    Join Date
    Feb 2008
    Location
    Atlit, Israel
    Posts
    470
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Possibly. I'll give that a look. Either way, try RC3 and let me know if there are still any problems.
    Learn about the new Retro Framework
    Code PHP the way it was meant to be coded!


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •