trql.website.class.php

This documentation is provided without any sort of liability.

Filename: trql.website.class.php Namespace: trql\web Class aliases: trql\quitus\iContext as iContext,trql\vaesoli\Vaesoli as v,trql\schema\creativework\CreativeWork as CreativeWork,trql\web\WebsiteGenerator as WebsiteGenerator,trql\quitus\Country as Country,trql\web\Browser as Browser,trql\web\WebPage as WebPage,DOMDocument; use DOMXPath; if ( ! defined( 'MOTHER_ABSTRACT_CLASS' ) ) require_once( 'trql.mother.cl as s Purpose: A WebSite is a set of related web pages and other items typically served from a single web domain and accessible via URLs. Author: Pat Y. Boens Company: Lato Sensu Management
Rue du Bois des Mazuis, 47
5070 Vitrival
Belgium
(geonames: )
Vae Soli!:
Creation date: 16-08-20 15:59 Last modification date: 06/02/2022 - 21:46:15 License/Copyrights: Intellectual Property belongs to Pat Y. Boens. You are free to:

Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material for any purpose, even commercially.

Under the following terms:

Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

Class: WebSite Description: A WebSite is a set of related web pages and other items typically served from a single web domain and accessible via URLs. Inheritance: Mother > Thing > CreativeWork > WebSite Declaration: class WebSite extends CreativeWork implements iContext Credits: The whole concept is derived from the fabulous work of Schema.org under the terms of their license: Doc: ?utm_source=TRQLLabs TODOs:
  1. Implement a generate() method that should take a paradeigma and generate a full website
  2. Must create a trql.exception.class.php
  3. Je dois aussi créer un fichier de type companies.xml qui devra être un objet dérivant d'une classe trql.configurationfile.class, elle-même devant au moins répondre au fichiers de type manifest dans uen radio (ce qui devrait aussi être une classe spécifique et qui doit répondre également à ce qu'est un manifest pour un site web) et au fichier des shows et au fichiers de config radio. Brrrr ... y'a du boulot !
  4. Je ne trouve pas de propriétés comme pages dans la classe WebSite et pourtant ... j'ai vraiment besoin de cela pour commencer la génération d'un site web
