本文整理汇总了PHP中Library类的典型用法代码示例。如果您正苦于以下问题:PHP Library类的具体用法?PHP Library怎么用?PHP Library使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Library类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getObjectStructure
static function getObjectStructure()
{
global $user;
//Load Libraries for lookup values
$library = new Library();
$library->orderBy('displayName');
if ($user->hasRole('libraryAdmin')) {
$homeLibrary = Library::getPatronHomeLibrary();
$library->libraryId = $homeLibrary->libraryId;
}
$library->find();
$libraryList = array();
while ($library->fetch()) {
$libraryList[$library->libraryId] = $library->displayName;
}
require_once ROOT_DIR . '/sys/Browse/BrowseCategory.php';
$browseCategories = new BrowseCategory();
$browseCategories->orderBy('label');
$browseCategories->find();
$browseCategoryList = array();
while ($browseCategories->fetch()) {
$browseCategoryList[$browseCategories->textId] = $browseCategories->label . " ({$browseCategories->textId})";
}
$structure = array('id' => array('property' => 'id', 'type' => 'label', 'label' => 'Id', 'description' => 'The unique id of the hours within the database'), 'libraryId' => array('property' => 'libraryId', 'type' => 'enum', 'values' => $libraryList, 'label' => 'Library', 'description' => 'A link to the library which the location belongs to'), 'browseCategoryTextId' => array('property' => 'browseCategoryTextId', 'type' => 'enum', 'values' => $browseCategoryList, 'label' => 'Browse Category', 'description' => 'The browse category to display '), 'weight' => array('property' => 'weight', 'type' => 'numeric', 'label' => 'Weight', 'weight' => 'Defines how lists are sorted within the widget. Lower weights are displayed to the left of the screen.', 'required' => true));
foreach ($structure as $fieldName => $field) {
$field['propertyOld'] = $field['property'] . 'Old';
$structure[$fieldName] = $field;
}
return $structure;
}
开发者ID:victorfcm,项目名称:VuFind-Plus,代码行数:30,代码来源:LibraryBrowseCategory.php
示例2: Main
public static function Main()
{
ob_start();
$lib = new Library();
$lib->f();
var_dump(new LibX());
$x = 1;
if ($x) {
class Q
{
}
}
eval('
class P extends Q { }
');
eval('
class A extends C { }
class D extends A { }
class E extends LibX { }
');
class F extends P
{
}
var_dump(new Q(), new P(), new A(), new D(), new E(), new F());
$out = ob_get_contents();
ob_end_clean();
$EXPECTED = "object(LibX)(0) {\r\n}\r\nobject(Q)(0) {\r\n}\r\nobject(P)(0) {\r\n}\r\nobject(A)(0) {\r\n}\r\nobject(D)(0) {\r\n}\r\nobject(E)(0) {\r\n}\r\nobject(F)(0) {\r\n}\r\n";
echo $out == $EXPECTED ? "OK" : "ERROR", "\n";
}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:29,代码来源:Test1.php
示例3: showfileAction
public function showfileAction()
{
$strContent = null;
$strPathFile = $this->params()->fromRoute('path');
if (!empty($strPathFile)) {
$strPathFile = base64_decode($strPathFile);
$booForceDownload = strtolower($this->params()->fromRoute('force_download'));
if (!empty($booForceDownload)) {
$booForceDownload = base64_decode($booForceDownload);
}
if (file_exists($strPathFile)) {
$library = new Library();
if ($booForceDownload == 'true' || stripos($library->getMimeContentFromFile($strPathFile), 'image/') === false) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . end(explode('/', $strPathFile)) . '"');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($strPathFile));
} else {
header('Content-Type: ' . $library->getMimeContentFromFile($strPathFile) . ';');
}
readfile($strPathFile);
} else {
$strContent = 'Arquivo inexistente!';
}
} else {
$strContent = 'Parâmetros incorretos!';
}
return $this->getViewClearContent($strContent);
}
开发者ID:phtfao,项目名称:Layout,代码行数:33,代码来源:ScriptController.php
示例4: checkoutValidaiton
public function checkoutValidaiton()
{
$validation = new Library();
$validation->getValidationOk();
if ($validation->getValidationOk()) {
echo "Success";
} else {
echo "Fail";
}
}
开发者ID:sunilmnagre,项目名称:Learning,代码行数:10,代码来源:Pages.php
示例5: getLibraryName
function getLibraryName()
{
if ($this->libraryId == -1) {
return 'Shared Digital Collection';
} else {
$library = new Library();
$library->libraryId = $this->libraryId;
$library->find(true);
return $library->displayName;
}
}
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:11,代码来源:EContentAvailability.php
示例6: return_book
public function return_book($copyId)
{
include 'connection.php';
$lib = new Library();
$lib->addCopy($copyId);
date_default_timezone_set('America/Chicago');
$date = date('Y-m-d');
$sql = "UPDATE Group8_loanHistory SET returned='" . $date . "' WHERE copyId = '" . $copyId . "' and username = '" . $this->username . "'";
//$sql = "delete from Group8_loanHistory where copyId = '".$copyId."' and username = '".$this->username."' and returned is null";
if ($conn->query($sql) === false) {
die('Invalid query: ' . $conn->error);
}
include 'close_connection.php';
}
开发者ID:MichaelWeems,项目名称:Miscellaneous_Projects,代码行数:14,代码来源:student.php
示例7: addRouteRecursively
/**
* The recursive method powering addRouteFor(Request).
*
* @param array Part of a path in reverse order.
* @param int Current index of path part array - decrements with each step.
* @param Route The route being added
*
* @return FindRouteResult
*/
private function addRouteRecursively(&$pathParts, $index, $route)
{
// Base Case
if ($index < 0) {
foreach ($route->methods as $method) {
if (isset($this->m[$method])) {
Library::import('recess.framework.routing.DuplicateRouteException');
throw new DuplicateRouteException($method . ' ' . str_replace('//', '/', $route->path), $route->fileDefined, $route->lineDefined);
}
$this->m[$method] = new Rt($route);
}
return;
}
$nextPart = $pathParts[$index];
if ($nextPart[0] != '$') {
$childrenArray =& $this->s;
$nextKey = $nextPart;
$isParam = false;
} else {
$childrenArray =& $this->p;
$nextKey = substr($nextPart, 1);
$isParam = true;
}
if (!isset($childrenArray[$nextKey])) {
$child = new RtNode();
if ($isParam) {
$child->c = $nextKey;
}
$childrenArray[$nextKey] = $child;
} else {
$child = $childrenArray[$nextKey];
}
$child->addRouteRecursively($pathParts, $index - 1, $route);
}
开发者ID:amitshukla30,项目名称:recess,代码行数:43,代码来源:RtNode.class.php
示例8: isValidForUser
function isValidForUser($locationCode, $eContentFieldData)
{
$sharing = $this->getSharing($locationCode, $eContentFieldData);
if ($sharing == 'shared') {
$searchLibrary = Library::getSearchLibrary();
if ($searchLibrary == null || $searchLibrary->econtentLocationsToInclude == 'all' || strlen($searchLibrary->econtentLocationsToInclude) == 0 || strpos($searchLibrary->econtentLocationsToInclude, $locationCode) !== FALSE) {
return true;
} else {
return false;
}
} else {
if ($sharing == 'library') {
$searchLibrary = Library::getSearchLibrary();
if ($searchLibrary == null || $searchLibrary->includeOutOfSystemExternalLinks || strlen($searchLibrary->ilsCode) > 0 && strpos($locationCode, $searchLibrary->ilsCode) === 0) {
return true;
} else {
return false;
}
} else {
$searchLibrary = Library::getSearchLibrary();
$searchLocation = Location::getSearchLocation();
if ($searchLibrary->includeOutOfSystemExternalLinks || strpos($locationCode, $searchLocation->code) === 0) {
return true;
} else {
return false;
}
}
}
}
开发者ID:victorfcm,项目名称:VuFind-Plus,代码行数:29,代码来源:ExternalEContentDriver.php
示例9: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
// Using factory
// Getting an instance of a model User example
$user = ModelFactory::getInstance('User');
// Getting an instance of a Library String
$stringLib = LibraryFactory::getInstance('String');
// Getting an instance of a Filter DateRange
$dateRange = FilterFactory::getInstance('DateRange');
// Getting an instance of a Type User
$userType = TypeFactory::getInstance('User');
// Perform an access check
AccessCheckFactory::getInstance('User')->canAccess(auth()->user()->id, 'view');
// Using facade
// Getting an instance of a model User example
$user = \Model::getInstance('User');
// Getting an instance of a Library String
$stringLib = \Library::getInstance('String');
// Getting an instance of a Filter DateRange
$dateRange = \Filter::getInstance('DateRange');
// Getting an instance of a Type User
$userType = \Type::getInstance('User');
// Passing data to view example
$this->view->fullname = auth()->user()->fullname;
// Perform an access check
\AccessCheck::getInstance('User')->canAccess(1, 'view');
return $this->view('dashboard');
}
开发者ID:atudz,项目名称:gorabelframework,代码行数:33,代码来源:MainPresenter.php
示例10: thumb
public function thumb($uniqueId, $width, $height, $method, $filename)
{
// only image can get thumbnails, existing files and valid resize method name
if (!$this->MediaFile->isImage() || !($ImageFile = $this->MediaFile->file()) || !method_exists($ImageFile, $method)) {
return false;
}
$filename = STATIC_DIR . 'img/public/' . $uniqueId . '/' . $width . 'x' . $height . '/' . $method . '/' . $filename;
$width = (int) $width > 0 ? (int) $width : null;
$height = (int) $height > 0 ? (int) $height : null;
// resize Image
try {
$ImageFile->{$method}($width, $height, true, false);
// apply sharpen filter if available and image is small
if (function_exists('imageconvolution') && $width < 400 && $height < 400) {
Library::load('ephFrame.lib.file.image.ImageSharpenFilter');
$sharpenFilter = new ImageSharpenFilter();
$ImageFile->applyFilter($sharpenFilter);
}
} catch (ImageToLargeToLoadException $e) {
$ImageFile = new Image($width, $height);
$ImageFile->backgroundColor('ffffe0')->border('e6db55', 1, 0);
$ImageFile->text(Image::CENTERED, Image::CENTERED, 'image to large to' . LF . 'create thumbnail', 'b8ad4c', 1);
}
$ImageFile->saveAs($filename, $this->thumbQuality);
$this->redirect(WEBROOT . $filename);
}
开发者ID:Ephigenia,项目名称:harrison,代码行数:26,代码来源:MediaFileController.php
示例11: expand
protected function expand($class, $reflection, $descriptor)
{
if (is_array($this->values[0])) {
$this->httpMethods = $this->values[0];
} else {
$this->httpMethods = array($this->values[0]);
}
if (isset($this->values[1])) {
$this->path = $this->values[1];
}
$controller = Library::getFullyQualifiedClassName($class);
$controllerMethod = $reflection->getName();
if (strpos($this->path, Library::pathSeparator) === 0) {
// Absolute Route
$route = new Route($controller, $controllerMethod, $this->httpMethods, $this->path);
$descriptor->methodUrls[$controllerMethod] = $this->path;
} else {
// Relative Route
$route = new Route($controller, $controllerMethod, $this->httpMethods, $descriptor->routesPrefix . $this->path);
$descriptor->methodUrls[$controllerMethod] = $descriptor->routesPrefix . $this->path;
}
$route->fileDefined = $reflection->getFileName();
$route->lineDefined = $reflection->getStartLine();
$descriptor->routes[] = $route;
}
开发者ID:amitshukla30,项目名称:recess,代码行数:25,代码来源:RouteAnnotation.class.php
示例12: __construct
public function __construct()
{
Cowl::timer('cowl init');
@session_start();
// I know that the @-notation is frowned upon, but adding it to session_start saves us unnecessary warnings
Cache::setDir(COWL_CACHE_DIR);
Current::initialize(COWL_DIR);
if (COWL_CLI) {
$this->parseCLIPath();
} else {
$this->parseRequestPath();
}
Cowl::timer('cowl set defaults');
// Get and set all directories for various things.
list($commands_dir, $model_dir, $validators_dir, $library_dir, $view_dir, $helpers_dir, $helpers_app_dir, $drivers_dir, $app_dir, $view_layout_dir, $validator_error_messages, $lang) = Current::$config->gets('paths.commands', 'paths.model', 'paths.validators', 'paths.library', 'paths.view', 'paths.helpers', 'paths.helpers_app', 'paths.drivers', 'paths.app', 'paths.layouts', 'paths.validator_messages', 'lang');
Controller::setDir($commands_dir);
DataMapper::setMappersDir($model_dir);
DataMapper::setObjectsDir($model_dir);
Validator::setPath($validators_dir);
Validator::loadStrings($validator_error_messages, $lang);
Templater::setBaseDir($view_dir);
Templater::setLayoutDir($view_layout_dir);
Library::setPath($library_dir);
Helpers::setPath($helpers_dir);
Helpers::setAppPath($helpers_app_dir);
Database::setPath($drivers_dir);
StaticServer::setDir($app_dir);
Cowl::timerEnd('cowl set defaults');
Cowl::timer('cowl plugins load');
Current::$plugins = new Plugins();
Cowl::timerEnd('cowl plugins load');
// Load default helper
Helpers::load('standard', 'form');
Cowl::timerEnd('cowl init');
}
开发者ID:erkie,项目名称:cowl,代码行数:35,代码来源:frontcontroller.php
示例13: __construct
public function __construct()
{
$library = Library::getActive();
if (is_object($library)) {
$this->controller = $library->getController();
}
}
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:7,代码来源:Service.php
示例14: isValidForUser
function isValidForUser($locationCode, $eContentFieldData)
{
$sharing = $this->getSharing($locationCode, $eContentFieldData);
if ($sharing == 'shared') {
return true;
} else {
if ($sharing == 'library') {
$searchLibrary = Library::getSearchLibrary();
if ($searchLibrary == null || strlen($searchLibrary->ilsCode) > 0 && strpos($locationCode, $searchLibrary->ilsCode) === 0) {
global $user;
if ($user) {
$patronHomeLibrary = Library::getPatronHomeLibrary();
return $patronHomeLibrary == null || strlen($patronHomeLibrary->ilsCode) > 0 && strpos($locationCode, $patronHomeLibrary->ilsCode) === 0;
} else {
return true;
}
} else {
return false;
}
} else {
//Just share with the specific location
$searchLocation = Location::getSearchLocation();
if (!$searchLocation) {
return true;
} elseif (strpos($locationCode, $searchLocation->code) === 0) {
return true;
} else {
return false;
}
}
}
}
开发者ID:victorfcm,项目名称:VuFind-Plus,代码行数:32,代码来源:RestrictedEContentDriver.php
示例15: getObjectStructure
static function getObjectStructure()
{
$library = new Library();
$library->orderBy('displayName');
$library->find();
$libraryList = array();
while ($library->fetch()) {
$libraryList[$library->libraryId] = $library->displayName;
}
$structure = array('id' => array('property' => 'id', 'type' => 'label', 'label' => 'Id', 'description' => 'The unique id of the holiday within the database'), 'libraryId' => array('property' => 'libraryId', 'type' => 'enum', 'values' => $libraryList, 'label' => 'Library', 'description' => 'A link to the library'), 'date' => array('property' => 'date', 'type' => 'date', 'label' => 'Date', 'description' => 'The date of a holiday.', 'required' => true), 'name' => array('property' => 'name', 'type' => 'text', 'label' => 'Holiday Name', 'description' => 'The name of a holiday'));
foreach ($structure as $fieldName => $field) {
$field['propertyOld'] = $field['property'] . 'Old';
$structure[$fieldName] = $field;
}
return $structure;
}
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:16,代码来源:Holiday.php
示例16: __construct
/**
* Initialize the plugin by loading admin scripts & styles and adding a
* settings page and menu.
*
* @since 1.0.0
*/
private function __construct()
{
$plugin = Library::get_instance();
$this->plugin_slug = $plugin->get_plugin_slug();
add_action('init', array($this, 'register'));
/* Fire our meta box setup function on the post editor screen. */
add_action('load-post.php', array($this, 'library_meta_boxes_setup'));
}
开发者ID:bbttxu,项目名称:library,代码行数:14,代码来源:class-library-admin.php
示例17: save
public function save($quality = 100)
{
$contents = Library::getContentsFromGDResource($this->resource, $this->format, $quality);
$format = $this->format;
$extension = $this->getExtensionFromFormat($format);
$mime = $this->getMimeFromFormat($format);
return array('contents' => $contents, 'format' => $format, 'extension' => $extension, 'mime' => $mime);
}
开发者ID:feeel1,项目名称:akina,代码行数:8,代码来源:Output.php
示例18: handleEdit
public function handleEdit()
{
$book = Library::findOrFail(Input::get('library'));
$book->book_name = Input::get('book_name');
$book->book_copy = Input::get('copy');
$book->updated_by_id = Auth::id();
$book->update();
return Redirect::action('AdminLibraryController@index')->with('flash_edit_success', 'Hurray!You have updated a new Book');
}
开发者ID:BDMADE,项目名称:DBA,代码行数:9,代码来源:AdminLibraryController.php
示例19: __construct
public function __construct($searchObject, $params)
{
global $library;
global $configArray;
// Save the basic parameters:
$this->searchObject = $searchObject;
// Parse the additional parameters:
$params = explode(':', $params);
$section = empty($params[0]) ? 'ResultsTop' : $params[0];
$iniFile = isset($params[1]) ? $params[1] : 'facets';
// Load the desired facet information:
$searchLibrary = Library::getActiveLibrary();
$searchLocation = Location::getActiveLocation();
$config = getExtraConfigArray($iniFile);
if ($searchObject->getSearchType() == 'genealogy') {
$this->mainFacets = array();
} else {
$searchLibrary = Library::getActiveLibrary();
$searchLocation = Location::getActiveLocation();
$userLocation = Location::getUserHomeLocation();
$hasSearchLibraryFacets = $searchLibrary != null && count($searchLibrary->facets) > 0;
$hasSearchLocationFacets = $searchLocation != null && count($searchLocation->facets) > 0;
if ($hasSearchLocationFacets) {
$facets = $searchLocation->facets;
} elseif ($hasSearchLibraryFacets) {
$facets = $searchLibrary->facets;
} else {
$facets = Library::getDefaultFacets();
}
foreach ($facets as $facet) {
if ($facet->showAboveResults == 1) {
$facetName = $facet->facetName;
if (isset($searchLibrary)) {
if ($facet->facetName == 'availability_toggle' && $configArray['Index']['enableDetailedAvailability']) {
$facetName = 'availability_toggle_' . $searchLibrary->subdomain;
}
}
if (isset($userLocation)) {
if ($facet->facetName == 'availability_toggle' && $configArray['Index']['enableDetailedAvailability']) {
$facetName = 'availability_toggle_' . $userLocation->code;
}
}
if (isset($searchLocation)) {
if ($facet->facetName == 'availability_toggle' && $configArray['Index']['enableDetailedAvailability']) {
$facetName = 'availability_toggle_' . $searchLocation->code;
}
}
$this->facets[$facetName] = $facet->displayName;
$this->facetSettings[$facetName] = $facet;
}
}
}
// Load other relevant settings:
$this->baseSettings = array('rows' => $config['Results_Settings']['top_rows'], 'cols' => $config['Results_Settings']['top_cols']);
}
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:55,代码来源:TopFacets.php
示例20: getName
/**
* Get the name of this face.
*
* @return string The name of this face.
*/
public function getName()
{
if (is_null($this->name)) {
$this->name = $this->library->getFaceName($this->key);
}
return $this->name;
}
开发者ID:robbertkl,项目名称:photolibrary,代码行数:12,代码来源:Face.php
注:本文中的Library类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论