Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezmediafile.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: ezmediafile.php 8138 2001-11-01 08:31:40Z ce $
5 //
6 // Definition of eZMediaFile class
7 //
8 // Created on: <24-Jul-2001 12:44:06 ce>
9 //
10 // This source file is part of Exponential Basic, publishing software.
11 //
12 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
13 //
14 // This program is free software; you can redistribute it and/or
15 // modify it under the terms of the GNU General Public License
16 // as published by the Free Software Foundation; either version 2
17 // of the License, or (at your option) any later version.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
27 //
28
31
64 //include_once( "kernel/classes/ezfile.php" );
65
66
67 class eZMediaFile extends eZFile
68 {
72 function __construct()
73 {
74
75 }
76
82 function isMedia()
83 {
84 if ( ereg( "media", $this->FileType ) )
85 {
86 $ret = true;
87 }
88 else
89 {
90 $ret = false;
91 }
92
93 return $ret;
94 }
95
105 function &information( $file, $use_default = false )
106 {
107 $ret = array();
108 $suffix = "";
109 if ( ereg( "\\.([a-zA-Z]+)$", $file, $regs ) )
110 {
111 // We got a suffix, make it lowercase and store it
112 $suffix = strtolower( $regs[1] );
113 }
114
115 // List of supported suffixes
116 $suffix_list = array( "mpg" => array( ".mpg", "video/mpeg" ),
117 "mpeg" => array( ".mpeg", "video/mpeg" ),
118 "avi" => array( ".avi", "video/avi" ),
119 "mov" => array( ".mov", "video/mov" ),
120 "swf" => array( ".swf", "application/x-shockwave-flash-" ),
121 "wmv" => array( ".wmv", "application/x-mplayer2" ),
122 "asf" => array( ".asf", "application/x-mplayer2" ),
123 "rm" => array( ".rm", "video/realaudio" ) );
124
125 $postfix = $suffix_list[$suffix];
126 $ret["suffix"] = $suffix;
127 $ret["dot-suffix"] = $postfix[0];
128 $ret["media-type"] = $postfix[1];
129 $ret["supported"] = is_array( $postfix );
130 if ( !$ret["supported"] and $use_default )
131 return eZMediaFile::defaultInformation();
132 return $ret;
133 }
134
140 function &defaultInformation()
141 {
142 $ret = array( "suffix" => "mpg",
143 "dot-suffix" => ".mpg",
144 "media-type" => "media/mpeg",
145 "supported" => false );
146 return $ret;
147 }
148 }
149
150 ?>
eZFile
Tool class which has convencience functions for files and directories.
Definition: ezfile.php:19
eZMediaFile
Definition: ezmediafile.php:68
eZMediaFile\__construct
__construct()
Definition: ezmediafile.php:72
eZMediaFile\isMedia
isMedia()
Definition: ezmediafile.php:82
eZMediaFile\defaultInformation
& defaultInformation()
Definition: ezmediafile.php:140
eZMediaFile\information
& information( $file, $use_default=false)
Definition: ezmediafile.php:105
$suffix
$suffix
Definition: ezfilemanager/user/filedownload.php:168
$file
$file
Definition: ezfilemanager/user/filedownload.php:35
$ret
$ret
Definition: ezsitemanager/admin/filelist.php:88
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.