Changeset 26477
- Timestamp:
- 01/11/10 16:39:55 (3 years ago)
- Files:
-
- plugins/sfAmfPlugin/README (modified) (3 diffs)
- plugins/sfAmfPlugin/config/config.php (deleted)
- plugins/sfAmfPlugin/config/sfAmfPluginConfiguration.class.php (added)
- plugins/sfAmfPlugin/lib/sfAmfGateway.class.php (modified) (5 diffs)
- plugins/sfAmfPlugin/lib/sfAmfTreeViewer.php (added)
- plugins/sfAmfPlugin/modules/amfbrowser (added)
- plugins/sfAmfPlugin/modules/amfbrowser/actions (added)
- plugins/sfAmfPlugin/modules/amfbrowser/actions/actions.class.php (added)
- plugins/sfAmfPlugin/modules/amfbrowser/templates (added)
- plugins/sfAmfPlugin/modules/amfbrowser/templates/indexSuccess.php (added)
- plugins/sfAmfPlugin/package.xml (modified) (4 diffs)
- plugins/sfAmfPlugin/web (added)
- plugins/sfAmfPlugin/web/css (added)
- plugins/sfAmfPlugin/web/css/sfAmfPluginBrowser.css (added)
- plugins/sfAmfPlugin/web/js (added)
- plugins/sfAmfPlugin/web/js/mootools-core.js (added)
- plugins/sfAmfPlugin/web/js/mootools-more.js (added)
- plugins/sfAmfPlugin/web/js/sfAmfPluginBrowser.js (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfAmfPlugin/README
r26472 r26477 111 111 } 112 112 113 AMF-Service Browser 114 ------------------- 115 116 You can call a AMF-Service-Browser to test your Service-Classes. The Plugin contains a Service-Browser to do so. 117 For that just enable the module in the settings.yml of your application: 118 119 [yaml] 120 enabled_modules: [default, amfbrowser] 121 122 Please keep in mind that you should activate this module only for the DEV-Environment. Otherwise you will create 123 a big security issue for your application. 124 After you have added the browser to your enabled_modules run the following symfony commands: 125 126 $ symfony cc 127 $ symfony plugin:publish-assets sfAmfPlugin 128 129 Now you can call the Service-Browser via calling http://host/amfbrowser 130 113 131 ORM-Support 114 132 ----------- … … 207 225 * Task for creating VO ActionScript classes from Doctrine or Propel classes 208 226 * Support for Doctrine nested sets 227 * Caching 209 228 210 229 I like to hear from you! Maybe you have an idea how to enhance the plugin. Just send me an email! … … 216 235 * Added Support for Symfony 1.3 and 1.4 217 236 * Updated to most current development version of SabreAMF 218 237 * Added first version of an AMF service browser (thanks to Beno�Gouchet) 219 238 * 1.4.2 (08-05-2009) 220 239 * Changed error_handler behaviour plugins/sfAmfPlugin/lib/sfAmfGateway.class.php
r20807 r26477 114 114 } 115 115 else if(file_exists($lib_dir.$service_class_path.'.php')) { 116 $service_path = $lib_dir.$service_class_path.'.php';117 break;118 }116 $service_path = $lib_dir.$service_class_path.'.php'; 117 break; 118 } 119 119 } 120 120 … … 139 139 140 140 $result = call_user_func_array( 141 array($instance, 'run'),142 array($method_name, $arguments)141 array($instance, 'run'), 142 array($method_name, $arguments) 143 143 ); 144 144 … … 161 161 } 162 162 163 /** 164 * 165 * @return array of ReflectionClass : Services 166 */ 167 public function parseAllServices() { 168 $files_paths = array(); 169 170 foreach($this->getProjectLibDirectories() as $dir) { 171 $files_paths = array_merge($files_paths, $this->servicesRecursiveSearch($dir.DIRECTORY_SEPARATOR.'services')); 172 } 173 174 $reflection_classes = array(); 175 176 foreach ($files_paths as $path) { 177 $class_name = $this->getClassName($path); 178 $full_package_name = $this->getPackageName($path); 179 180 require_once $path; 181 $reflection_classes[$full_package_name] = new ReflectionClass($class_name); 182 } 183 184 return $reflection_classes; 185 } 186 187 protected function getClassName($path) { 188 $class_name = basename($path, ".php"); 189 $class_name = basename($class_name, ".class"); 190 191 return $class_name; 192 } 193 194 protected function getPackageName($path) { 195 $result = $path; 196 197 foreach($this->getProjectLibDirectories() as $dir) { 198 $result = str_replace($dir.DIRECTORY_SEPARATOR.'services', '', $result); 199 } 200 201 if ($result[0] == DIRECTORY_SEPARATOR) { 202 // Remove leading slashes 203 $result = substr($result, 1); 204 } 205 206 $class_name = $this->getClassName($path); 207 208 $parts = explode(DIRECTORY_SEPARATOR, $result); 209 array_pop($parts); 210 $package_name = implode('.', $parts).'.'.$class_name; 211 return $package_name; 212 } 213 214 protected function servicesRecursiveSearch($dir) { 215 $files_paths = array_merge(glob($dir.DIRECTORY_SEPARATOR.'*Service.php'), 216 glob($dir.DIRECTORY_SEPARATOR.'*Service.class.php')); 217 218 $children_dirs = glob($dir.DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR); 219 220 foreach ($children_dirs as $child_dir) 221 $files_paths = array_merge($files_paths, $this->servicesRecursiveSearch($child_dir)); 222 223 return $files_paths; 224 } 225 163 226 164 227 /** … … 173 236 */ 174 237 protected function getProjectLibDirectories() { 175 // get the application lib directories238 // get the application lib directories 176 239 $lib_dirs = sfContext::getInstance()->getConfiguration()->getLibDirs(sfConfig::get('sf_app')); 177 240 … … 184 247 // get the plugin lib dirs 185 248 $lib_dirs = array_merge($lib_dirs, 186 sfContext::getInstance()->187 getConfiguration()->188 getPluginSubPaths('/lib'));249 sfContext::getInstance()-> 250 getConfiguration()-> 251 getPluginSubPaths('/lib')); 189 252 190 253 return $lib_dirs; plugins/sfAmfPlugin/package.xml
r26472 r26477 11 11 <active>yes</active> 12 12 </lead> 13 <date>20 09-08-05</date>13 <date>2010-01-11</date> 14 14 <version> 15 <release>1. 4.2</release>15 <release>1.5.0</release> 16 16 <api>1.0.0</api> 17 17 </version> … … 79 79 <file name="lib/sfAmfGateway.class.php" role="data"/> 80 80 <file name="lib/sfAmfService.php" role="data"/> 81 <file name="lib/sfAmfTreeViewer.php" role="data"/> 82 <file name="modules/amfbrowser/actions/actions.class.php" role="data"/> 83 <file name="modules/amfbrowser/templates/indexSuccess.php" role="data"/> 84 <file name="modules/amfgateway/actions/actions.class.php" role="data"/> 85 <file name="modules/amfgateway/config/security.yml" role="data"/> 81 86 <file name="config/autoload.yml" role="data"/> 82 <file name="config/config.php" role="data"/> 87 <file name="config/sfAmfPluginConfiguration.class.php" role="data"/> 88 <file name="web/css/sfAmfPluginBrowser.css" role="data"/> 89 <file name="web/js/sfAmfPluginBrowser.js" role="data"/> 90 <file name="web/js/mootools-core.js" role="data"/> 91 <file name="web/js/mootools-more.js" role="data"/> 83 92 <file name="LICENSE" role="data"/> 84 93 <file name="README" role="data"/> … … 97 106 <channel>pear.symfony-project.com</channel> 98 107 <min>1.1.0</min> 99 <max> 1.3.0</max>100 <exclude> 1.3.0</exclude>108 <max>2.0.0</max> 109 <exclude>2.0.0</exclude> 101 110 </package> 102 111 </required> … … 104 113 <phprelease/> 105 114 <changelog> 115 <release> 116 <version> 117 <release>1.5.0</release> 118 <api>1.0.0</api> 119 </version> 120 <stability> 121 <release>stable</release> 122 <api>stable</api> 123 </stability> 124 <date>2010-01-11</date> 125 <license>MIT License</license> 126 <notes>* Released for Symfony 1.3 and 1.4 127 * Added first version of an AMF Service Browser (thanks to Benoit Gouchet) 128 * Updated SabreAmf to current version</notes> 129 </release> 106 130 <release> 107 131 <version>