Changeset 129

Show
Ignore:
Timestamp:
03/11/07 08:54:24 (2 years ago)
Author:
bermiferrer
Message:

Adding small fixes by Kaste for testing and AR Collections. Allowing new syntax for Installer. Now you can set the length of VARCHAR columns using the following syntax: first_name(100)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/AkActiveRecord/AkHasAndBelongsToMany.php

    r119 r129  
    497497            $this->Owner->notifyObservers('afterRemove'); 
    498498        } 
    499         $this->Owner->{$this->association_id} = array_diff($this->Owner->{$this->association_id},array(null)); 
    500499    } 
    501500 
  • trunk/lib/AkActiveRecord/AkHasMany.php

    r55 r129  
    389389            $this->Owner->notifyObservers('afterRemove'); 
    390390        } 
    391         $this->Owner->{$this->association_id} = array_diff($this->Owner->{$this->association_id},array(null)); 
    392391    } 
    393392 
  • trunk/lib/AkInstaller.php

    r127 r129  
    406406    function _needsDefaultAttributes($column) 
    407407    { 
    408         return preg_match('/^(([A-Z0-9_]+)|(.+ string[^\(.]*)|(\*.*))$/i',$column); 
     408        return preg_match('/^(([A-Z0-9_\(\)]+)|(.+ string[^\(.]*)|(\*.*))$/i',$column); 
    409409    } 
    410410 
  • trunk/script/test

    r17 r129  
    2525 
    2626$tests_dir = realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'test'); 
    27 foreach ($argv as $test){ 
    28     $test = strstr($test,'.php') ? trim($test, '/') : $test.'.php'; 
    29     $test = substr($test,0,5) == 'test/' ? substr($test,5) : $test
    30     $test = $tests_dir.DIRECTORY_SEPARATOR.$test
    31     if(!file_exists($test)){ 
    32         echo "\nCould not load $test test file\n"; 
     27foreach ($argv as $_test_file){ 
     28    $_test_file = strstr($_test_file,'.php') ? trim($_test_file, '/') : $_test_file.'.php'; 
     29    $_test_file = substr($_test_file,0,5) == 'test/' ? substr($_test_file,5) : $_test_file
     30    $_test_file = $tests_dir.DIRECTORY_SEPARATOR.$_test_file
     31    if(!file_exists($_test_file)){ 
     32        echo "\nCould not load $_test_file test file\n"; 
    3333    }else{ 
    34         require($test); 
     34        require($_test_file); 
    3535    } 
    3636} 
    3737 
    38 echo $test
     38echo $_test_file
    3939 
    4040echo "\n";