- sfValidatedFile.class.php
- class sfValidatedFile
- {
- protected
- $originalName = '',
- $tempName = '',
- $savedName = null,
- $type = '',
- $size = 0,
- $path = null;
-
- public function __construct($originalName, $type, $tempName, $size, $path = null)
- {
- $this->originalName = $originalName;
- $this->tempName = $tempName;
- $this->type = $type;
- $this->size = $size;
- $this->path = $path;
- }
-
- public function __toString()
- {
- return null === $this->savedName ? '' : $this->savedName;
- }
-
- public function save($file = null, $fileMode = 0666, $create = true, $dirMode = 0777)
- {
- if (null === $file)
- {
- $file = $this->generateFilename();
- }
- if ($file[0] != '/' && $file[0] != '\\' && !(strlen($file) > 3 && ctype_alpha($file[0]) && $file[1] == ':' && ($file[2] == '\\' || $file[2] == '/')))
- {
- if (null === $this->path)
- {
- throw new RuntimeException('You must give a "path" when you give a relative file name.');
- }
- $file = $this->path.DIRECTORY_SEPARATOR.$file;
- }
-
- $directory = dirname($file);
- if (!is_readable($directory))
- {
- if ($create && !@mkdir($directory, $dirMode, true))
- {
-
- throw new Exception(sprintf('Failed to create file upload directory "%s".', $directory));
- }
-
- chmod($directory, $dirMode);
- }
- if (!is_dir($directory))
- {
-
- throw new Exception(sprintf('File upload path "%s" exists, but is not a directory.', $directory));
- }
- if (!is_writable($directory))
- {
-
- throw new Exception(sprintf('File upload path "%s" is not writable.', $directory));
- }
-
- copy($this->getTempName(), $file);
-
- chmod($file, $fileMode);
- $this->savedName = $file;
- return null === $this->path ? $file : str_replace($this->path.DIRECTORY_SEPARATOR, '', $file);
- }
-
- public function generateFilename()
- {
- return sha1($this->getOriginalName().rand(11111, 99999)).$this->getExtension($this->getOriginalExtension());
- }
-
- public function getPath()
- {
- return $this->path;
- }
-
- public function getExtension($default = '')
- {
- return $this->getExtensionFromType($this->type, $default);
- }
-
- public function getOriginalExtension($default = '')
- {
- return (false === $pos = strrpos($this->getOriginalName(), '.')) ? $default : substr($this->getOriginalName(), $pos);
- }
-
- public function isSaved()
- {
- return null !== $this->savedName;
- }
-
- public function getSavedName()
- {
- return $this->savedName;
- }
-
- public function getOriginalName()
- {
- return $this->originalName;
- }
-
- public function getTempName()
- {
- return $this->tempName;
- }
-
- public function getType()
- {
- return $this->type;
- }
-
- public function getSize()
- {
- return $this->size;
- }
-
- protected function getExtensionFromType($type, $default = '')
- {
- static $extensions = array(
- 'application/andrew-inset' => 'ez',
- 'application/appledouble' => 'base64',
- 'application/applefile' => 'base64',
- 'application/commonground' => 'dp',
- 'application/cprplayer' => 'pqi',
- 'application/dsptype' => 'tsp',
- 'application/excel' => 'xls',
- 'application/font-tdpfr' => 'pfr',
- 'application/futuresplash' => 'spl',
- 'application/hstu' => 'stk',
- 'application/hyperstudio' => 'stk',
- 'application/javascript' => 'js',
- 'application/mac-binhex40' => 'hqx',
- 'application/mac-compactpro' => 'cpt',
- 'application/mbed' => 'mbd',
- 'application/mirage' => 'mfp',
- 'application/msword' => 'doc',
- 'application/ocsp-request' => 'orq',
- 'application/ocsp-response' => 'ors',
- 'application/octet-stream' => 'bin',
- 'application/oda' => 'oda',
- 'application/ogg' => 'ogg',
- 'application/pdf' => 'pdf',
- 'application/x-pdf' => 'pdf',
- 'application/pgp-encrypted' => '7bit',
- 'application/pgp-keys' => '7bit',
- 'application/pgp-signature' => 'sig',
- 'application/pkcs10' => 'p10',
- 'application/pkcs7-mime' => 'p7m',
- 'application/pkcs7-signature' => 'p7s',
- 'application/pkix-cert' => 'cer',
- 'application/pkix-crl' => 'crl',
- 'application/pkix-pkipath' => 'pkipath',
- 'application/pkixcmp' => 'pki',
- 'application/postscript' => 'ps',
- 'application/presentations' => 'shw',
- 'application/prs.cww' => 'cw',
- 'application/prs.nprend' => 'rnd',
- 'application/quest' => 'qrt',
- 'application/rtf' => 'rtf',
- 'application/sgml-open-catalog' => 'soc',
- 'application/sieve' => 'siv',
- 'application/smil' => 'smi',
- 'application/toolbook' => 'tbk',
- 'application/vnd.3gpp.pic-bw-large' => 'plb',
- 'application/vnd.3gpp.pic-bw-small' => 'psb',
- 'application/vnd.3gpp.pic-bw-var' => 'pvb',
- 'application/vnd.3gpp.sms' => 'sms',
- 'application/vnd.acucorp' => 'atc',
- 'application/vnd.adobe.xfdf' => 'xfdf',
- 'application/vnd.amiga.amu' => 'ami',
- 'application/vnd.blueice.multipass' => 'mpm',
- 'application/vnd.cinderella' => 'cdy',
- 'application/vnd.cosmocaller' => 'cmc',
- 'application/vnd.criticaltools.wbs+xml' => 'wbs',
- 'application/vnd.curl' => 'curl',
- 'application/vnd.data-vision.rdz' => 'rdz',
- 'application/vnd.dreamfactory' => 'dfac',
- 'application/vnd.fsc.weblauch' => 'fsc',
- 'application/vnd.genomatix.tuxedo' => 'txd',
- 'application/vnd.hbci' => 'hbci',
- 'application/vnd.hhe.lesson-player' => 'les',
- 'application/vnd.hp-hpgl' => 'plt',
- 'application/vnd.ibm.electronic-media' => 'emm',
- 'application/vnd.ibm.rights-management' => 'irm',
- 'application/vnd.ibm.secure-container' => 'sc',
- 'application/vnd.ipunplugged.rcprofile' => 'rcprofile',
- 'application/vnd.irepository.package+xml' => 'irp',
- 'application/vnd.jisp' => 'jisp',
- 'application/vnd.kde.karbon' => 'karbon',
- 'application/vnd.kde.kchart' => 'chrt',
- 'application/vnd.kde.kformula' => 'kfo',
- 'application/vnd.kde.kivio' => 'flw',
- 'application/vnd.kde.kontour' => 'kon',
- 'application/vnd.kde.kpresenter' => 'kpr',
- 'application/vnd.kde.kspread' => 'ksp',
- 'application/vnd.kde.kword' => 'kwd',
- 'application/vnd.kenameapp' => 'htke',
- 'application/vnd.kidspiration' => 'kia',
- 'application/vnd.kinar' => 'kne',
- 'application/vnd.llamagraphics.life-balance.desktop' => 'lbd',
- 'application/vnd.llamagraphics.life-balance.exchange+xml' => 'lbe',
- 'application/vnd.lotus-1-2-3' => 'wks',
- 'application/vnd.mcd' => 'mcd',
- 'application/vnd.mfmp' => 'mfm',
- 'application/vnd.micrografx.flo' => 'flo',
- 'application/vnd.micrografx.igx' => 'igx',
- 'application/vnd.mif' => 'mif',
- 'application/vnd.mophun.application' => 'mpn',
- 'application/vnd.mophun.certificate' => 'mpc',
- 'application/vnd.mozilla.xul+xml' => 'xul',
- 'application/vnd.ms-artgalry' => 'cil',
- 'application/vnd.ms-asf' => 'asf',
- 'application/vnd.ms-excel' => 'xls',
- 'application/vnd.ms-excel.sheet.macroenabled.12' => 'xlsm',
- 'application/vnd.ms-lrm' => 'lrm',
- 'application/vnd.ms-powerpoint' => 'ppt',
- 'application/vnd.ms-project' => 'mpp',
- 'application/vnd.ms-tnef' => 'base64',
- 'application/vnd.ms-works' => 'base64',
- 'application/vnd.ms-wpl' => 'wpl',
- 'application/vnd.mseq' => 'mseq',
- 'application/vnd.nervana' => 'ent',
- 'application/vnd.nokia.radio-preset' => 'rpst',
- 'application/vnd.nokia.radio-presets' => 'rpss',
- 'application/vnd.oasis.opendocument.text' => 'odt',
- 'application/vnd.oasis.opendocument.text-template' => 'ott',
- 'application/vnd.oasis.opendocument.text-web' => 'oth',
- 'application/vnd.oasis.opendocument.text-master' => 'odm',
- 'application/vnd.oasis.opendocument.graphics' => 'odg',
- 'application/vnd.oasis.opendocument.graphics-template' => 'otg',
- 'application/vnd.oasis.opendocument.presentation' => 'odp',
- 'application/vnd.oasis.opendocument.presentation-template' => 'otp',
- 'application/vnd.oasis.opendocument.spreadsheet' => 'ods',
- 'application/vnd.oasis.opendocument.spreadsheet-template' => 'ots',
- 'application/vnd.oasis.opendocument.chart' => 'odc',
- 'application/vnd.oasis.opendocument.formula' => 'odf',
- 'application/vnd.oasis.opendocument.database' => 'odb',
- 'application/vnd.oasis.opendocument.image' => 'odi',
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx',
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => 'dotx',
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx',
- 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'pptx',
- 'application/vnd.palm' => 'prc',
- 'application/vnd.picsel' => 'efif',
- 'application/vnd.pvi.ptid1' => 'pti',
- 'application/vnd.quark.quarkxpress' => 'qxd',
- 'application/vnd.sealed.doc' => 'sdoc',
- 'application/vnd.sealed.eml' => 'seml',
- 'application/vnd.sealed.mht' => 'smht',
- 'application/vnd.sealed.ppt' => 'sppt',
- 'application/vnd.sealed.xls' => 'sxls',
- 'application/vnd.sealedmedia.softseal.html' => 'stml',
- 'application/vnd.sealedmedia.softseal.pdf' => 'spdf',
- 'application/vnd.seemail' => 'see',
- 'application/vnd.smaf' => 'mmf',
- 'application/vnd.sun.xml.calc' => 'sxc',
- 'application/vnd.sun.xml.calc.template' => 'stc',
- 'application/vnd.sun.xml.draw' => 'sxd',
- 'application/vnd.sun.xml.draw.template' => 'std',
- 'application/vnd.sun.xml.impress' => 'sxi',
- 'application/vnd.sun.xml.impress.template' => 'sti',
- 'application/vnd.sun.xml.math' => 'sxm',
- 'application/vnd.sun.xml.writer' => 'sxw',
- 'application/vnd.sun.xml.writer.global' => 'sxg',
- 'application/vnd.sun.xml.writer.template' => 'stw',
- 'application/vnd.sus-calendar' => 'sus',
- 'application/vnd.vidsoft.vidconference' => 'vsc',
- 'application/vnd.visio' => 'vsd',
- 'application/vnd.visionary' => 'vis',
- 'application/vnd.wap.sic' => 'sic',
- 'application/vnd.wap.slc' => 'slc',
- 'application/vnd.wap.wbxml' => 'wbxml',
- 'application/vnd.wap.wmlc' => 'wmlc',
- 'application/vnd.wap.wmlscriptc' => 'wmlsc',
- 'application/vnd.webturbo' => 'wtb',
- 'application/vnd.wordperfect' => 'wpd',
- 'application/vnd.wqd' => 'wqd',
- 'application/vnd.wv.csp+wbxml' => 'wv',
- 'application/vnd.wv.csp+xml' => '8bit',
- 'application/vnd.wv.ssp+xml' => '8bit',
- 'application/vnd.yamaha.hv-dic' => 'hvd',
- 'application/vnd.yamaha.hv-script' => 'hvs',
- 'application/vnd.yamaha.hv-voice' => 'hvp',
- 'application/vnd.yamaha.smaf-audio' => 'saf',
- 'application/vnd.yamaha.smaf-phrase' => 'spf',
- 'application/vocaltec-media-desc' => 'vmd',
- 'application/vocaltec-media-file' => 'vmf',
- 'application/vocaltec-talker' => 'vtk',
- 'application/watcherinfo+xml' => 'wif',
- 'application/wordperfect5.1' => 'wp5',
- 'application/x-123' => 'wk',
- 'application/x-7th_level_event' => '7ls',
- 'application/x-authorware-bin' => 'aab',
- 'application/x-authorware-map' => 'aam',
- 'application/x-authorware-seg' => 'aas',
- 'application/x-bcpio' => 'bcpio',
- 'application/x-bleeper' => 'bleep',
- 'application/x-bzip2' => 'bz2',
- 'application/x-cdlink' => 'vcd',
- 'application/x-chat' => 'chat',
- 'application/x-chess-pgn' => 'pgn',
- 'application/x-compress' => 'z',
- 'application/x-cpio' => 'cpio',
- 'application/x-cprplayer' => 'pqf',
- 'application/x-csh' => 'csh',
- 'application/x-cu-seeme' => 'csm',
- 'application/x-cult3d-object' => 'co',
- 'application/x-debian-package' => 'deb',
- 'application/x-director' => 'dcr',
- 'application/x-dvi' => 'dvi',
- 'application/x-envoy' => 'evy',
- 'application/x-futuresplash' => 'spl',
- 'application/x-gtar' => 'gtar',
- 'application/x-gzip' => 'gz',
- 'application/x-hdf' => 'hdf',
- 'application/x-hep' => 'hep',
- 'application/x-html+ruby' => 'rhtml',
- 'application/x-httpd-miva' => 'mv',
- 'application/x-httpd-php' => 'phtml',
- 'application/x-ica' => 'ica',
- 'application/x-imagemap' => 'imagemap',
- 'application/x-ipix' => 'ipx',
- 'application/x-ipscript' => 'ips',
- 'application/x-java-archive' => 'jar',
- 'application/x-java-jnlp-file' => 'jnlp',
- 'application/x-java-serialized-object' => 'ser',
- 'application/x-java-vm' => 'class',
- 'application/x-javascript' => 'js',
- 'application/x-koan' => 'skp',
- 'application/x-latex' => 'latex',
- 'application/x-mac-compactpro' => 'cpt',
- 'application/x-maker' => 'frm',
- 'application/x-mathcad' => 'mcd',
- 'application/x-midi' => 'mid',
- 'application/x-mif' => 'mif',
- 'application/x-msaccess' => 'mda',
- 'application/x-msdos-program' => 'com',
- 'application/x-msdownload' => 'base64',
- 'application/x-msexcel' => 'xls',
- 'application/x-msword' => 'doc',
- 'application/x-netcdf' => 'nc',
- 'application/x-ns-proxy-autoconfig' => 'pac',
- 'application/x-pagemaker' => 'pm5',
- 'application/x-perl' => 'pl',
- 'application/x-pn-realmedia' => 'rp',
- 'application/x-python' => 'py',
- 'application/x-quicktimeplayer' => 'qtl',
- 'application/x-rar-compressed' => 'rar',
- 'application/x-ruby' => 'rb',
- 'application/x-sh' => 'sh',
- 'application/x-shar' => 'shar',
- 'application/x-shockwave-flash' => 'swf',
- 'application/x-sprite' => 'spr',
- 'application/x-spss' => 'sav',
- 'application/x-spt' => 'spt',
- 'application/x-stuffit' => 'sit',
- 'application/x-sv4cpio' => 'sv4cpio',
- 'application/x-sv4crc' => 'sv4crc',
- 'application/x-tar' => 'tar',
- 'application/x-tcl' => 'tcl',
- 'application/x-tex' => 'tex',
- 'application/x-texinfo' => 'texinfo',
- 'application/x-troff' => 't',
- 'application/x-troff-man' => 'man',
- 'application/x-troff-me' => 'me',
- 'application/x-troff-ms' => 'ms',
- 'application/x-twinvq' => 'vqf',
- 'application/x-twinvq-plugin' => 'vqe',
- 'application/x-ustar' => 'ustar',
- 'application/x-vmsbackup' => 'bck',
- 'application/x-wais-source' => 'src',
- 'application/x-wingz' => 'wz',
- 'application/x-word' => 'base64',
- 'application/x-wordperfect6.1' => 'wp6',
- 'application/x-x509-ca-cert' => 'crt',
- 'application/x-zip-compressed' => 'zip',
- 'application/xhtml+xml' => 'xhtml',
- 'application/zip' => 'zip',
- 'audio/3gpp' => '3gpp',
- 'audio/amr' => 'amr',
- 'audio/amr-wb' => 'awb',
- 'audio/basic' => 'au',
- 'audio/evrc' => 'evc',
- 'audio/l16' => 'l16',
- 'audio/midi' => 'mid',
- 'audio/mpeg' => 'mp3',
- 'audio/prs.sid' => 'sid',
- 'audio/qcelp' => 'qcp',
- 'audio/smv' => 'smv',
- 'audio/vnd.audiokoz' => 'koz',
- 'audio/vnd.digital-winds' => 'eol',
- 'audio/vnd.everad.plj' => 'plj',
- 'audio/vnd.lucent.voice' => 'lvp',
- 'audio/vnd.nokia.mobile-xmf' => 'mxmf',
- 'audio/vnd.nortel.vbk' => 'vbk',
- 'audio/vnd.nuera.ecelp4800' => 'ecelp4800',
- 'audio/vnd.nuera.ecelp7470' => 'ecelp7470',
- 'audio/vnd.nuera.ecelp9600' => 'ecelp9600',
- 'audio/vnd.sealedmedia.softseal.mpeg' => 'smp3',
- 'audio/voxware' => 'vox',
- 'audio/x-aiff' => 'aif',
- 'audio/x-mid' => 'mid',
- 'audio/x-midi' => 'mid',
- 'audio/x-mpeg' => 'mp2',
- 'audio/x-mpegurl' => 'mpu',
- 'audio/x-pn-realaudio' => 'rm',
- 'audio/x-pn-realaudio-plugin' => 'rpm',
- 'audio/x-realaudio' => 'ra',
- 'audio/x-wav' => 'wav',
- 'chemical/x-csml' => 'csm',
- 'chemical/x-embl-dl-nucleotide' => 'emb',
- 'chemical/x-gaussian-cube' => 'cube',
- 'chemical/x-gaussian-input' => 'gau',
- 'chemical/x-jcamp-dx' => 'jdx',
- 'chemical/x-mdl-molfile' => 'mol',
- 'chemical/x-mdl-rxnfile' => 'rxn',
- 'chemical/x-mdl-tgf' => 'tgf',
- 'chemical/x-mopac-input' => 'mop',
- 'chemical/x-pdb' => 'pdb',
- 'chemical/x-rasmol' => 'scr',
- 'chemical/x-xyz' => 'xyz',
- 'drawing/dwf' => 'dwf',
- 'drawing/x-dwf' => 'dwf',
- 'i-world/i-vrml' => 'ivr',
- 'image/bmp' => 'bmp',
- 'image/cewavelet' => 'wif',
- 'image/cis-cod' => 'cod',
- 'image/fif' => 'fif',
- 'image/gif' => 'gif',
- 'image/ief' => 'ief',
- 'image/jp2' => 'jp2',
- 'image/jpeg' => 'jpg',
- 'image/jpm' => 'jpm',
- 'image/jpx' => 'jpf',
- 'image/pict' => 'pic',
- 'image/pjpeg' => 'jpg',
- 'image/png' => 'png',
- 'image/targa' => 'tga',
- 'image/tiff' => 'tif',
- 'image/vn-svf' => 'svf',
- 'image/vnd.dgn' => 'dgn',
- 'image/vnd.djvu' => 'djvu',
- 'image/vnd.dwg' => 'dwg',
- 'image/vnd.glocalgraphics.pgb' => 'pgb',
- 'image/vnd.microsoft.icon' => 'ico',
- 'image/vnd.ms-modi' => 'mdi',
- 'image/vnd.sealed.png' => 'spng',
- 'image/vnd.sealedmedia.softseal.gif' => 'sgif',
- 'image/vnd.sealedmedia.softseal.jpg' => 'sjpg',
- 'image/vnd.wap.wbmp' => 'wbmp',
- 'image/x-bmp' => 'bmp',
- 'image/x-cmu-raster' => 'ras',
- 'image/x-freehand' => 'fh4',
- 'image/x-png' => 'png',
- 'image/x-portable-anymap' => 'pnm',
- 'image/x-portable-bitmap' => 'pbm',
- 'image/x-portable-graymap' => 'pgm',
- 'image/x-portable-pixmap' => 'ppm',
- 'image/x-rgb' => 'rgb',
- 'image/x-xbitmap' => 'xbm',
- 'image/x-xpixmap' => 'xpm',
- 'image/x-xwindowdump' => 'xwd',
- 'message/external-body' => '8bit',
- 'message/news' => '8bit',
- 'message/partial' => '8bit',
- 'message/rfc822' => '8bit',
- 'model/iges' => 'igs',
- 'model/mesh' => 'msh',
- 'model/vnd.parasolid.transmit.binary' => 'x_b',
- 'model/vnd.parasolid.transmit.text' => 'x_t',
- 'model/vrml' => 'wrl',
- 'multipart/alternative' => '8bit',
- 'multipart/appledouble' => '8bit',
- 'multipart/digest' => '8bit',
- 'multipart/mixed' => '8bit',
- 'multipart/parallel' => '8bit',
- 'text/comma-separated-values' => 'csv',
- 'text/css' => 'css',
- 'text/html' => 'html',
- 'text/plain' => 'txt',
- 'text/prs.fallenstein.rst' => 'rst',
- 'text/richtext' => 'rtx',
- 'text/rtf' => 'rtf',
- 'text/sgml' => 'sgml',
- 'text/tab-separated-values' => 'tsv',
- 'text/vnd.net2phone.commcenter.command' => 'ccc',
- 'text/vnd.sun.j2me.app-descriptor' => 'jad',
- 'text/vnd.wap.si' => 'si',
- 'text/vnd.wap.sl' => 'sl',
- 'text/vnd.wap.wml' => 'wml',
- 'text/vnd.wap.wmlscript' => 'wmls',
- 'text/x-hdml' => 'hdml',
- 'text/x-setext' => 'etx',
- 'text/x-sgml' => 'sgml',
- 'text/x-speech' => 'talk',
- 'text/x-vcalendar' => 'vcs',
- 'text/x-vcard' => 'vcf',
- 'text/xml' => 'xml',
- 'ulead/vrml' => 'uvr',
- 'video/3gpp' => '3gp',
- 'video/dl' => 'dl',
- 'video/gl' => 'gl',
- 'video/mj2' => 'mj2',
- 'video/mpeg' => 'mpeg',
- 'video/quicktime' => 'mov',
- 'video/vdo' => 'vdo',
- 'video/vivo' => 'viv',
- 'video/vnd.fvt' => 'fvt',
- 'video/vnd.mpegurl' => 'mxu',
- 'video/vnd.nokia.interleaved-multimedia' => 'nim',
- 'video/vnd.objectvideo' => 'mp4',
- 'video/vnd.sealed.mpeg1' => 's11',
- 'video/vnd.sealed.mpeg4' => 'smpg',
- 'video/vnd.sealed.swf' => 'sswf',
- 'video/vnd.sealedmedia.softseal.mov' => 'smov',
- 'video/vnd.vivo' => 'vivo',
- 'video/x-fli' => 'fli',
- 'video/x-ms-asf' => 'asf',
- 'video/x-ms-wmv' => 'wmv',
- 'video/x-msvideo' => 'avi',
- 'video/x-sgi-movie' => 'movie',
- 'x-chemical/x-pdb' => 'pdb',
- 'x-chemical/x-xyz' => 'xyz',
- 'x-conference/x-cooltalk' => 'ice',
- 'x-drawing/dwf' => 'dwf',
- 'x-world/x-d96' => 'd',
- 'x-world/x-svr' => 'svr',
- 'x-world/x-vream' => 'vrw',
- 'x-world/x-vrml' => 'wrl',
- );
- return !$type ? $default : (isset($extensions[$type]) ? '.'.$extensions[$type] : $default);
- }
- }
Configuration
- debug
- xdebug
- logging
- cache
- compression
- tokenizer
- eaccelerator
- apc
- xcache
Request 
options:
path_info_key: PATH_INFO
path_info_array: SERVER
default_format: null
logging: '1'
relative_url_root: null
formats: { txt: text/plain, js: [application/javascript, application/x-javascript, text/javascript], css: text/css, json: [application/json, application/x-json], xml: [text/xml, application/xml, application/x-xml], rdf: application/rdf+xml, atom: application/atom+xml }
no_script_name: false
parameterHolder:
action: index
class: sfValidatedFile
method: ''
module: sfCodeView
attributeHolder:
sf_route: 'sfRoute Object()'
Response 
status:
code: 200
text: OK
options:
http_protocol: HTTP/1.1
logging: '1'
charset: utf-8
send_http_headers: false
content_type: 'text/html; charset=utf-8'
cookies: { }
httpHeaders:
Content-Type: 'text/html; charset=utf-8'
javascripts:
'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js': { }
/sfCodeViewPlugin/js/sfCodeViewPlugin.js: { }
stylesheets:
main.css: { }
/sfCodeViewPlugin/css/sfCodeViewPlugin.css: { }
metas: { }
httpMetas:
Content-Type: 'text/html; charset=utf-8'
User 
options:
auto_shutdown: false
culture: null
default_culture: en
use_flash: true
logging: '1'
timeout: 1800
attributeHolder:
symfony/user/sfUser/attributes: { history: [sfValidatedFile, sfUser, sfToolkit, sfTimerManager, sfTimer, sfTesterViewCache, sfTesterUser, sfTesterResponse, sfTesterRequest, sfTesterMailer] }
culture: en
Settings 
app_sfCodeViewPlugin_javascripts:
- /sfCodeViewPlugin/js/sfCodeViewPlugin.js
app_sfCodeViewPlugin_stylesheets:
- /sfCodeViewPlugin/css/sfCodeViewPlugin.css
mod_sfcodeview_enabled: true
mod_sfcodeview_view_class: sfPHP
sf_admin_module_web_dir: /sfDoctrinePlugin
sf_admin_web_dir: /sf/sf_admin
sf_app: frontend
sf_app_base_cache_dir: /www/redotheoffice/codeview/cache/frontend
sf_app_cache_dir: /www/redotheoffice/codeview/cache/frontend/dev
sf_app_config_dir: /www/redotheoffice/codeview/apps/frontend/config
sf_app_dir: /www/redotheoffice/codeview/apps/frontend
sf_app_i18n_dir: /www/redotheoffice/codeview/apps/frontend/i18n
sf_app_lib_dir: /www/redotheoffice/codeview/apps/frontend/lib
sf_app_module_dir: /www/redotheoffice/codeview/apps/frontend/modules
sf_app_template_dir: /www/redotheoffice/codeview/apps/frontend/templates
sf_apps_dir: /www/redotheoffice/codeview/apps
sf_cache: false
sf_cache_dir: /www/redotheoffice/codeview/cache
sf_charset: utf-8
sf_check_lock: false
sf_compressed: false
sf_config_cache_dir: /www/redotheoffice/codeview/cache/frontend/dev/config
sf_config_dir: /www/redotheoffice/codeview/config
sf_csrf_secret: 220ab365e581d678efc07c41371dbc49a1fdcec3
sf_data_dir: /www/redotheoffice/codeview/data
sf_debug: true
sf_default_culture: en
sf_enabled_modules:
- default
- sfCodeView
sf_environment: dev
sf_error_404_action: error404
sf_error_404_module: default
sf_error_reporting: 8191
sf_escaping_method: ESC_SPECIALCHARS
sf_escaping_strategy: true
sf_etag: false
sf_file_link_format: null
sf_i18n: false
sf_i18n_cache_dir: /www/redotheoffice/codeview/cache/frontend/dev/i18n
sf_lib_dir: /www/redotheoffice/codeview/lib
sf_log_dir: /www/redotheoffice/codeview/log
sf_logging_enabled: true
sf_login_action: login
sf_login_module: default
sf_module_cache_dir: /www/redotheoffice/codeview/cache/frontend/dev/modules
sf_module_disabled_action: disabled
sf_module_disabled_module: default
sf_no_script_name: false
sf_orm: doctrine
sf_plugins_dir: /www/redotheoffice/codeview/plugins
sf_root_dir: /www/redotheoffice/codeview
sf_secure_action: secure
sf_secure_module: default
sf_standard_helpers:
- Partial
- Cache
sf_symfony_lib_dir: /www/redotheoffice/lib/symfony/1.4/lib
sf_template_cache_dir: /www/redotheoffice/codeview/cache/frontend/dev/template
sf_test_cache_dir: /www/redotheoffice/codeview/cache/frontend/dev/test
sf_test_dir: /www/redotheoffice/codeview/test
sf_upload_dir: /www/redotheoffice/codeview/web/uploads
sf_use_database: true
sf_web_debug: true
sf_web_debug_web_dir: /sf/sf_web_debug
sf_web_dir: /www/redotheoffice/codeview/web
symfony.asset.javascripts_included: true
symfony.asset.stylesheets_included: true
Globals 
cookie:
symfony: igbg1vov0kr106fi7q336aqd75
env: { }
files: { }
get: { }
post: { }
server:
DOCUMENT_ROOT: /Library/WebServer/Documents
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: 'text/html,application/xhtml+xml,text/xml;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'
HTTP_ACCEPT_CHARSET: 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'
HTTP_ACCEPT_ENCODING: gzip
HTTP_ACCEPT_LANGUAGE: 'en-us,en;q=0.5'
HTTP_CACHE_CONTROL: no-cache
HTTP_CONNECTION: close
HTTP_COOKIE: symfony=igbg1vov0kr106fi7q336aqd75
HTTP_HOST: codeview.redotheoffice.com
HTTP_PRAGMA: no-cache
HTTP_USER_AGENT: 'CCBot/1.0 (+http://www.commoncrawl.org/bot.html)'
HTTP_X_CC_ID: ccc04-02
PATH: '/usr/bin:/bin:/usr/sbin:/sbin'
PATH_INFO: /sfCodeView/sfValidatedFile
PATH_TRANSLATED: 'redirect:/www/redotheoffice/codeview/web/index.php/sfValidatedFile'
PHP_SELF: /index.php/sfCodeView/sfValidatedFile
QUERY_STRING: ''
REMOTE_ADDR: 38.107.179.240
REMOTE_PORT: '39388'
REQUEST_METHOD: GET
REQUEST_TIME: 1337462889
REQUEST_URI: /index.php/sfCodeView/sfValidatedFile
SCRIPT_FILENAME: /www/redotheoffice/codeview/web/index.php
SCRIPT_NAME: /index.php
SERVER_ADDR: 192.168.0.108
SERVER_ADMIN: webmaster@weett.nl
SERVER_NAME: codeview.redotheoffice.com
SERVER_PORT: '80'
SERVER_PROTOCOL: HTTP/1.1
SERVER_SIGNATURE: ''
SERVER_SOFTWARE: 'Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 PHP/5.3.6'
session:
symfony/user/sfUser/attributes: { symfony/user/sfUser/attributes: { history: [sfUser, sfToolkit, sfTimerManager, sfTimer, sfTesterViewCache, sfTesterUser, sfTesterResponse, sfTesterRequest, sfTesterMailer, sfTesterForm] } }
symfony/user/sfUser/authenticated: false
symfony/user/sfUser/credentials: { }
symfony/user/sfUser/culture: en
symfony/user/sfUser/lastRequest: 1337462859
Php 
php: 5.3.6
os: 'Darwin Mac-mini-van-Sjoerd-de-Jong.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386'
extensions:
54: apache2handler
33: 'apc (3.1.7)'
8: bcmath
9: bz2
10: calendar
0: 'Core (5.3.6)'
11: ctype
56: curl
1: 'date (5.3.6)'
12: 'dom (20031129)'
2: ereg
42: 'exif (1.4 $Id: exif.c 308362 2011-02-15 14:02:26Z pajoye $)'
14: 'fileinfo (1.0.5-dev)'
15: 'filter (0.11.0)'
16: ftp
17: gd
18: gettext
13: 'hash (1.0)'
20: iconv
36: imap
57: 'intl (1.1.0)'
22: 'json (1.2.1)'
23: ldap
3: libxml
24: mbstring
58: mcrypt
59: 'memcache (3.0.4)'
60: 'memcached (1.0.1)'
71: mhash
61: 'mongo (1.1.4)'
62: mssql
29: 'mysql (1.0)'
27: 'mysqli (0.1)'
26: 'mysqlnd (mysqlnd 5.0.8-dev - 20102224 - $Revision: 308673 $)'
63: 'OAuth (1.0-dev)'
28: 'odbc (1.0)'
4: openssl
5: pcre
30: 'PDO (1.0.4dev)'
64: 'pdo_dblib (1.0.1)'
31: 'pdo_mysql (1.0.2)'
65: 'pdo_pgsql (1.0.2)'
32: 'pdo_sqlite (1.0.1)'
66: pgsql
55: 'Phar (2.0.1)'
34: posix
35: 'Reflection ($Revision: 307971 $)'
21: session
37: shmop
38: 'SimpleXML (0.1)'
39: soap
40: sockets
67: 'solr (0.9.11)'
19: 'SPL (0.2)'
41: 'SQLite (2.0-dev)'
6: 'sqlite3 (0.7-dev)'
25: 'standard (5.3.6)'
43: sysvmsg
44: sysvsem
45: sysvshm
46: 'tidy (2.0)'
47: 'tokenizer (0.1)'
68: 'uploadprogress (1.0.1)'
48: wddx
72: 'xdebug (2.2.0-dev)'
69: 'xhprof (0.9.2)'
49: xml
50: 'xmlreader (0.1)'
51: 'xmlrpc (0.51)'
52: 'xmlwriter (0.1)'
70: 'xsl (0.1)'
53: 'zip (1.9.1)'
7: 'zlib (1.1)'
Symfony 
version: 1.4.2-DEV
path: /www/redotheoffice/lib/symfony/1.4/lib
View Layer
Template: sfCodeView … indexSuccess.php 
Parameters:
$class (string)
$method (NULL)
$viewer (sfCodeViewer)
$history (array)
Logs
| # |
type |
message |
| 1 | sfPatternRouting | Match route "sfCodeView" (/sfCodeView/:class/:method) for /sfCodeView/sfValidatedFile with parameters array ( 'module' => 'sfCodeView', 'action' => 'index', 'class' => 'sfValidatedFile', 'method' => '',) |
| 2 | sfFilterChain | Executing filter "sfRenderingFilter" |
| 3 | sfFilterChain | Executing filter "sfExecutionFilter" |
| 4 | sfCodeViewActions | Call "sfCodeViewActions->executeIndex()" |
| 5 | sfPHPView | Render "sf_root_dir/plugins/sfCodeViewPlugin/modules/sfCodeView/templates/indexSuccess.php" |
| 6 | sfPHPView | Decorate content with "sf_app_dir/templates/layout.php" |
| 7 | sfPHPView | Render "sf_app_dir/templates/layout.php" |
| 8 | sfWebResponse | Send status "HTTP/1.1 200 OK" |
| 9 | sfWebResponse | Send header "Content-Type: text/html; charset=utf-8" |
Timers
| type | calls | time (ms) | time (%) |
|---|
| Configuration | 11 | 33.46 | 5 |
| Factories | 1 | 6.56 | 1 |
| Action "sfCodeView/index" | 1 | 359.39 | 58 |
| View "Success" for "sfCodeView/index" | 1 | 213.03 | 34 |
View php class code
Enter the name of a class you want to view in the toolbar and hit 'enter' to view its code, or click one of the available classes below.
User classes
- apps/frontend/config
- apps/frontend/lib
- config
- lib/form
- plugins/sfCodeViewPlugin/config
- plugins/sfCodeViewPlugin/lib
- plugins/sfCodeViewPlugin/modules/sfCodeView/actions
- plugins/sfCodeViewPlugin/modules/sfCodeView/lib
Symfony classes
- action
- addon
- autoload
- cache
- command
- config
- controller
- database
- debug
- escaper
- exception
- filter
- form/addon
- form
- generator
- i18n/Gettext
- i18n/extract
- i18n
- log
- mailer
- plugin
- request
- response
- routing
- storage
- task/app
- task/cache
- task/configure
- task/generator
- task/help
- task/i18n
- task/log
- task/plugin
- task/project
- task/project/validation
- task
- task/symfony
- task/test
- test
- user
- util
- validator/i18n
- validator
- view
- widget/i18n
- widget