Changeset 174
- Timestamp:
- 04/09/07 16:12:38 (2 years ago)
- Files:
-
- trunk/lib/AkImage.php (modified) (3 diffs)
- trunk/script/generators/controller/templates/fixture.tpl (modified) (1 diff)
- trunk/script/generators/controller/templates/helper_fixture.tpl (modified) (1 diff)
- trunk/script/generators/model/templates/installer_fixture.tpl (modified) (1 diff)
- trunk/script/generators/model/templates/model_fixture.tpl (modified) (1 diff)
- trunk/script/generators/scaffold/templates/installer_fixture.tpl (modified) (1 diff)
- trunk/script/generators/scaffold/templates/model_fixture.tpl (modified) (1 diff)
- trunk/test/fixtures/app/shared_model.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/AkImage.php
r41 r174 31 31 { 32 32 $this->Transform =& Image_Transform::factory($tranform_using); 33 if (PEAR::isError($this->Transform)){ 34 trigger_error($this->Transform->getMessage(), E_USER_ERROR); 35 } 33 36 if(!empty($image_path)){ 34 37 $this->load($image_path); … … 49 52 50 53 $path = empty($path) ? $this->image_path : $path; 51 $this->Transform->save($tmp_image_name, array_pop(pathinfo($path)), $quality);54 $this->Transform->save($tmp_image_name, $this->getExtension($path), $quality); 52 55 Ak::file_put_contents($path, file_get_contents($tmp_image_name), $options); 53 56 @unlink($tmp_image_name); … … 71 74 } 72 75 73 function getExtension( )76 function getExtension($path = null) 74 77 { 75 return array_pop(pathinfo($this->image_path));78 return substr(strrchr(empty($path) ? $this->image_path : $path, '.'), 1); 76 79 } 77 80 trunk/script/generators/controller/templates/fixture.tpl
r155 r174 1 1 <?php echo '<?php'?> 2 2 3 require_once(AK_BASE_DIR.DS.'app'.DS.'controllers'.DS. array_shift(array_slice(pathinfo(__FILE__),1,1)));3 require_once(AK_BASE_DIR.DS.'app'.DS.'controllers'.DS.substr(strrchr(__FILE__, DS), 1)); 4 4 5 5 ?> trunk/script/generators/controller/templates/helper_fixture.tpl
r155 r174 1 1 <?php echo '<?php'?> 2 2 3 require_once(AK_BASE_DIR.DS.'app'.DS.'helpers'.DS. array_shift(array_slice(pathinfo(__FILE__),1,1)));3 require_once(AK_BASE_DIR.DS.'app'.DS.'helpers'.DS.substr(strrchr(__FILE__, DS), 1)); 4 4 5 5 ?> trunk/script/generators/model/templates/installer_fixture.tpl
r155 r174 1 1 <?php echo '<?php'?> 2 2 3 require_once(AK_BASE_DIR.DS.'app'.DS.'installers'.DS. array_shift(array_slice(pathinfo(__FILE__),1,1)));3 require_once(AK_BASE_DIR.DS.'app'.DS.'installers'.DS.substr(strrchr(__FILE__, DS), 1)); 4 4 5 5 ?> trunk/script/generators/model/templates/model_fixture.tpl
r155 r174 1 1 <?php echo '<?php'?> 2 2 3 require_once(AK_BASE_DIR.DS.'app'.DS.'models'.DS. array_shift(array_slice(pathinfo(__FILE__),1,1)));3 require_once(AK_BASE_DIR.DS.'app'.DS.'models'.DS.substr(strrchr(__FILE__, DS), 1)); 4 4 5 5 ?> trunk/script/generators/scaffold/templates/installer_fixture.tpl
r155 r174 1 1 <?php echo '<?php'?> 2 2 3 require_once(AK_BASE_DIR.DS.'app'.DS.'installers'.DS. array_shift(array_slice(pathinfo(__FILE__),1,1)));3 require_once(AK_BASE_DIR.DS.'app'.DS.'installers'.DS.substr(strrchr(__FILE__, DS), 1)); 4 4 5 5 ?> trunk/script/generators/scaffold/templates/model_fixture.tpl
r155 r174 1 1 <?php echo '<?php'?> 2 2 3 require_once(AK_BASE_DIR.DS.'app'.DS.'models'.DS. array_shift(array_slice(pathinfo(__FILE__),1,1)));3 require_once(AK_BASE_DIR.DS.'app'.DS.'models'.DS.substr(strrchr(__FILE__, DS), 1)); 4 4 5 5 ?> trunk/test/fixtures/app/shared_model.php
r48 r174 1 1 <?php 2 require_once(AK_BASE_DIR.DS.'app'.DS. array_shift(array_slice(pathinfo(__FILE__),1,1)));2 require_once(AK_BASE_DIR.DS.'app'.DS.substr(strrchr(__FILE__, DS), 1)); 3 3 4 4 ?>
