├── README.md ├── composer.json ├── examples ├── complete.php └── thumbs.php └── src └── FFmpeg.php /README.md: -------------------------------------------------------------------------------- 1 | [![Donate](https://www.paypalobjects.com/es_XC/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8TJZSNT5JQUXL) 2 | 3 | 4 | # FFmpeg Class ( Without `ffmpeg-php` ) 5 | A complete cross-platform class for using FFmpeg written in PHP 5.3+ 6 | 7 | > **IMPORTANT!** 8 | 9 | > This class DON'T depend/need of `ffmpeg-php` php extension. 10 | 11 | ## Requirements 12 | 13 | * FFmpeg 0.5.12+ 14 | * PHP 5.3+ 15 | * PCRE( Perl-Compatible ) 16 | 17 | 18 | ## Install 19 | 20 | You can download FFmpeg class via Github [here](https://github.com/olaferlandsen/ffmpeg-php-class/archive/master.zip) 21 | 22 | Or If you want install via Composer, try with `composer require olaferlandsen/ffmpeg-php-class` 23 | 24 | 25 | ## Examples 26 | 27 | ### Example #1: Input & output. 28 | 29 | ```php 30 | input( '/var/media/original.mp4' )->output( '/var/media/new.3gp' )->ready(); 33 | ?> 34 | ``` 35 | 36 | ### Example #2: Simple frame rate. 37 | 38 | ```php 39 | input( '/var/media/original.mp4' )->frameRate( '30000/1001' )->output( '/var/media/new.3gp' )->ready(); 42 | ?> 43 | ``` 44 | 45 | ### Example #3: Simple frame rate using method alias. 46 | 47 | ```php 48 | i( '/var/media/original.mp4' )->r( '30000/1001' )->output( '/var/media/new.3gp' )->ready(); 51 | ?> 52 | ``` 53 | 54 | ### Example #4: Rotate video. 55 | 56 | ```php 57 | input( '/var/media/original.mp4' )->transpose( 2 )->output( '/var/media/new.3gp' )->ready(); 60 | ?> 61 | ``` 62 | 63 | ### Example #5: Rotate video with alias "rotate". 64 | 65 | ```php 66 | input( '/var/media/original.mp4' )->rotate( 2 )->output( '/var/media/new.3gp' )->ready(); 69 | ?> 70 | ``` 71 | 72 | ### Example #6: Force format. 73 | 74 | ```php 75 | input( '/var/media/original.mp4' )->forceFormat( '3gp' )->output( '/var/media/new.3gp' )->ready(); 78 | ?> 79 | ``` 80 | 81 | ### Example #7: Force format quickly. 82 | 83 | ```php 84 | input( '/var/media/original.mp4' )->output( '/var/media/new.3gp' , '3gp' )->ready(); 87 | ?> 88 | ``` 89 | 90 | ### Example #8: Get command 91 | 92 | ```php 93 | input( '/var/media/original.mp4' )->output( '/var/media/new.3gp' )->command; 96 | ?> 97 | ``` 98 | 99 | 100 | ### Example #9: Run command. 101 | 102 | ```php 103 | input( '/var/media/original.mp4' )->output( '/var/media/new.3gp' )->ready(); 106 | ?> 107 | ``` 108 | 109 | 110 | ### Example #10: Gray Scale. 111 | 112 | ```php 113 | input( '/var/media/original.mp4' )->grayScale()->output( '/var/media/new.3gp' )->ready(); 116 | ?> 117 | ``` 118 | 119 | ### Example #11: Set param. 120 | 121 | ```php 122 | input( '/var/media/original.mp4' )->set($key,$value)->output( '/var/media/new.3gp' )->ready(); 127 | ?> 128 | ``` 129 | 130 | ### Example #12: Unset param. 131 | 132 | ```php 133 | input( '/var/media/original.mp4' )->unset($key)->output( '/var/media/new.3gp' )->ready(); 137 | ?> 138 | ``` 139 | 140 | ### Example #13: Quick methods 141 | 142 | ```php 143 | input( '/var/media/original.mp4' )->sameq()->output( '/var/media/new.3gp' )->ready(); 146 | ?> 147 | ``` 148 | 149 | ### Example #14: Flip ( V or H ) 150 | 151 | ```php 152 | input( '/var/media/original.mp4' )->flip( 'v' )->output( '/var/media/new.3gp' )->ready(); 155 | ?> 156 | ``` 157 | 158 | ### Example #15: hflip 159 | 160 | ```php 161 | input( '/var/media/original.mp4' )->hflip()->output( '/var/media/new.3gp' )->ready(); 164 | ?> 165 | ``` 166 | 167 | ### Example #16: vflip 168 | 169 | ```php 170 | input( '/var/media/original.mp4' )->vflip()->output( '/var/media/new.3gp' )->ready(); 173 | ?> 174 | ``` 175 | 176 | 177 | ### Example #17: Complete 178 | 179 | ```php 180 | 99, 191 | 'position' => 0, 192 | 'itsoffset' => 2, 193 | ); 194 | /** 195 | * Create command 196 | */ 197 | $FFmpeg = new FFmpeg( '/usr/local/bin/ffmpeg' ); 198 | $FFmpeg->input( '/var/media/original.avi' ); 199 | $FFmpeg->transpose( 0 )->vflip()->grayScale()->vcodec('h264')->frameRate('30000/1001'); 200 | $FFmpeg->acodec( 'aac' )->audioBitrate( '192k' ); 201 | foreach( $options AS $option => $values ) 202 | { 203 | $FFmpeg->call( $option , $values ); 204 | } 205 | $FFmpeg->output( '/var/media/new.mp4' , 'mp4' ); 206 | print($FFmpeg->command); 207 | ?> 208 | ``` 209 | 210 | ```bash 211 | /usr/local/bin/ffmpeg -y -vf transpose=0,vflip -pix_fmt gray -vcodec h264 -r 30000/1001 -acodec aac -ab 192k -t 99 -ss 0 -itsoffset 2 -f mp4 /var/media/new.mp4 /dev/null 2<&1 212 | ``` 213 | 214 | ### Example #18: Clear 215 | 216 | ```php 217 | vflip()->output( '/var/media/new.3gp' )->clear()->input( '/var/www/file.3gp' ); 219 | ?> 220 | ``` 221 | 222 | ### Example #19: Thumbs ( Experimental ) 223 | 224 | ```php 225 | input( '/var/www/video.mp4' )->thumb( $size , $start, $frames )->ready(); 232 | ?> 233 | ``` 234 | 235 | ### Example #20: Image to video 236 | 237 | ```php 238 | input( '/var/www/images/pref%04d.png' )->frameRate( '29,97' )->size( '1920x1080' )->force('image2'); 241 | $FFmpeg->output( 'image2video.mp4' ); 242 | $FFmpeg->ready(); 243 | ?> 244 | ``` 245 | 246 | ### Example #21: Set the FFmpeg binary file on Windows 247 | 248 | ```php 249 | input( 'C:\xampp\input.mp4' )->output( 'output.3gp' ); 252 | $FFmpeg->ready(); 253 | ?> 254 | ``` 255 | 256 | ### Example #22: Set the FFmpeg binary file on Linux & Unix 257 | 258 | ```php 259 | input( '/var/www/input.mp4' )->output( 'output.3gp' ); 262 | $FFmpeg->ready(); 263 | ?> 264 | ``` 265 | 266 | ### Example #23: Log level 267 | 268 | ```php 269 | input( '/var/www/input.mp4' )->loglevel("debug")->output( 'output.3gp' ); 272 | $FFmpeg->ready(); 273 | ?> 274 | ``` 275 | ## Remember: 276 | 277 | * This is an open source project and free. 278 | * Share our repository. 279 | 280 | ## Thanks to: 281 | * [@HankBrown](https://github.com/HankBrown) 282 | * [@remotemethod](https://github.com/remotemethod) 283 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "olaferlandsen/ffmpeg-php-class", 3 | "description": "FFmpeg class to use with PHP without install FFmpeg-PHP extension", 4 | "keywords": [ 5 | "ffmpeg", 6 | "video" 7 | ], 8 | "homepage": "https://github.com/olaferlandsen/ffmpeg-php-class", 9 | "license": "MIT", 10 | "require": { 11 | "php": ">=5.3.0" 12 | }, 13 | "autoload": { 14 | "psr-0": { 15 | "FFmpeg": "src/" 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /examples/complete.php: -------------------------------------------------------------------------------- 1 | 99, 12 | 'position' => 0, 13 | 'itsoffset' => 2, 14 | ); 15 | /** 16 | * Create command 17 | */ 18 | $FFmpeg = new FFmpeg( '/usr/local/bin/ffmpeg' ); 19 | $FFmpeg->input( '/var/media/original.avi' ); 20 | $FFmpeg->transpose( 0 )->vflip()->grayScale()->vcodec('h264')->frameRate('30000/1001'); 21 | $FFmpeg->acodec( 'aac' )->audioBitrate( '192k' ); 22 | foreach( $options AS $option => $values ) 23 | { 24 | $FFmpeg->call( $option , $values ); 25 | } 26 | $FFmpeg->output( '/var/media/new.mp4' , 'mp4' ); 27 | print($FFmpeg->command); -------------------------------------------------------------------------------- /examples/thumbs.php: -------------------------------------------------------------------------------- 1 | input( $file )->thumb($size, $start , $frames )->ready(); -------------------------------------------------------------------------------- /src/FFmpeg.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | class FFmpeg 13 | { 14 | /** 15 | * 16 | */ 17 | private $STD = ' 2<&1'; 18 | /** 19 | * 20 | */ 21 | private $quickMethods = array( 22 | 'sameq' 23 | ); 24 | /** 25 | * 26 | */ 27 | private $as = array( 28 | 'b' => 'bitrate', 29 | 'r' => 'frameRate', 30 | 'fs' => 'fileSizeLimit', 31 | 'f' => 'forceFormat', 32 | 'force' => 'forceFormat', 33 | 'i' => 'input', 34 | 's' => 'size', 35 | 'ar' => 'audioSamplingFrequency', 36 | 'ab' => 'audioBitrate', 37 | 'acodec' => 'audioCodec', 38 | 'vcodec' => 'videoCodec', 39 | 'std' => 'redirectOutput', 40 | 'unset' => '_unset', 41 | 'number' => 'videoFrames', 42 | 'vframes' => 'videoFrames', 43 | 'y' => 'overwrite', 44 | 'log' => 'logLevel', 45 | ); 46 | /** 47 | * 48 | */ 49 | private $FFmpegOptionsAS = array( 50 | 'position' => 'ss', 51 | 'duration' => 't', 52 | 'filename' => 'i', 53 | 'offset' => 'itsoffset', 54 | 'time' => 'timestamp', 55 | 'number' => 'vframes', 56 | ); 57 | /** 58 | * 59 | */ 60 | private $ffmpeg = 'ffmpeg'; 61 | /** 62 | * 63 | */ 64 | private $options = array(); 65 | /** 66 | * 67 | */ 68 | private $fixForceFormat = array( 69 | "ogv" => 'ogg', 70 | "jpeg" => 'mjpeg', 71 | "jpg" => 'mjpeg', 72 | "flash" => "flv", 73 | ); 74 | public $command; 75 | /** 76 | * 77 | */ 78 | public function __call( $method , $args ) 79 | { 80 | if (array_key_exists($method, $this->as)) { 81 | return call_user_func_array( 82 | array($this, $this->as[$method]), 83 | ( is_array( $args ) ) ? $args : array( $args ) 84 | ); 85 | } elseif (in_array($method, $this->quickMethods)) { 86 | return call_user_func_array( 87 | array($this, 'set'), 88 | ( is_array( $args ) ) ? $args : array( $args ) 89 | ); 90 | } else { 91 | throw new Exception( 'The method "'. $method .'" doesnt exist' ); 92 | } 93 | } 94 | /** 95 | * 96 | */ 97 | public function call( $method , $args = array() ) 98 | { 99 | if (method_exists ($this, $method)) { 100 | return call_user_func_array( 101 | array( $this , $method ) , 102 | ( is_array( $args ) ) ? $args : array( $args ) 103 | ); 104 | } 105 | throw new Exception( 'method doesnt exist' ); 106 | } 107 | /** 108 | * 109 | */ 110 | public function __construct( $ffmpeg = null ,$input = false ) 111 | { 112 | $this->ffmpeg( $ffmpeg ); 113 | if (!empty($input)) { 114 | $this->input( $input ); 115 | } 116 | return $this; 117 | } 118 | /** 119 | * @param string $std 120 | * @return object 121 | * @access public 122 | */ 123 | public function redirectOutput( $std ) 124 | { 125 | if (!empty($std)) { 126 | $this->STD = ' '.$std; 127 | } 128 | return $this; 129 | } 130 | /** 131 | * @param string $output Output file path 132 | * @param string $forceFormat Force format output 133 | * @return object 134 | * @access public 135 | */ 136 | public function output( $output = null , $forceFormat = null ) 137 | { 138 | $this->forceFormat( $forceFormat ); 139 | $options = array(); 140 | foreach ($this->options AS $option => $values) { 141 | if (is_array($values)) { 142 | $items = array(); 143 | foreach ($values AS $item => $val) { 144 | if (!is_null($val)) { 145 | if (is_array($val)) { 146 | print_r( $val ); 147 | $val = join( ',' , $val ); 148 | } 149 | $val = strval( $val ); 150 | if (is_numeric( $item ) AND is_integer($item)) { 151 | $items[] = $val; 152 | } else { 153 | $items[] = $item."=". $val; 154 | } 155 | } else { 156 | $items[] = $item; 157 | } 158 | } 159 | $options [] = "-".$option." ".join(',',$items); 160 | } else { 161 | $options [] = "-".$option." ".strval($values); 162 | } 163 | } 164 | $this->command = $this->ffmpeg." ".join(' ',$options)." ".$output . $this->STD; 165 | return $this; 166 | } 167 | /** 168 | * @param string $forceFormat Force format output 169 | * @return object 170 | * @access public 171 | */ 172 | public function forceFormat( $forceFormat ) 173 | { 174 | if (!empty($forceFormat)) { 175 | $forceFormat = strtolower( $forceFormat ); 176 | if (array_key_exists( $forceFormat, $this->fixForceFormat)) { 177 | $forceFormat = $this->fixForceFormat[ $forceFormat ]; 178 | } 179 | $this->set('f',$forceFormat,false); 180 | } 181 | return $this; 182 | } 183 | /** 184 | * @param string $file input file path 185 | * @return object 186 | * @access public 187 | * @version 1.2 Fix by @propertunist 188 | */ 189 | public function input ($file) 190 | { 191 | if (file_exists($file) AND is_file($file)) { 192 | $this->set('i', '"'.$file.'"', false); 193 | } else { 194 | if (strstr($file, '%') !== false) { 195 | $this->set('i', '"'.$file.'"', false); 196 | } else { 197 | trigger_error ("File $file doesn't exist", E_USER_ERROR); 198 | } 199 | } 200 | return $this; 201 | } 202 | /** 203 | * ATENTION!: This method is experimental 204 | * 205 | * @param string $size 206 | * @param string $start 207 | * @param string $videoFrames 208 | * @return object 209 | * @access public 210 | * @version 1.2 Fix by @propertunist 211 | */ 212 | public function thumb ($size, $start, $videoFrames = 1) 213 | { 214 | //$input = false; 215 | if (!is_numeric( $videoFrames ) OR $videoFrames <= 0) { 216 | $videoFrames = 1; 217 | } 218 | $this->audioDisable (); 219 | $this->size ($size); 220 | $this->position ($start); 221 | $this->videoFrames ($videoFrames); 222 | $this->frameRate (1); 223 | return $this; 224 | } 225 | /** 226 | * @return object 227 | * @access public 228 | */ 229 | public function clear() 230 | { 231 | $this->options = array(); 232 | return $this; 233 | } 234 | /** 235 | * @param string $transpose http://ffmpeg.org/ffmpeg.html#transpose 236 | * @return object 237 | * @access public 238 | */ 239 | public function transpose( $transpose = 0 ) 240 | { 241 | if( is_numeric( $transpose ) ) 242 | { 243 | $this->options['vf']['transpose'] = strval($transpose); 244 | } 245 | return $this; 246 | } 247 | /** 248 | * @return object 249 | * @access public 250 | */ 251 | public function vFlip() 252 | { 253 | $this->options['vf']['vflip'] = null; 254 | return $this; 255 | } 256 | /** 257 | * @return object 258 | * @access public 259 | */ 260 | public function hFlip() 261 | { 262 | $this->options['vf']['hflip'] = null; 263 | return $this; 264 | } 265 | /** 266 | * @return object 267 | * @param $flip v=vertial OR h=horizontal 268 | * @access public 269 | * @example $ffmpeg->flip('v'); 270 | */ 271 | public function flip( $flip ) 272 | { 273 | if( !empty( $flip ) ) 274 | { 275 | $flip = strtolower( $flip ); 276 | if( $flip == 'v' ) 277 | { 278 | return $this->vFlip(); 279 | } 280 | else if( $flip == 'h' ) 281 | { 282 | $this->hFlip(); 283 | } 284 | } 285 | return false; 286 | } 287 | /** 288 | * @param string $aspect sample aspect ratio 289 | * @return object 290 | * @access public 291 | */ 292 | public function aspect( $aspect ) 293 | { 294 | $this->set('aspect',$aspect,false); 295 | } 296 | /** 297 | * @param string $b set bitrate (in bits/s) 298 | * @return object 299 | * @access public 300 | * @example $ffmpeg->bitrate('3000/1000'); 301 | 302 | */ 303 | public function bitrate( $b ) 304 | { 305 | return $this->set('b',$b,false); 306 | } 307 | /** 308 | * @param string $r Set frame rate (Hz value, fraction or abbreviation). 309 | * @return object 310 | * @access public 311 | */ 312 | public function frameRate( $r ) 313 | { 314 | if( !empty( $r ) AND preg_match( '/^([0-9]+\/[0-9]+)$/' , $r ) XOR is_numeric( $r ) ) 315 | { 316 | $this->set('r',$r,false); 317 | } 318 | return $this; 319 | } 320 | /** 321 | * @param string $s Set frame size. 322 | * @return object 323 | * @access public 324 | */ 325 | public function size( $s ) 326 | { 327 | if (!empty($s) AND preg_match( '/^([0-9]+x[0-9]+)$/', $s)) { 328 | $this->set('s',$s,false); 329 | } 330 | return $this; 331 | } 332 | /** 333 | * When used as an input option (before "input"), seeks in this input file to position. When used as an output option (before an output filename), decodes but discards input until the timestamps reach position. This is slower, but more accurate. 334 | * 335 | * @param string $s position may be either in seconds or in hh:mm:ss[.xxx] form. 336 | * @return object 337 | * @access public 338 | */ 339 | public function position( $ss ) 340 | { 341 | return $this->set('ss',$ss,false); 342 | } 343 | /** 344 | * @param string $t Stop writing the output after its duration reaches duration. duration may be a number in seconds, or in hh:mm:ss[.xxx] form. 345 | * @return object 346 | * @access public 347 | */ 348 | public function duration( $t ) 349 | { 350 | return $this->set('t',$t,false); 351 | } 352 | /** 353 | * Set the input time offset in seconds. [-]hh:mm:ss[.xxx] syntax is also supported. The offset is added to the timestamps of the input files. 354 | * 355 | * @param string $t Specifying a positive offset means that the corresponding streams are delayed by offset seconds. 356 | * @return object 357 | * @access public 358 | */ 359 | public function itsoffset( $itsoffset ) 360 | { 361 | return $this->set('itsoffset',$itsoffset,false); 362 | } 363 | /** 364 | * 365 | */ 366 | public function audioSamplingFrequency( $ar ) 367 | { 368 | return $this->set('ar',$ar,false); 369 | } 370 | /** 371 | * 372 | */ 373 | public function audioBitrate( $ab ) 374 | { 375 | return $this->set('ab', $ab , false ); 376 | } 377 | /** 378 | * 379 | */ 380 | public function audioCodec( $acodec = 'copy' ) 381 | { 382 | return $this->set('acodec',$acodec,false); 383 | } 384 | /** 385 | * 386 | */ 387 | public function audioChannels( $ac ) 388 | { 389 | $this->set('ac',$ac,false); 390 | } 391 | /** 392 | * 393 | */ 394 | public function audioQuality( $aq ) 395 | { 396 | return $this->set('aq', $aq , false ); 397 | } 398 | /** 399 | * 400 | */ 401 | public function audioDisable() 402 | { 403 | return $this->set('an',null,false); 404 | } 405 | /** 406 | * @param string $number 407 | * @return object 408 | * @access public 409 | */ 410 | public function videoFrames( $number ) 411 | { 412 | return $this->set( 'vframes' , $number ); 413 | } 414 | /** 415 | * @param string $vcodec 416 | * @return object Self 417 | */ 418 | public function videoCodec( $vcodec = 'copy' ) 419 | { 420 | return $this->set('vcodec' , $vcodec ); 421 | } 422 | /** 423 | * @return object Self 424 | */ 425 | public function videoDisable() 426 | { 427 | return $this->set('vn',null,false); 428 | } 429 | /** 430 | * @return object Self 431 | */ 432 | public function overwrite() 433 | { 434 | return $this->set('y',null,false); 435 | } 436 | /** 437 | * @param string $fs 438 | * @return object Self 439 | */ 440 | public function fileSizeLimit( $fs ) 441 | { 442 | return $this->set('fs' , $fs , false ); 443 | } 444 | /** 445 | * @param string $progress 446 | * @return object Self 447 | */ 448 | public function progress( $progress ) 449 | { 450 | return $this->set('progress',$progress); 451 | } 452 | /** 453 | * @param integer $pass 454 | * @return object Self 455 | */ 456 | public function pass( $pass ) 457 | { 458 | if( is_numeric( $pass ) ) 459 | { 460 | $pass = intval( $pass ); 461 | if( $pass == 1 OR $pass == 2 ) 462 | { 463 | $this->options['pass'] = $pass; 464 | } 465 | } 466 | return $this; 467 | } 468 | /** 469 | * @return object 470 | * @param string $append 471 | * @access public 472 | */ 473 | public function ready( $append = null ) 474 | { 475 | /** 476 | * Check if command is empty 477 | */ 478 | if( empty( $this->command ) ) 479 | { 480 | $this->output(); 481 | } 482 | if(empty( $this->command )) 483 | { 484 | trigger_error("Cannot execute a blank command",E_USER_ERROR); 485 | return false; 486 | }else{ 487 | return exec( $this->command . $append ); 488 | } 489 | } 490 | /** 491 | * @return object 492 | * @param string ffmpeg 493 | * @access public 494 | */ 495 | public function ffmpeg( $ffmpeg ) 496 | { 497 | if (!empty( $ffmpeg)) { 498 | $this->ffmpeg = $ffmpeg; 499 | } 500 | } 501 | /** 502 | * @param string $key 503 | * @param string $value 504 | * @param boolen $append 505 | * @return object Self 506 | */ 507 | public function set( $key , $value = null , $append = false ) 508 | { 509 | $key = preg_replace( '/^(\-+)/' , '' , $key ); 510 | if( !empty( $key ) ) 511 | { 512 | if( array_key_exists( $key , $this->FFmpegOptionsAS ) ) 513 | { 514 | $key = $this->FFmpegOptionsAS[ $key ]; 515 | } 516 | if( $append === false ) 517 | { 518 | $this->options[ $key ] = $value; 519 | }else{ 520 | if( !array_key_exists( $key , $this->options ) ) 521 | { 522 | $this->options[ $key ] = array($value); 523 | }else if( !is_array( $this->options[ $key ] ) ) 524 | { 525 | $this->options[ $key ] = array($this->options[ $key ],$value); 526 | }else{ 527 | $this->options[ $key ][] = $value; 528 | } 529 | } 530 | } 531 | return $this; 532 | } 533 | /** 534 | * @param string $key 535 | * @return object Self 536 | */ 537 | public function _unset( $key ) 538 | { 539 | if( array_key_exists( $key , $this->options ) ) 540 | { 541 | unset( $this->options[ $key ] ) ; 542 | } 543 | return $this; 544 | } 545 | /** 546 | * @return object Self 547 | * @access public 548 | */ 549 | public function grayScale( ) 550 | { 551 | return $this->set('pix_fmt','gray'); 552 | } 553 | 554 | /** 555 | * @param string $level 556 | * @return object 557 | * @access public 558 | */ 559 | public function logLevel( $level = "verbose" ) 560 | { 561 | $level = strtolower( $level ); 562 | if( in_array( $level , array("quiet","panic","fatal","error","warning","info","verbose","debug") ) ) 563 | { 564 | return $this->set('loglevel',$level ); 565 | }else{ 566 | trigger_error( "The option does not valid in loglevel" ); 567 | } 568 | } 569 | } 570 | --------------------------------------------------------------------------------