Properties:
Name Type Description
$about Thing The subject matter of the content. Inverse property: $subjectOf
$abstract string An abstract is a short description that summarizes a CreativeWork
$accessibilityAPI string Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).
$accessibilityControl string Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).
$accessibilityFeature string Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).
$accessibilityHazard string A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).
$accessibilitySummary string A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."
$accessMode string The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual.
$accessModeSufficient ItemList A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual.
$accountablePerson Person Specifies the Person that is legally accountable for the CreativeWork.
$active bool Web site active or not
$additionalType string An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types.
$aggregateRating AggregateRating The overall rating, based on a collection of reviews or ratings, of the item.
$alternateName string An alias for the item.
$alternativeHeadline string A secondary title of the CreativeWork.
$associatedMedia MediaObject A media object that encodes this CreativeWork. This property is a synonym for encoding.
$audience Audience An intended audience, i.e. a group for whom something was created.
$audio AudioObject|Clip An embedded audio object.
$aURL array $url parsed into an associative array
$author Organization|Person The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.
$availableLanguage string Token-based string of languages (',' or ';' separated) (each language must correspond to https://www.rfc-editor.org/info/bcp47)
$award string An award won by or for this item. Supersedes awards.
$blockedIPs array An array of IP addresses that must be blocked
$browser Browser The browser this website is rendered in
$charset string Default charset for all pages
$citation CreativeWork|string A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.
$comment Comment Comments, typically from users.
$commentCount int The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.
$conditionsOfAccess string Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an ArchiveComponent held by an ArchiveOrganization. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language.
For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".
$contentDir string Folder where all content is placed (e.g. "d:\website\www\httpdocs\content")
$contentLocation Place The location depicted or described in the content. For example, the location in a photograph or painting.
$contentRating Rating|string Official rating of a piece of content—for example,'MPAA PG-13'.
$contentReferenceTime DateTime The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.
$contentResourceID string The content ID ofd the resource we need to get access to (e.g. https://www.trql.fm/artist/watson/' -> 'artist-watson')
$contributor Organization|Person A secondary contributor to the CreativeWork or Event.
$copyrightHolder Organization|Person The party holding the legal copyright to the CreativeWork.
$copyrightYear Number The year during which the claimed copyright for the CreativeWork was first asserted.
$correction CorrectionComment|string|URL Indicates a correction to a CreativeWork, either via a CorrectionComment, textually or in another document.
$creativeWorkStatus DefinedTerm|string The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.
$creator Organization|Person The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.
$dateCreated Date|DateTime The date on which the CreativeWork was created or the item was added to a DataFeed.
$dateModified Date|DateTime The date on which the CreativeWork was most recently modified or when the item's entry was modified within a DataFeed.
$datePublished Date Date of first broadcast/publication.
$description string A short description of the item.
$disambiguatingDescription string A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
$discussionUrl URL A link to the page containing the comments of the CreativeWork.
$editor Person Specifies the Person who edited the CreativeWork.
$educationalAlignment AlignmentObject An alignment to an established educational framework.
$educationalUse string The purpose of a work in the context of education; for example, 'assignment', 'group work'.
$encoding MediaObject A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. Supersedes encodings. Inverse property: encodesCreativeWork.
$encodingFormat string|URL Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.).
$exampleOfWork CreativeWork A creative work that this work is an example/instance/realization/derivation of. Inverse property: workExample.
$expires Date Date the content expires and is no longer useful or available. For example a VideoObject or NewsArticle whose availability or relevance is time-limited, or a ClaimReview fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.
$funder Organization|Person A person or organization that supports (sponsors) something through some kind of financial contribution.
$genre string|URL Genre of the creative work, broadcast channel or group.
$hasPart CreativeWork Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). Inverse property: $isPartOf.
$headline string Headline of the article.
$homeDir string Name of the folder where the website is supposed to be generated (e.g. "d:/websites/trql.io/").
$identifier string The identifier property represents any kind of identifier for any kind of Thing, such as ISBNs, GTIN codes, UUIDs etc. http://schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See background notes for more details.
$image string URL of an image of the item.
$inLanguage Language|string The language of the content or performance or used in an action. Please use one of the language codes from the IETF BCP 47 standard. See also availableLanguage. Supersedes language.
$interactionStatistic InteractionCounter The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.
$interactivityType string The predominant mode of learning supported by the learning resource. Acceptable values are 'active', 'expositive', or 'mixed'.
$isAccessibleForFree Boolean A flag to signal that the item, event, or place is accessible for free. Supersedes free.
$isBasedOn CreativeWork|Product|URL A resource from which this work is derived or from which it is a modification or adaption. Supersedes isBasedOnUrl.
$isFamilyFriendly Boolean Indicates whether this content is family friendly.
$isPartOf CreativeWork Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. Inverse property: $hasPart.
$issn string The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.
$keywords string Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.
$learningResourceType string The predominant type or kind characterizing the learning resource. For example, 'presentation', 'handout'.
$license CreativeWork|URL A license document that applies to this content, typically indicated by URL.
$locationCreated Place The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.
$mainEntity Thing Indicates the primary entity described in some page or other CreativeWork. Inverse property: $mainEntityOfPage.
$mainEntityOfPage string Indicates a page (or other CreativeWork, Event) for which this thing is the main entity being described. See background notes for details. Inverse property: $mainEntity.
$material Product|string|URL A material that something is made from, e.g. leather, wool, cotton, paper.
$materialExtent QuantitativeValue|string The quantity of the materials being described or an expression of the physical space they occupy.
$mentions Thing Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.
$name string The name of the item.
$offers Offer An offer to provide this item—for example, an offer to sell a product, rent the DVD of a movie, perform a service, or give away tickets to an event.
$page WebPage Current Web page
$position int|string The position of an item in a series or sequence of items.
$potentialAction Action Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
$producer Organization|Person The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).
$provider Organization|Person The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller. Supersedes carrier.
$publication PublicationEvent A publication event associated with the item.
$publisher Organization|Person The publisher of the creative work.
$publisherImprint Organization The publishing division which published the comic.
$publishingPrinciples CreativeWork|URL The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.
$recordedAt Event The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. Inverse property: $recordedIn.
$releasedEvent PublicationEvent The place and time the release was issued, expressed as a PublicationEvent.
$remoteIP string The IP address of the caller
$resource string Part of the resource that is requested (e.g. 'https://www.trql.fm/advertisement/' -> 'advertisement' )
$review Review A review of the item. Supersedes reviews.
$sameAs string URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Freebase page, or official website.
$schemaOrg string Where the official documentation is maintained
$schemaVersion string|URL Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application.
$sdDatePublished Date Indicates the date on which the current structured data was generated / published. Typically used alongside sdPublisher
$sdLicense CreativeWork|URL A license document that applies to this structured data, typically indicated by URL.
$sdPublisher Organization|Person Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The sdPublisher property helps make such practices more explicit.
$self array Fixed 'class' information.
$shelter string The name of the file where the XML definition of the site is stored
$sourceOrganization Organization The Organization on whose behalf the creator was working.
$spatial Place The "spatial" property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate.
$spatialCoverage Place The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.
$sponsor Organization|Person A person or organization that supports a thing through a pledge, promise, or financial contribution. e.g. a sponsor of a Medical Study or a corporate sponsor of an event.
$subjectOf CreativeWork|Event A CreativeWork or Event about this Thing. Inverse property: $about.
$temporal DateTime|string The "temporal" property can be used in cases where more specific properties (e.g. $temporalCoverage, $dateCreated, $dateModified, $datePublished) are not known to be appropriate.
$temporalCoverage DateTime|string|URL The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. Supersedes datasetTimeInterval.
$text string The textual content of this CreativeWork.
$thumbnailUrl URL A thumbnail image relevant to the Thing.
$timeRequired Duration Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'.
$translationOfWork CreativeWork The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” Inverse property: workTranslation.
$translator Organization|Person Organization or Person who adapts a creative work to different languages, regional differences and technical requirements of a target market, or that translates during some event.
$typicalAgeRange string The typical expected age range, e.g. '7-9', '11-'.
$underConstruction boolean Is this site still under construction ? false by default
$url string URL of the item.
$URL string Normalized URL of the page that is requested
$version Number|string The version of the CreativeWork embodied by a specified resource.
$video Clip|VideoObject An embedded video object.
$viewport string Viewport meta tag to control layout on mobile browsers
$wikidataId string Wikidata ID. set of related web pages served from a single web domain
$workExample CreativeWork Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. Inverse property: $exampleOfWork.
$workTranslation CreativeWork A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. Inverse property: $translationOfWork.

