本文整理汇总了PHP中throw_error函数的典型用法代码示例。如果您正苦于以下问题:PHP throw_error函数的具体用法?PHP throw_error怎么用?PHP throw_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了throw_error函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: loadPackages
function loadPackages()
{
include_once(LIMB_DIR . '/core/util/ini_support.inc.php');
$toolkit =& Limb :: toolkit();
$ini =& $toolkit->getINI('packages.ini');
$this->_packages = array();
$groups = $ini->getAll();
$packages = $ini->getOption('packages');
if (!count($packages))
return throw_error(new LimbException('no packages in package.ini!'));
foreach($packages as $package_path)
{
$package_data = array();
include($package_path . '/setup.php');
$this->_definePackageConstant($PACKAGE_NAME, $package_path);
$package_data['path'] = $package_path;
$package_data['name'] = $PACKAGE_NAME;
$this->_packages[] = $package_data;
}
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:29,代码来源:PackagesInfo.class.php
示例2: getClassId
function getClassId($object)
{
$toolkit =& Limb :: toolkit();
$db_table =& $toolkit->createDBTable('SysClass');
$class_name = $object->__class_name;
$rs =& $db_table->select(array('name' => $class_name));
$count = $rs->getTotalRowCount();
if ($count == 1)
{
$rs->rewind();
$record = $rs->current();
return $record->get('id');
}
elseif($count > 1)
{
return throw_error(new LimbException('there are more than 1 type found',
array('name' => $class_name)));
}
$insert_data['name'] = $class_name;
return $db_table->insert($insert_data);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:27,代码来源:ObjectMapper.class.php
示例3: run
public function run($sql, $data = array())
{
try {
$statement = $this->PDO->prepare($sql);
if (count($data)) {
foreach ($data as $key => $value) {
if (is_int($value)) {
$statement->bindValue(":" . $key, $value, PDO::PARAM_INT);
} else {
if (is_bool($value)) {
$statement->bindValue(":" . $key, $value, PDO::PARAM_BOOL);
} else {
if (is_null($value)) {
$statement->bindValue(":" . $key, $value, PDO::PARAM_NULL);
} else {
if (is_string($value)) {
$statement->bindValue(":" . $key, $value);
}
}
}
}
}
}
$statement->execute();
return $statement;
} catch (PDOException $e) {
throw_error("Query Error: " . $e->getMessage());
}
}
开发者ID:amriterry,项目名称:HelpNepal,代码行数:29,代码来源:QueryBuilder.php
示例4: resize
function resize($max_size)
{
$image_library =& $this->_getImageLibrary();
$media_manager =& $this->_getMediaManager();
$media_file_id = $this->getMediaFileId();
$input_file = $media_manager->getMediaFilePath($media_file_id);
$output_file = $this->_generateTempFile();
$input_file_type = $image_library->getImageType($this->getMimeType());
$output_file_type = $image_library->fallBackToAnySupportedType($input_file_type);
$image_library->setInputFile($input_file);
$image_library->setInputType($input_file_type);
$image_library->setOutputFile($output_file);
$image_library->setOutputType($output_file_type);
$image_library->resize(array('max_dimension' => $max_size));
//ugly!!!
$image_library->commit();
if (catch_error('LimbException', $e)) {
if (file_exists($output_file)) {
$this->_unlinkTempFile($output_file);
}
return throw_error($e);
}
$this->_updateDimensionsUsingFile($output_file);
$media_file_id = $media_manager->store($output_file);
$this->setMediaFileId($media_file_id);
$this->_unlinkTempFile($output_file);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:27,代码来源:ImageVariation.class.php
示例5: create
function create($library = 'gd', $dir = '')
{
if(defined('IMAGE_LIBRARY'))
$library = IMAGE_LIBRARY;
$image_class_name = 'image_' . $library;
if(isset($GLOBALS['global_' . $image_class_name]))
$obj =& $GLOBALS['global_' . $image_class_name];
else
$obj = null;
if(get_class($obj) != $image_class_name)
{
$dir = ($dir == '') ? LIMB_DIR . '/core/image/' : $dir;
if(!file_exists($dir . $image_class_name . '.class.php'))
return throw_error(new FileNotFoundException('image library not found', $dir . $image_class_name . '.class.php'));
include_once($dir . $image_class_name . '.class.php');
$obj = new $image_class_name();
$GLOBALS['global_' . $image_class_name] =& $obj;
}
return $obj;
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:27,代码来源:ImageFactory.class.php
示例6: run
function run(&$filter_chain, &$request, &$response)
{
$toolkit =& Limb :: toolkit();
$action_resolver =& $toolkit->getRequestResolver('action');
$service_resolver =& $toolkit->getRequestResolver('service');
if(!is_object($service_resolver) || !is_object($action_resolver))
return throw_error(new LimbException('request resolvers not set'));
$service =& $service_resolver->resolve($request);
if(!$action =& $action_resolver->resolve($request))
{
$toolkit->setService($service);
}
elseif($service->actionExists($action))
{
$service->setCurrentAction($action);
$toolkit->setService($service);
}
else
{
$service404 = new Service('404');
$toolkit->setService($service404);
}
$filter_chain->next();
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:28,代码来源:ServiceActionMappingFilter.class.php
示例7: preParse
function preParse()
{
if (!isset($this->attributes['name'])) {
return throw_error(new WactException('missing required attribute', array('tag' => $this->tag, 'attribute' => 'name', 'file' => $this->source_file, 'line' => $this->starting_line_no)));
}
$this->const = $this->attributes['name'];
return PARSER_REQUIRE_PARSING;
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:8,代码来源:ConstOptional.tag.php
示例8: getFileResolver
function & getFileResolver($resolver_name)
{
global $LIMB_FILE_RESOLVERS;
if(isset($LIMB_FILE_RESOLVERS[$resolver_name]))
return $LIMB_FILE_RESOLVERS[$resolver_name];
else
return throw_error(new LimbException('unknown file resolver',
array('resolver' => $resolver_name)));
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:9,代码来源:file_resolvers_registry.inc.php
示例9: resolve
function resolve($class_path, $params = array())
{
if(file_exists(LIMB_DIR . '/core/actions/' . $class_path . '.class.php'))
$full_path = LIMB_DIR . '/core/actions/' . $class_path . '.class.php';
else
return throw_error(new FileNotFoundException('action not found', $class_path));
return $full_path;
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:9,代码来源:TestsActionFileResolver.class.php
示例10: getCurrentDateTime
/**
* Created by PhpStorm.
* User: Asus
* Date: 5/30/2015
* Time: 9:57 AM
*/
function getCurrentDateTime()
{
global $timezone;
try {
$now = new DateTime("now", new DateTimeZone($timezone['timezone']));
} catch (Exception $e) {
throw_error($e->getMessage());
}
return $now->format("Y-m-d H:i:s");
}
开发者ID:amriterry,项目名称:HelpNepal,代码行数:16,代码来源:datetime.helper.php
示例11: get_slow_page_data
function get_slow_page_data()
{
global $xhprofModelObject;
global $game_cfg;
$result = $xhprofModelObject->generic_execute_get_query_detail('get_slow_page_data', array("slow_page_table" => $game_cfg["slow_page_table"]));
if (!$result) {
throw_error("Internal plumping error, slow db could not be owned (mined)");
}
return $result;
}
开发者ID:shourya07,项目名称:zperfmon,代码行数:10,代码来源:slow-page.php
示例12: _applyAccessPolicy
function _applyAccessPolicy($object, $action)
{
$access_policy = new AccessPolicy();
$access_policy->applyAccessTemplates($object, $action);
if (catch_error('LimbException', $e)) {
MessageBox::writeNotice("Access template of " . get_class($object) . " for action '{$action}' not defined!!!");
} elseif (catch_error('LimbException', $e)) {
return throw_error($e);
}
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:MultiTogglePublishStatusAction.class.php
示例13: load
function load()
{
if(!file_exists($this->file_path))
return throw_error(new FileNotFoundException('ini file not found', $this->file_path));
if ($this->use_cache)
$this->_loadCache();
else
$this->_parse($this->file_path);
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:Ini.class.php
示例14: preParse
function preParse()
{
if (!isset($this->attributes['tab_id'])) {
return throw_error(new WactException('missing required attribute', array('tag' => $this->tag, 'attribute' => 'id', 'file' => $this->source_file, 'line' => $this->starting_line_no)));
}
if (!in_array($this->attributes['tab_id'], $this->parent->parent->tabs)) {
return throw_error(new WactException('invalid attribute value', array('tag' => $this->tag, 'attribute' => 'tab_id', 'description' => 'tab_id not declared in <tab_item:label> tag', 'file' => $this->source_file, 'line' => $this->starting_line_no)));
}
return PARSER_REQUIRE_PARSING;
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:TabItemContent.tag.php
示例15: resolve
function resolve($file_name, $params = array())
{
if (file_exists(LIMB_DIR . '/tests/settings/' . $file_name))
$dir = LIMB_DIR . '/tests/settings/';
elseif (file_exists(LIMB_DIR . '/settings/' . $file_name))
$dir = LIMB_DIR . '/settings/';
else
return throw_error(new FileNotFoundException('ini file not found', $file_name));
return $dir . $file_name;
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:11,代码来源:TestsIniFileResolver.class.php
示例16: _updateObjectOperation
function _updateObjectOperation()
{
$this->object->set('files_data', $_FILES[$this->name]);
$this->object->updateVariations();
if (catch_error('SQLException', $e)) {
return throw_error($e);
} elseif (catch_error('LimbException', $e)) {
MessageBox::writeNotice('Some variations were not resized');
} elseif (catch_error('LimbException', $e)) {
return throw_error($e);
}
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:12,代码来源:EditVariationsAction.class.php
示例17: _getIni
function & _getIni()
{
if(is_object($this->ini))
return $this->ini;
$toolkit =& Limb :: toolkit();
$this->ini =& $toolkit->getIni($this->name . '.service.ini', 'service');
if(!is_object($this->ini))
return throw_error(new LimbException($this->name . '.service.ini not found'));//FIX
return $this->ini;
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:13,代码来源:Service.class.php
示例18: fallBackToAnySupportedType
function fallBackToAnySupportedType($type)
{
if ($this->isTypeCreateSupported($type))
return $type;
if ($this->isTypeCreateSupported('PNG'))
return 'PNG';
if ($this->isTypeCreateSupported('JPEG'))
return 'JPEG';
return throw_error(new LimbException('no file type supported'));
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:13,代码来源:ImageLibrary.class.php
示例19: resolve
function resolve($file_name, $params = array())
{
if(!isset($params[0]))
$locale_id = DEFAULT_CONTENT_LOCALE_ID;
else
$locale_id = $params[0];
if(file_exists(LIMB_DIR . '/tests/i18n/' . $file_name . '_' . $locale_id . '.ini'))
$dir = LIMB_DIR . '/tests/i18n/';
else
return throw_error(new FileNotFoundException('strings file not found', $file_name, array('locale_id' => $locale_id)));
return $dir . $file_name . '_' . $locale_id . '.ini';
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:14,代码来源:TestsStringsFileResolver.class.php
示例20: store
function store($disk_file_path)
{
if (!file_exists($disk_file_path)) {
return throw_error(new FileNotFoundException('file not found', $disk_file_path));
}
srand(time());
$media_id = md5(uniqid(rand()));
Fs::mkdir(MEDIA_DIR);
$media_file = $this->getMediaFilePath($media_id);
if (!copy($disk_file_path, $media_file)) {
return throw_error(new IOException('copy failed', array('dst' => $media_file, 'src' => $disk_file_path)));
}
return $media_id;
}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:14,代码来源:MediaManager.class.php
注:本文中的throw_error函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论