Methods of WebSite

__construct(): Class constructor

Syntax:

__construct( $szHome )

Parameters:
Name Type Description
$szHome string Home of the class. Optional.

Return:

(self): The current instance of the class


__destruct(): Class destructor

Syntax:

__destruct()

Return:

(void): No return


__get(): Reading data from inaccessible (protected or private) or non-existing properties.

Syntax:

__get( $property )

Parameters:
Name Type Description
$property string Name of the property

Return:

(mixed): The value of $this->$property if $property is known. Throws a EXCEPTION_CODE_INVALID_PROPERTY exception if not known.


__set(): Reading data from inaccessible (protected or private) or non-existing properties.

Syntax:

__set( $property,$value )

Parameters:
Name Type Description
$property string Name of the property to assign
$value mixed Value to assign to the property

Return:

(void): No return value


blockIP(): Blocks an IP address

Syntax:

blockIP( $ip )

Parameters:
Name Type Description
$ip string IP address to block (e.g. "5.188.62.214")

Return:

(self): The method returns the current instance of the c lass


edit(): Edit a website

Warning:

This method is empty at the moment (03/01/2022 11:41:10)

Syntax:

edit()

Return:

(self): Returns self


generate(): Generate a website

Warning:

1) This method uses trql.websitegenerator.class.php

Syntax:

generate()

Return:

(self): Returns self


getStatFile(): Returns the file that corresponds to an id and a name

Warning:

All stat filesd re maintained in a directory that is NOT accessible from the root directory (../databases/vsuv). "vsuv" stands for "Vae Soli Unique Visitors".

Syntax:

getStatFile( $id,$date,$name,$folder )

Parameters:
Name Type Description
$id string The ID to track
$date string Date to consider ('YYYYMMDD' format)
$name string Name of the object (used in the file that is formed)
$folder string Folder in which the file had to be saved

Return:

(self): Returns self

Example(s):



      $radio = new Radio( 'trql.fm' );
      $radio->name = 'TRQL Radio';

      $website = new WebSite();
      $date    = '20220201';
      $file   = $website->getStatFile( $radio-id,$radio->name,$date,'radios );

  

home(): Determines the home directory of the website

Syntax:

home()

Return:

(string): The name of the folder in which the data of the radio is maintained (e.g. "D:\websites\trql.fm\www\httpdocs\playlists\trql.fm\")


IPBlocked(): Is the remote IP blocked or not

Syntax:

IPBlocked()

Return:

(bool): true if the remote IP is blocked; false if not


loadBlockedIPs(): Load a set of IP addresses that we want to block from a common file

Syntax:

loadBlockedIPs()

Return:

(self): The method returns the current instance of the c lass


readManifest(): The website meta data is maintained in a XML file. This method permits to read the XML file and to populate internal properties based on what is in the XML file.

Syntax:

readManifest( $szFile )

Parameters:
Name Type Description
$szFile string XML file that holds the description of the website. Optional. manifest.xml by default.

Return:

(self): The current instance of the class

Example(s):


  

trackUniqueVisitors(): Tracks unique visits for a given id

Warning:

$id MUST be unique As this method uses cookies, any source that does not return the cookies that we set will be counted multiple times

Abstract:

This method increments the counter of the object identified by its id if it hasn't been visited in the last day

Syntax:

trackUniqueVisitors( $id )

Parameters:
Name Type Description
$id string The ID to track

Return:

(self): Returns self

Example(s):


      //$id = unique ID of the object we want to monitor
      //$name = name of the object we want to monitor

      $radio = new Radio( 'trql.fm' );
      $radio->name = 'TRQL Radio';

      $website = new WebSite();
      $website->trackUniqueVisitors( $radio->szID,$radio->name,'radios' );