mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 22:50:07 +01:00
Run formatter on all PHP code; should not change behaviour in any way
This commit is contained in:
parent
2ce6eba811
commit
7289aba68d
199 changed files with 136135 additions and 155831 deletions
|
@ -44,7 +44,8 @@ $adminid = $query->fetch()['user'];
|
||||||
<!-- Start Top Right -->
|
<!-- Start Top Right -->
|
||||||
<ul class="top-right">
|
<ul class="top-right">
|
||||||
<li class="dropdown link">
|
<li class="dropdown link">
|
||||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span class="caret"></span></a>
|
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span
|
||||||
|
class="caret"></span></a>
|
||||||
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
||||||
<li><a href="admin.php">Settings</a></li>
|
<li><a href="admin.php">Settings</a></li>
|
||||||
<li><a href="?logout">Logout</a></li>
|
<li><a href="?logout">Logout</a></li>
|
||||||
|
@ -91,8 +92,10 @@ $adminid = $query->fetch()['user'];
|
||||||
<div role="tabpanel">
|
<div role="tabpanel">
|
||||||
<!-- Nav tabs -->
|
<!-- Nav tabs -->
|
||||||
<ul class="nav nav-tabs nav-line" role="tablist" style="text-align: center;">
|
<ul class="nav nav-tabs nav-line" role="tablist" style="text-align: center;">
|
||||||
<li role="presentation" class="active"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">Settings</a></li>
|
<li role="presentation" class="active"><a href="#settings" aria-controls="settings"
|
||||||
<li role="presentation"><a href="#logs" aria-controls="logs" role="tab" data-toggle="tab">Login History</a></li>
|
role="tab" data-toggle="tab">Settings</a></li>
|
||||||
|
<li role="presentation"><a href="#logs" aria-controls="logs" role="tab"
|
||||||
|
data-toggle="tab">Login History</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!-- Tab panes -->
|
<!-- Tab panes -->
|
||||||
|
@ -100,14 +103,17 @@ $adminid = $query->fetch()['user'];
|
||||||
<div role="tabpanel" class="tab-pane active" id="settings">
|
<div role="tabpanel" class="tab-pane active" id="settings">
|
||||||
<div class="login-form" style="padding:0;">
|
<div class="login-form" style="padding:0;">
|
||||||
<?php if (isset($msg)) echo $msg; ?>
|
<?php if (isset($msg)) echo $msg; ?>
|
||||||
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" class="form-area" method="POST">
|
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" class="form-area"
|
||||||
|
method="POST">
|
||||||
<div class="form-area">
|
<div class="form-area">
|
||||||
<div class="group">
|
<div class="group">
|
||||||
<input type="text" id="adminid" name="adminid" class="form-control" placeholder="Username" value="<?php echo $adminid; ?>">
|
<input type="text" id="adminid" name="adminid" class="form-control"
|
||||||
|
placeholder="Username" value="<?php echo $adminid; ?>">
|
||||||
<i class="fa fa-user"></i>
|
<i class="fa fa-user"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="group">
|
<div class="group">
|
||||||
<input type="password" id="password" name="password" class="form-control" placeholder="Password">
|
<input type="password" id="password" name="password"
|
||||||
|
class="form-control" placeholder="Password">
|
||||||
<i class="fa fa-key"></i>
|
<i class="fa fa-key"></i>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-default btn-block">Save</button>
|
<button type="submit" class="btn btn-default btn-block">Save</button>
|
||||||
|
@ -156,7 +162,8 @@ $adminid = $query->fetch()['user'];
|
||||||
<!-- Start Footer -->
|
<!-- Start Footer -->
|
||||||
<div class="row footer">
|
<div class="row footer">
|
||||||
<div class="col-md-6 text-left">
|
<div class="col-md-6 text-left">
|
||||||
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a
|
||||||
|
href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 text-right">
|
<div class="col-md-6 text-right">
|
||||||
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
||||||
|
|
|
@ -63,7 +63,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
<!-- Start Top Right -->
|
<!-- Start Top Right -->
|
||||||
<ul class="top-right">
|
<ul class="top-right">
|
||||||
<li class="dropdown link">
|
<li class="dropdown link">
|
||||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span class="caret"></span></a>
|
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span
|
||||||
|
class="caret"></span></a>
|
||||||
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
||||||
<li><a href="admin.php">Settings</a></li>
|
<li><a href="admin.php">Settings</a></li>
|
||||||
<li><a href="?logout">Logout</a></li>
|
<li><a href="?logout">Logout</a></li>
|
||||||
|
@ -91,20 +92,23 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label" for="text_ads">Text Ads</label>
|
<label class="control-label" for="text_ads">Text Ads</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<textarea placeholder="Ad code" name="text_ads" rows="3" class="span6"><?php echo $text_ads; ?></textarea>
|
<textarea placeholder="Ad code" name="text_ads" rows="3"
|
||||||
|
class="span6"><?php echo $text_ads; ?></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label" for="ads_1">Image Ad - (Sidebar)</label>
|
<label class="control-label" for="ads_1">Image Ad - (Sidebar)</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<textarea placeholder="Ad code" name="ads_1" id="ads_1" rows="3" class="span6"><?php echo $ads_1; ?></textarea>
|
<textarea placeholder="Ad code" name="ads_1" id="ads_1" rows="3"
|
||||||
|
class="span6"><?php echo $ads_1; ?></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label" for="ads_2">Image Ad (Footer)</label>
|
<label class="control-label" for="ads_2">Image Ad (Footer)</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<textarea placeholder="Ad code" name="ads_2" id="ads_2" rows="3" class="span6"><?php echo $ads_2; ?></textarea>
|
<textarea placeholder="Ad code" name="ads_2" id="ads_2" rows="3"
|
||||||
|
class="span6"><?php echo $ads_2; ?></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-default">Save</button>
|
<button type="submit" class="btn btn-default">Save</button>
|
||||||
|
@ -120,7 +124,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
<!-- Start Footer -->
|
<!-- Start Footer -->
|
||||||
<div class="row footer">
|
<div class="row footer">
|
||||||
<div class="col-md-6 text-left">
|
<div class="col-md-6 text-left">
|
||||||
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a
|
||||||
|
href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 text-right">
|
<div class="col-md-6 text-right">
|
||||||
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
||||||
|
|
|
@ -167,7 +167,8 @@ if (isset($_POST['smtp_code'])) {
|
||||||
<!-- Start Top Right -->
|
<!-- Start Top Right -->
|
||||||
<ul class="top-right">
|
<ul class="top-right">
|
||||||
<li class="dropdown link">
|
<li class="dropdown link">
|
||||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span class="caret"></span></a>
|
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span
|
||||||
|
class="caret"></span></a>
|
||||||
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
||||||
<li><a href="admin.php">Settings</a></li>
|
<li><a href="admin.php">Settings</a></li>
|
||||||
<li><a href="?logout">Logout</a></li>
|
<li><a href="?logout">Logout</a></li>
|
||||||
|
@ -195,28 +196,38 @@ if (isset($_POST['smtp_code'])) {
|
||||||
<div role="tabpanel">
|
<div role="tabpanel">
|
||||||
<!-- Nav tabs -->
|
<!-- Nav tabs -->
|
||||||
<ul class="nav nav-tabs nav-line" role="tablist" style="text-align: center;">
|
<ul class="nav nav-tabs nav-line" role="tablist" style="text-align: center;">
|
||||||
<li role="presentation" class="active"><a href="#siteinfo" aria-controls="siteinfo" role="tab" data-toggle="tab">Site Info</a></li>
|
<li role="presentation" class="active"><a href="#siteinfo" aria-controls="siteinfo"
|
||||||
<li role="presentation"><a href="#permissions" aria-controls="permissions" role="tab" data-toggle="tab">Permissions</a></li>
|
role="tab" data-toggle="tab">Site Info</a>
|
||||||
<li role="presentation"><a href="#captcha" aria-controls="captcha" role="tab" data-toggle="tab">Captcha Settings</a></li>
|
</li>
|
||||||
<li role="presentation"><a href="#mail" aria-controls="mail" role="tab" data-toggle="tab">Mail Settings</a></li>
|
<li role="presentation"><a href="#permissions" aria-controls="permissions" role="tab"
|
||||||
|
data-toggle="tab">Permissions</a></li>
|
||||||
|
<li role="presentation"><a href="#captcha" aria-controls="captcha" role="tab"
|
||||||
|
data-toggle="tab">Captcha Settings</a></li>
|
||||||
|
<li role="presentation"><a href="#mail" aria-controls="mail" role="tab"
|
||||||
|
data-toggle="tab">Mail Settings</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!-- Tab panes -->
|
<!-- Tab panes -->
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div role="tabpanel" class="tab-pane active" id="siteinfo">
|
<div role="tabpanel" class="tab-pane active" id="siteinfo">
|
||||||
<form class="form-horizontal" method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
<form class="form-horizontal" method="POST"
|
||||||
|
action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label form-label">Site Name</label>
|
<label class="col-sm-2 control-label form-label">Site Name</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" class="form-control" name="site_name" placeholder="The name of your site" value="<?php echo (isset($_POST['site_name']))?$_POST['site_name']:$site_name; // Prevent special characters on $_POST ?>">
|
<input type="text" class="form-control" name="site_name"
|
||||||
|
placeholder="The name of your site"
|
||||||
|
value="<?php echo (isset($_POST['site_name'])) ? $_POST['site_name'] : $site_name; // Prevent special characters on $_POST ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label form-label">Site Title</label>
|
<label class="col-sm-2 control-label form-label">Site Title</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" class="form-control" name="title" placeholder="Site title tag" value="<?php echo (isset($_POST['title']))?$_POST['title']:$title; // Prevent special characters on $_POST ?>">
|
<input type="text" class="form-control" name="title"
|
||||||
|
placeholder="Site title tag"
|
||||||
|
value="<?php echo (isset($_POST['title'])) ? $_POST['title'] : $title; // Prevent special characters on $_POST ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -232,63 +243,77 @@ if (isset($_POST['smtp_code'])) {
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-5">
|
<div class="col-sm-5">
|
||||||
<input type="text" class="form-control" name="baseurl" placeholder="eg: pastethis.in (no trailing slash)" value="<?php echo (isset($_POST['baseurl']))?$_POST['baseurl']:$baseurl; // Prevent special characters on $_POST ?>">
|
<input type="text" class="form-control" name="baseurl"
|
||||||
|
placeholder="eg: pastethis.in (no trailing slash)"
|
||||||
|
value="<?php echo (isset($_POST['baseurl'])) ? $_POST['baseurl'] : $baseurl; // Prevent special characters on $_POST ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label form-label">Site Description</label>
|
<label class="col-sm-2 control-label form-label">Site Description</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" class="form-control" name="des" placeholder="Site description" value="<?php echo (isset($_POST['des']))?$_POST['des']:$des; // Prevent special characters on $_POST ?>">
|
<input type="text" class="form-control" name="des"
|
||||||
|
placeholder="Site description"
|
||||||
|
value="<?php echo (isset($_POST['des'])) ? $_POST['des'] : $des; // Prevent special characters on $_POST ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label form-label">Site Keywords</label>
|
<label class="col-sm-2 control-label form-label">Site Keywords</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" class="form-control" name="keyword" placeholder="Keywords (separated by a comma)" value="<?php echo $keyword; ?>">
|
<input type="text" class="form-control" name="keyword"
|
||||||
|
placeholder="Keywords (separated by a comma)"
|
||||||
|
value="<?php echo $keyword; ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label form-label">Google Analytics</label>
|
<label class="col-sm-2 control-label form-label">Google Analytics</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" class="form-control" name="ga" placeholder="Google Analytics ID" value="<?php echo $ga; ?>">
|
<input type="text" class="form-control" name="ga"
|
||||||
|
placeholder="Google Analytics ID" value="<?php echo $ga; ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label form-label">Admin Email</label>
|
<label class="col-sm-2 control-label form-label">Admin Email</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" class="form-control" name="email" placeholder="Email" value="<?php echo (isset($_POST['email']))?$_POST['email']:$email; // Prevent special characters on $_POST ?>">
|
<input type="text" class="form-control" name="email" placeholder="Email"
|
||||||
|
value="<?php echo (isset($_POST['email'])) ? $_POST['email'] : $email; // Prevent special characters on $_POST ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label form-label">Facebook URL</label>
|
<label class="col-sm-2 control-label form-label">Facebook URL</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" class="form-control" name="face" placeholder="Facebook URL" value="<?php echo $face; ?>">
|
<input type="text" class="form-control" name="face"
|
||||||
|
placeholder="Facebook URL" value="<?php echo $face; ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label form-label">Twitter URL</label>
|
<label class="col-sm-2 control-label form-label">Twitter URL</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" class="form-control" name="twit" placeholder="Twitter URL" value="<?php echo $twit; ?>">
|
<input type="text" class="form-control" name="twit"
|
||||||
|
placeholder="Twitter URL" value="<?php echo $twit; ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label form-label">Google+ URL</label>
|
<label class="col-sm-2 control-label form-label">Google+ URL</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" class="form-control" name="gplus" placeholder="Google+ URL" value="<?php echo $gplus; ?>">
|
<input type="text" class="form-control" name="gplus"
|
||||||
|
placeholder="Google+ URL" value="<?php echo $gplus; ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label form-label">Additional Site Scripts</label>
|
<label class="col-sm-2 control-label form-label">Additional Site
|
||||||
|
Scripts</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<textarea class="form-control" id="additional_scripts" name="additional_scripts" rows="8"><?php echo (isset($_POST['additional_scripts']))?$_POST['additional_scripts']:$additional_scripts; // Prevent special characters on $_POST ?></textarea>
|
<textarea class="form-control" id="additional_scripts"
|
||||||
|
name="additional_scripts"
|
||||||
|
rows="8"><?php echo (isset($_POST['additional_scripts'])) ? $_POST['additional_scripts'] : $additional_scripts; // Prevent special characters on $_POST ?></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -305,17 +330,20 @@ if (isset($_POST['smtp_code'])) {
|
||||||
<!-- Permissions -->
|
<!-- Permissions -->
|
||||||
|
|
||||||
<div role="tabpanel" class="tab-pane" id="permissions">
|
<div role="tabpanel" class="tab-pane" id="permissions">
|
||||||
<form class="form-horizontal" method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
<form class="form-horizontal" method="POST"
|
||||||
|
action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
||||||
|
|
||||||
<div class="checkbox checkbox-primary">
|
<div class="checkbox checkbox-primary">
|
||||||
<input <?php if ($disableguest == "on") echo 'checked="true"'; ?> type="checkbox" name="disableguest" id="disableguest">
|
<input <?php if ($disableguest == "on") echo 'checked="true"'; ?>
|
||||||
|
type="checkbox" name="disableguest" id="disableguest">
|
||||||
<label for="disableguest">
|
<label for="disableguest">
|
||||||
Only allow registered users to paste
|
Only allow registered users to paste
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="checkbox checkbox-primary">
|
<div class="checkbox checkbox-primary">
|
||||||
<input <?php if ($siteprivate == "on") echo 'checked="true"'; ?> type="checkbox" name="siteprivate" id="siteprivate">
|
<input <?php if ($siteprivate == "on") echo 'checked="true"'; ?>
|
||||||
|
type="checkbox" name="siteprivate" id="siteprivate">
|
||||||
<label for="siteprivate">
|
<label for="siteprivate">
|
||||||
Make site private (no Recent Pastes or Archives)
|
Make site private (no Recent Pastes or Archives)
|
||||||
</label>
|
</label>
|
||||||
|
@ -336,10 +364,13 @@ if (isset($_POST['smtp_code'])) {
|
||||||
<!-- Captcha pane -->
|
<!-- Captcha pane -->
|
||||||
|
|
||||||
<div role="tabpanel" class="tab-pane" id="captcha">
|
<div role="tabpanel" class="tab-pane" id="captcha">
|
||||||
<form class="form-horizontal" method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
<form class="form-horizontal" method="POST"
|
||||||
|
action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
||||||
|
|
||||||
<div class="checkbox checkbox-primary">
|
<div class="checkbox checkbox-primary">
|
||||||
<input <?php if ( $cap_e == "on" ) echo 'checked="true"'; ?> type="checkbox" name="cap_e" id="cap_e">
|
<input <?php if ($cap_e == "on") echo 'checked="true"'; ?> type="checkbox"
|
||||||
|
name="cap_e"
|
||||||
|
id="cap_e">
|
||||||
<label for="cap_e">Enable Captcha</label>
|
<label for="cap_e">Enable Captcha</label>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
|
@ -377,21 +408,27 @@ if (isset($_POST['smtp_code'])) {
|
||||||
Internal Captcha Settings:
|
Internal Captcha Settings:
|
||||||
</div>
|
</div>
|
||||||
<div class="checkbox checkbox-primary">
|
<div class="checkbox checkbox-primary">
|
||||||
<input <?php if ( $mul == "on" ) echo 'checked="true"'; ?> type="checkbox" name="mul" id="mul">
|
<input <?php if ($mul == "on") echo 'checked="true"'; ?> type="checkbox"
|
||||||
|
name="mul"
|
||||||
|
id="mul">
|
||||||
<label for="mul">Enable multiple backgrounds</label>
|
<label for="mul">Enable multiple backgrounds</label>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="allowed" class="col-sm-1 col-form-label">Captcha Characters</label>
|
<label for="allowed" class="col-sm-1 col-form-label">Captcha
|
||||||
|
Characters</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" id="allowed" name="allowed" placeholder="Allowed Characters" value="<?php echo $allowed; ?>">
|
<input type="text" id="allowed" name="allowed"
|
||||||
|
placeholder="Allowed Characters" value="<?php echo $allowed; ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="color" class="col-sm-1 col-form-label">Captcha Text Colour</label>
|
<label for="color" class="col-sm-1 col-form-label">Captcha Text
|
||||||
|
Colour</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" id="color" name="color" placeholder="Captcha Text Colour" value="<?php echo $color; ?>">
|
<input type="text" id="color" name="color"
|
||||||
|
placeholder="Captcha Text Colour" value="<?php echo $color; ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -400,16 +437,21 @@ if (isset($_POST['smtp_code'])) {
|
||||||
reCAPTCHA Settings:
|
reCAPTCHA Settings:
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="recaptcha_sitekey" class="col-sm-1 col-form-label">Site Key</label>
|
<label for="recaptcha_sitekey" class="col-sm-1 col-form-label">Site
|
||||||
|
Key</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" id="recaptcha_sitekey" name="recaptcha_sitekey" placeholder="Site Key" value="<?php echo $recaptcha_sitekey; ?>">
|
<input type="text" id="recaptcha_sitekey" name="recaptcha_sitekey"
|
||||||
|
placeholder="Site Key" value="<?php echo $recaptcha_sitekey; ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="recaptcha_secretkey" class="col-sm-1 col-form-label">Secret Key</label>
|
<label for="recaptcha_secretkey" class="col-sm-1 col-form-label">Secret
|
||||||
|
Key</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" id="recaptcha_secretkey" name="recaptcha_secretkey" placeholder="Site Key" value="<?php echo $recaptcha_secretkey; ?>">
|
<input type="text" id="recaptcha_secretkey" name="recaptcha_secretkey"
|
||||||
|
placeholder="Site Key"
|
||||||
|
value="<?php echo $recaptcha_secretkey; ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -426,7 +468,8 @@ if (isset($_POST['smtp_code'])) {
|
||||||
<!-- Mail Settings -->
|
<!-- Mail Settings -->
|
||||||
|
|
||||||
<div role="tabpanel" class="tab-pane" id="mail">
|
<div role="tabpanel" class="tab-pane" id="mail">
|
||||||
<form class="form-horizontal" method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
<form class="form-horizontal" method="POST"
|
||||||
|
action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="panel-title">
|
<div class="panel-title">
|
||||||
|
@ -499,34 +542,45 @@ if (isset($_POST['smtp_code'])) {
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label form-label">SMTP Host</label>
|
<label class="col-sm-2 control-label form-label">SMTP Host</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" class="form-control" placeholder="eg smtp.gmail.com" name="smtp_host" value="<?php echo $smtp_host; ?>">
|
<input type="text" class="form-control" placeholder="eg smtp.gmail.com"
|
||||||
|
name="smtp_host" value="<?php echo $smtp_host; ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label form-label">SMTP Port</label>
|
<label class="col-sm-2 control-label form-label">SMTP Port</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" class="form-control" name="smtp_port" placeholder="eg 465 for SSL or 587 for TLS" value="<?php echo $smtp_port; ?>">
|
<input type="text" class="form-control" name="smtp_port"
|
||||||
|
placeholder="eg 465 for SSL or 587 for TLS"
|
||||||
|
value="<?php echo $smtp_port; ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label form-label">SMTP User</label>
|
<label class="col-sm-2 control-label form-label">SMTP User</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" class="form-control" name="smtp_user" placeholder="eg user@gmail.com" value="<?php echo $smtp_username; ?>">
|
<input type="text" class="form-control" name="smtp_user"
|
||||||
|
placeholder="eg user@gmail.com"
|
||||||
|
value="<?php echo $smtp_username; ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label form-label">SMTP Password</label>
|
<label class="col-sm-2 control-label form-label">SMTP Password</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="password" class="form-control" id="smtp_pass" name="smtp_pass" placeholder="Email password" value="<?php echo($smtp_password); ?>">
|
<input type="password" class="form-control" id="smtp_pass"
|
||||||
|
name="smtp_pass" placeholder="Email password"
|
||||||
|
value="<?php echo($smtp_password); ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-sm-offset-2 col-sm-10">
|
<div class="col-sm-offset-2 col-sm-10">
|
||||||
<button style="margin-bottom: 2%;" id="smtppasstoggle" type="button" class="btn btn-default" onclick="if (smtp_pass.type == 'text') {smtp_pass.type = 'password';} else {smtp_pass.type = 'text';}">Toggle password</button>
|
<button style="margin-bottom: 2%;" id="smtppasstoggle" type="button"
|
||||||
|
class="btn btn-default"
|
||||||
|
onclick="if (smtp_pass.type == 'text') {smtp_pass.type = 'password';} else {smtp_pass.type = 'text';}">
|
||||||
|
Toggle password
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" name="smtp_code" value="smtp">
|
<input type="hidden" name="smtp_code" value="smtp">
|
||||||
|
@ -551,7 +605,8 @@ if (isset($_POST['smtp_code'])) {
|
||||||
<!-- Start Footer -->
|
<!-- Start Footer -->
|
||||||
<div class="row footer">
|
<div class="row footer">
|
||||||
<div class="col-md-6 text-left">
|
<div class="col-md-6 text-left">
|
||||||
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a
|
||||||
|
href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 text-right">
|
<div class="col-md-6 text-right">
|
||||||
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
||||||
|
|
|
@ -100,7 +100,8 @@ for ($loop = 0; $loop <= 6; $loop++) {
|
||||||
<!-- Start Top Right -->
|
<!-- Start Top Right -->
|
||||||
<ul class="top-right">
|
<ul class="top-right">
|
||||||
<li class="dropdown link">
|
<li class="dropdown link">
|
||||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span class="caret"></span></a>
|
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span
|
||||||
|
class="caret"></span></a>
|
||||||
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
||||||
<li><a href="admin.php">Settings</a></li>
|
<li><a href="admin.php">Settings</a></li>
|
||||||
<li><a href="?logout">Logout</a></li>
|
<li><a href="?logout">Logout</a></li>
|
||||||
|
@ -300,7 +301,11 @@ for ($loop = 0; $loop <= 6; $loop++) {
|
||||||
<?php
|
<?php
|
||||||
$latestversion = file_get_contents('https://raw.githubusercontent.com/jordansamuel/PASTE/releases/version');
|
$latestversion = file_get_contents('https://raw.githubusercontent.com/jordansamuel/PASTE/releases/version');
|
||||||
echo "Latest version: " . $latestversion . "— Installed version: " . $currentversion;
|
echo "Latest version: " . $latestversion . "— Installed version: " . $currentversion;
|
||||||
if ($currentversion == $latestversion) { echo '<br />You have the latest version'; } else { echo '<br />Your Paste installation is outdated. Get the latest version from <a href="https://sourceforge.net/projects/phpaste/files/latest/download">SourceForge</a>'; }
|
if ($currentversion == $latestversion) {
|
||||||
|
echo '<br />You have the latest version';
|
||||||
|
} else {
|
||||||
|
echo '<br />Your Paste installation is outdated. Get the latest version from <a href="https://sourceforge.net/projects/phpaste/files/latest/download">SourceForge</a>';
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
@ -313,7 +318,8 @@ for ($loop = 0; $loop <= 6; $loop++) {
|
||||||
<!-- Start Footer -->
|
<!-- Start Footer -->
|
||||||
<div class="row footer">
|
<div class="row footer">
|
||||||
<div class="col-md-6 text-left">
|
<div class="col-md-6 text-left">
|
||||||
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a
|
||||||
|
href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 text-right">
|
<div class="col-md-6 text-right">
|
||||||
A fork of <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
A fork of <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
||||||
|
|
|
@ -62,7 +62,9 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||||
<title>Paste - Login</title>
|
<title>Paste - Login</title>
|
||||||
<link href="css/paste.css" rel="stylesheet">
|
<link href="css/paste.css" rel="stylesheet">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body{background: #F5F5F5;}
|
body {
|
||||||
|
background: #F5F5F5;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -82,7 +84,8 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||||
<i class="fa fa-user"></i>
|
<i class="fa fa-user"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="group">
|
<div class="group">
|
||||||
<input type="password" class="form-control" id="password" name="password" placeholder="Password" value="">
|
<input type="password" class="form-control" id="password" name="password" placeholder="Password"
|
||||||
|
value="">
|
||||||
<i class="fa fa-key"></i>
|
<i class="fa fa-key"></i>
|
||||||
</div>
|
</div>
|
||||||
<!-- Not yet implemented
|
<!-- Not yet implemented
|
||||||
|
|
|
@ -91,7 +91,8 @@ if ($last_ip == $ip) {
|
||||||
<!-- Start Top Right -->
|
<!-- Start Top Right -->
|
||||||
<ul class="top-right">
|
<ul class="top-right">
|
||||||
<li class="dropdown link">
|
<li class="dropdown link">
|
||||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span class="caret"></span></a>
|
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span
|
||||||
|
class="caret"></span></a>
|
||||||
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
||||||
<li><a href="admin.php">Settings</a></li>
|
<li><a href="admin.php">Settings</a></li>
|
||||||
<li><a href="?logout">Logout</a></li>
|
<li><a href="?logout">Logout</a></li>
|
||||||
|
@ -191,8 +192,8 @@ if ($last_ip == $ip) {
|
||||||
$fname = explode('.php', $files1[$loop]);
|
$fname = explode('.php', $files1[$loop]);
|
||||||
$fname = $fname[0];
|
$fname = $fname[0];
|
||||||
$ffname = $files1[$loop];
|
$ffname = $files1[$loop];
|
||||||
if ($ffname == "index.php") {/* we don't want index.php showing */}
|
if ($ffname == "index.php") {/* we don't want index.php showing */
|
||||||
else {
|
} else {
|
||||||
echo '<option value="' . $ffname . '">' . $fname . '</option>';
|
echo '<option value="' . $ffname . '">' . $fname . '</option>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -245,7 +246,8 @@ if ($last_ip == $ip) {
|
||||||
<!-- Start Footer -->
|
<!-- Start Footer -->
|
||||||
<div class="row footer">
|
<div class="row footer">
|
||||||
<div class="col-md-6 text-left">
|
<div class="col-md-6 text-left">
|
||||||
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a
|
||||||
|
href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 text-right">
|
<div class="col-md-6 text-right">
|
||||||
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
||||||
|
|
|
@ -136,7 +136,8 @@ if (isset($_GET{'delete'})) {
|
||||||
<!-- Start Top Right -->
|
<!-- Start Top Right -->
|
||||||
<ul class="top-right">
|
<ul class="top-right">
|
||||||
<li class="dropdown link">
|
<li class="dropdown link">
|
||||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span class="caret"></span></a>
|
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span
|
||||||
|
class="caret"></span></a>
|
||||||
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
||||||
<li><a href="admin.php">Settings</a></li>
|
<li><a href="admin.php">Settings</a></li>
|
||||||
<li><a href="?logout">Logout</a></li>
|
<li><a href="?logout">Logout</a></li>
|
||||||
|
@ -236,7 +237,6 @@ if (isset($_GET{'delete'})) {
|
||||||
$rec_count = Trim($row[0]);
|
$rec_count = Trim($row[0]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (isset($_GET{'page'})) { // Current page
|
if (isset($_GET{'page'})) { // Current page
|
||||||
$page = $_GET{'page'} + 1;
|
$page = $_GET{'page'} + 1;
|
||||||
$offset = $rec_limit * $page;
|
$offset = $rec_limit * $page;
|
||||||
|
@ -293,7 +293,8 @@ if (isset($_GET{'delete'})) {
|
||||||
<!-- Start Footer -->
|
<!-- Start Footer -->
|
||||||
<div class="row footer">
|
<div class="row footer">
|
||||||
<div class="col-md-6 text-left">
|
<div class="col-md-6 text-left">
|
||||||
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a
|
||||||
|
href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 text-right">
|
<div class="col-md-6 text-right">
|
||||||
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
||||||
|
|
|
@ -16,7 +16,9 @@ For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
CKEditor — Posted Data
|
CKEditor — Posted Data
|
||||||
</h1>
|
</h1>
|
||||||
<table border="1" cellspacing="0" id="outputSample">
|
<table border="1" cellspacing="0" id="outputSample">
|
||||||
<colgroup><col width="120"></colgroup>
|
<colgroup>
|
||||||
|
<col width="120">
|
||||||
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Field Name</th>
|
<th>Field Name</th>
|
||||||
|
@ -25,10 +27,8 @@ For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
</thead>
|
</thead>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if (!empty($_POST))
|
if (!empty($_POST)) {
|
||||||
{
|
foreach ($_POST as $key => $value) {
|
||||||
foreach ( $_POST as $key => $value )
|
|
||||||
{
|
|
||||||
if ((!is_string($value) && !is_numeric($value)) || !is_string($key))
|
if ((!is_string($value) && !is_numeric($value)) || !is_string($key))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -36,7 +36,9 @@ if (!empty($_POST))
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="vertical-align: top"><?php echo htmlspecialchars((string)$key); ?></th>
|
<th style="vertical-align: top"><?php echo htmlspecialchars((string)$key); ?></th>
|
||||||
<td><pre class="samples"><?php echo $value; ?></pre></td>
|
<td>
|
||||||
|
<pre class="samples"><?php echo $value; ?></pre>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
@ -46,10 +48,12 @@ if (!empty($_POST))
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<hr>
|
<hr>
|
||||||
<p>
|
<p>
|
||||||
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
|
CKEditor - The text editor for the Internet - <a class="samples"
|
||||||
|
href="http://ckeditor.com/">http://ckeditor.com</a>
|
||||||
</p>
|
</p>
|
||||||
<p id="copy">
|
<p id="copy">
|
||||||
Copyright © 2003-2014, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved.
|
Copyright © 2003-2014, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico Knabben. All
|
||||||
|
rights reserved.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -13,4 +13,5 @@
|
||||||
For licensing, see LICENSE.md or <a href="http://ckeditor.com/license">http://ckeditor.com/license</a>
|
For licensing, see LICENSE.md or <a href="http://ckeditor.com/license">http://ckeditor.com/license</a>
|
||||||
-------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
</pre><div style="display:none"></body> */ include "assets/posteddata.php"; ?>
|
</pre><div style="display:none"></body> */
|
||||||
|
include "assets/posteddata.php"; ?>
|
||||||
|
|
|
@ -78,7 +78,8 @@ if (isset($_GET{'edit'})) {
|
||||||
<!-- Start Top Right -->
|
<!-- Start Top Right -->
|
||||||
<ul class="top-right">
|
<ul class="top-right">
|
||||||
<li class="dropdown link">
|
<li class="dropdown link">
|
||||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span class="caret"></span></a>
|
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span
|
||||||
|
class="caret"></span></a>
|
||||||
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
||||||
<li><a href="admin.php">Settings</a></li>
|
<li><a href="admin.php">Settings</a></li>
|
||||||
<li><a href="?logout">Logout</a></li>
|
<li><a href="?logout">Logout</a></li>
|
||||||
|
@ -104,14 +105,17 @@ if (isset($_GET{'edit'})) {
|
||||||
<div class="panel-title">Add a Page</a></div>
|
<div class="panel-title">Add a Page</a></div>
|
||||||
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" class="form-horizontal" method="post">
|
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" class="form-horizontal" method="post">
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="page_name">Page name (No spaces, e.g. terms_of_service)</label> <input class="span6" id=
|
<label for="page_name">Page name (No spaces, e.g. terms_of_service)</label> <input
|
||||||
|
class="span6" id=
|
||||||
"page_name" name="page_name" placeholder="Enter page name"
|
"page_name" name="page_name" placeholder="Enter page name"
|
||||||
type="text" value="<?php echo isset($page_name); ?>">
|
type="text" value="<?php echo isset($page_name); ?>">
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="page_title">Page title</label> <input class=
|
<label for="page_title">Page title</label> <input class=
|
||||||
"span6" id="page_title" name="page_title" placeholder=
|
"span6" id="page_title"
|
||||||
"Enter page title" type="text" value=
|
name="page_title" placeholder=
|
||||||
|
"Enter page title" type="text"
|
||||||
|
value=
|
||||||
"<?php echo isset($page_title); ?>">
|
"<?php echo isset($page_title); ?>">
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
|
@ -121,7 +125,8 @@ if (isset($_GET{'edit'})) {
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class='control-group'>
|
<div class='control-group'>
|
||||||
<textarea class="span6" cols="80" id="editor1" name="data" rows="10"><?php echo isset($page_content); ?></textarea><br>
|
<textarea class="span6" cols="80" id="editor1" name="data"
|
||||||
|
rows="10"><?php echo isset($page_content); ?></textarea><br>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn btn-default btn-sm">Save</button>
|
<button class="btn btn-default btn-sm">Save</button>
|
||||||
</form>
|
</form>
|
||||||
|
@ -170,7 +175,6 @@ if (isset($_GET{'edit'})) {
|
||||||
$rec_count = Trim($row[0]);
|
$rec_count = Trim($row[0]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (isset($_GET['page'])) { // Get the current page
|
if (isset($_GET['page'])) { // Get the current page
|
||||||
$page = $_GET['page'] + 1;
|
$page = $_GET['page'] + 1;
|
||||||
$offset = $rec_limit * $page;
|
$offset = $rec_limit * $page;
|
||||||
|
@ -229,7 +233,8 @@ if (isset($_GET{'edit'})) {
|
||||||
<!-- Start Footer -->
|
<!-- Start Footer -->
|
||||||
<div class="row footer">
|
<div class="row footer">
|
||||||
<div class="col-md-6 text-left">
|
<div class="col-md-6 text-left">
|
||||||
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a
|
||||||
|
href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 text-right">
|
<div class="col-md-6 text-right">
|
||||||
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
||||||
|
|
|
@ -40,7 +40,8 @@ updateAdminHistory($conn);
|
||||||
<!-- Start Top Right -->
|
<!-- Start Top Right -->
|
||||||
<ul class="top-right">
|
<ul class="top-right">
|
||||||
<li class="dropdown link">
|
<li class="dropdown link">
|
||||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span class="caret"></span></a>
|
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span
|
||||||
|
class="caret"></span></a>
|
||||||
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
||||||
<li><a href="admin.php">Settings</a></li>
|
<li><a href="admin.php">Settings</a></li>
|
||||||
<li><a href="?logout">Logout</a></li>
|
<li><a href="?logout">Logout</a></li>
|
||||||
|
@ -195,7 +196,8 @@ updateAdminHistory($conn);
|
||||||
|
|
||||||
<?php if (isset($msg)) echo $msg; ?>
|
<?php if (isset($msg)) echo $msg; ?>
|
||||||
|
|
||||||
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="pastesTable">
|
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered"
|
||||||
|
id="pastesTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
|
@ -223,7 +225,8 @@ updateAdminHistory($conn);
|
||||||
<!-- Start Footer -->
|
<!-- Start Footer -->
|
||||||
<div class="row footer">
|
<div class="row footer">
|
||||||
<div class="col-md-6 text-left">
|
<div class="col-md-6 text-left">
|
||||||
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a
|
||||||
|
href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 text-right">
|
<div class="col-md-6 text-right">
|
||||||
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
||||||
|
|
|
@ -93,7 +93,8 @@ if ($last_ip == $ip) {
|
||||||
<!-- Start Top Right -->
|
<!-- Start Top Right -->
|
||||||
<ul class="top-right">
|
<ul class="top-right">
|
||||||
<li class="dropdown link">
|
<li class="dropdown link">
|
||||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span class="caret"></span></a>
|
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span
|
||||||
|
class="caret"></span></a>
|
||||||
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
||||||
<li><a href="admin.php">Settings</a></li>
|
<li><a href="admin.php">Settings</a></li>
|
||||||
<li><a href="?logout">Logout</a></li>
|
<li><a href="?logout">Logout</a></li>
|
||||||
|
@ -264,7 +265,8 @@ if ($last_ip == $ip) {
|
||||||
|
|
||||||
<?php if (isset($msg)) echo $msg; ?>
|
<?php if (isset($msg)) echo $msg; ?>
|
||||||
|
|
||||||
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="pastesTable">
|
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered"
|
||||||
|
id="pastesTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
|
@ -292,7 +294,8 @@ if ($last_ip == $ip) {
|
||||||
<!-- Start Footer -->
|
<!-- Start Footer -->
|
||||||
<div class="row footer">
|
<div class="row footer">
|
||||||
<div class="col-md-6 text-left">
|
<div class="col-md-6 text-left">
|
||||||
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a
|
||||||
|
href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 text-right">
|
<div class="col-md-6 text-right">
|
||||||
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
||||||
|
|
|
@ -99,7 +99,8 @@ while ($row = mysqli_fetch_array($result)) {
|
||||||
<!-- Start Top Right -->
|
<!-- Start Top Right -->
|
||||||
<ul class="top-right">
|
<ul class="top-right">
|
||||||
<li class="dropdown link">
|
<li class="dropdown link">
|
||||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span class="caret"></span></a>
|
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span
|
||||||
|
class="caret"></span></a>
|
||||||
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
||||||
<li><a href="admin.php">Settings</a></li>
|
<li><a href="admin.php">Settings</a></li>
|
||||||
<li><a href="?logout">Logout</a></li>
|
<li><a href="?logout">Logout</a></li>
|
||||||
|
@ -148,11 +149,13 @@ while ($row = mysqli_fetch_array($result)) {
|
||||||
<form method="POST" action="sitemap.php">
|
<form method="POST" action="sitemap.php">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="changefreq">Change Frequency</label>
|
<label for="changefreq">Change Frequency</label>
|
||||||
<input type="text" placeholder="Enter frequency range" name="changefreq" id="changefreq" value="<?php echo $changefreq; ?>" class="form-control">
|
<input type="text" placeholder="Enter frequency range" name="changefreq" id="changefreq"
|
||||||
|
value="<?php echo $changefreq; ?>" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="priority">Priority Level</label>
|
<label for="priority">Priority Level</label>
|
||||||
<input type="text" placeholder="Enter priority..." id="priority" name="priority" value="<?php echo $priority; ?>" class="form-control">
|
<input type="text" placeholder="Enter priority..." id="priority" name="priority"
|
||||||
|
value="<?php echo $priority; ?>" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="btn btn-default" type="submit">Submit</button>
|
<button class="btn btn-default" type="submit">Submit</button>
|
||||||
|
@ -164,7 +167,11 @@ while ($row = mysqli_fetch_array($result)) {
|
||||||
// which protocol are we on
|
// which protocol are we on
|
||||||
$protocol = paste_protocol();
|
$protocol = paste_protocol();
|
||||||
// level up, dirty but meh
|
// level up, dirty but meh
|
||||||
$x=2;$path = dirname($_SERVER['PHP_SELF']); while(max(0, --$x)) { $levelup = dirname($path); }
|
$x = 2;
|
||||||
|
$path = dirname($_SERVER['PHP_SELF']);
|
||||||
|
while (max(0, --$x)) {
|
||||||
|
$levelup = dirname($path);
|
||||||
|
}
|
||||||
$c_date = date('Y-m-d');
|
$c_date = date('Y-m-d');
|
||||||
$data = '<?xml version="1.0" encoding="UTF-8"?>
|
$data = '<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
@ -223,7 +230,8 @@ while ($row = mysqli_fetch_array($result)) {
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<form method="GET" action="sitemap.php">
|
<form method="GET" action="sitemap.php">
|
||||||
<button class="btn btn-default" name="re" id="re" type="submit">Generate sitemap.xml</button>
|
<button class="btn btn-default" name="re" id="re" type="submit">Generate sitemap.xml
|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -236,7 +244,8 @@ while ($row = mysqli_fetch_array($result)) {
|
||||||
<!-- Start Footer -->
|
<!-- Start Footer -->
|
||||||
<div class="row footer">
|
<div class="row footer">
|
||||||
<div class="col-md-6 text-left">
|
<div class="col-md-6 text-left">
|
||||||
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a
|
||||||
|
href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 text-right">
|
<div class="col-md-6 text-right">
|
||||||
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
||||||
|
|
|
@ -8,8 +8,7 @@ class SSP {
|
||||||
* @param array $data Data from the SQL get
|
* @param array $data Data from the SQL get
|
||||||
* @return array Formatted data in a row based format
|
* @return array Formatted data in a row based format
|
||||||
*/
|
*/
|
||||||
static function data_output ( $columns, $data )
|
static function data_output($columns, $data) {
|
||||||
{
|
|
||||||
$out = array();
|
$out = array();
|
||||||
|
|
||||||
for ($i = 0, $ien = count($data); $i < $ien; $i++) {
|
for ($i = 0, $ien = count($data); $i < $ien; $i++) {
|
||||||
|
@ -21,8 +20,7 @@ class SSP {
|
||||||
// Is there a formatter?
|
// Is there a formatter?
|
||||||
if (isset($column['formatter'])) {
|
if (isset($column['formatter'])) {
|
||||||
$row[$column['dt']] = $column['formatter']($data[$i][$column['db']], $data[$i]);
|
$row[$column['dt']] = $column['formatter']($data[$i][$column['db']], $data[$i]);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$row[$column['dt']] = $data[$i][$columns[$j]['db']];
|
$row[$column['dt']] = $data[$i][$columns[$j]['db']];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,8 +41,7 @@ class SSP {
|
||||||
* @param array $columns Column information array
|
* @param array $columns Column information array
|
||||||
* @return string SQL limit clause
|
* @return string SQL limit clause
|
||||||
*/
|
*/
|
||||||
static function limit ( $request, $columns )
|
static function limit($request, $columns) {
|
||||||
{
|
|
||||||
$limit = '';
|
$limit = '';
|
||||||
|
|
||||||
if (isset($request['start']) && $request['length'] != -1) {
|
if (isset($request['start']) && $request['length'] != -1) {
|
||||||
|
@ -64,8 +61,7 @@ class SSP {
|
||||||
* @param array $columns Column information array
|
* @param array $columns Column information array
|
||||||
* @return string SQL order by clause
|
* @return string SQL order by clause
|
||||||
*/
|
*/
|
||||||
static function order ( $request, $columns )
|
static function order($request, $columns) {
|
||||||
{
|
|
||||||
$order = '';
|
$order = '';
|
||||||
|
|
||||||
if (isset($request['order']) && count($request['order'])) {
|
if (isset($request['order']) && count($request['order'])) {
|
||||||
|
@ -111,8 +107,7 @@ class SSP {
|
||||||
* sql_exec() function
|
* sql_exec() function
|
||||||
* @return string SQL where clause
|
* @return string SQL where clause
|
||||||
*/
|
*/
|
||||||
static function filter ( $request, $columns, &$bindings )
|
static function filter($request, $columns, &$bindings) {
|
||||||
{
|
|
||||||
$globalSearch = array();
|
$globalSearch = array();
|
||||||
$columnSearch = array();
|
$columnSearch = array();
|
||||||
$dtColumns = self::pluck($columns, 'dt');
|
$dtColumns = self::pluck($columns, 'dt');
|
||||||
|
@ -182,8 +177,7 @@ class SSP {
|
||||||
* @param array $columns Column information array
|
* @param array $columns Column information array
|
||||||
* @return array Server-side processing response array
|
* @return array Server-side processing response array
|
||||||
*/
|
*/
|
||||||
static function simple ( $request, $sql_details, $table, $primaryKey, $columns, $columns2 )
|
static function simple($request, $sql_details, $table, $primaryKey, $columns, $columns2) {
|
||||||
{
|
|
||||||
$bindings = array();
|
$bindings = array();
|
||||||
$db = self::sql_connect($sql_details);
|
$db = self::sql_connect($sql_details);
|
||||||
|
|
||||||
|
@ -236,8 +230,7 @@ class SSP {
|
||||||
* * pass - user password
|
* * pass - user password
|
||||||
* @return resource Database connection handle
|
* @return resource Database connection handle
|
||||||
*/
|
*/
|
||||||
static function sql_connect ( $sql_details )
|
static function sql_connect($sql_details) {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
$db = @new PDO(
|
$db = @new PDO(
|
||||||
"mysql:host={$sql_details['host']};dbname={$sql_details['db']}",
|
"mysql:host={$sql_details['host']};dbname={$sql_details['db']}",
|
||||||
|
@ -245,8 +238,7 @@ class SSP {
|
||||||
$sql_details['pass'],
|
$sql_details['pass'],
|
||||||
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)
|
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)
|
||||||
);
|
);
|
||||||
}
|
} catch (PDOException $e) {
|
||||||
catch (PDOException $e) {
|
|
||||||
self::fatal(
|
self::fatal(
|
||||||
"An error occurred while connecting to the database. " .
|
"An error occurred while connecting to the database. " .
|
||||||
"The error reported by the server was: " . $e->getMessage()
|
"The error reported by the server was: " . $e->getMessage()
|
||||||
|
@ -267,8 +259,7 @@ class SSP {
|
||||||
* @param string $sql SQL query to execute.
|
* @param string $sql SQL query to execute.
|
||||||
* @return array Result from the query (all rows)
|
* @return array Result from the query (all rows)
|
||||||
*/
|
*/
|
||||||
static function sql_exec ( $db, $bindings, $sql=null )
|
static function sql_exec($db, $bindings, $sql = null) {
|
||||||
{
|
|
||||||
// Argument shifting
|
// Argument shifting
|
||||||
if ($sql === null) {
|
if ($sql === null) {
|
||||||
$sql = $bindings;
|
$sql = $bindings;
|
||||||
|
@ -288,16 +279,14 @@ class SSP {
|
||||||
// Execute
|
// Execute
|
||||||
try {
|
try {
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
}
|
} catch (PDOException $e) {
|
||||||
catch (PDOException $e) {
|
|
||||||
self::fatal("An SQL error occurred: " . $e->getMessage());
|
self::fatal("An SQL error occurred: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
$result = $stmt->fetchAll();
|
$result = $stmt->fetchAll();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function Ssql_exec ($db, $bindings, $sql=null )
|
static function Ssql_exec($db, $bindings, $sql = null) {
|
||||||
{
|
|
||||||
// Argument shifting
|
// Argument shifting
|
||||||
if ($sql === null) {
|
if ($sql === null) {
|
||||||
$sql = $bindings;
|
$sql = $bindings;
|
||||||
|
@ -316,8 +305,7 @@ class SSP {
|
||||||
// Execute
|
// Execute
|
||||||
try {
|
try {
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
}
|
} catch (PDOException $e) {
|
||||||
catch (PDOException $e) {
|
|
||||||
self::fatal("An SQL error occurred: " . $e->getMessage());
|
self::fatal("An SQL error occurred: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
$loop = '0';
|
$loop = '0';
|
||||||
|
@ -327,16 +315,11 @@ class SSP {
|
||||||
$result[$loop]['member'] = $arr['member'];
|
$result[$loop]['member'] = $arr['member'];
|
||||||
$result[$loop]['ip'] = $arr['ip'];
|
$result[$loop]['ip'] = $arr['ip'];
|
||||||
$vis = Trim($arr['visible']);
|
$vis = Trim($arr['visible']);
|
||||||
if ($vis == '0')
|
if ($vis == '0') {
|
||||||
{
|
|
||||||
$result[$loop]['visible'] = "Public";
|
$result[$loop]['visible'] = "Public";
|
||||||
}
|
} elseif ($vis == '1') {
|
||||||
elseif ($vis == '1')
|
|
||||||
{
|
|
||||||
$result[$loop]['visible'] = "Unlisted";
|
$result[$loop]['visible'] = "Unlisted";
|
||||||
}
|
} elseif ($vis == '2') {
|
||||||
elseif ($vis == '2')
|
|
||||||
{
|
|
||||||
$result[$loop]['visible'] = "Private";
|
$result[$loop]['visible'] = "Private";
|
||||||
}
|
}
|
||||||
$myid = $arr['id'];
|
$myid = $arr['id'];
|
||||||
|
@ -361,8 +344,7 @@ class SSP {
|
||||||
*
|
*
|
||||||
* @param string $msg Message to send to the client
|
* @param string $msg Message to send to the client
|
||||||
*/
|
*/
|
||||||
static function fatal ( $msg )
|
static function fatal($msg) {
|
||||||
{
|
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
"error" => $msg
|
"error" => $msg
|
||||||
));
|
));
|
||||||
|
@ -380,8 +362,7 @@ class SSP {
|
||||||
* @return string Bound key to be used in the SQL where this parameter
|
* @return string Bound key to be used in the SQL where this parameter
|
||||||
* would be used.
|
* would be used.
|
||||||
*/
|
*/
|
||||||
static function bind ( &$a, $val, $type )
|
static function bind(&$a, $val, $type) {
|
||||||
{
|
|
||||||
$key = ':binding_' . count($a);
|
$key = ':binding_' . count($a);
|
||||||
|
|
||||||
$a[] = array(
|
$a[] = array(
|
||||||
|
@ -402,8 +383,7 @@ class SSP {
|
||||||
* @param string $prop Property to read
|
* @param string $prop Property to read
|
||||||
* @return array Array of property values
|
* @return array Array of property values
|
||||||
*/
|
*/
|
||||||
static function pluck ( $a, $prop )
|
static function pluck($a, $prop) {
|
||||||
{
|
|
||||||
$out = array();
|
$out = array();
|
||||||
|
|
||||||
for ($i = 0, $len = count($a); $i < $len; $i++) {
|
for ($i = 0, $len = count($a); $i < $len; $i++) {
|
||||||
|
|
|
@ -8,8 +8,7 @@ class SSP {
|
||||||
* @param array $data Data from the SQL get
|
* @param array $data Data from the SQL get
|
||||||
* @return array Formatted data in a row based format
|
* @return array Formatted data in a row based format
|
||||||
*/
|
*/
|
||||||
static function data_output ( $columns, $data )
|
static function data_output($columns, $data) {
|
||||||
{
|
|
||||||
$out = array();
|
$out = array();
|
||||||
|
|
||||||
for ($i = 0, $ien = count($data); $i < $ien; $i++) {
|
for ($i = 0, $ien = count($data); $i < $ien; $i++) {
|
||||||
|
@ -21,8 +20,7 @@ class SSP {
|
||||||
// Is there a formatter?
|
// Is there a formatter?
|
||||||
if (isset($column['formatter'])) {
|
if (isset($column['formatter'])) {
|
||||||
$row[$column['dt']] = $column['formatter']($data[$i][$column['db']], $data[$i]);
|
$row[$column['dt']] = $column['formatter']($data[$i][$column['db']], $data[$i]);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$row[$column['dt']] = $data[$i][$columns[$j]['db']];
|
$row[$column['dt']] = $data[$i][$columns[$j]['db']];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,8 +41,7 @@ class SSP {
|
||||||
* @param array $columns Column information array
|
* @param array $columns Column information array
|
||||||
* @return string SQL limit clause
|
* @return string SQL limit clause
|
||||||
*/
|
*/
|
||||||
static function limit ( $request, $columns )
|
static function limit($request, $columns) {
|
||||||
{
|
|
||||||
$limit = '';
|
$limit = '';
|
||||||
|
|
||||||
if (isset($request['start']) && $request['length'] != -1) {
|
if (isset($request['start']) && $request['length'] != -1) {
|
||||||
|
@ -64,8 +61,7 @@ class SSP {
|
||||||
* @param array $columns Column information array
|
* @param array $columns Column information array
|
||||||
* @return string SQL order by clause
|
* @return string SQL order by clause
|
||||||
*/
|
*/
|
||||||
static function order ( $request, $columns )
|
static function order($request, $columns) {
|
||||||
{
|
|
||||||
$order = '';
|
$order = '';
|
||||||
|
|
||||||
if (isset($request['order']) && count($request['order'])) {
|
if (isset($request['order']) && count($request['order'])) {
|
||||||
|
@ -111,8 +107,7 @@ class SSP {
|
||||||
* sql_exec() function
|
* sql_exec() function
|
||||||
* @return string SQL where clause
|
* @return string SQL where clause
|
||||||
*/
|
*/
|
||||||
static function filter ( $request, $columns, &$bindings )
|
static function filter($request, $columns, &$bindings) {
|
||||||
{
|
|
||||||
$globalSearch = array();
|
$globalSearch = array();
|
||||||
$columnSearch = array();
|
$columnSearch = array();
|
||||||
$dtColumns = self::pluck($columns, 'dt');
|
$dtColumns = self::pluck($columns, 'dt');
|
||||||
|
@ -182,8 +177,7 @@ class SSP {
|
||||||
* @param array $columns Column information array
|
* @param array $columns Column information array
|
||||||
* @return array Server-side processing response array
|
* @return array Server-side processing response array
|
||||||
*/
|
*/
|
||||||
static function simple ( $request, $sql_details, $table, $primaryKey, $columns, $columns2 )
|
static function simple($request, $sql_details, $table, $primaryKey, $columns, $columns2) {
|
||||||
{
|
|
||||||
$bindings = array();
|
$bindings = array();
|
||||||
$db = self::sql_connect($sql_details);
|
$db = self::sql_connect($sql_details);
|
||||||
|
|
||||||
|
@ -236,8 +230,7 @@ class SSP {
|
||||||
* * pass - user password
|
* * pass - user password
|
||||||
* @return resource Database connection handle
|
* @return resource Database connection handle
|
||||||
*/
|
*/
|
||||||
static function sql_connect ( $sql_details )
|
static function sql_connect($sql_details) {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
$db = @new PDO(
|
$db = @new PDO(
|
||||||
"mysql:host={$sql_details['host']};dbname={$sql_details['db']}",
|
"mysql:host={$sql_details['host']};dbname={$sql_details['db']}",
|
||||||
|
@ -245,8 +238,7 @@ class SSP {
|
||||||
$sql_details['pass'],
|
$sql_details['pass'],
|
||||||
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)
|
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)
|
||||||
);
|
);
|
||||||
}
|
} catch (PDOException $e) {
|
||||||
catch (PDOException $e) {
|
|
||||||
self::fatal(
|
self::fatal(
|
||||||
"An error occurred while connecting to the database. " .
|
"An error occurred while connecting to the database. " .
|
||||||
"The error reported by the server was: " . $e->getMessage()
|
"The error reported by the server was: " . $e->getMessage()
|
||||||
|
@ -267,8 +259,7 @@ class SSP {
|
||||||
* @param string $sql SQL query to execute.
|
* @param string $sql SQL query to execute.
|
||||||
* @return array Result from the query (all rows)
|
* @return array Result from the query (all rows)
|
||||||
*/
|
*/
|
||||||
static function sql_exec ( $db, $bindings, $sql=null )
|
static function sql_exec($db, $bindings, $sql = null) {
|
||||||
{
|
|
||||||
// Argument shifting
|
// Argument shifting
|
||||||
if ($sql === null) {
|
if ($sql === null) {
|
||||||
$sql = $bindings;
|
$sql = $bindings;
|
||||||
|
@ -288,16 +279,14 @@ class SSP {
|
||||||
// Execute
|
// Execute
|
||||||
try {
|
try {
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
}
|
} catch (PDOException $e) {
|
||||||
catch (PDOException $e) {
|
|
||||||
self::fatal("An SQL error occurred: " . $e->getMessage());
|
self::fatal("An SQL error occurred: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
$result = $stmt->fetchAll();
|
$result = $stmt->fetchAll();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function Ssql_exec ($db, $bindings, $sql=null )
|
static function Ssql_exec($db, $bindings, $sql = null) {
|
||||||
{
|
|
||||||
// Argument shifting
|
// Argument shifting
|
||||||
if ($sql === null) {
|
if ($sql === null) {
|
||||||
$sql = $bindings;
|
$sql = $bindings;
|
||||||
|
@ -316,8 +305,7 @@ class SSP {
|
||||||
// Execute
|
// Execute
|
||||||
try {
|
try {
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
}
|
} catch (PDOException $e) {
|
||||||
catch (PDOException $e) {
|
|
||||||
self::fatal("An SQL error occurred: " . $e->getMessage());
|
self::fatal("An SQL error occurred: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
$loop = '0';
|
$loop = '0';
|
||||||
|
@ -327,16 +315,11 @@ class SSP {
|
||||||
$result[$loop]['m_report'] = $arr['m_report'];
|
$result[$loop]['m_report'] = $arr['m_report'];
|
||||||
$result[$loop]['p_report'] = $arr['p_report'];
|
$result[$loop]['p_report'] = $arr['p_report'];
|
||||||
$vis = Trim($arr['rep_reason']);
|
$vis = Trim($arr['rep_reason']);
|
||||||
if ($vis == '0')
|
if ($vis == '0') {
|
||||||
{
|
|
||||||
$result[$loop]['rep_reason'] = "Public";
|
$result[$loop]['rep_reason'] = "Public";
|
||||||
}
|
} elseif ($vis == '1') {
|
||||||
elseif ($vis == '1')
|
|
||||||
{
|
|
||||||
$result[$loop]['rep_reason'] = "Unlisted";
|
$result[$loop]['rep_reason'] = "Unlisted";
|
||||||
}
|
} elseif ($vis == '2') {
|
||||||
elseif ($vis == '2')
|
|
||||||
{
|
|
||||||
$result[$loop]['rep_reason'] = "Private";
|
$result[$loop]['rep_reason'] = "Private";
|
||||||
}
|
}
|
||||||
$rid = $arr['p_report'];
|
$rid = $arr['p_report'];
|
||||||
|
@ -362,8 +345,7 @@ class SSP {
|
||||||
*
|
*
|
||||||
* @param string $msg Message to send to the client
|
* @param string $msg Message to send to the client
|
||||||
*/
|
*/
|
||||||
static function fatal ( $msg )
|
static function fatal($msg) {
|
||||||
{
|
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
"error" => $msg
|
"error" => $msg
|
||||||
));
|
));
|
||||||
|
@ -381,8 +363,7 @@ class SSP {
|
||||||
* @return string Bound key to be used in the SQL where this parameter
|
* @return string Bound key to be used in the SQL where this parameter
|
||||||
* would be used.
|
* would be used.
|
||||||
*/
|
*/
|
||||||
static function bind ( &$a, $val, $type )
|
static function bind(&$a, $val, $type) {
|
||||||
{
|
|
||||||
$key = ':binding_' . count($a);
|
$key = ':binding_' . count($a);
|
||||||
|
|
||||||
$a[] = array(
|
$a[] = array(
|
||||||
|
@ -403,8 +384,7 @@ class SSP {
|
||||||
* @param string $prop Property to read
|
* @param string $prop Property to read
|
||||||
* @return array Array of property values
|
* @return array Array of property values
|
||||||
*/
|
*/
|
||||||
static function pluck ( $a, $prop )
|
static function pluck($a, $prop) {
|
||||||
{
|
|
||||||
$out = array();
|
$out = array();
|
||||||
|
|
||||||
for ($i = 0, $len = count($a); $i < $len; $i++) {
|
for ($i = 0, $len = count($a); $i < $len; $i++) {
|
||||||
|
|
|
@ -8,8 +8,7 @@ class SSP {
|
||||||
* @param array $data Data from the SQL get
|
* @param array $data Data from the SQL get
|
||||||
* @return array Formatted data in a row based format
|
* @return array Formatted data in a row based format
|
||||||
*/
|
*/
|
||||||
static function data_output ( $columns, $data )
|
static function data_output($columns, $data) {
|
||||||
{
|
|
||||||
$out = array();
|
$out = array();
|
||||||
|
|
||||||
for ($i = 0, $ien = count($data); $i < $ien; $i++) {
|
for ($i = 0, $ien = count($data); $i < $ien; $i++) {
|
||||||
|
@ -21,8 +20,7 @@ class SSP {
|
||||||
// Is there a formatter?
|
// Is there a formatter?
|
||||||
if (isset($column['formatter'])) {
|
if (isset($column['formatter'])) {
|
||||||
$row[$column['dt']] = $column['formatter']($data[$i][$column['db']], $data[$i]);
|
$row[$column['dt']] = $column['formatter']($data[$i][$column['db']], $data[$i]);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$row[$column['dt']] = $data[$i][$columns[$j]['db']];
|
$row[$column['dt']] = $data[$i][$columns[$j]['db']];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,8 +41,7 @@ class SSP {
|
||||||
* @param array $columns Column information array
|
* @param array $columns Column information array
|
||||||
* @return string SQL limit clause
|
* @return string SQL limit clause
|
||||||
*/
|
*/
|
||||||
static function limit ( $request, $columns )
|
static function limit($request, $columns) {
|
||||||
{
|
|
||||||
$limit = '';
|
$limit = '';
|
||||||
|
|
||||||
if (isset($request['start']) && $request['length'] != -1) {
|
if (isset($request['start']) && $request['length'] != -1) {
|
||||||
|
@ -64,8 +61,7 @@ class SSP {
|
||||||
* @param array $columns Column information array
|
* @param array $columns Column information array
|
||||||
* @return string SQL order by clause
|
* @return string SQL order by clause
|
||||||
*/
|
*/
|
||||||
static function order ( $request, $columns )
|
static function order($request, $columns) {
|
||||||
{
|
|
||||||
$order = '';
|
$order = '';
|
||||||
|
|
||||||
if (isset($request['order']) && count($request['order'])) {
|
if (isset($request['order']) && count($request['order'])) {
|
||||||
|
@ -111,8 +107,7 @@ class SSP {
|
||||||
* sql_exec() function
|
* sql_exec() function
|
||||||
* @return string SQL where clause
|
* @return string SQL where clause
|
||||||
*/
|
*/
|
||||||
static function filter ( $request, $columns, &$bindings )
|
static function filter($request, $columns, &$bindings) {
|
||||||
{
|
|
||||||
$globalSearch = array();
|
$globalSearch = array();
|
||||||
$columnSearch = array();
|
$columnSearch = array();
|
||||||
$dtColumns = self::pluck($columns, 'dt');
|
$dtColumns = self::pluck($columns, 'dt');
|
||||||
|
@ -182,8 +177,7 @@ class SSP {
|
||||||
* @param array $columns Column information array
|
* @param array $columns Column information array
|
||||||
* @return array Server-side processing response array
|
* @return array Server-side processing response array
|
||||||
*/
|
*/
|
||||||
static function simple ( $request, $sql_details, $table, $primaryKey, $columns, $columns2 )
|
static function simple($request, $sql_details, $table, $primaryKey, $columns, $columns2) {
|
||||||
{
|
|
||||||
$bindings = array();
|
$bindings = array();
|
||||||
$db = self::sql_connect($sql_details);
|
$db = self::sql_connect($sql_details);
|
||||||
|
|
||||||
|
@ -236,8 +230,7 @@ class SSP {
|
||||||
* * pass - user password
|
* * pass - user password
|
||||||
* @return resource Database connection handle
|
* @return resource Database connection handle
|
||||||
*/
|
*/
|
||||||
static function sql_connect ( $sql_details )
|
static function sql_connect($sql_details) {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
$db = @new PDO(
|
$db = @new PDO(
|
||||||
"mysql:host={$sql_details['host']};dbname={$sql_details['db']}",
|
"mysql:host={$sql_details['host']};dbname={$sql_details['db']}",
|
||||||
|
@ -245,8 +238,7 @@ class SSP {
|
||||||
$sql_details['pass'],
|
$sql_details['pass'],
|
||||||
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)
|
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)
|
||||||
);
|
);
|
||||||
}
|
} catch (PDOException $e) {
|
||||||
catch (PDOException $e) {
|
|
||||||
self::fatal(
|
self::fatal(
|
||||||
"An error occurred while connecting to the database. " .
|
"An error occurred while connecting to the database. " .
|
||||||
"The error reported by the server was: " . $e->getMessage()
|
"The error reported by the server was: " . $e->getMessage()
|
||||||
|
@ -267,8 +259,7 @@ class SSP {
|
||||||
* @param string $sql SQL query to execute.
|
* @param string $sql SQL query to execute.
|
||||||
* @return array Result from the query (all rows)
|
* @return array Result from the query (all rows)
|
||||||
*/
|
*/
|
||||||
static function sql_exec ( $db, $bindings, $sql=null )
|
static function sql_exec($db, $bindings, $sql = null) {
|
||||||
{
|
|
||||||
// Argument shifting
|
// Argument shifting
|
||||||
if ($sql === null) {
|
if ($sql === null) {
|
||||||
$sql = $bindings;
|
$sql = $bindings;
|
||||||
|
@ -288,16 +279,14 @@ class SSP {
|
||||||
// Execute
|
// Execute
|
||||||
try {
|
try {
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
}
|
} catch (PDOException $e) {
|
||||||
catch (PDOException $e) {
|
|
||||||
self::fatal("An SQL error occurred: " . $e->getMessage());
|
self::fatal("An SQL error occurred: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
$result = $stmt->fetchAll();
|
$result = $stmt->fetchAll();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function Ssql_exec ($db, $bindings, $sql=null )
|
static function Ssql_exec($db, $bindings, $sql = null) {
|
||||||
{
|
|
||||||
// Argument shifting
|
// Argument shifting
|
||||||
if ($sql === null) {
|
if ($sql === null) {
|
||||||
$sql = $bindings;
|
$sql = $bindings;
|
||||||
|
@ -316,8 +305,7 @@ class SSP {
|
||||||
// Execute
|
// Execute
|
||||||
try {
|
try {
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
}
|
} catch (PDOException $e) {
|
||||||
catch (PDOException $e) {
|
|
||||||
self::fatal("An SQL error occurred: " . $e->getMessage());
|
self::fatal("An SQL error occurred: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
$loop = '0';
|
$loop = '0';
|
||||||
|
@ -331,16 +319,11 @@ class SSP {
|
||||||
$ver = $arr['verified'];
|
$ver = $arr['verified'];
|
||||||
|
|
||||||
$myid = $arr['id'];
|
$myid = $arr['id'];
|
||||||
if ($ver == '0')
|
if ($ver == '0') {
|
||||||
{
|
|
||||||
$result[$loop]['ban'] = "<span class='bg-red'>User unverified</span>";
|
$result[$loop]['ban'] = "<span class='bg-red'>User unverified</span>";
|
||||||
}
|
} elseif ($ver == '1') {
|
||||||
elseif ($ver == '1')
|
|
||||||
{
|
|
||||||
$result[$loop]['ban'] = "<a class='btn btn-danger btn-sm' href=users.php?ban=" . $myid . "> Ban </a>";
|
$result[$loop]['ban'] = "<a class='btn btn-danger btn-sm' href=users.php?ban=" . $myid . "> Ban </a>";
|
||||||
}
|
} elseif ($ver == '2') {
|
||||||
elseif ($ver == '2')
|
|
||||||
{
|
|
||||||
$result[$loop]['ban'] = "<a class='btn btn-success btn-sm' href=users.php?unban=" . $myid . "> Unban </a>";
|
$result[$loop]['ban'] = "<a class='btn btn-success btn-sm' href=users.php?unban=" . $myid . "> Unban </a>";
|
||||||
}
|
}
|
||||||
$result[$loop]['view'] = "<a class='btn btn-default btn-sm' href=users.php?details=" . $myid . "> Details </a>";
|
$result[$loop]['view'] = "<a class='btn btn-default btn-sm' href=users.php?details=" . $myid . "> Details </a>";
|
||||||
|
@ -363,8 +346,7 @@ class SSP {
|
||||||
*
|
*
|
||||||
* @param string $msg Message to send to the client
|
* @param string $msg Message to send to the client
|
||||||
*/
|
*/
|
||||||
static function fatal ( $msg )
|
static function fatal($msg) {
|
||||||
{
|
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
"error" => $msg
|
"error" => $msg
|
||||||
));
|
));
|
||||||
|
@ -382,8 +364,7 @@ class SSP {
|
||||||
* @return string Bound key to be used in the SQL where this parameter
|
* @return string Bound key to be used in the SQL where this parameter
|
||||||
* would be used.
|
* would be used.
|
||||||
*/
|
*/
|
||||||
static function bind ( &$a, $val, $type )
|
static function bind(&$a, $val, $type) {
|
||||||
{
|
|
||||||
$key = ':binding_' . count($a);
|
$key = ':binding_' . count($a);
|
||||||
|
|
||||||
$a[] = array(
|
$a[] = array(
|
||||||
|
@ -404,8 +385,7 @@ class SSP {
|
||||||
* @param string $prop Property to read
|
* @param string $prop Property to read
|
||||||
* @return array Array of property values
|
* @return array Array of property values
|
||||||
*/
|
*/
|
||||||
static function pluck ( $a, $prop )
|
static function pluck($a, $prop) {
|
||||||
{
|
|
||||||
$out = array();
|
$out = array();
|
||||||
|
|
||||||
for ($i = 0, $len = count($a); $i < $len; $i++) {
|
for ($i = 0, $len = count($a); $i < $len; $i++) {
|
||||||
|
@ -415,6 +395,7 @@ class SSP {
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_SERVER['HTTP_X_REQUESTED_WITH'] != "XMLHttpRequest") {
|
if ($_SERVER['HTTP_X_REQUESTED_WITH'] != "XMLHttpRequest") {
|
||||||
header("Location: http://ponepaste.org/SVOtaKqJZh4nT9Z");
|
header("Location: http://ponepaste.org/SVOtaKqJZh4nT9Z");
|
||||||
die();
|
die();
|
||||||
|
|
|
@ -90,7 +90,8 @@ if ($last_ip == $ip) {
|
||||||
<!-- Start Top Right -->
|
<!-- Start Top Right -->
|
||||||
<ul class="top-right">
|
<ul class="top-right">
|
||||||
<li class="dropdown link">
|
<li class="dropdown link">
|
||||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span class="caret"></span></a>
|
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span
|
||||||
|
class="caret"></span></a>
|
||||||
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
||||||
<li><a href="admin.php">Settings</a></li>
|
<li><a href="admin.php">Settings</a></li>
|
||||||
<li><a href="?logout">Logout</a></li>
|
<li><a href="?logout">Logout</a></li>
|
||||||
|
@ -330,7 +331,8 @@ if ($last_ip == $ip) {
|
||||||
<!-- Start Footer -->
|
<!-- Start Footer -->
|
||||||
<div class="row footer">
|
<div class="row footer">
|
||||||
<div class="col-md-6 text-left">
|
<div class="col-md-6 text-left">
|
||||||
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a
|
||||||
|
href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 text-right">
|
<div class="col-md-6 text-right">
|
||||||
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
||||||
|
|
|
@ -90,7 +90,8 @@ if ($last_ip == $ip) {
|
||||||
<!-- Start Top Right -->
|
<!-- Start Top Right -->
|
||||||
<ul class="top-right">
|
<ul class="top-right">
|
||||||
<li class="dropdown link">
|
<li class="dropdown link">
|
||||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span class="caret"></span></a>
|
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span
|
||||||
|
class="caret"></span></a>
|
||||||
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
||||||
<li><a href="admin.php">Settings</a></li>
|
<li><a href="admin.php">Settings</a></li>
|
||||||
<li><a href="?logout">Logout</a></li>
|
<li><a href="?logout">Logout</a></li>
|
||||||
|
@ -254,7 +255,8 @@ if ($last_ip == $ip) {
|
||||||
<!-- Start Footer -->
|
<!-- Start Footer -->
|
||||||
<div class="row footer">
|
<div class="row footer">
|
||||||
<div class="col-md-6 text-left">
|
<div class="col-md-6 text-left">
|
||||||
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a
|
||||||
|
href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 text-right">
|
<div class="col-md-6 text-right">
|
||||||
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
||||||
|
|
|
@ -91,7 +91,8 @@ if ($last_ip == $ip) {
|
||||||
<!-- Start Top Right -->
|
<!-- Start Top Right -->
|
||||||
<ul class="top-right">
|
<ul class="top-right">
|
||||||
<li class="dropdown link">
|
<li class="dropdown link">
|
||||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span class="caret"></span></a>
|
<a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><b>Admin</b><span
|
||||||
|
class="caret"></span></a>
|
||||||
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
<ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
|
||||||
<li><a href="admin.php">Settings</a></li>
|
<li><a href="admin.php">Settings</a></li>
|
||||||
<li><a href="?logout">Logout</a></li>
|
<li><a href="?logout">Logout</a></li>
|
||||||
|
@ -243,7 +244,8 @@ if ($last_ip == $ip) {
|
||||||
|
|
||||||
<?php if (isset($msg)) echo $msg; ?>
|
<?php if (isset($msg)) echo $msg; ?>
|
||||||
|
|
||||||
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="usersTable">
|
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered"
|
||||||
|
id="usersTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
|
@ -272,7 +274,8 @@ if ($last_ip == $ip) {
|
||||||
<!-- Start Footer -->
|
<!-- Start Footer -->
|
||||||
<div class="row footer">
|
<div class="row footer">
|
||||||
<div class="col-md-6 text-left">
|
<div class="col-md-6 text-left">
|
||||||
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
<a href="https://github.com/jordansamuel/PASTE" target="_blank">Updates</a> — <a
|
||||||
|
href="https://github.com/jordansamuel/PASTE/issues" target="_blank">Bugs</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 text-right">
|
<div class="col-md-6 text-right">
|
||||||
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
Powered by <a href="https://phpaste.sourceforge.io" target="_blank">Paste</a>
|
||||||
|
|
|
@ -8,8 +8,7 @@ class SSP {
|
||||||
* @param array $data Data from the SQL get
|
* @param array $data Data from the SQL get
|
||||||
* @return array Formatted data in a row based format
|
* @return array Formatted data in a row based format
|
||||||
*/
|
*/
|
||||||
static function data_output ( $columns, $data )
|
static function data_output($columns, $data) {
|
||||||
{
|
|
||||||
$out = array();
|
$out = array();
|
||||||
|
|
||||||
for ($i = 0, $ien = count($data); $i < $ien; $i++) {
|
for ($i = 0, $ien = count($data); $i < $ien; $i++) {
|
||||||
|
@ -21,8 +20,7 @@ class SSP {
|
||||||
// Is there a formatter?
|
// Is there a formatter?
|
||||||
if (isset($column['formatter'])) {
|
if (isset($column['formatter'])) {
|
||||||
$row[$column['dt']] = $column['formatter']($data[$i][$column['db']], $data[$i]);
|
$row[$column['dt']] = $column['formatter']($data[$i][$column['db']], $data[$i]);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$row[$column['dt']] = $data[$i][$columns[$j]['db']];
|
$row[$column['dt']] = $data[$i][$columns[$j]['db']];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,8 +41,7 @@ class SSP {
|
||||||
* @param array $columns Column information array
|
* @param array $columns Column information array
|
||||||
* @return string SQL limit clause
|
* @return string SQL limit clause
|
||||||
*/
|
*/
|
||||||
static function limit ( $request, $columns )
|
static function limit($request, $columns) {
|
||||||
{
|
|
||||||
$limit = '';
|
$limit = '';
|
||||||
|
|
||||||
if (isset($request['start']) && $request['length'] != -1) {
|
if (isset($request['start']) && $request['length'] != -1) {
|
||||||
|
@ -64,8 +61,7 @@ class SSP {
|
||||||
* @param array $columns Column information array
|
* @param array $columns Column information array
|
||||||
* @return string SQL order by clause
|
* @return string SQL order by clause
|
||||||
*/
|
*/
|
||||||
static function order ( $request, $columns )
|
static function order($request, $columns) {
|
||||||
{
|
|
||||||
$order = '';
|
$order = '';
|
||||||
|
|
||||||
if (isset($request['order']) && count($request['order'])) {
|
if (isset($request['order']) && count($request['order'])) {
|
||||||
|
@ -111,8 +107,7 @@ class SSP {
|
||||||
* sql_exec() function
|
* sql_exec() function
|
||||||
* @return string SQL where clause
|
* @return string SQL where clause
|
||||||
*/
|
*/
|
||||||
static function filter ( $request, $columns, &$bindings )
|
static function filter($request, $columns, &$bindings) {
|
||||||
{
|
|
||||||
$globalSearch = array();
|
$globalSearch = array();
|
||||||
$columnSearch = array();
|
$columnSearch = array();
|
||||||
$dtColumns = self::pluck($columns, 'dt');
|
$dtColumns = self::pluck($columns, 'dt');
|
||||||
|
@ -182,8 +177,7 @@ class SSP {
|
||||||
* @param array $columns Column information array
|
* @param array $columns Column information array
|
||||||
* @return array Server-side processing response array
|
* @return array Server-side processing response array
|
||||||
*/
|
*/
|
||||||
static function simple ( $request, $sql_details, $table, $primaryKey, $columns, $columns2 )
|
static function simple($request, $sql_details, $table, $primaryKey, $columns, $columns2) {
|
||||||
{
|
|
||||||
$bindings = array();
|
$bindings = array();
|
||||||
$db = self::sql_connect($sql_details);
|
$db = self::sql_connect($sql_details);
|
||||||
|
|
||||||
|
@ -235,8 +229,7 @@ class SSP {
|
||||||
* * pass - user password
|
* * pass - user password
|
||||||
* @return resource Database connection handle
|
* @return resource Database connection handle
|
||||||
*/
|
*/
|
||||||
static function sql_connect ( $sql_details )
|
static function sql_connect($sql_details) {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
$db = @new PDO(
|
$db = @new PDO(
|
||||||
"mysql:host={$sql_details['host']};dbname={$sql_details['db']}",
|
"mysql:host={$sql_details['host']};dbname={$sql_details['db']}",
|
||||||
|
@ -244,8 +237,7 @@ class SSP {
|
||||||
$sql_details['pass'],
|
$sql_details['pass'],
|
||||||
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)
|
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)
|
||||||
);
|
);
|
||||||
}
|
} catch (PDOException $e) {
|
||||||
catch (PDOException $e) {
|
|
||||||
self::fatal(
|
self::fatal(
|
||||||
"An error occurred while connecting to the database. " .
|
"An error occurred while connecting to the database. " .
|
||||||
"The error reported by the server was: " . $e->getMessage()
|
"The error reported by the server was: " . $e->getMessage()
|
||||||
|
@ -266,8 +258,7 @@ class SSP {
|
||||||
* @param string $sql SQL query to execute.
|
* @param string $sql SQL query to execute.
|
||||||
* @return array Result from the query (all rows)
|
* @return array Result from the query (all rows)
|
||||||
*/
|
*/
|
||||||
static function sql_exec ( $db, $bindings, $sql=null )
|
static function sql_exec($db, $bindings, $sql = null) {
|
||||||
{
|
|
||||||
// Argument shifting
|
// Argument shifting
|
||||||
if ($sql === null) {
|
if ($sql === null) {
|
||||||
$sql = $bindings;
|
$sql = $bindings;
|
||||||
|
@ -287,16 +278,14 @@ class SSP {
|
||||||
// Execute
|
// Execute
|
||||||
try {
|
try {
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
}
|
} catch (PDOException $e) {
|
||||||
catch (PDOException $e) {
|
|
||||||
self::fatal("An SQL error occurred: " . $e->getMessage());
|
self::fatal("An SQL error occurred: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
$result = $stmt->fetchAll();
|
$result = $stmt->fetchAll();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function Ssql_exec ($db, $bindings, $sql=null )
|
static function Ssql_exec($db, $bindings, $sql = null) {
|
||||||
{
|
|
||||||
// Argument shifting
|
// Argument shifting
|
||||||
if ($sql === null) {
|
if ($sql === null) {
|
||||||
$sql = $bindings;
|
$sql = $bindings;
|
||||||
|
@ -315,8 +304,7 @@ class SSP {
|
||||||
// Execute
|
// Execute
|
||||||
try {
|
try {
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
}
|
} catch (PDOException $e) {
|
||||||
catch (PDOException $e) {
|
|
||||||
self::fatal("An SQL error occurred: " . $e->getMessage());
|
self::fatal("An SQL error occurred: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
$loop = '0';
|
$loop = '0';
|
||||||
|
@ -351,8 +339,7 @@ class SSP {
|
||||||
*
|
*
|
||||||
* @param string $msg Message to send to the client
|
* @param string $msg Message to send to the client
|
||||||
*/
|
*/
|
||||||
static function fatal ( $msg )
|
static function fatal($msg) {
|
||||||
{
|
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
"error" => $msg
|
"error" => $msg
|
||||||
));
|
));
|
||||||
|
@ -370,8 +357,7 @@ class SSP {
|
||||||
* @return string Bound key to be used in the SQL where this parameter
|
* @return string Bound key to be used in the SQL where this parameter
|
||||||
* would be used.
|
* would be used.
|
||||||
*/
|
*/
|
||||||
static function bind ( &$a, $val, $type )
|
static function bind(&$a, $val, $type) {
|
||||||
{
|
|
||||||
$key = ':binding_' . count($a);
|
$key = ':binding_' . count($a);
|
||||||
|
|
||||||
$a[] = array(
|
$a[] = array(
|
||||||
|
@ -392,8 +378,7 @@ class SSP {
|
||||||
* @param string $prop Property to read
|
* @param string $prop Property to read
|
||||||
* @return array Array of property values
|
* @return array Array of property values
|
||||||
*/
|
*/
|
||||||
static function pluck ( $a, $prop )
|
static function pluck($a, $prop) {
|
||||||
{
|
|
||||||
$out = array();
|
$out = array();
|
||||||
|
|
||||||
for ($i = 0, $len = count($a); $i < $len; $i++) {
|
for ($i = 0, $len = count($a); $i < $len; $i++) {
|
||||||
|
|
|
@ -12,12 +12,10 @@ function sandwitch($str){
|
||||||
if (stripos($word, 'nsfw') !== false) {
|
if (stripos($word, 'nsfw') !== false) {
|
||||||
$word = strtoupper($word);
|
$word = strtoupper($word);
|
||||||
$tagcolor = "tag is-danger";
|
$tagcolor = "tag is-danger";
|
||||||
}
|
} elseif (stripos($word, 'SAFE') !== false) {
|
||||||
elseif (stripos($word, 'SAFE') !== false) {
|
|
||||||
$word = strtoupper($word);
|
$word = strtoupper($word);
|
||||||
$tagcolor = "tag is-success";
|
$tagcolor = "tag is-success";
|
||||||
}
|
} elseif (strstr($word, '/')) {
|
||||||
elseif (strstr($word, '/')){
|
|
||||||
$tagcolor = "tag is-primary";
|
$tagcolor = "tag is-primary";
|
||||||
} else {
|
} else {
|
||||||
$tagcolor = "tag is-info";
|
$tagcolor = "tag is-info";
|
||||||
|
@ -28,7 +26,6 @@ function sandwitch($str){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SSP {
|
class SSP {
|
||||||
/**
|
/**
|
||||||
* Create the data output array for the DataTables rows
|
* Create the data output array for the DataTables rows
|
||||||
|
@ -37,8 +34,7 @@ class SSP {
|
||||||
* @param array $data Data from the SQL get
|
* @param array $data Data from the SQL get
|
||||||
* @return array Formatted data in a row based format
|
* @return array Formatted data in a row based format
|
||||||
*/
|
*/
|
||||||
static function data_output ( $columns, $data )
|
static function data_output($columns, $data) {
|
||||||
{
|
|
||||||
$out = array();
|
$out = array();
|
||||||
|
|
||||||
for ($i = 0, $ien = count($data); $i < $ien; $i++) {
|
for ($i = 0, $ien = count($data); $i < $ien; $i++) {
|
||||||
|
@ -50,8 +46,7 @@ class SSP {
|
||||||
// Is there a formatter?
|
// Is there a formatter?
|
||||||
if (isset($column['formatter'])) {
|
if (isset($column['formatter'])) {
|
||||||
$row[$column['dt']] = $column['formatter']($data[$i][$column['db']], $data[$i]);
|
$row[$column['dt']] = $column['formatter']($data[$i][$column['db']], $data[$i]);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$row[$column['dt']] = $data[$i][$columns[$j]['db']];
|
$row[$column['dt']] = $data[$i][$columns[$j]['db']];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,8 +67,7 @@ class SSP {
|
||||||
* @param array $columns Column information array
|
* @param array $columns Column information array
|
||||||
* @return string SQL limit clause
|
* @return string SQL limit clause
|
||||||
*/
|
*/
|
||||||
static function limit ( $request, $columns )
|
static function limit($request, $columns) {
|
||||||
{
|
|
||||||
$limit = '';
|
$limit = '';
|
||||||
|
|
||||||
if (isset($request['start']) && $request['length'] != -1) {
|
if (isset($request['start']) && $request['length'] != -1) {
|
||||||
|
@ -93,8 +87,7 @@ class SSP {
|
||||||
* @param array $columns Column information array
|
* @param array $columns Column information array
|
||||||
* @return string SQL order by clause
|
* @return string SQL order by clause
|
||||||
*/
|
*/
|
||||||
static function order ( $request, $columns )
|
static function order($request, $columns) {
|
||||||
{
|
|
||||||
$order = '';
|
$order = '';
|
||||||
|
|
||||||
if (isset($request['order']) && count($request['order'])) {
|
if (isset($request['order']) && count($request['order'])) {
|
||||||
|
@ -140,8 +133,7 @@ class SSP {
|
||||||
* sql_exec() function
|
* sql_exec() function
|
||||||
* @return string SQL where clause
|
* @return string SQL where clause
|
||||||
*/
|
*/
|
||||||
static function filter ( $request, $columns, &$bindings )
|
static function filter($request, $columns, &$bindings) {
|
||||||
{
|
|
||||||
$globalSearch = array();
|
$globalSearch = array();
|
||||||
$columnSearch = array();
|
$columnSearch = array();
|
||||||
$dtColumns = self::pluck($columns, 'dt');
|
$dtColumns = self::pluck($columns, 'dt');
|
||||||
|
@ -211,8 +203,7 @@ class SSP {
|
||||||
* @param array $columns Column information array
|
* @param array $columns Column information array
|
||||||
* @return array Server-side processing response array
|
* @return array Server-side processing response array
|
||||||
*/
|
*/
|
||||||
static function simple ( $request, $sql_details, $table, $primaryKey, $columns, $columns2 )
|
static function simple($request, $sql_details, $table, $primaryKey, $columns, $columns2) {
|
||||||
{
|
|
||||||
$bindings = array();
|
$bindings = array();
|
||||||
$db = self::sql_connect($sql_details);
|
$db = self::sql_connect($sql_details);
|
||||||
|
|
||||||
|
@ -264,8 +255,7 @@ class SSP {
|
||||||
* * pass - user password
|
* * pass - user password
|
||||||
* @return PDO Database connection handle
|
* @return PDO Database connection handle
|
||||||
*/
|
*/
|
||||||
static function sql_connect ( $sql_details )
|
static function sql_connect($sql_details) {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
$db = @new PDO(
|
$db = @new PDO(
|
||||||
"mysql:host={$sql_details['host']};dbname={$sql_details['db']}",
|
"mysql:host={$sql_details['host']};dbname={$sql_details['db']}",
|
||||||
|
@ -273,8 +263,7 @@ class SSP {
|
||||||
$sql_details['pass'],
|
$sql_details['pass'],
|
||||||
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)
|
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)
|
||||||
);
|
);
|
||||||
}
|
} catch (PDOException $e) {
|
||||||
catch (PDOException $e) {
|
|
||||||
self::fatal(
|
self::fatal(
|
||||||
"An error occurred while connecting to the database. " .
|
"An error occurred while connecting to the database. " .
|
||||||
"The error reported by the server was: " . $e->getMessage()
|
"The error reported by the server was: " . $e->getMessage()
|
||||||
|
@ -295,8 +284,7 @@ class SSP {
|
||||||
* @param string $sql SQL query to execute.
|
* @param string $sql SQL query to execute.
|
||||||
* @return array Result from the query (all rows)
|
* @return array Result from the query (all rows)
|
||||||
*/
|
*/
|
||||||
static function sql_exec ( $db, $bindings, $sql=null )
|
static function sql_exec($db, $bindings, $sql = null) {
|
||||||
{
|
|
||||||
// Argument shifting
|
// Argument shifting
|
||||||
if ($sql === null) {
|
if ($sql === null) {
|
||||||
$sql = $bindings;
|
$sql = $bindings;
|
||||||
|
@ -316,16 +304,14 @@ class SSP {
|
||||||
// Execute
|
// Execute
|
||||||
try {
|
try {
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
}
|
} catch (PDOException $e) {
|
||||||
catch (PDOException $e) {
|
|
||||||
self::fatal("An SQL error occurred: " . $e->getMessage());
|
self::fatal("An SQL error occurred: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
$result = $stmt->fetchAll();
|
$result = $stmt->fetchAll();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function Ssql_exec ($db, $bindings, $sql=null )
|
static function Ssql_exec($db, $bindings, $sql = null) {
|
||||||
{
|
|
||||||
// Argument shifting
|
// Argument shifting
|
||||||
if ($sql === null) {
|
if ($sql === null) {
|
||||||
$sql = $bindings;
|
$sql = $bindings;
|
||||||
|
@ -344,8 +330,7 @@ class SSP {
|
||||||
// Execute
|
// Execute
|
||||||
try {
|
try {
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
}
|
} catch (PDOException $e) {
|
||||||
catch (PDOException $e) {
|
|
||||||
self::fatal("An SQL error occurred: " . $e->getMessage());
|
self::fatal("An SQL error occurred: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
$loop = '0';
|
$loop = '0';
|
||||||
|
@ -381,8 +366,7 @@ class SSP {
|
||||||
*
|
*
|
||||||
* @param string $msg Message to send to the client
|
* @param string $msg Message to send to the client
|
||||||
*/
|
*/
|
||||||
static function fatal ( $msg )
|
static function fatal($msg) {
|
||||||
{
|
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
"error" => $msg
|
"error" => $msg
|
||||||
));
|
));
|
||||||
|
@ -400,8 +384,7 @@ class SSP {
|
||||||
* @return string Bound key to be used in the SQL where this parameter
|
* @return string Bound key to be used in the SQL where this parameter
|
||||||
* would be used.
|
* would be used.
|
||||||
*/
|
*/
|
||||||
static function bind ( &$a, $val, $type )
|
static function bind(&$a, $val, $type) {
|
||||||
{
|
|
||||||
$key = ':binding_' . count($a);
|
$key = ':binding_' . count($a);
|
||||||
|
|
||||||
$a[] = array(
|
$a[] = array(
|
||||||
|
@ -422,8 +405,7 @@ class SSP {
|
||||||
* @param string $prop Property to read
|
* @param string $prop Property to read
|
||||||
* @return array Array of property values
|
* @return array Array of property values
|
||||||
*/
|
*/
|
||||||
static function pluck ( $a, $prop )
|
static function pluck($a, $prop) {
|
||||||
{
|
|
||||||
$out = array();
|
$out = array();
|
||||||
|
|
||||||
for ($i = 0, $len = count($a); $i < $len; $i++) {
|
for ($i = 0, $len = count($a); $i < $len; $i++) {
|
||||||
|
|
6
fav.php
6
fav.php
|
@ -56,7 +56,6 @@ if (isset($_GET['logout'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Fav paste
|
//Fav paste
|
||||||
if (isset($_POST['fid'])) {
|
if (isset($_POST['fid'])) {
|
||||||
if (isset($_SESSION['token'])) {
|
if (isset($_SESSION['token'])) {
|
||||||
|
@ -78,12 +77,13 @@ $faved = "INSERT INTO pins (m_fav,f_paste,f_time) VALUES
|
||||||
} else {
|
} else {
|
||||||
$faved = "DELETE FROM pins WHERE f_paste='$f_pasteid' and m_fav='$f_user'";
|
$faved = "DELETE FROM pins WHERE f_paste='$f_pasteid' and m_fav='$f_user'";
|
||||||
}
|
}
|
||||||
if ($con->query($faved) === TRUE) {
|
if ($con->query($faved) === true) {
|
||||||
$error = "Paste has been Favorited.";
|
$error = "Paste has been Favorited.";
|
||||||
} else {
|
} else {
|
||||||
$error = "Fav failed";
|
$error = "Fav failed";
|
||||||
}
|
}
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Theme
|
// Theme
|
||||||
|
|
|
@ -16,8 +16,7 @@
|
||||||
|
|
||||||
if ($method == "Like") {
|
if ($method == "Like") {
|
||||||
mysqli_query($conn, "INSERT INTO favs (user_id, director_id) VALUES ('$user_id', '$director_id')");
|
mysqli_query($conn, "INSERT INTO favs (user_id, director_id) VALUES ('$user_id', '$director_id')");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
mysqli_query($conn, "DELETE FROM favs WHERE user_id = '$user_id' AND director_id = '$director_id'");
|
mysqli_query($conn, "DELETE FROM favs WHERE user_id = '$user_id' AND director_id = '$director_id'");
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -46,11 +46,11 @@
|
||||||
$numrows = $result->num_rows;
|
$numrows = $result->num_rows;
|
||||||
if ($numrows == 0) {
|
if ($numrows == 0) {
|
||||||
echo "<div class = 'button' method = 'Like' user_id = " . $user_id . " director_id = " . $director_id . "> <img id=" . $director_id . " src='favoff.png'> </div>";
|
echo "<div class = 'button' method = 'Like' user_id = " . $user_id . " director_id = " . $director_id . "> <img id=" . $director_id . " src='favoff.png'> </div>";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
echo "<div class = 'button' method = 'Unlike' user_id = " . $user_id . " director_id = " . $director_id . "> <img id=" . $director_id . " src='favon.jpg'> </div>";
|
echo "<div class = 'button' method = 'Unlike' user_id = " . $user_id . " director_id = " . $director_id . "> <img id=" . $director_id . " src='favon.jpg'> </div>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Query to get the user_id
|
// Query to get the user_id
|
||||||
$result = $conn->query("SELECT * FROM user WHERE name = 'Henrique'");
|
$result = $conn->query("SELECT * FROM user WHERE name = 'Henrique'");
|
||||||
$row = $result->fetch_assoc();
|
$row = $result->fetch_assoc();
|
||||||
|
|
|
@ -20,19 +20,16 @@ namespace ArdiSSoebrata\BeamParsedown;
|
||||||
|
|
||||||
use ParsedownExtra;
|
use ParsedownExtra;
|
||||||
|
|
||||||
class BeamParsedown extends ParsedownExtra
|
class BeamParsedown extends ParsedownExtra {
|
||||||
{
|
|
||||||
const version = '0.0.1';
|
const version = '0.0.1';
|
||||||
protected $isUrlRegex = "/(https?|ftp)\:\/\//i";
|
protected $isUrlRegex = "/(https?|ftp)\:\/\//i";
|
||||||
protected $regexAttribute = '(?:([#.][\w-]+\s*)|([\w-]+=[\w-]+\s*))+';
|
protected $regexAttribute = '(?:([#.][\w-]+\s*)|([\w-]+=[\w-]+\s*))+';
|
||||||
|
|
||||||
function __construct()
|
function __construct() {
|
||||||
{
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
// @codeCoverageIgnoreStart
|
// @codeCoverageIgnoreStart
|
||||||
if (version_compare(parent::version, '0.8.1') < 0)
|
if (version_compare(parent::version, '0.8.1') < 0) {
|
||||||
{
|
|
||||||
throw new Exception('BeamParsedown requires a later version of ParsedownExtra');
|
throw new Exception('BeamParsedown requires a later version of ParsedownExtra');
|
||||||
}
|
}
|
||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
|
@ -53,18 +50,15 @@ class BeamParsedown extends ParsedownExtra
|
||||||
|
|
||||||
protected $basePath = '';
|
protected $basePath = '';
|
||||||
|
|
||||||
public function setBasePath($url)
|
public function setBasePath($url) {
|
||||||
{
|
|
||||||
$this->basePath = preg_replace('{/$}', '', $url) . '/';
|
$this->basePath = preg_replace('{/$}', '', $url) . '/';
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function inlineImage($excerpt)
|
protected function inlineImage($excerpt) {
|
||||||
{
|
|
||||||
$image = parent::inlineImage($excerpt);
|
$image = parent::inlineImage($excerpt);
|
||||||
|
|
||||||
if ( ! isset($image))
|
if (!isset($image)) {
|
||||||
{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,8 +73,7 @@ class BeamParsedown extends ParsedownExtra
|
||||||
|
|
||||||
// Heading id & attributes.
|
// Heading id & attributes.
|
||||||
|
|
||||||
protected function blockHeader($Line)
|
protected function blockHeader($Line) {
|
||||||
{
|
|
||||||
$Block = parent::blockHeader($Line);
|
$Block = parent::blockHeader($Line);
|
||||||
|
|
||||||
if (!isset($Block)) {
|
if (!isset($Block)) {
|
||||||
|
@ -96,8 +89,7 @@ class BeamParsedown extends ParsedownExtra
|
||||||
return $Block;
|
return $Block;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function blockSetextHeader($Line, array $Block = null)
|
protected function blockSetextHeader($Line, array $Block = null) {
|
||||||
{
|
|
||||||
$Block = parent::blockSetextHeader($Line, $Block);
|
$Block = parent::blockSetextHeader($Line, $Block);
|
||||||
|
|
||||||
if (isset($Block['element']) && !isset($Block['element']['attributes']['id'])) {
|
if (isset($Block['element']) && !isset($Block['element']['attributes']['id'])) {
|
||||||
|
@ -109,38 +101,29 @@ class BeamParsedown extends ParsedownExtra
|
||||||
return $Block;
|
return $Block;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function parseAttributeData($attributeString)
|
protected function parseAttributeData($attributeString) {
|
||||||
{
|
|
||||||
$Data = array();
|
$Data = array();
|
||||||
|
|
||||||
$attributes = preg_split('/[ ]+/', $attributeString, -1, PREG_SPLIT_NO_EMPTY);
|
$attributes = preg_split('/[ ]+/', $attributeString, -1, PREG_SPLIT_NO_EMPTY);
|
||||||
|
|
||||||
foreach ($attributes as $attribute)
|
foreach ($attributes as $attribute) {
|
||||||
{
|
if ($attribute[0] === '#') {
|
||||||
if ($attribute[0] === '#')
|
|
||||||
{
|
|
||||||
$Data['id'] = substr($attribute, 1);
|
$Data['id'] = substr($attribute, 1);
|
||||||
}
|
} elseif ($attribute[0] === '.') {
|
||||||
elseif ($attribute[0] === '.')
|
|
||||||
{
|
|
||||||
$classes [] = substr($attribute, 1);
|
$classes [] = substr($attribute, 1);
|
||||||
}
|
} elseif (preg_match('/([\w-]+)=([\w-]+)/', $attribute, $match)) {
|
||||||
elseif (preg_match('/([\w-]+)=([\w-]+)/', $attribute, $match))
|
|
||||||
{
|
|
||||||
$Data[$match[1]] = $match[2];
|
$Data[$match[1]] = $match[2];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($classes))
|
if (isset($classes)) {
|
||||||
{
|
|
||||||
$Data['class'] = implode(' ', $classes);
|
$Data['class'] = implode(' ', $classes);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $Data;
|
return $Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function slugify($text)
|
public static function slugify($text) {
|
||||||
{
|
|
||||||
// replace non letter or digits by -
|
// replace non letter or digits by -
|
||||||
$text = preg_replace('~[^\pL\d]+~u', '-', $text);
|
$text = preg_replace('~[^\pL\d]+~u', '-', $text);
|
||||||
|
|
||||||
|
@ -168,10 +151,8 @@ class BeamParsedown extends ParsedownExtra
|
||||||
|
|
||||||
// Icon
|
// Icon
|
||||||
|
|
||||||
protected function InlineIcon($excerpt)
|
protected function InlineIcon($excerpt) {
|
||||||
{
|
if (preg_match('/\[icon:(.+?)\]/', $excerpt['text'], $matches)) {
|
||||||
if (preg_match('/\[icon:(.+?)\]/', $excerpt['text'], $matches))
|
|
||||||
{
|
|
||||||
return array(
|
return array(
|
||||||
// How many characters to advance the Parsedown's
|
// How many characters to advance the Parsedown's
|
||||||
// cursor after being done processing this tag.
|
// cursor after being done processing this tag.
|
||||||
|
@ -189,10 +170,8 @@ class BeamParsedown extends ParsedownExtra
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
|
|
||||||
protected function InlineAudio($excerpt)
|
protected function InlineAudio($excerpt) {
|
||||||
{
|
if (preg_match('/\[audio:(.+?)\]/', $excerpt['text'], $matches)) {
|
||||||
if (preg_match('/\[audio:(.+?)\]/', $excerpt['text'], $matches))
|
|
||||||
{
|
|
||||||
// Add basePath if src is relative.
|
// Add basePath if src is relative.
|
||||||
$src = trim($matches[1]);
|
$src = trim($matches[1]);
|
||||||
if (!preg_match($this->isUrlRegex, $src, $urlmatch)) {
|
if (!preg_match($this->isUrlRegex, $src, $urlmatch)) {
|
||||||
|
@ -223,10 +202,8 @@ class BeamParsedown extends ParsedownExtra
|
||||||
|
|
||||||
// Youtube
|
// Youtube
|
||||||
|
|
||||||
protected function BlockYoutube($excerpt)
|
protected function BlockYoutube($excerpt) {
|
||||||
{
|
if (preg_match('/\[youtube:\s*https\:\/\/youtu\.be\/(.+?)\]/', $excerpt['text'], $matches)) {
|
||||||
if (preg_match('/\[youtube:\s*https\:\/\/youtu\.be\/(.+?)\]/', $excerpt['text'], $matches))
|
|
||||||
{
|
|
||||||
$video_id = trim($matches[1]);
|
$video_id = trim($matches[1]);
|
||||||
return array(
|
return array(
|
||||||
// How many characters to advance the Parsedown's
|
// How many characters to advance the Parsedown's
|
||||||
|
@ -270,11 +247,9 @@ class BeamParsedown extends ParsedownExtra
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
protected function BlockAlert($line, $block)
|
protected function BlockAlert($line, $block) {
|
||||||
{
|
|
||||||
$types = implode('|', array_keys($this->alert_types));
|
$types = implode('|', array_keys($this->alert_types));
|
||||||
if (preg_match('/^:::(' . $types . ')/', $line['text'], $matches))
|
if (preg_match('/^:::(' . $types . ')/', $line['text'], $matches)) {
|
||||||
{
|
|
||||||
$type = trim($matches[1]);
|
$type = trim($matches[1]);
|
||||||
return array(
|
return array(
|
||||||
'char' => $line['text'][0],
|
'char' => $line['text'][0],
|
||||||
|
@ -314,22 +289,18 @@ class BeamParsedown extends ParsedownExtra
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function BlockAlertContinue($line, $block)
|
protected function BlockAlertContinue($line, $block) {
|
||||||
{
|
if (isset($block['complete'])) {
|
||||||
if (isset($block['complete']))
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A blank newline has occurred.
|
// A blank newline has occurred.
|
||||||
if (isset($block['interrupted']))
|
if (isset($block['interrupted'])) {
|
||||||
{
|
|
||||||
unset($block['interrupted']);
|
unset($block['interrupted']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for end of the block.
|
// Check for end of the block.
|
||||||
if (preg_match('/^:::/', $line['text']))
|
if (preg_match('/^:::/', $line['text'])) {
|
||||||
{
|
|
||||||
$block['complete'] = true;
|
$block['complete'] = true;
|
||||||
return $block;
|
return $block;
|
||||||
}
|
}
|
||||||
|
@ -339,17 +310,14 @@ class BeamParsedown extends ParsedownExtra
|
||||||
return $block;
|
return $block;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function BlockAlertComplete($block)
|
protected function BlockAlertComplete($block) {
|
||||||
{
|
|
||||||
return $block;
|
return $block;
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw.io
|
// draw.io
|
||||||
|
|
||||||
protected function BlockDrawio($excerpt)
|
protected function BlockDrawio($excerpt) {
|
||||||
{
|
if (preg_match('/\[drawio:\s*(.+?)\]/', $excerpt['text'], $matches)) {
|
||||||
if (preg_match('/\[drawio:\s*(.+?)\]/', $excerpt['text'], $matches))
|
|
||||||
{
|
|
||||||
$file = trim($matches[1]);
|
$file = trim($matches[1]);
|
||||||
if (!preg_match($this->isUrlRegex, $file, $urlmatch)) {
|
if (!preg_match($this->isUrlRegex, $file, $urlmatch)) {
|
||||||
$file = $this->basePath . $file;
|
$file = $this->basePath . $file;
|
||||||
|
@ -393,10 +361,8 @@ class BeamParsedown extends ParsedownExtra
|
||||||
|
|
||||||
// Mermaid
|
// Mermaid
|
||||||
|
|
||||||
protected function BlockMermaid($line, $block)
|
protected function BlockMermaid($line, $block) {
|
||||||
{
|
if (preg_match('/^:::\s*mermaid/', $line['text'], $matches)) {
|
||||||
if (preg_match('/^:::\s*mermaid/', $line['text'], $matches))
|
|
||||||
{
|
|
||||||
return array(
|
return array(
|
||||||
'char' => $line['text'][0],
|
'char' => $line['text'][0],
|
||||||
'element' => array(
|
'element' => array(
|
||||||
|
@ -410,22 +376,18 @@ class BeamParsedown extends ParsedownExtra
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function BlockMermaidContinue($line, $block)
|
protected function BlockMermaidContinue($line, $block) {
|
||||||
{
|
if (isset($block['complete'])) {
|
||||||
if (isset($block['complete']))
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A blank newline has occurred.
|
// A blank newline has occurred.
|
||||||
if (isset($block['interrupted']))
|
if (isset($block['interrupted'])) {
|
||||||
{
|
|
||||||
unset($block['interrupted']);
|
unset($block['interrupted']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for end of the block.
|
// Check for end of the block.
|
||||||
if (preg_match('/^:::/', $line['text']))
|
if (preg_match('/^:::/', $line['text'])) {
|
||||||
{
|
|
||||||
$block['complete'] = true;
|
$block['complete'] = true;
|
||||||
return $block;
|
return $block;
|
||||||
}
|
}
|
||||||
|
@ -435,17 +397,14 @@ class BeamParsedown extends ParsedownExtra
|
||||||
return $block;
|
return $block;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function BlockMermaidComplete($block)
|
protected function BlockMermaidComplete($block) {
|
||||||
{
|
|
||||||
return $block;
|
return $block;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chart JS
|
// Chart JS
|
||||||
|
|
||||||
protected function BlockChart($line, $block)
|
protected function BlockChart($line, $block) {
|
||||||
{
|
if (preg_match('/^:::\s*chart/', $line['text'], $matches)) {
|
||||||
if (preg_match('/^:::\s*chart/', $line['text'], $matches))
|
|
||||||
{
|
|
||||||
return array(
|
return array(
|
||||||
'char' => $line['text'][0],
|
'char' => $line['text'][0],
|
||||||
'element' => array(
|
'element' => array(
|
||||||
|
@ -459,22 +418,18 @@ class BeamParsedown extends ParsedownExtra
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function BlockChartContinue($line, $block)
|
protected function BlockChartContinue($line, $block) {
|
||||||
{
|
if (isset($block['complete'])) {
|
||||||
if (isset($block['complete']))
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A blank newline has occurred.
|
// A blank newline has occurred.
|
||||||
if (isset($block['interrupted']))
|
if (isset($block['interrupted'])) {
|
||||||
{
|
|
||||||
unset($block['interrupted']);
|
unset($block['interrupted']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for end of the block.
|
// Check for end of the block.
|
||||||
if (preg_match('/^:::/', $line['text']))
|
if (preg_match('/^:::/', $line['text'])) {
|
||||||
{
|
|
||||||
$block['complete'] = true;
|
$block['complete'] = true;
|
||||||
return $block;
|
return $block;
|
||||||
}
|
}
|
||||||
|
@ -484,8 +439,7 @@ class BeamParsedown extends ParsedownExtra
|
||||||
return $block;
|
return $block;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function BlockChartComplete($block)
|
protected function BlockChartComplete($block) {
|
||||||
{
|
|
||||||
return $block;
|
return $block;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -4,15 +4,13 @@ namespace ArdiSSoebrata\BeamParsedown;
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
class BeamParsedownServiceProvider extends ServiceProvider
|
class BeamParsedownServiceProvider extends ServiceProvider {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Perform post-registration booting of services.
|
* Perform post-registration booting of services.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function boot(): void
|
public function boot() : void {
|
||||||
{
|
|
||||||
// $this->loadTranslationsFrom(__DIR__.'/../resources/lang', ':lc:vendor');
|
// $this->loadTranslationsFrom(__DIR__.'/../resources/lang', ':lc:vendor');
|
||||||
// $this->loadViewsFrom(__DIR__.'/../resources/views', ':lc:vendor');
|
// $this->loadViewsFrom(__DIR__.'/../resources/views', ':lc:vendor');
|
||||||
// $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
|
// $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
|
||||||
|
@ -29,8 +27,7 @@ class BeamParsedownServiceProvider extends ServiceProvider
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function register(): void
|
public function register() : void {
|
||||||
{
|
|
||||||
$this->mergeConfigFrom(__DIR__ . '/../config/beam-parsedown.php', 'beam-parsedown');
|
$this->mergeConfigFrom(__DIR__ . '/../config/beam-parsedown.php', 'beam-parsedown');
|
||||||
|
|
||||||
// Register the service the package provides.
|
// Register the service the package provides.
|
||||||
|
@ -52,8 +49,7 @@ class BeamParsedownServiceProvider extends ServiceProvider
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function provides()
|
public function provides() {
|
||||||
{
|
|
||||||
// @codeCoverageIgnoreStart
|
// @codeCoverageIgnoreStart
|
||||||
return ['beam-parsedown'];
|
return ['beam-parsedown'];
|
||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
|
@ -64,8 +60,7 @@ class BeamParsedownServiceProvider extends ServiceProvider
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function bootForConsole(): void
|
protected function bootForConsole() : void {
|
||||||
{
|
|
||||||
// Publishing the configuration file.
|
// Publishing the configuration file.
|
||||||
$this->publishes([
|
$this->publishes([
|
||||||
__DIR__ . '/../config/beam-parsedown.php' => config_path('beam-parsedown.php'),
|
__DIR__ . '/../config/beam-parsedown.php' => config_path('beam-parsedown.php'),
|
||||||
|
|
|
@ -4,15 +4,13 @@ namespace ArdiSSoebrata\BeamParsedown\Facades;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Facade;
|
use Illuminate\Support\Facades\Facade;
|
||||||
|
|
||||||
class BeamParsedown extends Facade
|
class BeamParsedown extends Facade {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Get the registered name of the component.
|
* Get the registered name of the component.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected static function getFacadeAccessor(): string
|
protected static function getFacadeAccessor() : string {
|
||||||
{
|
|
||||||
return 'beam-parsedown';
|
return 'beam-parsedown';
|
||||||
}
|
}
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load diff
|
@ -13,18 +13,15 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
class ParsedownExtra extends Parsedown
|
class ParsedownExtra extends Parsedown {
|
||||||
{
|
|
||||||
# ~
|
# ~
|
||||||
|
|
||||||
const version = '0.8.0';
|
const version = '0.8.0';
|
||||||
|
|
||||||
# ~
|
# ~
|
||||||
|
|
||||||
function __construct()
|
function __construct() {
|
||||||
{
|
if (version_compare(parent::version, '1.7.1') < 0) {
|
||||||
if (version_compare(parent::version, '1.7.1') < 0)
|
|
||||||
{
|
|
||||||
throw new Exception('ParsedownExtra requires a later version of Parsedown');
|
throw new Exception('ParsedownExtra requires a later version of Parsedown');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,8 +38,7 @@ class ParsedownExtra extends Parsedown
|
||||||
#
|
#
|
||||||
# ~
|
# ~
|
||||||
|
|
||||||
function text($text)
|
function text($text) {
|
||||||
{
|
|
||||||
$Elements = $this->textElements($text);
|
$Elements = $this->textElements($text);
|
||||||
|
|
||||||
# convert to markup
|
# convert to markup
|
||||||
|
@ -57,8 +53,7 @@ class ParsedownExtra extends Parsedown
|
||||||
|
|
||||||
# add footnotes
|
# add footnotes
|
||||||
|
|
||||||
if (isset($this->DefinitionData['Footnote']))
|
if (isset($this->DefinitionData['Footnote'])) {
|
||||||
{
|
|
||||||
$Element = $this->buildFootnoteElement();
|
$Element = $this->buildFootnoteElement();
|
||||||
|
|
||||||
$markup .= "\n" . $this->element($Element);
|
$markup .= "\n" . $this->element($Element);
|
||||||
|
@ -74,10 +69,8 @@ class ParsedownExtra extends Parsedown
|
||||||
#
|
#
|
||||||
# Abbreviation
|
# Abbreviation
|
||||||
|
|
||||||
protected function blockAbbreviation($Line)
|
protected function blockAbbreviation($Line) {
|
||||||
{
|
if (preg_match('/^\*\[(.+?)\]:[ ]*(.+?)[ ]*$/', $Line['text'], $matches)) {
|
||||||
if (preg_match('/^\*\[(.+?)\]:[ ]*(.+?)[ ]*$/', $Line['text'], $matches))
|
|
||||||
{
|
|
||||||
$this->DefinitionData['Abbreviation'][$matches[1]] = $matches[2];
|
$this->DefinitionData['Abbreviation'][$matches[1]] = $matches[2];
|
||||||
|
|
||||||
$Block = array(
|
$Block = array(
|
||||||
|
@ -91,10 +84,8 @@ class ParsedownExtra extends Parsedown
|
||||||
#
|
#
|
||||||
# Footnote
|
# Footnote
|
||||||
|
|
||||||
protected function blockFootnote($Line)
|
protected function blockFootnote($Line) {
|
||||||
{
|
if (preg_match('/^\[\^(.+?)\]:[ ]?(.*)$/', $Line['text'], $matches)) {
|
||||||
if (preg_match('/^\[\^(.+?)\]:[ ]?(.*)$/', $Line['text'], $matches))
|
|
||||||
{
|
|
||||||
$Block = array(
|
$Block = array(
|
||||||
'label' => $matches[1],
|
'label' => $matches[1],
|
||||||
'text' => $matches[2],
|
'text' => $matches[2],
|
||||||
|
@ -105,32 +96,25 @@ class ParsedownExtra extends Parsedown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function blockFootnoteContinue($Line, $Block)
|
protected function blockFootnoteContinue($Line, $Block) {
|
||||||
{
|
if ($Line['text'][0] === '[' and preg_match('/^\[\^(.+?)\]:/', $Line['text'])) {
|
||||||
if ($Line['text'][0] === '[' and preg_match('/^\[\^(.+?)\]:/', $Line['text']))
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($Block['interrupted']))
|
if (isset($Block['interrupted'])) {
|
||||||
{
|
if ($Line['indent'] >= 4) {
|
||||||
if ($Line['indent'] >= 4)
|
|
||||||
{
|
|
||||||
$Block['text'] .= "\n\n" . $Line['text'];
|
$Block['text'] .= "\n\n" . $Line['text'];
|
||||||
|
|
||||||
return $Block;
|
return $Block;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$Block['text'] .= "\n" . $Line['text'];
|
$Block['text'] .= "\n" . $Line['text'];
|
||||||
|
|
||||||
return $Block;
|
return $Block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function blockFootnoteComplete($Block)
|
protected function blockFootnoteComplete($Block) {
|
||||||
{
|
|
||||||
$this->DefinitionData['Footnote'][$Block['label']] = array(
|
$this->DefinitionData['Footnote'][$Block['label']] = array(
|
||||||
'text' => $Block['text'],
|
'text' => $Block['text'],
|
||||||
'count' => null,
|
'count' => null,
|
||||||
|
@ -143,10 +127,8 @@ class ParsedownExtra extends Parsedown
|
||||||
#
|
#
|
||||||
# Definition List
|
# Definition List
|
||||||
|
|
||||||
protected function blockDefinitionList($Line, $Block)
|
protected function blockDefinitionList($Line, $Block) {
|
||||||
{
|
if (!isset($Block) or $Block['type'] !== 'Paragraph') {
|
||||||
if ( ! isset($Block) or $Block['type'] !== 'Paragraph')
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,8 +139,7 @@ class ParsedownExtra extends Parsedown
|
||||||
|
|
||||||
$terms = explode("\n", $Block['element']['handler']['argument']);
|
$terms = explode("\n", $Block['element']['handler']['argument']);
|
||||||
|
|
||||||
foreach ($terms as $term)
|
foreach ($terms as $term) {
|
||||||
{
|
|
||||||
$Element['elements'] [] = array(
|
$Element['elements'] [] = array(
|
||||||
'name' => 'dt',
|
'name' => 'dt',
|
||||||
'handler' => array(
|
'handler' => array(
|
||||||
|
@ -176,23 +157,17 @@ class ParsedownExtra extends Parsedown
|
||||||
return $Block;
|
return $Block;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function blockDefinitionListContinue($Line, array $Block)
|
protected function blockDefinitionListContinue($Line, array $Block) {
|
||||||
{
|
if ($Line['text'][0] === ':') {
|
||||||
if ($Line['text'][0] === ':')
|
|
||||||
{
|
|
||||||
$Block = $this->addDdElement($Line, $Block);
|
$Block = $this->addDdElement($Line, $Block);
|
||||||
|
|
||||||
return $Block;
|
return $Block;
|
||||||
}
|
} else {
|
||||||
else
|
if (isset($Block['interrupted']) and $Line['indent'] === 0) {
|
||||||
{
|
|
||||||
if (isset($Block['interrupted']) and $Line['indent'] === 0)
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($Block['interrupted']))
|
if (isset($Block['interrupted'])) {
|
||||||
{
|
|
||||||
$Block['dd']['handler']['function'] = 'textElements';
|
$Block['dd']['handler']['function'] = 'textElements';
|
||||||
$Block['dd']['handler']['argument'] .= "\n\n";
|
$Block['dd']['handler']['argument'] .= "\n\n";
|
||||||
|
|
||||||
|
@ -212,12 +187,10 @@ class ParsedownExtra extends Parsedown
|
||||||
#
|
#
|
||||||
# Header
|
# Header
|
||||||
|
|
||||||
protected function blockHeader($Line)
|
protected function blockHeader($Line) {
|
||||||
{
|
|
||||||
$Block = parent::blockHeader($Line);
|
$Block = parent::blockHeader($Line);
|
||||||
|
|
||||||
if ($Block !== null && preg_match('/[ #]*{('.$this->regexAttribute.'+)}[ ]*$/', $Block['element']['handler']['argument'], $matches, PREG_OFFSET_CAPTURE))
|
if ($Block !== null && preg_match('/[ #]*{(' . $this->regexAttribute . '+)}[ ]*$/', $Block['element']['handler']['argument'], $matches, PREG_OFFSET_CAPTURE)) {
|
||||||
{
|
|
||||||
$attributeString = $matches[1][0];
|
$attributeString = $matches[1][0];
|
||||||
|
|
||||||
$Block['element']['attributes'] = $this->parseAttributeData($attributeString);
|
$Block['element']['attributes'] = $this->parseAttributeData($attributeString);
|
||||||
|
@ -231,19 +204,15 @@ class ParsedownExtra extends Parsedown
|
||||||
#
|
#
|
||||||
# Markup
|
# Markup
|
||||||
|
|
||||||
protected function blockMarkup($Line)
|
protected function blockMarkup($Line) {
|
||||||
{
|
if ($this->markupEscaped or $this->safeMode) {
|
||||||
if ($this->markupEscaped or $this->safeMode)
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/^<(\w[\w-]*)(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*(\/)?>/', $Line['text'], $matches))
|
if (preg_match('/^<(\w[\w-]*)(?:[ ]*' . $this->regexHtmlAttribute . ')*[ ]*(\/)?>/', $Line['text'], $matches)) {
|
||||||
{
|
|
||||||
$element = strtolower($matches[1]);
|
$element = strtolower($matches[1]);
|
||||||
|
|
||||||
if (in_array($element, $this->textLevelElements))
|
if (in_array($element, $this->textLevelElements)) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,22 +228,16 @@ class ParsedownExtra extends Parsedown
|
||||||
$length = strlen($matches[0]);
|
$length = strlen($matches[0]);
|
||||||
$remainder = substr($Line['text'], $length);
|
$remainder = substr($Line['text'], $length);
|
||||||
|
|
||||||
if (trim($remainder) === '')
|
if (trim($remainder) === '') {
|
||||||
{
|
if (isset($matches[2]) or in_array($matches[1], $this->voidElements)) {
|
||||||
if (isset($matches[2]) or in_array($matches[1], $this->voidElements))
|
|
||||||
{
|
|
||||||
$Block['closed'] = true;
|
$Block['closed'] = true;
|
||||||
$Block['void'] = true;
|
$Block['void'] = true;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
if (isset($matches[2]) or in_array($matches[1], $this->voidElements)) {
|
||||||
{
|
|
||||||
if (isset($matches[2]) or in_array($matches[1], $this->voidElements))
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (preg_match('/<\/'.$matches[1].'>[ ]*$/i', $remainder))
|
if (preg_match('/<\/' . $matches[1] . '>[ ]*$/i', $remainder)) {
|
||||||
{
|
|
||||||
$Block['closed'] = true;
|
$Block['closed'] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -283,10 +246,8 @@ class ParsedownExtra extends Parsedown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function blockMarkupContinue($Line, array $Block)
|
protected function blockMarkupContinue($Line, array $Block) {
|
||||||
{
|
if (isset($Block['closed'])) {
|
||||||
if (isset($Block['closed']))
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,18 +258,14 @@ class ParsedownExtra extends Parsedown
|
||||||
|
|
||||||
if (preg_match('/(.*?)<\/' . $Block['name'] . '>[ ]*$/i', $Line['text'], $matches)) # close
|
if (preg_match('/(.*?)<\/' . $Block['name'] . '>[ ]*$/i', $Line['text'], $matches)) # close
|
||||||
{
|
{
|
||||||
if ($Block['depth'] > 0)
|
if ($Block['depth'] > 0) {
|
||||||
{
|
|
||||||
$Block['depth']--;
|
$Block['depth']--;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$Block['closed'] = true;
|
$Block['closed'] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($Block['interrupted']))
|
if (isset($Block['interrupted'])) {
|
||||||
{
|
|
||||||
$Block['element']['rawHtml'] .= "\n";
|
$Block['element']['rawHtml'] .= "\n";
|
||||||
unset($Block['interrupted']);
|
unset($Block['interrupted']);
|
||||||
}
|
}
|
||||||
|
@ -318,10 +275,8 @@ class ParsedownExtra extends Parsedown
|
||||||
return $Block;
|
return $Block;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function blockMarkupComplete($Block)
|
protected function blockMarkupComplete($Block) {
|
||||||
{
|
if (!isset($Block['void'])) {
|
||||||
if ( ! isset($Block['void']))
|
|
||||||
{
|
|
||||||
$Block['element']['rawHtml'] = $this->processTag($Block['element']['rawHtml']);
|
$Block['element']['rawHtml'] = $this->processTag($Block['element']['rawHtml']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -331,12 +286,10 @@ class ParsedownExtra extends Parsedown
|
||||||
#
|
#
|
||||||
# Setext
|
# Setext
|
||||||
|
|
||||||
protected function blockSetextHeader($Line, array $Block = null)
|
protected function blockSetextHeader($Line, array $Block = null) {
|
||||||
{
|
|
||||||
$Block = parent::blockSetextHeader($Line, $Block);
|
$Block = parent::blockSetextHeader($Line, $Block);
|
||||||
|
|
||||||
if ($Block !== null && preg_match('/[ ]*{('.$this->regexAttribute.'+)}[ ]*$/', $Block['element']['handler']['argument'], $matches, PREG_OFFSET_CAPTURE))
|
if ($Block !== null && preg_match('/[ ]*{(' . $this->regexAttribute . '+)}[ ]*$/', $Block['element']['handler']['argument'], $matches, PREG_OFFSET_CAPTURE)) {
|
||||||
{
|
|
||||||
$attributeString = $matches[1][0];
|
$attributeString = $matches[1][0];
|
||||||
|
|
||||||
$Block['element']['attributes'] = $this->parseAttributeData($attributeString);
|
$Block['element']['attributes'] = $this->parseAttributeData($attributeString);
|
||||||
|
@ -354,21 +307,17 @@ class ParsedownExtra extends Parsedown
|
||||||
#
|
#
|
||||||
# Footnote Marker
|
# Footnote Marker
|
||||||
|
|
||||||
protected function inlineFootnoteMarker($Excerpt)
|
protected function inlineFootnoteMarker($Excerpt) {
|
||||||
{
|
if (preg_match('/^\[\^(.+?)\]/', $Excerpt['text'], $matches)) {
|
||||||
if (preg_match('/^\[\^(.+?)\]/', $Excerpt['text'], $matches))
|
|
||||||
{
|
|
||||||
$name = $matches[1];
|
$name = $matches[1];
|
||||||
|
|
||||||
if ( ! isset($this->DefinitionData['Footnote'][$name]))
|
if (!isset($this->DefinitionData['Footnote'][$name])) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->DefinitionData['Footnote'][$name]['count']++;
|
$this->DefinitionData['Footnote'][$name]['count']++;
|
||||||
|
|
||||||
if ( ! isset($this->DefinitionData['Footnote'][$name]['number']))
|
if (!isset($this->DefinitionData['Footnote'][$name]['number'])) {
|
||||||
{
|
|
||||||
$this->DefinitionData['Footnote'][$name]['number'] = ++$this->footnoteCount; # » &
|
$this->DefinitionData['Footnote'][$name]['number'] = ++$this->footnoteCount; # » &
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,14 +343,12 @@ class ParsedownExtra extends Parsedown
|
||||||
#
|
#
|
||||||
# Link
|
# Link
|
||||||
|
|
||||||
protected function inlineLink($Excerpt)
|
protected function inlineLink($Excerpt) {
|
||||||
{
|
|
||||||
$Link = parent::inlineLink($Excerpt);
|
$Link = parent::inlineLink($Excerpt);
|
||||||
|
|
||||||
$remainder = $Link !== null ? substr($Excerpt['text'], $Link['extent']) : '';
|
$remainder = $Link !== null ? substr($Excerpt['text'], $Link['extent']) : '';
|
||||||
|
|
||||||
if (preg_match('/^[ ]*{('.$this->regexAttribute.'+)}/', $remainder, $matches))
|
if (preg_match('/^[ ]*{(' . $this->regexAttribute . '+)}/', $remainder, $matches)) {
|
||||||
{
|
|
||||||
$Link['element']['attributes'] += $this->parseAttributeData($matches[1]);
|
$Link['element']['attributes'] += $this->parseAttributeData($matches[1]);
|
||||||
|
|
||||||
$Link['extent'] += strlen($matches[0]);
|
$Link['extent'] += strlen($matches[0]);
|
||||||
|
@ -417,10 +364,8 @@ class ParsedownExtra extends Parsedown
|
||||||
private $currentAbreviation;
|
private $currentAbreviation;
|
||||||
private $currentMeaning;
|
private $currentMeaning;
|
||||||
|
|
||||||
protected function insertAbreviation(array $Element)
|
protected function insertAbreviation(array $Element) {
|
||||||
{
|
if (isset($Element['text'])) {
|
||||||
if (isset($Element['text']))
|
|
||||||
{
|
|
||||||
$Element['elements'] = self::pregReplaceElements(
|
$Element['elements'] = self::pregReplaceElements(
|
||||||
'/\b' . preg_quote($this->currentAbreviation, '/') . '\b/',
|
'/\b' . preg_quote($this->currentAbreviation, '/') . '\b/',
|
||||||
array(
|
array(
|
||||||
|
@ -441,14 +386,11 @@ class ParsedownExtra extends Parsedown
|
||||||
return $Element;
|
return $Element;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function inlineText($text)
|
protected function inlineText($text) {
|
||||||
{
|
|
||||||
$Inline = parent::inlineText($text);
|
$Inline = parent::inlineText($text);
|
||||||
|
|
||||||
if (isset($this->DefinitionData['Abbreviation']))
|
if (isset($this->DefinitionData['Abbreviation'])) {
|
||||||
{
|
foreach ($this->DefinitionData['Abbreviation'] as $abbreviation => $meaning) {
|
||||||
foreach ($this->DefinitionData['Abbreviation'] as $abbreviation => $meaning)
|
|
||||||
{
|
|
||||||
$this->currentAbreviation = $abbreviation;
|
$this->currentAbreviation = $abbreviation;
|
||||||
$this->currentMeaning = $meaning;
|
$this->currentMeaning = $meaning;
|
||||||
|
|
||||||
|
@ -466,8 +408,7 @@ class ParsedownExtra extends Parsedown
|
||||||
# Util Methods
|
# Util Methods
|
||||||
#
|
#
|
||||||
|
|
||||||
protected function addDdElement(array $Line, array $Block)
|
protected function addDdElement(array $Line, array $Block) {
|
||||||
{
|
|
||||||
$text = substr($Line['text'], 1);
|
$text = substr($Line['text'], 1);
|
||||||
$text = trim($text);
|
$text = trim($text);
|
||||||
|
|
||||||
|
@ -482,8 +423,7 @@ class ParsedownExtra extends Parsedown
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isset($Block['interrupted']))
|
if (isset($Block['interrupted'])) {
|
||||||
{
|
|
||||||
$Block['dd']['handler']['function'] = 'textElements';
|
$Block['dd']['handler']['function'] = 'textElements';
|
||||||
|
|
||||||
unset($Block['interrupted']);
|
unset($Block['interrupted']);
|
||||||
|
@ -494,8 +434,7 @@ class ParsedownExtra extends Parsedown
|
||||||
return $Block;
|
return $Block;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function buildFootnoteElement()
|
protected function buildFootnoteElement() {
|
||||||
{
|
|
||||||
$Element = array(
|
$Element = array(
|
||||||
'name' => 'div',
|
'name' => 'div',
|
||||||
'attributes' => array('class' => 'footnotes'),
|
'attributes' => array('class' => 'footnotes'),
|
||||||
|
@ -510,10 +449,8 @@ class ParsedownExtra extends Parsedown
|
||||||
|
|
||||||
uasort($this->DefinitionData['Footnote'], 'self::sortFootnotes');
|
uasort($this->DefinitionData['Footnote'], 'self::sortFootnotes');
|
||||||
|
|
||||||
foreach ($this->DefinitionData['Footnote'] as $definitionId => $DefinitionData)
|
foreach ($this->DefinitionData['Footnote'] as $definitionId => $DefinitionData) {
|
||||||
{
|
if (!isset($DefinitionData['number'])) {
|
||||||
if ( ! isset($DefinitionData['number']))
|
|
||||||
{
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,8 +462,7 @@ class ParsedownExtra extends Parsedown
|
||||||
|
|
||||||
$backLinkElements = array();
|
$backLinkElements = array();
|
||||||
|
|
||||||
foreach ($numbers as $number)
|
foreach ($numbers as $number) {
|
||||||
{
|
|
||||||
$backLinkElements[] = array('text' => ' ');
|
$backLinkElements[] = array('text' => ' ');
|
||||||
$backLinkElements[] = array(
|
$backLinkElements[] = array(
|
||||||
'name' => 'a',
|
'name' => 'a',
|
||||||
|
@ -545,8 +481,7 @@ class ParsedownExtra extends Parsedown
|
||||||
|
|
||||||
$n = count($textElements) - 1;
|
$n = count($textElements) - 1;
|
||||||
|
|
||||||
if ($textElements[$n]['name'] === 'p')
|
if ($textElements[$n]['name'] === 'p') {
|
||||||
{
|
|
||||||
$backLinkElements = array_merge(
|
$backLinkElements = array_merge(
|
||||||
array(
|
array(
|
||||||
array(
|
array(
|
||||||
|
@ -566,9 +501,7 @@ class ParsedownExtra extends Parsedown
|
||||||
$backLinkElements
|
$backLinkElements
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$textElements[] = array(
|
$textElements[] = array(
|
||||||
'name' => 'p',
|
'name' => 'p',
|
||||||
'elements' => $backLinkElements
|
'elements' => $backLinkElements
|
||||||
|
@ -589,26 +522,21 @@ class ParsedownExtra extends Parsedown
|
||||||
|
|
||||||
# ~
|
# ~
|
||||||
|
|
||||||
protected function parseAttributeData($attributeString)
|
protected function parseAttributeData($attributeString) {
|
||||||
{
|
|
||||||
$Data = array();
|
$Data = array();
|
||||||
|
|
||||||
$attributes = preg_split('/[ ]+/', $attributeString, -1, PREG_SPLIT_NO_EMPTY);
|
$attributes = preg_split('/[ ]+/', $attributeString, -1, PREG_SPLIT_NO_EMPTY);
|
||||||
|
|
||||||
foreach ($attributes as $attribute)
|
foreach ($attributes as $attribute) {
|
||||||
{
|
if ($attribute[0] === '#') {
|
||||||
if ($attribute[0] === '#')
|
|
||||||
{
|
|
||||||
$Data['id'] = substr($attribute, 1);
|
$Data['id'] = substr($attribute, 1);
|
||||||
}
|
} else # "."
|
||||||
else # "."
|
|
||||||
{
|
{
|
||||||
$classes [] = substr($attribute, 1);
|
$classes [] = substr($attribute, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($classes))
|
if (isset($classes)) {
|
||||||
{
|
|
||||||
$Data['class'] = implode(' ', $classes);
|
$Data['class'] = implode(' ', $classes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -634,29 +562,21 @@ class ParsedownExtra extends Parsedown
|
||||||
|
|
||||||
$elementText = '';
|
$elementText = '';
|
||||||
|
|
||||||
if ($DOMDocument->documentElement->getAttribute('markdown') === '1')
|
if ($DOMDocument->documentElement->getAttribute('markdown') === '1') {
|
||||||
{
|
foreach ($DOMDocument->documentElement->childNodes as $Node) {
|
||||||
foreach ($DOMDocument->documentElement->childNodes as $Node)
|
|
||||||
{
|
|
||||||
$elementText .= $DOMDocument->saveHTML($Node);
|
$elementText .= $DOMDocument->saveHTML($Node);
|
||||||
}
|
}
|
||||||
|
|
||||||
$DOMDocument->documentElement->removeAttribute('markdown');
|
$DOMDocument->documentElement->removeAttribute('markdown');
|
||||||
|
|
||||||
$elementText = "\n" . $this->text($elementText) . "\n";
|
$elementText = "\n" . $this->text($elementText) . "\n";
|
||||||
}
|
} else {
|
||||||
else
|
foreach ($DOMDocument->documentElement->childNodes as $Node) {
|
||||||
{
|
|
||||||
foreach ($DOMDocument->documentElement->childNodes as $Node)
|
|
||||||
{
|
|
||||||
$nodeMarkup = $DOMDocument->saveHTML($Node);
|
$nodeMarkup = $DOMDocument->saveHTML($Node);
|
||||||
|
|
||||||
if ($Node instanceof DOMElement and ! in_array($Node->nodeName, $this->textLevelElements))
|
if ($Node instanceof DOMElement and !in_array($Node->nodeName, $this->textLevelElements)) {
|
||||||
{
|
|
||||||
$elementText .= $this->processTag($nodeMarkup);
|
$elementText .= $this->processTag($nodeMarkup);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$elementText .= $nodeMarkup;
|
$elementText .= $nodeMarkup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,12 +2,10 @@
|
||||||
|
|
||||||
namespace Aidantwoods\SecureParsedown;
|
namespace Aidantwoods\SecureParsedown;
|
||||||
|
|
||||||
class SecureParsedown extends \Parsedown
|
class SecureParsedown extends \Parsedown {
|
||||||
{
|
|
||||||
const version = '1.0.1';
|
const version = '1.0.1';
|
||||||
|
|
||||||
function setSafeMode($safeMode)
|
function setSafeMode($safeMode) {
|
||||||
{
|
|
||||||
$this->safeMode = (bool)$safeMode;
|
$this->safeMode = (bool)$safeMode;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -32,8 +30,7 @@ class SecureParsedown extends \Parsedown
|
||||||
'steam:',
|
'steam:',
|
||||||
);
|
);
|
||||||
|
|
||||||
protected function blockCodeComplete($Block)
|
protected function blockCodeComplete($Block) {
|
||||||
{
|
|
||||||
$text = $Block['element']['text']['text'];
|
$text = $Block['element']['text']['text'];
|
||||||
|
|
||||||
$Block['element']['text']['text'] = $text;
|
$Block['element']['text']['text'] = $text;
|
||||||
|
@ -41,21 +38,17 @@ class SecureParsedown extends \Parsedown
|
||||||
return $Block;
|
return $Block;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function blockComment($Line)
|
protected function blockComment($Line) {
|
||||||
{
|
if ($this->markupEscaped or $this->safeMode) {
|
||||||
if ($this->markupEscaped or $this->safeMode)
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($Line['text'][3]) and $Line['text'][3] === '-' and $Line['text'][2] === '-' and $Line['text'][1] === '!')
|
if (isset($Line['text'][3]) and $Line['text'][3] === '-' and $Line['text'][2] === '-' and $Line['text'][1] === '!') {
|
||||||
{
|
|
||||||
$Block = array(
|
$Block = array(
|
||||||
'markup' => $Line['body'],
|
'markup' => $Line['body'],
|
||||||
);
|
);
|
||||||
|
|
||||||
if (preg_match('/-->$/', $Line['text']))
|
if (preg_match('/-->$/', $Line['text'])) {
|
||||||
{
|
|
||||||
$Block['closed'] = true;
|
$Block['closed'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,8 +56,7 @@ class SecureParsedown extends \Parsedown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function blockFencedCodeComplete($Block)
|
protected function blockFencedCodeComplete($Block) {
|
||||||
{
|
|
||||||
$text = $Block['element']['text']['text'];
|
$text = $Block['element']['text']['text'];
|
||||||
|
|
||||||
$Block['element']['text']['text'] = $text;
|
$Block['element']['text']['text'] = $text;
|
||||||
|
@ -72,19 +64,15 @@ class SecureParsedown extends \Parsedown
|
||||||
return $Block;
|
return $Block;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function blockMarkup($Line)
|
protected function blockMarkup($Line) {
|
||||||
{
|
if ($this->markupEscaped or $this->safeMode) {
|
||||||
if ($this->markupEscaped or $this->safeMode)
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/^<(\w*)(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*(\/)?>/', $Line['text'], $matches))
|
if (preg_match('/^<(\w*)(?:[ ]*' . $this->regexHtmlAttribute . ')*[ ]*(\/)?>/', $Line['text'], $matches)) {
|
||||||
{
|
|
||||||
$element = strtolower($matches[1]);
|
$element = strtolower($matches[1]);
|
||||||
|
|
||||||
if (in_array($element, $this->textLevelElements))
|
if (in_array($element, $this->textLevelElements)) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,24 +86,18 @@ class SecureParsedown extends \Parsedown
|
||||||
|
|
||||||
$remainder = substr($Line['text'], $length);
|
$remainder = substr($Line['text'], $length);
|
||||||
|
|
||||||
if (trim($remainder) === '')
|
if (trim($remainder) === '') {
|
||||||
{
|
if (isset($matches[2]) or in_array($matches[1], $this->voidElements)) {
|
||||||
if (isset($matches[2]) or in_array($matches[1], $this->voidElements))
|
|
||||||
{
|
|
||||||
$Block['closed'] = true;
|
$Block['closed'] = true;
|
||||||
|
|
||||||
$Block['void'] = true;
|
$Block['void'] = true;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
if (isset($matches[2]) or in_array($matches[1], $this->voidElements)) {
|
||||||
{
|
|
||||||
if (isset($matches[2]) or in_array($matches[1], $this->voidElements))
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/<\/'.$matches[1].'>[ ]*$/i', $remainder))
|
if (preg_match('/<\/' . $matches[1] . '>[ ]*$/i', $remainder)) {
|
||||||
{
|
|
||||||
$Block['closed'] = true;
|
$Block['closed'] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,12 +106,10 @@ class SecureParsedown extends \Parsedown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function inlineCode($Excerpt)
|
protected function inlineCode($Excerpt) {
|
||||||
{
|
|
||||||
$marker = $Excerpt['text'][0];
|
$marker = $Excerpt['text'][0];
|
||||||
|
|
||||||
if (preg_match('/^('.$marker.'+)[ ]*(.+?)[ ]*(?<!'.$marker.')\1(?!'.$marker.')/s', $Excerpt['text'], $matches))
|
if (preg_match('/^(' . $marker . '+)[ ]*(.+?)[ ]*(?<!' . $marker . ')\1(?!' . $marker . ')/s', $Excerpt['text'], $matches)) {
|
||||||
{
|
|
||||||
$text = $matches[2];
|
$text = $matches[2];
|
||||||
$text = preg_replace("/[ ]*\n/", ' ', $text);
|
$text = preg_replace("/[ ]*\n/", ' ', $text);
|
||||||
|
|
||||||
|
@ -143,8 +123,7 @@ class SecureParsedown extends \Parsedown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function inlineLink($Excerpt)
|
protected function inlineLink($Excerpt) {
|
||||||
{
|
|
||||||
$Element = array(
|
$Element = array(
|
||||||
'name' => 'a',
|
'name' => 'a',
|
||||||
'handler' => 'line',
|
'handler' => 'line',
|
||||||
|
@ -159,46 +138,35 @@ class SecureParsedown extends \Parsedown
|
||||||
|
|
||||||
$remainder = $Excerpt['text'];
|
$remainder = $Excerpt['text'];
|
||||||
|
|
||||||
if (preg_match('/\[((?:[^][]++|(?R))*+)\]/', $remainder, $matches))
|
if (preg_match('/\[((?:[^][]++|(?R))*+)\]/', $remainder, $matches)) {
|
||||||
{
|
|
||||||
$Element['text'] = $matches[1];
|
$Element['text'] = $matches[1];
|
||||||
|
|
||||||
$extent += strlen($matches[0]);
|
$extent += strlen($matches[0]);
|
||||||
|
|
||||||
$remainder = substr($remainder, $extent);
|
$remainder = substr($remainder, $extent);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/^[(]\s*+((?:[^ ()]++|[(][^ )]+[)])++)(?:[ ]+("[^"]*"|\'[^\']*\'))?\s*[)]/', $remainder, $matches))
|
if (preg_match('/^[(]\s*+((?:[^ ()]++|[(][^ )]+[)])++)(?:[ ]+("[^"]*"|\'[^\']*\'))?\s*[)]/', $remainder, $matches)) {
|
||||||
{
|
|
||||||
$Element['attributes']['href'] = $matches[1];
|
$Element['attributes']['href'] = $matches[1];
|
||||||
|
|
||||||
if (isset($matches[2]))
|
if (isset($matches[2])) {
|
||||||
{
|
|
||||||
$Element['attributes']['title'] = substr($matches[2], 1, -1);
|
$Element['attributes']['title'] = substr($matches[2], 1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$extent += strlen($matches[0]);
|
$extent += strlen($matches[0]);
|
||||||
}
|
} else {
|
||||||
else
|
if (preg_match('/^\s*\[(.*?)\]/', $remainder, $matches)) {
|
||||||
{
|
|
||||||
if (preg_match('/^\s*\[(.*?)\]/', $remainder, $matches))
|
|
||||||
{
|
|
||||||
$definition = strlen($matches[1]) ? $matches[1] : $Element['text'];
|
$definition = strlen($matches[1]) ? $matches[1] : $Element['text'];
|
||||||
$definition = strtolower($definition);
|
$definition = strtolower($definition);
|
||||||
|
|
||||||
$extent += strlen($matches[0]);
|
$extent += strlen($matches[0]);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$definition = strtolower($Element['text']);
|
$definition = strtolower($Element['text']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! isset($this->DefinitionData['Reference'][$definition]))
|
if (!isset($this->DefinitionData['Reference'][$definition])) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,31 +182,26 @@ class SecureParsedown extends \Parsedown
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function inlineMarkup($Excerpt)
|
protected function inlineMarkup($Excerpt) {
|
||||||
{
|
if ($this->markupEscaped or $this->safeMode or strpos($Excerpt['text'], '>') === false) {
|
||||||
if ($this->markupEscaped or $this->safeMode or strpos($Excerpt['text'], '>') === false)
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($Excerpt['text'][1] === '/' and preg_match('/^<\/\w*[ ]*>/s', $Excerpt['text'], $matches))
|
if ($Excerpt['text'][1] === '/' and preg_match('/^<\/\w*[ ]*>/s', $Excerpt['text'], $matches)) {
|
||||||
{
|
|
||||||
return array(
|
return array(
|
||||||
'markup' => $matches[0],
|
'markup' => $matches[0],
|
||||||
'extent' => strlen($matches[0]),
|
'extent' => strlen($matches[0]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($Excerpt['text'][1] === '!' and preg_match('/^<!---?[^>-](?:-?[^-])*-->/s', $Excerpt['text'], $matches))
|
if ($Excerpt['text'][1] === '!' and preg_match('/^<!---?[^>-](?:-?[^-])*-->/s', $Excerpt['text'], $matches)) {
|
||||||
{
|
|
||||||
return array(
|
return array(
|
||||||
'markup' => $matches[0],
|
'markup' => $matches[0],
|
||||||
'extent' => strlen($matches[0]),
|
'extent' => strlen($matches[0]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($Excerpt['text'][1] !== ' ' and preg_match('/^<\w*(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*\/?>/s', $Excerpt['text'], $matches))
|
if ($Excerpt['text'][1] !== ' ' and preg_match('/^<\w*(?:[ ]*' . $this->regexHtmlAttribute . ')*[ ]*\/?>/s', $Excerpt['text'], $matches)) {
|
||||||
{
|
|
||||||
return array(
|
return array(
|
||||||
'markup' => $matches[0],
|
'markup' => $matches[0],
|
||||||
'extent' => strlen($matches[0]),
|
'extent' => strlen($matches[0]),
|
||||||
|
@ -246,15 +209,12 @@ class SecureParsedown extends \Parsedown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function inlineUrl($Excerpt)
|
protected function inlineUrl($Excerpt) {
|
||||||
{
|
if ($this->urlsLinked !== true or !isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/') {
|
||||||
if ($this->urlsLinked !== true or ! isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/')
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/\bhttps?:[\/]{2}[^\s<]+\b\/*/ui', $Excerpt['context'], $matches, PREG_OFFSET_CAPTURE))
|
if (preg_match('/\bhttps?:[\/]{2}[^\s<]+\b\/*/ui', $Excerpt['context'], $matches, PREG_OFFSET_CAPTURE)) {
|
||||||
{
|
|
||||||
$url = $matches[0][0];
|
$url = $matches[0][0];
|
||||||
|
|
||||||
$Inline = array(
|
$Inline = array(
|
||||||
|
@ -273,10 +233,8 @@ class SecureParsedown extends \Parsedown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function inlineUrlTag($Excerpt)
|
protected function inlineUrlTag($Excerpt) {
|
||||||
{
|
if (strpos($Excerpt['text'], '>') !== false and preg_match('/^<(\w+:\/{2}[^ >]+)>/i', $Excerpt['text'], $matches)) {
|
||||||
if (strpos($Excerpt['text'], '>') !== false and preg_match('/^<(\w+:\/{2}[^ >]+)>/i', $Excerpt['text'], $matches))
|
|
||||||
{
|
|
||||||
$url = $matches[1];
|
$url = $matches[1];
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
@ -292,21 +250,16 @@ class SecureParsedown extends \Parsedown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function element(array $Element)
|
protected function element(array $Element) {
|
||||||
{
|
if ($this->safeMode) {
|
||||||
if ($this->safeMode)
|
|
||||||
{
|
|
||||||
$Element = $this->sanitiseElement($Element);
|
$Element = $this->sanitiseElement($Element);
|
||||||
}
|
}
|
||||||
|
|
||||||
$markup = '<' . $Element['name'];
|
$markup = '<' . $Element['name'];
|
||||||
|
|
||||||
if (isset($Element['attributes']))
|
if (isset($Element['attributes'])) {
|
||||||
{
|
foreach ($Element['attributes'] as $name => $value) {
|
||||||
foreach ($Element['attributes'] as $name => $value)
|
if ($value === null) {
|
||||||
{
|
|
||||||
if ($value === null)
|
|
||||||
{
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -314,54 +267,41 @@ class SecureParsedown extends \Parsedown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($Element['text']))
|
if (isset($Element['text'])) {
|
||||||
{
|
|
||||||
$markup .= '>';
|
$markup .= '>';
|
||||||
|
|
||||||
if (isset($Element['handler']))
|
if (isset($Element['handler'])) {
|
||||||
{
|
|
||||||
$markup .= $this->{$Element['handler']}($Element['text']);
|
$markup .= $this->{$Element['handler']}($Element['text']);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$markup .= self::escape($Element['text'], true);
|
$markup .= self::escape($Element['text'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$markup .= '</' . $Element['name'] . '>';
|
$markup .= '</' . $Element['name'] . '>';
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$markup .= ' />';
|
$markup .= ' />';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $markup;
|
return $markup;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function sanitiseElement(array $Element)
|
protected function sanitiseElement(array $Element) {
|
||||||
{
|
|
||||||
static $goodAttribute = '/^[a-zA-Z0-9][a-zA-Z0-9-_]*+$/';
|
static $goodAttribute = '/^[a-zA-Z0-9][a-zA-Z0-9-_]*+$/';
|
||||||
static $safeUrlNameToAtt = array(
|
static $safeUrlNameToAtt = array(
|
||||||
'a' => 'href',
|
'a' => 'href',
|
||||||
'img' => 'src',
|
'img' => 'src',
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isset($safeUrlNameToAtt[$Element['name']]))
|
if (isset($safeUrlNameToAtt[$Element['name']])) {
|
||||||
{
|
|
||||||
$Element = $this->filterUnsafeUrlInAttribute($Element, $safeUrlNameToAtt[$Element['name']]);
|
$Element = $this->filterUnsafeUrlInAttribute($Element, $safeUrlNameToAtt[$Element['name']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! empty($Element['attributes']))
|
if (!empty($Element['attributes'])) {
|
||||||
{
|
foreach ($Element['attributes'] as $att => $val) {
|
||||||
foreach ($Element['attributes'] as $att => $val)
|
|
||||||
{
|
|
||||||
# filter out badly parsed attribute
|
# filter out badly parsed attribute
|
||||||
if ( ! preg_match($goodAttribute, $att))
|
if (!preg_match($goodAttribute, $att)) {
|
||||||
{
|
|
||||||
unset($Element['attributes'][$att]);
|
unset($Element['attributes'][$att]);
|
||||||
}
|
} # dump onevent attribute
|
||||||
# dump onevent attribute
|
elseif (self::striAtStart($att, 'on')) {
|
||||||
elseif (self::striAtStart($att, 'on'))
|
|
||||||
{
|
|
||||||
unset($Element['attributes'][$att]);
|
unset($Element['attributes'][$att]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -370,12 +310,9 @@ class SecureParsedown extends \Parsedown
|
||||||
return $Element;
|
return $Element;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function filterUnsafeUrlInAttribute(array $Element, $attribute)
|
protected function filterUnsafeUrlInAttribute(array $Element, $attribute) {
|
||||||
{
|
foreach ($this->safeLinksWhitelist as $scheme) {
|
||||||
foreach ($this->safeLinksWhitelist as $scheme)
|
if (self::striAtStart($Element['attributes'][$attribute], $scheme)) {
|
||||||
{
|
|
||||||
if (self::striAtStart($Element['attributes'][$attribute], $scheme))
|
|
||||||
{
|
|
||||||
return $Element;
|
return $Element;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -385,21 +322,16 @@ class SecureParsedown extends \Parsedown
|
||||||
return $Element;
|
return $Element;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function escape($text, $allowQuotes = false)
|
protected static function escape($text, $allowQuotes = false) {
|
||||||
{
|
|
||||||
return htmlspecialchars($text, $allowQuotes ? ENT_NOQUOTES : ENT_QUOTES, 'UTF-8');
|
return htmlspecialchars($text, $allowQuotes ? ENT_NOQUOTES : ENT_QUOTES, 'UTF-8');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function striAtStart($string, $needle)
|
protected static function striAtStart($string, $needle) {
|
||||||
{
|
|
||||||
$len = strlen($needle);
|
$len = strlen($needle);
|
||||||
|
|
||||||
if ($len > strlen($string))
|
if ($len > strlen($string)) {
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
return strtolower(substr($string, 0, $len)) === strtolower($needle);
|
return strtolower(substr($string, 0, $len)) === strtolower($needle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
function captcha($color, $mode, $mul, $allowed)
|
function captcha($color, $mode, $mul, $allowed) {
|
||||||
{
|
|
||||||
|
|
||||||
$bg_path = dirname(__FILE__) . '/captchabg/';
|
$bg_path = dirname(__FILE__) . '/captchabg/';
|
||||||
$font_path = dirname(__FILE__) . '/fonts/';
|
$font_path = dirname(__FILE__) . '/fonts/';
|
||||||
|
@ -109,8 +108,7 @@ function captcha($color, $mode, $mul, $allowed)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('hex2rgb')) {
|
if (!function_exists('hex2rgb')) {
|
||||||
function hex2rgb($hex_str, $return_string = false, $separator = ',')
|
function hex2rgb($hex_str, $return_string = false, $separator = ',') {
|
||||||
{
|
|
||||||
$hex_str = preg_replace("/[^0-9A-Fa-f]/", '', $hex_str); // Gets a proper hex string
|
$hex_str = preg_replace("/[^0-9A-Fa-f]/", '', $hex_str); // Gets a proper hex string
|
||||||
$rgb_array = array();
|
$rgb_array = array();
|
||||||
if (strlen($hex_str) == 6) {
|
if (strlen($hex_str) == 6) {
|
||||||
|
|
|
@ -26,9 +26,11 @@ function getSiteAds(PDO $conn) : array | bool {
|
||||||
function getSiteTotalPastes(PDO $conn) : int {
|
function getSiteTotalPastes(PDO $conn) : int {
|
||||||
return intval($conn->query('SELECT COUNT(*) FROM pastes')->fetch(PDO::FETCH_NUM)[0]);
|
return intval($conn->query('SELECT COUNT(*) FROM pastes')->fetch(PDO::FETCH_NUM)[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSiteTotalviews(PDO $conn) : int {
|
function getSiteTotalviews(PDO $conn) : int {
|
||||||
return intval($conn->query('SELECT tpage FROM page_view ORDER BY id DESC LIMIT 1')->fetch(PDO::FETCH_NUM)[0]);
|
return intval($conn->query('SELECT tpage FROM page_view ORDER BY id DESC LIMIT 1')->fetch(PDO::FETCH_NUM)[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSiteTotal_unique_views(PDO $conn) : int {
|
function getSiteTotal_unique_views(PDO $conn) : int {
|
||||||
return intval($conn->query('SELECT tvisit FROM page_view ORDER BY id DESC LIMIT 1')->fetch(PDO::FETCH_NUM)[0]);
|
return intval($conn->query('SELECT tvisit FROM page_view ORDER BY id DESC LIMIT 1')->fetch(PDO::FETCH_NUM)[0]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,31 +14,25 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
function timer()
|
function timer() {
|
||||||
{
|
|
||||||
static $start;
|
static $start;
|
||||||
|
|
||||||
if (is_null($start))
|
if (is_null($start)) {
|
||||||
{
|
|
||||||
$start = microtime(true);
|
$start = microtime(true);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$diff = round((microtime(true) - $start), 4);
|
$diff = round((microtime(true) - $start), 4);
|
||||||
$start = null;
|
$start = null;
|
||||||
return $diff;
|
return $diff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUserFavs($conn, $username)
|
function getUserFavs($conn, $username) {
|
||||||
{
|
|
||||||
$query = $conn->prepare("SELECT pins.f_time, pins.m_fav, pins.f_paste, pastes.id, pastes.title, pastes.now_time, pastes.tagsys FROM pins, pastes WHERE pins.f_paste = pastes.id AND pins.m_fav=?'");
|
$query = $conn->prepare("SELECT pins.f_time, pins.m_fav, pins.f_paste, pastes.id, pastes.title, pastes.now_time, pastes.tagsys FROM pins, pastes WHERE pins.f_paste = pastes.id AND pins.m_fav=?'");
|
||||||
$query->execute([$username]);
|
$query->execute([$username]);
|
||||||
return $query->fetchAll();
|
return $query->fetchAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
function CountPasteFavs($conn, $fav_id)
|
function CountPasteFavs($conn, $fav_id) {
|
||||||
{
|
|
||||||
$query = $conn->prepare("SELECT COUNT(f_paste) FROM pins WHERE f_paste=?");
|
$query = $conn->prepare("SELECT COUNT(f_paste) FROM pins WHERE f_paste=?");
|
||||||
$query->execute([$fav_id]);
|
$query->execute([$fav_id]);
|
||||||
return $query->fetchAll();
|
return $query->fetchAll();
|
||||||
|
@ -50,8 +44,7 @@ function checkFavorite($paste_id, $user_id, $conn) {
|
||||||
$numrows = $result->num_rows;
|
$numrows = $result->num_rows;
|
||||||
if ($numrows == 0) {
|
if ($numrows == 0) {
|
||||||
echo "<a href='#' id='favorite' class='iconn tool-iconn' data-fid='" . $paste_id . "'><i class='far fa-star fa-lg has-text-grey' title='Favourite'></i></a>";
|
echo "<a href='#' id='favorite' class='iconn tool-iconn' data-fid='" . $paste_id . "'><i class='far fa-star fa-lg has-text-grey' title='Favourite'></i></a>";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
echo "<a href='#' id='favorite' class='iconn tool-iconn' data-fid='" . $paste_id . "'><i class='fas fa-star fa-lg has-text-grey' title='Favourite'></i></a>";
|
echo "<a href='#' id='favorite' class='iconn tool-iconn' data-fid='" . $paste_id . "'><i class='fas fa-star fa-lg has-text-grey' title='Favourite'></i></a>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,12 +64,10 @@ function sandwitch($str){
|
||||||
if (stripos($word, 'nsfw') !== false) {
|
if (stripos($word, 'nsfw') !== false) {
|
||||||
$word = strtoupper($word);
|
$word = strtoupper($word);
|
||||||
$tagcolor = "tag is-danger";
|
$tagcolor = "tag is-danger";
|
||||||
}
|
} elseif (stripos($word, 'SAFE') !== false) {
|
||||||
elseif (stripos($word, 'SAFE') !== false) {
|
|
||||||
$word = strtoupper($word);
|
$word = strtoupper($word);
|
||||||
$tagcolor = "tag is-success";
|
$tagcolor = "tag is-success";
|
||||||
}
|
} elseif (strstr($word, '/')) {
|
||||||
elseif (strstr($word, '/')){
|
|
||||||
$tagcolor = "tag is-primary";
|
$tagcolor = "tag is-primary";
|
||||||
} else {
|
} else {
|
||||||
$tagcolor = "tag is-info";
|
$tagcolor = "tag is-info";
|
||||||
|
@ -87,16 +78,14 @@ function sandwitch($str){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getevent($conn, $event_name, $count)
|
function getevent($conn, $event_name, $count) {
|
||||||
{
|
|
||||||
$query = $conn->prepare("SELECT id, visible, title, date, now_time, views, member, tagsys FROM pastes WHERE visible='1' AND tagsys LIKE '%?%'
|
$query = $conn->prepare("SELECT id, visible, title, date, now_time, views, member, tagsys FROM pastes WHERE visible='1' AND tagsys LIKE '%?%'
|
||||||
ORDER BY RAND () LIMIT 0, ?");
|
ORDER BY RAND () LIMIT 0, ?");
|
||||||
$query->execute([$event_name, $count]);
|
$query->execute([$event_name, $count]);
|
||||||
return $query->fetchAll();
|
return $query->fetchAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
function linkify($value, $protocols = array('http', 'mail'), array $attributes = array())
|
function linkify($value, $protocols = array('http', 'mail'), array $attributes = array()) {
|
||||||
{
|
|
||||||
// Link attributes
|
// Link attributes
|
||||||
$attr = '';
|
$attr = '';
|
||||||
foreach ($attributes as $key => $val) {
|
foreach ($attributes as $key => $val) {
|
||||||
|
@ -106,25 +95,37 @@ function linkify($value, $protocols = array('http', 'mail'), array $attributes =
|
||||||
$links = array();
|
$links = array();
|
||||||
|
|
||||||
// Extract existing links and tags
|
// Extract existing links and tags
|
||||||
$value = preg_replace_callback('~(<a .*?>.*?</a>|<.*?>)~i', function ($match) use (&$links) { return '<' . array_push($links, $match[1]) . '>'; }, $value);
|
$value = preg_replace_callback('~(<a .*?>.*?</a>|<.*?>)~i', function ($match) use (&$links) {
|
||||||
|
return '<' . array_push($links, $match[1]) . '>';
|
||||||
|
}, $value);
|
||||||
|
|
||||||
// Extract text links for each protocol
|
// Extract text links for each protocol
|
||||||
foreach ((array)$protocols as $protocol) {
|
foreach ((array)$protocols as $protocol) {
|
||||||
switch ($protocol) {
|
switch ($protocol) {
|
||||||
case 'http':
|
case 'http':
|
||||||
case 'https': $value = preg_replace_callback('~(?:(https?)://([^\s<]+)|(www\.[^\s<]+?\.[^\s<]+))(?<![\.,:])~i', function ($match) use ($protocol, &$links, $attr) { if ($match[1]) $protocol = $match[1]; $link = $match[2] ?: $match[3]; return '<' . array_push($links, "<a $attr href=\"$protocol://$link\">$protocol://$link</a>") . '>'; }, $value); break;
|
case 'https':
|
||||||
default: $value = preg_replace_callback('~' . preg_quote($protocol, '~') . '://([^\s<]+?)(?<![\.,:])~i', function ($match) use ($protocol, &$links, $attr) { return '<' . array_push($links, "<a $attr href=\"$protocol://{$match[1]}\">$protocol://{$match[1]}</a>") . '>'; }, $value); break;
|
$value = preg_replace_callback('~(?:(https?)://([^\s<]+)|(www\.[^\s<]+?\.[^\s<]+))(?<![\.,:])~i', function ($match) use ($protocol, &$links, $attr) {
|
||||||
|
if ($match[1]) $protocol = $match[1];
|
||||||
|
$link = $match[2] ?: $match[3];
|
||||||
|
return '<' . array_push($links, "<a $attr href=\"$protocol://$link\">$protocol://$link</a>") . '>';
|
||||||
|
}, $value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$value = preg_replace_callback('~' . preg_quote($protocol, '~') . '://([^\s<]+?)(?<![\.,:])~i', function ($match) use ($protocol, &$links, $attr) {
|
||||||
|
return '<' . array_push($links, "<a $attr href=\"$protocol://{$match[1]}\">$protocol://{$match[1]}</a>") . '>';
|
||||||
|
}, $value);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert all link
|
// Insert all link
|
||||||
return preg_replace_callback('/<(\d+)>/', function ($match) use (&$links) { return $links[$match[1] - 1]; }, $value);
|
return preg_replace_callback('/<(\d+)>/', function ($match) use (&$links) {
|
||||||
|
return $links[$match[1] - 1];
|
||||||
|
}, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getRecentreport($conn, $count) {
|
||||||
function getRecentreport($conn, $count)
|
|
||||||
{
|
|
||||||
$query = $conn->prepare("SELECT id, m_report, p_report, rep_reason, t_report FROM user_reports
|
$query = $conn->prepare("SELECT id, m_report, p_report, rep_reason, t_report FROM user_reports
|
||||||
ORDER BY id DESC
|
ORDER BY id DESC
|
||||||
LIMIT 0 , ?");
|
LIMIT 0 , ?");
|
||||||
|
@ -133,8 +134,7 @@ function getRecentreport($conn, $count)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getUserRecom($conn,$p_member)
|
function getUserRecom($conn, $p_member) {
|
||||||
{
|
|
||||||
$query = $conn->prepare("SELECT id, member, title, visible
|
$query = $conn->prepare("SELECT id, member, title, visible
|
||||||
FROM pastes where member= ? AND visible = '0'
|
FROM pastes where member= ? AND visible = '0'
|
||||||
ORDER BY id DESC
|
ORDER BY id DESC
|
||||||
|
@ -163,16 +163,15 @@ function isValidEmail($email) {
|
||||||
return filter_var($email, FILTER_VALIDATE_EMAIL)
|
return filter_var($email, FILTER_VALIDATE_EMAIL)
|
||||||
&& preg_match('/@.+\./', $email);
|
&& preg_match('/@.+\./', $email);
|
||||||
}
|
}
|
||||||
function formatBytes($size, $precision = 2)
|
|
||||||
{
|
function formatBytes($size, $precision = 2) {
|
||||||
$base = log($size, 1024);
|
$base = log($size, 1024);
|
||||||
$suffixes = array('B', 'KB', 'MB', 'GB', 'TB');
|
$suffixes = array('B', 'KB', 'MB', 'GB', 'TB');
|
||||||
|
|
||||||
return round(pow(1024, $base - floor($base)), $precision) . ' ' . $suffixes[floor($base)];
|
return round(pow(1024, $base - floor($base)), $precision) . ' ' . $suffixes[floor($base)];
|
||||||
}
|
}
|
||||||
|
|
||||||
function str_conntains($haystack, $needle, $ignoreCase = false)
|
function str_conntains($haystack, $needle, $ignoreCase = false) {
|
||||||
{
|
|
||||||
if ($ignoreCase) {
|
if ($ignoreCase) {
|
||||||
$haystack = strtolower($haystack);
|
$haystack = strtolower($haystack);
|
||||||
$needle = strtolower($needle);
|
$needle = strtolower($needle);
|
||||||
|
@ -181,29 +180,25 @@ function str_conntains($haystack, $needle, $ignoreCase = false)
|
||||||
return ($needlePos === false ? false : ($needlePos + 1));
|
return ($needlePos === false ? false : ($needlePos + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
function encrypt($value)
|
function encrypt($value) {
|
||||||
{
|
|
||||||
$salt = $sec_key;
|
$salt = $sec_key;
|
||||||
$encrypted_string = openssl_encrypt($value, "AES-256-CBC", $salt);
|
$encrypted_string = openssl_encrypt($value, "AES-256-CBC", $salt);
|
||||||
return $encrypted_string;
|
return $encrypted_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
function decrypt($value)
|
function decrypt($value) {
|
||||||
{
|
|
||||||
$salt = $sec_key;
|
$salt = $sec_key;
|
||||||
$decrypted_string = openssl_decrypt($value, "AES-256-CBC", $salt);
|
$decrypted_string = openssl_decrypt($value, "AES-256-CBC", $salt);
|
||||||
return $decrypted_string;
|
return $decrypted_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteMyPaste($conn, $paste_id)
|
function deleteMyPaste($conn, $paste_id) {
|
||||||
{
|
|
||||||
$query = "DELETE FROM pastes where id='$paste_id'";
|
$query = "DELETE FROM pastes where id='$paste_id'";
|
||||||
$result = mysqli_query($conn, $query);
|
$result = mysqli_query($conn, $query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getRecent($conn, $count)
|
function getRecent($conn, $count) {
|
||||||
{
|
|
||||||
$query = $conn->prepare("SELECT id, visible, title, date, now_time, member, tagsys
|
$query = $conn->prepare("SELECT id, visible, title, date, now_time, member, tagsys
|
||||||
FROM pastes where visible='0'
|
FROM pastes where visible='0'
|
||||||
ORDER BY id DESC
|
ORDER BY id DESC
|
||||||
|
@ -212,15 +207,14 @@ LIMIT ?");
|
||||||
return $query->fetchAll();
|
return $query->fetchAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRecentadmin($conn, $count = 5)
|
function getRecentadmin($conn, $count = 5) {
|
||||||
{
|
|
||||||
$query = $conn->prepare('SELECT id, ip title, date, now_time, s_date, views, member FROM pastes ORDER BY id DESC LIMIT 0, ?');
|
$query = $conn->prepare('SELECT id, ip title, date, now_time, s_date, views, member FROM pastes ORDER BY id DESC LIMIT 0, ?');
|
||||||
$query->execute([$count]);
|
$query->execute([$count]);
|
||||||
|
|
||||||
return $query->fetchAll();
|
return $query->fetchAll();
|
||||||
}
|
}
|
||||||
function getpopular($conn, $count)
|
|
||||||
{
|
function getpopular($conn, $count) {
|
||||||
$query = $conn->prepare("SELECT id, visible, title, date, now_time, views, member, tagsys
|
$query = $conn->prepare("SELECT id, visible, title, date, now_time, views, member, tagsys
|
||||||
FROM pastes WHERE visible='0'
|
FROM pastes WHERE visible='0'
|
||||||
ORDER BY views + 0 DESC
|
ORDER BY views + 0 DESC
|
||||||
|
@ -229,8 +223,7 @@ LIMIT 0, ?");
|
||||||
return $query->fetchAll();
|
return $query->fetchAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getrandom($conn, $count)
|
function getrandom($conn, $count) {
|
||||||
{
|
|
||||||
$query = $conn->prepare("SELECT id, visible, title, date, now_time, views, member, tagsys
|
$query = $conn->prepare("SELECT id, visible, title, date, now_time, views, member, tagsys
|
||||||
FROM pastes where visible='0'
|
FROM pastes where visible='0'
|
||||||
ORDER BY RAND()
|
ORDER BY RAND()
|
||||||
|
@ -239,8 +232,7 @@ LIMIT ?");
|
||||||
return $query->fetchAll();
|
return $query->fetchAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUserRecent($conn, $count, $username)
|
function getUserRecent($conn, $count, $username) {
|
||||||
{
|
|
||||||
$query = $conn->prepare("SELECT id, member, title, date, now_time
|
$query = $conn->prepare("SELECT id, member, title, date, now_time
|
||||||
FROM pastes where member=?
|
FROM pastes where member=?
|
||||||
ORDER BY id DESC
|
ORDER BY id DESC
|
||||||
|
@ -250,15 +242,13 @@ LIMIT 0 , ?");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getUserPastes($conn, $username)
|
function getUserPastes($conn, $username) {
|
||||||
{
|
|
||||||
$query = $conn->prepare("SELECT id, title, code, views, s_date, now_time, visible, date, tagsys, member FROM pastes where member=? ORDER by id DESC");
|
$query = $conn->prepare("SELECT id, title, code, views, s_date, now_time, visible, date, tagsys, member FROM pastes where member=? ORDER by id DESC");
|
||||||
$query->execute([$username]);
|
$query->execute([$username]);
|
||||||
return $query->fetchAll();
|
return $query->fetchAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
function jsonView($paste_id, $p_title, $p_conntent, $p_code)
|
function jsonView($paste_id, $p_title, $p_conntent, $p_code) {
|
||||||
{
|
|
||||||
$stats = false;
|
$stats = false;
|
||||||
if ($p_code) {
|
if ($p_code) {
|
||||||
// Raw
|
// Raw
|
||||||
|
@ -273,9 +263,7 @@ function jsonView($paste_id, $p_title, $p_conntent, $p_code)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getTotalPastes($conn, $username) {
|
||||||
function getTotalPastes($conn, $username)
|
|
||||||
{
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
$query = $conn->prepare("SELECT member FROM pastes WHERE member=?");
|
$query = $conn->prepare("SELECT member FROM pastes WHERE member=?");
|
||||||
$query->execute([$username]);
|
$query->execute([$username]);
|
||||||
|
@ -296,8 +284,7 @@ function existingUser(PDO $conn, string $username) : bool {
|
||||||
return (bool)$query->fetch();
|
return (bool)$query->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateMyView($conn, $paste_id)
|
function updateMyView($conn, $paste_id) {
|
||||||
{
|
|
||||||
$query = $conn->prepare("SELECT views, id FROM pastes WHERE id= ?");
|
$query = $conn->prepare("SELECT views, id FROM pastes WHERE id= ?");
|
||||||
$query->execute([$paste_id]);
|
$query->execute([$paste_id]);
|
||||||
if ($row = $query->fetch()) {
|
if ($row = $query->fetch()) {
|
||||||
|
@ -344,8 +331,7 @@ function conTime($secs) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
function truncate($input, $maxWords, $maxChars)
|
function truncate($input, $maxWords, $maxChars) {
|
||||||
{
|
|
||||||
$words = preg_split('/\s+/', $input);
|
$words = preg_split('/\s+/', $input);
|
||||||
$words = array_slice($words, 0, $maxWords);
|
$words = array_slice($words, 0, $maxWords);
|
||||||
$words = array_reverse($words);
|
$words = array_reverse($words);
|
||||||
|
@ -367,8 +353,9 @@ function truncate($input, $maxWords, $maxChars)
|
||||||
|
|
||||||
return $result . ($input == $result ? '' : '[...]');
|
return $result . ($input == $result ? '' : '[...]');
|
||||||
}
|
}
|
||||||
function truncatetag($input, $maxWords, $maxChars)
|
|
||||||
{$str = $input;
|
function truncatetag($input, $maxWords, $maxChars) {
|
||||||
|
$str = $input;
|
||||||
$pattern = '/,/i';
|
$pattern = '/,/i';
|
||||||
$words = preg_replace($pattern, ' ', $str);
|
$words = preg_replace($pattern, ' ', $str);
|
||||||
$words = preg_split('/\s+/', $input);
|
$words = preg_split('/\s+/', $input);
|
||||||
|
@ -392,8 +379,8 @@ function truncatetag($input, $maxWords, $maxChars)
|
||||||
|
|
||||||
return $result . ($input == $result ? '' : '...');
|
return $result . ($input == $result ? '' : '...');
|
||||||
}
|
}
|
||||||
function doDownload($paste_id, $p_title, $p_member, $p_conntent, $p_code)
|
|
||||||
{
|
function doDownload($paste_id, $p_title, $p_member, $p_conntent, $p_code) {
|
||||||
$stats = false;
|
$stats = false;
|
||||||
if ($p_code) {
|
if ($p_code) {
|
||||||
// Figure out extensions.
|
// Figure out extensions.
|
||||||
|
@ -417,8 +404,7 @@ function doDownload($paste_id, $p_title, $p_member, $p_conntent, $p_code)
|
||||||
return $stats;
|
return $stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
function rawView($paste_id, $p_title, $p_conntent, $p_code)
|
function rawView($paste_id, $p_title, $p_conntent, $p_code) {
|
||||||
{
|
|
||||||
$stats = false;
|
$stats = false;
|
||||||
if ($p_code) {
|
if ($p_code) {
|
||||||
// Raw
|
// Raw
|
||||||
|
@ -433,7 +419,6 @@ function rawView($paste_id, $p_title, $p_conntent, $p_code)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function embedView($paste_id, $p_title, $p_conntent, $p_code, $title, $baseurl, $ges_style, $lang) {
|
function embedView($paste_id, $p_title, $p_conntent, $p_code, $title, $baseurl, $ges_style, $lang) {
|
||||||
$stats = false;
|
$stats = false;
|
||||||
if ($p_conntent) {
|
if ($p_conntent) {
|
||||||
|
@ -503,8 +488,7 @@ function embedView( $paste_id, $p_title, $p_conntent, $p_code, $title, $baseurl,
|
||||||
return $stats;
|
return $stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
function addToSitemap($paste_id, $priority, $changefreq, $mod_rewrite)
|
function addToSitemap($paste_id, $priority, $changefreq, $mod_rewrite) {
|
||||||
{
|
|
||||||
$c_date = date('Y-m-d');
|
$c_date = date('Y-m-d');
|
||||||
$site_data = file_get_contents("sitemap.xml");
|
$site_data = file_get_contents("sitemap.xml");
|
||||||
$site_data = str_replace("</urlset>", "", $site_data);
|
$site_data = str_replace("</urlset>", "", $site_data);
|
||||||
|
@ -529,6 +513,7 @@ function addToSitemap($paste_id, $priority, $changefreq, $mod_rewrite)
|
||||||
$full_map = $site_data . $c_sitemap;
|
$full_map = $site_data . $c_sitemap;
|
||||||
file_put_contents("sitemap.xml", $full_map);
|
file_put_contents("sitemap.xml", $full_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
function paste_protocol() {
|
function paste_protocol() {
|
||||||
|
|
||||||
$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? 'https://' : 'http://';
|
$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? 'https://' : 'http://';
|
||||||
|
@ -542,4 +527,5 @@ function is_banned($conn, $ip) {
|
||||||
|
|
||||||
return (bool)$query->fetch();
|
return (bool)$query->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -52,7 +52,8 @@ if (!defined('GESHI_ROOT')) {
|
||||||
define('GESHI_ROOT', dirname(__FILE__) . DIRECTORY_SEPARATOR);
|
define('GESHI_ROOT', dirname(__FILE__) . DIRECTORY_SEPARATOR);
|
||||||
}
|
}
|
||||||
/** The language file directory for GeSHi
|
/** The language file directory for GeSHi
|
||||||
@access private */
|
* @access private
|
||||||
|
*/
|
||||||
define('GESHI_LANG_ROOT', GESHI_ROOT . 'geshi' . DIRECTORY_SEPARATOR);
|
define('GESHI_LANG_ROOT', GESHI_ROOT . 'geshi' . DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
// Define if GeSHi should be paranoid about security
|
// Define if GeSHi should be paranoid about security
|
||||||
|
@ -126,7 +127,7 @@ define('GESHI_END_IMPORTANT', '<END GeSHi>');
|
||||||
/** Strict mode never applies (this is the most common) */
|
/** Strict mode never applies (this is the most common) */
|
||||||
define('GESHI_NEVER', 0);
|
define('GESHI_NEVER', 0);
|
||||||
/** Strict mode *might* apply, and can be enabled or
|
/** Strict mode *might* apply, and can be enabled or
|
||||||
disabled by {@link GeSHi->enable_strict_mode()} */
|
* disabled by {@link GeSHi->enable_strict_mode()} */
|
||||||
define('GESHI_MAYBE', 1);
|
define('GESHI_MAYBE', 1);
|
||||||
/** Strict mode always applies */
|
/** Strict mode always applies */
|
||||||
define('GESHI_ALWAYS', 2);
|
define('GESHI_ALWAYS', 2);
|
||||||
|
@ -135,32 +136,32 @@ define('GESHI_ALWAYS', 2);
|
||||||
/** The key of the regex array defining what to search for */
|
/** The key of the regex array defining what to search for */
|
||||||
define('GESHI_SEARCH', 0);
|
define('GESHI_SEARCH', 0);
|
||||||
/** The key of the regex array defining what bracket group in a
|
/** The key of the regex array defining what bracket group in a
|
||||||
matched search to use as a replacement */
|
* matched search to use as a replacement */
|
||||||
define('GESHI_REPLACE', 1);
|
define('GESHI_REPLACE', 1);
|
||||||
/** The key of the regex array defining any modifiers to the regular expression */
|
/** The key of the regex array defining any modifiers to the regular expression */
|
||||||
define('GESHI_MODIFIERS', 2);
|
define('GESHI_MODIFIERS', 2);
|
||||||
/** The key of the regex array defining what bracket group in a
|
/** The key of the regex array defining what bracket group in a
|
||||||
matched search to put before the replacement */
|
* matched search to put before the replacement */
|
||||||
define('GESHI_BEFORE', 3);
|
define('GESHI_BEFORE', 3);
|
||||||
/** The key of the regex array defining what bracket group in a
|
/** The key of the regex array defining what bracket group in a
|
||||||
matched search to put after the replacement */
|
* matched search to put after the replacement */
|
||||||
define('GESHI_AFTER', 4);
|
define('GESHI_AFTER', 4);
|
||||||
/** The key of the regex array defining a custom keyword to use
|
/** The key of the regex array defining a custom keyword to use
|
||||||
for this regexp's html tag class */
|
* for this regexp's html tag class */
|
||||||
define('GESHI_CLASS', 5);
|
define('GESHI_CLASS', 5);
|
||||||
|
|
||||||
/** Used in language files to mark comments */
|
/** Used in language files to mark comments */
|
||||||
define('GESHI_COMMENTS', 0);
|
define('GESHI_COMMENTS', 0);
|
||||||
|
|
||||||
/** some old PHP / PCRE subpatterns only support up to xxx subpatterns in
|
/** some old PHP / PCRE subpatterns only support up to xxx subpatterns in
|
||||||
regular expressions. Set this to false if your PCRE lib is up to date
|
* regular expressions. Set this to false if your PCRE lib is up to date
|
||||||
@see GeSHi->optimize_regexp_list()
|
* @see GeSHi->optimize_regexp_list()
|
||||||
**/
|
**/
|
||||||
define('GESHI_MAX_PCRE_SUBPATTERNS', 500);
|
define('GESHI_MAX_PCRE_SUBPATTERNS', 500);
|
||||||
/** it's also important not to generate too long regular expressions
|
/** it's also important not to generate too long regular expressions
|
||||||
be generous here... but keep in mind, that when reaching this limit we
|
* be generous here... but keep in mind, that when reaching this limit we
|
||||||
still have to close open patterns. 12k should do just fine on a 16k limit.
|
* still have to close open patterns. 12k should do just fine on a 16k limit.
|
||||||
@see GeSHi->optimize_regexp_list()
|
* @see GeSHi->optimize_regexp_list()
|
||||||
**/
|
**/
|
||||||
define('GESHI_MAX_PCRE_LENGTH', 12288);
|
define('GESHI_MAX_PCRE_LENGTH', 12288);
|
||||||
|
|
||||||
|
@ -578,8 +579,7 @@ class GeSHi {
|
||||||
* @return string
|
* @return string
|
||||||
* @since 1.0.8.11
|
* @since 1.0.8.11
|
||||||
*/
|
*/
|
||||||
public function get_version()
|
public function get_version() {
|
||||||
{
|
|
||||||
return GESHI_VERSION;
|
return GESHI_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -720,8 +720,7 @@ class GeSHi {
|
||||||
* @param boolean $full_names
|
* @param boolean $full_names
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function get_supported_languages($full_names=false)
|
public function get_supported_languages($full_names = false) {
|
||||||
{
|
|
||||||
// return array
|
// return array
|
||||||
$back = array();
|
$back = array();
|
||||||
|
|
||||||
|
@ -729,8 +728,7 @@ class GeSHi {
|
||||||
$dir = dir($this->language_path);
|
$dir = dir($this->language_path);
|
||||||
|
|
||||||
// foreach entry
|
// foreach entry
|
||||||
while (false !== ($entry = $dir->read()))
|
while (false !== ($entry = $dir->read())) {
|
||||||
{
|
|
||||||
$full_path = $this->language_path . $entry;
|
$full_path = $this->language_path . $entry;
|
||||||
|
|
||||||
// Skip all dirs
|
// Skip all dirs
|
||||||
|
@ -747,15 +745,11 @@ class GeSHi {
|
||||||
$langname = $matches[1];
|
$langname = $matches[1];
|
||||||
|
|
||||||
// We want the fullname too?
|
// We want the fullname too?
|
||||||
if ($full_names === true)
|
if ($full_names === true) {
|
||||||
{
|
if (false !== ($fullname = $this->get_language_fullname($langname))) {
|
||||||
if (false !== ($fullname = $this->get_language_fullname($langname)))
|
|
||||||
{
|
|
||||||
$back[$langname] = $fullname; // we go associative
|
$back[$langname] = $fullname; // we go associative
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
// just store raw langname
|
// just store raw langname
|
||||||
$back[] = $langname;
|
$back[] = $langname;
|
||||||
}
|
}
|
||||||
|
@ -771,8 +765,7 @@ class GeSHi {
|
||||||
* @param string $language short langname (html4strict for example)
|
* @param string $language short langname (html4strict for example)
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function get_language_fullname($language)
|
public function get_language_fullname($language) {
|
||||||
{
|
|
||||||
//Clean up the language name to prevent malicious code injection
|
//Clean up the language name to prevent malicious code injection
|
||||||
$language = preg_replace('#[^a-zA-Z0-9\-_]#', '', $language);
|
$language = preg_replace('#[^a-zA-Z0-9\-_]#', '', $language);
|
||||||
|
|
||||||
|
@ -968,8 +961,8 @@ class GeSHi {
|
||||||
/**
|
/**
|
||||||
* Get current setting for multiline spans, see GeSHi->enable_multiline_span().
|
* Get current setting for multiline spans, see GeSHi->enable_multiline_span().
|
||||||
*
|
*
|
||||||
* @see enable_multiline_span
|
|
||||||
* @return bool
|
* @return bool
|
||||||
|
* @see enable_multiline_span
|
||||||
*/
|
*/
|
||||||
public function get_multiline_span() {
|
public function get_multiline_span() {
|
||||||
return $this->allow_multiline_span;
|
return $this->allow_multiline_span;
|
||||||
|
@ -1408,8 +1401,8 @@ class GeSHi {
|
||||||
* The optional flag parameter was added in version 1.0.7.21 and can be used
|
* The optional flag parameter was added in version 1.0.7.21 and can be used
|
||||||
* to enable (true) or disable (false) all highlighting.
|
* to enable (true) or disable (false) all highlighting.
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
|
||||||
* @param boolean $flag A flag specifying whether to enable or disable all highlighting
|
* @param boolean $flag A flag specifying whether to enable or disable all highlighting
|
||||||
|
* @since 1.0.0
|
||||||
* @todo Rewrite with array traversal
|
* @todo Rewrite with array traversal
|
||||||
*/
|
*/
|
||||||
public function enable_highlighting($flag = true) {
|
public function enable_highlighting($flag = true) {
|
||||||
|
@ -1434,10 +1427,10 @@ class GeSHi {
|
||||||
*
|
*
|
||||||
* @param string $extension The extension to get a language name for
|
* @param string $extension The extension to get a language name for
|
||||||
* @param array $lookup A lookup array to use instead of the default one
|
* @param array $lookup A lookup array to use instead of the default one
|
||||||
* @since 1.0.5
|
* @return int|string
|
||||||
* @todo Re-think about how this method works (maybe make it private and/or make it
|
* @todo Re-think about how this method works (maybe make it private and/or make it
|
||||||
* a extension->lang lookup?)
|
* a extension->lang lookup?)
|
||||||
* @return int|string
|
* @since 1.0.5
|
||||||
*/
|
*/
|
||||||
public static function get_language_name_from_extension($extension, $lookup = array()) {
|
public static function get_language_name_from_extension($extension, $lookup = array()) {
|
||||||
$extension = strtolower($extension);
|
$extension = strtolower($extension);
|
||||||
|
@ -1609,8 +1602,8 @@ class GeSHi {
|
||||||
* @param string $styles The styles for the keyword group
|
* @param string $styles The styles for the keyword group
|
||||||
* @param boolean $case_sensitive Whether the keyword group is case sensitive ornot
|
* @param boolean $case_sensitive Whether the keyword group is case sensitive ornot
|
||||||
* @param array $words The words to use for the keyword group
|
* @param array $words The words to use for the keyword group
|
||||||
* @since 1.0.0
|
|
||||||
* @return bool
|
* @return bool
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function add_keyword_group($key, $styles, $case_sensitive = true, $words = array()) {
|
public function add_keyword_group($key, $styles, $case_sensitive = true, $words = array()) {
|
||||||
$words = (array)$words;
|
$words = (array)$words;
|
||||||
|
@ -2047,8 +2040,7 @@ class GeSHi {
|
||||||
'<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">{|>',
|
'<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">{|>',
|
||||||
'<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">}|>',
|
'<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">}|>',
|
||||||
);
|
);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$this->language_data['CACHE_BRACKET_REPLACE'] = array(
|
$this->language_data['CACHE_BRACKET_REPLACE'] = array(
|
||||||
'<| class="br0">[|>',
|
'<| class="br0">[|>',
|
||||||
'<| class="br0">]|>',
|
'<| class="br0">]|>',
|
||||||
|
@ -2243,8 +2235,7 @@ class GeSHi {
|
||||||
*/
|
*/
|
||||||
if (preg_match($delimiters, $code, $matches_rx, PREG_OFFSET_CAPTURE, $i)) {
|
if (preg_match($delimiters, $code, $matches_rx, PREG_OFFSET_CAPTURE, $i)) {
|
||||||
//We got a match ...
|
//We got a match ...
|
||||||
if(isset($matches_rx['start']) && isset($matches_rx['end']))
|
if (isset($matches_rx['start']) && isset($matches_rx['end'])) {
|
||||||
{
|
|
||||||
$matches[$dk] = array(
|
$matches[$dk] = array(
|
||||||
'next_match' => $matches_rx['start'][1],
|
'next_match' => $matches_rx['start'][1],
|
||||||
'dk' => $dk,
|
'dk' => $dk,
|
||||||
|
@ -3010,8 +3001,7 @@ class GeSHi {
|
||||||
if ((empty($sc_disallowed_before) || ($i == 0) ||
|
if ((empty($sc_disallowed_before) || ($i == 0) ||
|
||||||
(false === strpos($sc_disallowed_before, $part[$i - 1]))) &&
|
(false === strpos($sc_disallowed_before, $part[$i - 1]))) &&
|
||||||
(empty($sc_disallowed_after) || ($length <= $i + $com_len) ||
|
(empty($sc_disallowed_after) || ($length <= $i + $com_len) ||
|
||||||
(false === strpos($sc_disallowed_after, $part[$i + $com_len]))))
|
(false === strpos($sc_disallowed_after, $part[$i + $com_len])))) {
|
||||||
{
|
|
||||||
// this is a valid comment
|
// this is a valid comment
|
||||||
$COMMENT_MATCHED = true;
|
$COMMENT_MATCHED = true;
|
||||||
if ($this->lexic_permissions['COMMENTS'][$comment_key]) {
|
if ($this->lexic_permissions['COMMENTS'][$comment_key]) {
|
||||||
|
@ -3325,9 +3315,9 @@ class GeSHi {
|
||||||
* stuff like keywords, numbers and methods.
|
* stuff like keywords, numbers and methods.
|
||||||
*
|
*
|
||||||
* @param string $stuff_to_parse The string to parse for keyword, numbers etc.
|
* @param string $stuff_to_parse The string to parse for keyword, numbers etc.
|
||||||
* @since 1.0.0
|
|
||||||
* @todo BUGGY! Why? Why not build string and return?
|
|
||||||
* @return string
|
* @return string
|
||||||
|
* @todo BUGGY! Why? Why not build string and return?
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected function parse_non_string_part($stuff_to_parse) {
|
protected function parse_non_string_part($stuff_to_parse) {
|
||||||
$stuff_to_parse = ' ' . $this->hsc($stuff_to_parse);
|
$stuff_to_parse = ' ' . $this->hsc($stuff_to_parse);
|
||||||
|
@ -4030,8 +4020,7 @@ class GeSHi {
|
||||||
if ($close) {
|
if ($close) {
|
||||||
$parsed_code .= str_repeat('</span>', $close);
|
$parsed_code .= str_repeat('</span>', $close);
|
||||||
$close = 0;
|
$close = 0;
|
||||||
}
|
} elseif ($i + 1 < $n) {
|
||||||
elseif ($i + 1 < $n) {
|
|
||||||
$parsed_code .= "\n";
|
$parsed_code .= "\n";
|
||||||
}
|
}
|
||||||
unset($code[$i]);
|
unset($code[$i]);
|
||||||
|
@ -4163,15 +4152,13 @@ class GeSHi {
|
||||||
}
|
}
|
||||||
return ($this->force_code_block ? '</div>' : '') .
|
return ($this->force_code_block ? '</div>' : '') .
|
||||||
"$footer</div>";
|
"$footer</div>";
|
||||||
}
|
} elseif ($this->header_type == GESHI_HEADER_PRE_TABLE) {
|
||||||
elseif ($this->header_type == GESHI_HEADER_PRE_TABLE) {
|
|
||||||
if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
|
if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
|
||||||
return "</tr></tbody>$footer</table>";
|
return "</tr></tbody>$footer</table>";
|
||||||
}
|
}
|
||||||
return ($this->force_code_block ? '</div>' : '') .
|
return ($this->force_code_block ? '</div>' : '') .
|
||||||
"$footer</div>";
|
"$footer</div>";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
|
if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
|
||||||
return "</ol>$footer</pre>";
|
return "</ol>$footer</pre>";
|
||||||
}
|
}
|
||||||
|
@ -4670,11 +4657,11 @@ class GeSHi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* this function creates the appropriate regexp string of an token array
|
* this function creates the appropriate regexp string of an token array
|
||||||
* you should not call this function directly, @see $this->optimize_regexp_list().
|
* you should not call this function directly, @param array $tokens array of tokens
|
||||||
*
|
|
||||||
* @param array $tokens array of tokens
|
|
||||||
* @param bool $recursed to know wether we recursed or not
|
* @param bool $recursed to know wether we recursed or not
|
||||||
* @return string
|
* @return string
|
||||||
|
* @see $this->optimize_regexp_list().
|
||||||
|
*
|
||||||
* @author Milian Wolff <mail@milianw.de>
|
* @author Milian Wolff <mail@milianw.de>
|
||||||
* @since 1.0.8
|
* @since 1.0.8
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -135,8 +135,7 @@ $language_data = array (
|
||||||
2 => 'color: #000000; font-weight: bold;',
|
2 => 'color: #000000; font-weight: bold;',
|
||||||
3 => 'color: #000066;'
|
3 => 'color: #000066;'
|
||||||
),
|
),
|
||||||
'COMMENTS' => array(
|
'COMMENTS' => array(),
|
||||||
),
|
|
||||||
'ESCAPE_CHAR' => array(
|
'ESCAPE_CHAR' => array(
|
||||||
0 => 'color: #000099; font-weight: bold;'
|
0 => 'color: #000099; font-weight: bold;'
|
||||||
),
|
),
|
||||||
|
@ -149,8 +148,7 @@ $language_data = array (
|
||||||
'NUMBERS' => array(
|
'NUMBERS' => array(
|
||||||
0 => 'color: #cc66cc;'
|
0 => 'color: #cc66cc;'
|
||||||
),
|
),
|
||||||
'METHODS' => array(
|
'METHODS' => array(),
|
||||||
),
|
|
||||||
'SYMBOLS' => array(
|
'SYMBOLS' => array(
|
||||||
0 => 'color: #66cc66;'
|
0 => 'color: #66cc66;'
|
||||||
),
|
),
|
||||||
|
@ -161,18 +159,15 @@ $language_data = array (
|
||||||
1 => 'color: #ddbb00;',
|
1 => 'color: #ddbb00;',
|
||||||
2 => 'color: #009900;'
|
2 => 'color: #009900;'
|
||||||
),
|
),
|
||||||
'REGEXPS' => array(
|
'REGEXPS' => array()
|
||||||
)
|
|
||||||
),
|
),
|
||||||
'URLS' => array(
|
'URLS' => array(
|
||||||
2 => 'http://december.com/html/4/element/{FNAMEL}.html',
|
2 => 'http://december.com/html/4/element/{FNAMEL}.html',
|
||||||
3 => ''
|
3 => ''
|
||||||
),
|
),
|
||||||
'OOLANG' => false,
|
'OOLANG' => false,
|
||||||
'OBJECT_SPLITTERS' => array(
|
'OBJECT_SPLITTERS' => array(),
|
||||||
),
|
'REGEXPS' => array(),
|
||||||
'REGEXPS' => array(
|
|
||||||
),
|
|
||||||
'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
|
'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
|
||||||
'SCRIPT_DELIMITERS' => array(
|
'SCRIPT_DELIMITERS' => array(
|
||||||
-2 => array(
|
-2 => array(
|
||||||
|
|
|
@ -955,10 +955,8 @@ $language_data = array (
|
||||||
'SYMBOLS' => array(
|
'SYMBOLS' => array(
|
||||||
0 => 'color: #339933;'
|
0 => 'color: #339933;'
|
||||||
),
|
),
|
||||||
'SCRIPT' => array(
|
'SCRIPT' => array(),
|
||||||
),
|
'REGEXPS' => array()
|
||||||
'REGEXPS' => array(
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
'URLS' => array(
|
'URLS' => array(
|
||||||
1 => '',
|
1 => '',
|
||||||
|
@ -970,11 +968,8 @@ $language_data = array (
|
||||||
'OBJECT_SPLITTERS' => array(
|
'OBJECT_SPLITTERS' => array(
|
||||||
1 => '.'
|
1 => '.'
|
||||||
),
|
),
|
||||||
'REGEXPS' => array(
|
'REGEXPS' => array(),
|
||||||
),
|
|
||||||
'STRICT_MODE_APPLIES' => GESHI_NEVER,
|
'STRICT_MODE_APPLIES' => GESHI_NEVER,
|
||||||
'SCRIPT_DELIMITERS' => array(
|
'SCRIPT_DELIMITERS' => array(),
|
||||||
),
|
'HIGHLIGHT_STRICT_BLOCK' => array()
|
||||||
'HIGHLIGHT_STRICT_BLOCK' => array(
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
|
@ -134,8 +134,7 @@ $language_data = array (
|
||||||
'SYMBOLS' => array(
|
'SYMBOLS' => array(
|
||||||
0 => 'color: #339933;'
|
0 => 'color: #339933;'
|
||||||
),
|
),
|
||||||
'REGEXPS' => array(
|
'REGEXPS' => array(),
|
||||||
),
|
|
||||||
'SCRIPT' => array(
|
'SCRIPT' => array(
|
||||||
0 => '',
|
0 => '',
|
||||||
1 => '',
|
1 => '',
|
||||||
|
@ -154,8 +153,7 @@ $language_data = array (
|
||||||
'OBJECT_SPLITTERS' => array(
|
'OBJECT_SPLITTERS' => array(
|
||||||
1 => '.'
|
1 => '.'
|
||||||
),
|
),
|
||||||
'REGEXPS' => array(
|
'REGEXPS' => array(),
|
||||||
),
|
|
||||||
'STRICT_MODE_APPLIES' => GESHI_MAYBE,
|
'STRICT_MODE_APPLIES' => GESHI_MAYBE,
|
||||||
'SCRIPT_DELIMITERS' => array(
|
'SCRIPT_DELIMITERS' => array(
|
||||||
0 => array(
|
0 => array(
|
||||||
|
|
|
@ -97,8 +97,7 @@ class MarkdownGeshi_Parser extends MarkdownExtra_Parser {
|
||||||
'<cite class="gist">(GIST: <a href="https://gist.github.com/%1$d" target="_blank">%1$d</a>)</cite>',
|
'<cite class="gist">(GIST: <a href="https://gist.github.com/%1$d" target="_blank">%1$d</a>)</cite>',
|
||||||
$value
|
$value
|
||||||
)
|
)
|
||||||
. $highlighted
|
. $highlighted;
|
||||||
;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -378,16 +378,13 @@ $language_data = array (
|
||||||
'NUMBERS' => array(
|
'NUMBERS' => array(
|
||||||
0 => 'color: #008080;'
|
0 => 'color: #008080;'
|
||||||
),
|
),
|
||||||
'METHODS' => array(
|
'METHODS' => array(),
|
||||||
),
|
|
||||||
'SYMBOLS' => array(
|
'SYMBOLS' => array(
|
||||||
1 => 'color: #CC0099;', // operators
|
1 => 'color: #CC0099;', // operators
|
||||||
2 => 'color: #000033;', // syntax
|
2 => 'color: #000033;', // syntax
|
||||||
),
|
),
|
||||||
'SCRIPT' => array(
|
'SCRIPT' => array(),
|
||||||
),
|
'REGEXPS' => array()
|
||||||
'REGEXPS' => array(
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
'URLS' => array(
|
'URLS' => array(
|
||||||
1 => 'http://search.oracle.com/search/search?group=MySQL&q={FNAME}',
|
1 => 'http://search.oracle.com/search/search?group=MySQL&q={FNAME}',
|
||||||
|
@ -421,15 +418,11 @@ $language_data = array (
|
||||||
27 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/analysing-spatial-information.html',
|
27 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/analysing-spatial-information.html',
|
||||||
),
|
),
|
||||||
'OOLANG' => false,
|
'OOLANG' => false,
|
||||||
'OBJECT_SPLITTERS' => array(
|
'OBJECT_SPLITTERS' => array(),
|
||||||
),
|
'REGEXPS' => array(),
|
||||||
'REGEXPS' => array(
|
|
||||||
),
|
|
||||||
'STRICT_MODE_APPLIES' => GESHI_NEVER,
|
'STRICT_MODE_APPLIES' => GESHI_NEVER,
|
||||||
'SCRIPT_DELIMITERS' => array(
|
'SCRIPT_DELIMITERS' => array(),
|
||||||
),
|
'HIGHLIGHT_STRICT_BLOCK' => array(),
|
||||||
'HIGHLIGHT_STRICT_BLOCK' => array(
|
|
||||||
),
|
|
||||||
'TAB_WIDTH' => 4,
|
'TAB_WIDTH' => 4,
|
||||||
'PARSER_CONTROL' => array(
|
'PARSER_CONTROL' => array(
|
||||||
'KEYWORDS' => array(
|
'KEYWORDS' => array(
|
||||||
|
|
|
@ -97,8 +97,7 @@ class MarkdownGeshi_Parser extends MarkdownExtra_Parser {
|
||||||
'<cite class="gist">(GIST: <a href="https://gist.github.com/%1$d" target="_blank">%1$d</a>)</cite>',
|
'<cite class="gist">(GIST: <a href="https://gist.github.com/%1$d" target="_blank">%1$d</a>)</cite>',
|
||||||
$value
|
$value
|
||||||
)
|
)
|
||||||
. $highlighted
|
. $highlighted;
|
||||||
;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,10 +217,8 @@ $language_data = array (
|
||||||
'SYMBOLS' => array(
|
'SYMBOLS' => array(
|
||||||
0 => 'color: #66cc66;'
|
0 => 'color: #66cc66;'
|
||||||
),
|
),
|
||||||
'REGEXPS' => array(
|
'REGEXPS' => array(),
|
||||||
),
|
'SCRIPT' => array()
|
||||||
'SCRIPT' => array(
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
'URLS' => array(
|
'URLS' => array(
|
||||||
1 => '',
|
1 => '',
|
||||||
|
@ -232,11 +230,8 @@ $language_data = array (
|
||||||
'OBJECT_SPLITTERS' => array(
|
'OBJECT_SPLITTERS' => array(
|
||||||
1 => '.'
|
1 => '.'
|
||||||
),
|
),
|
||||||
'REGEXPS' => array(
|
'REGEXPS' => array(),
|
||||||
),
|
|
||||||
'STRICT_MODE_APPLIES' => GESHI_NEVER,
|
'STRICT_MODE_APPLIES' => GESHI_NEVER,
|
||||||
'SCRIPT_DELIMITERS' => array(
|
'SCRIPT_DELIMITERS' => array(),
|
||||||
),
|
'HIGHLIGHT_STRICT_BLOCK' => array()
|
||||||
'HIGHLIGHT_STRICT_BLOCK' => array(
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
|
@ -207,8 +207,8 @@ namespace PasswordCompat\binary {
|
||||||
*
|
*
|
||||||
* @param string $binary_string The input string
|
* @param string $binary_string The input string
|
||||||
*
|
*
|
||||||
* @internal
|
|
||||||
* @return int The number of bytes
|
* @return int The number of bytes
|
||||||
|
* @internal
|
||||||
*/
|
*/
|
||||||
function _strlen($binary_string) {
|
function _strlen($binary_string) {
|
||||||
if (function_exists('mb_strlen')) {
|
if (function_exists('mb_strlen')) {
|
||||||
|
@ -220,14 +220,14 @@ namespace PasswordCompat\binary {
|
||||||
/**
|
/**
|
||||||
* Get a substring based on byte limits
|
* Get a substring based on byte limits
|
||||||
*
|
*
|
||||||
* @see _strlen()
|
|
||||||
*
|
|
||||||
* @param string $binary_string The input string
|
* @param string $binary_string The input string
|
||||||
* @param int $start
|
* @param int $start
|
||||||
* @param int $length
|
* @param int $length
|
||||||
*
|
*
|
||||||
* @internal
|
|
||||||
* @return string The substring
|
* @return string The substring
|
||||||
|
* @internal
|
||||||
|
* @see _strlen()
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
function _substr($binary_string, $start, $length) {
|
function _substr($binary_string, $start, $length) {
|
||||||
if (function_exists('mb_substr')) {
|
if (function_exists('mb_substr')) {
|
||||||
|
@ -242,7 +242,7 @@ namespace PasswordCompat\binary {
|
||||||
* @return boolean the check result
|
* @return boolean the check result
|
||||||
*/
|
*/
|
||||||
function check() {
|
function check() {
|
||||||
static $pass = NULL;
|
static $pass = null;
|
||||||
|
|
||||||
if (is_null($pass)) {
|
if (is_null($pass)) {
|
||||||
if (function_exists('crypt')) {
|
if (function_exists('crypt')) {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Paste <https://github.com/jordansamuel/PASTE>
|
* Paste <https://github.com/jordansamuel/PASTE>
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -27,8 +27,7 @@
|
||||||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
*/
|
*/
|
||||||
class POP3
|
class POP3 {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* The POP3 PHPMailer Version number.
|
* The POP3 PHPMailer Version number.
|
||||||
* @var string
|
* @var string
|
||||||
|
@ -162,8 +161,7 @@ class POP3
|
||||||
* @param integer $debug_level
|
* @param integer $debug_level
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0)
|
public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0) {
|
||||||
{
|
|
||||||
$this->host = $host;
|
$this->host = $host;
|
||||||
// If no port value provided, use default
|
// If no port value provided, use default
|
||||||
if (false === $port) {
|
if (false === $port) {
|
||||||
|
@ -204,8 +202,7 @@ class POP3
|
||||||
* @param integer $tval
|
* @param integer $tval
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function connect($host, $port = false, $tval = 30)
|
public function connect($host, $port = false, $tval = 30) {
|
||||||
{
|
|
||||||
// Are we already connected?
|
// Are we already connected?
|
||||||
if ($this->connected) {
|
if ($this->connected) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -263,8 +260,7 @@ class POP3
|
||||||
* @param string $password
|
* @param string $password
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function login($username = '', $password = '')
|
public function login($username = '', $password = '') {
|
||||||
{
|
|
||||||
if (!$this->connected) {
|
if (!$this->connected) {
|
||||||
$this->setError('Not connected to POP3 server');
|
$this->setError('Not connected to POP3 server');
|
||||||
}
|
}
|
||||||
|
@ -293,8 +289,7 @@ class POP3
|
||||||
* Disconnect from the POP3 server.
|
* Disconnect from the POP3 server.
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
public function disconnect()
|
public function disconnect() {
|
||||||
{
|
|
||||||
$this->sendString('QUIT');
|
$this->sendString('QUIT');
|
||||||
//The QUIT command may cause the daemon to exit, which will kill our connection
|
//The QUIT command may cause the daemon to exit, which will kill our connection
|
||||||
//So ignore errors here
|
//So ignore errors here
|
||||||
|
@ -312,8 +307,7 @@ class POP3
|
||||||
* @return string
|
* @return string
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
protected function getResponse($size = 128)
|
protected function getResponse($size = 128) {
|
||||||
{
|
|
||||||
$response = fgets($this->pop_conn, $size);
|
$response = fgets($this->pop_conn, $size);
|
||||||
if ($this->do_debug >= 1) {
|
if ($this->do_debug >= 1) {
|
||||||
echo "Server -> Client: $response";
|
echo "Server -> Client: $response";
|
||||||
|
@ -327,8 +321,7 @@ class POP3
|
||||||
* @return integer
|
* @return integer
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
protected function sendString($string)
|
protected function sendString($string) {
|
||||||
{
|
|
||||||
if ($this->pop_conn) {
|
if ($this->pop_conn) {
|
||||||
if ($this->do_debug >= 2) { //Show client messages when debug >= 2
|
if ($this->do_debug >= 2) { //Show client messages when debug >= 2
|
||||||
echo "Client -> Server: $string";
|
echo "Client -> Server: $string";
|
||||||
|
@ -345,8 +338,7 @@ class POP3
|
||||||
* @return boolean
|
* @return boolean
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
protected function checkResponse($string)
|
protected function checkResponse($string) {
|
||||||
{
|
|
||||||
if (substr($string, 0, 3) !== '+OK') {
|
if (substr($string, 0, 3) !== '+OK') {
|
||||||
$this->setError(array(
|
$this->setError(array(
|
||||||
'error' => "Server reported an error: $string",
|
'error' => "Server reported an error: $string",
|
||||||
|
@ -365,8 +357,7 @@ class POP3
|
||||||
* @param $error
|
* @param $error
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
protected function setError($error)
|
protected function setError($error) {
|
||||||
{
|
|
||||||
$this->errors[] = $error;
|
$this->errors[] = $error;
|
||||||
if ($this->do_debug >= 1) {
|
if ($this->do_debug >= 1) {
|
||||||
echo '<pre>';
|
echo '<pre>';
|
||||||
|
@ -381,8 +372,7 @@ class POP3
|
||||||
* Get an array of error messages, if any.
|
* Get an array of error messages, if any.
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getErrors()
|
public function getErrors() {
|
||||||
{
|
|
||||||
return $this->errors;
|
return $this->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,8 +384,7 @@ class POP3
|
||||||
* @param integer $errline
|
* @param integer $errline
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
protected function catchWarning($errno, $errstr, $errfile, $errline)
|
protected function catchWarning($errno, $errstr, $errfile, $errline) {
|
||||||
{
|
|
||||||
$this->setError(array(
|
$this->setError(array(
|
||||||
'error' => "Connecting to the POP3 server raised a PHP warning: ",
|
'error' => "Connecting to the POP3 server raised a PHP warning: ",
|
||||||
'errno' => $errno,
|
'errno' => $errno,
|
||||||
|
|
|
@ -24,8 +24,7 @@
|
||||||
* @author Chris Ryan
|
* @author Chris Ryan
|
||||||
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
|
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
|
||||||
*/
|
*/
|
||||||
class SMTP
|
class SMTP {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* The PHPMailer SMTP version number.
|
* The PHPMailer SMTP version number.
|
||||||
* @var string
|
* @var string
|
||||||
|
@ -204,14 +203,13 @@ class SMTP
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output debugging info via a user-selected method.
|
* Output debugging info via a user-selected method.
|
||||||
* @see SMTP::$Debugoutput
|
|
||||||
* @see SMTP::$do_debug
|
|
||||||
* @param string $str Debug string to output
|
* @param string $str Debug string to output
|
||||||
* @param integer $level The debug level of this message; see DEBUG_* constants
|
* @param integer $level The debug level of this message; see DEBUG_* constants
|
||||||
* @return void
|
* @return void
|
||||||
|
* @see SMTP::$do_debug
|
||||||
|
* @see SMTP::$Debugoutput
|
||||||
*/
|
*/
|
||||||
protected function edebug($str, $level = 0)
|
protected function edebug($str, $level = 0) {
|
||||||
{
|
|
||||||
if ($level > $this->do_debug) {
|
if ($level > $this->do_debug) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -255,8 +253,7 @@ class SMTP
|
||||||
* @access public
|
* @access public
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function connect($host, $port = null, $timeout = 30, $options = array())
|
public function connect($host, $port = null, $timeout = 30, $options = array()) {
|
||||||
{
|
|
||||||
static $streamok;
|
static $streamok;
|
||||||
//This is enabled by default since 5.0.0 but some providers disable it
|
//This is enabled by default since 5.0.0 but some providers disable it
|
||||||
//Check this once and cache the result
|
//Check this once and cache the result
|
||||||
|
@ -345,8 +342,7 @@ class SMTP
|
||||||
* @access public
|
* @access public
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function startTLS()
|
public function startTLS() {
|
||||||
{
|
|
||||||
if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
|
if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -375,7 +371,6 @@ class SMTP
|
||||||
/**
|
/**
|
||||||
* Perform SMTP authentication.
|
* Perform SMTP authentication.
|
||||||
* Must be run after hello().
|
* Must be run after hello().
|
||||||
* @see hello()
|
|
||||||
* @param string $username The user name
|
* @param string $username The user name
|
||||||
* @param string $password The password
|
* @param string $password The password
|
||||||
* @param string $authtype The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5, XOAUTH2)
|
* @param string $authtype The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5, XOAUTH2)
|
||||||
|
@ -383,6 +378,7 @@ class SMTP
|
||||||
* @param string $workstation The auth workstation for NTLM
|
* @param string $workstation The auth workstation for NTLM
|
||||||
* @param null|OAuth $OAuth An optional OAuth instance (@see PHPMailerOAuth)
|
* @param null|OAuth $OAuth An optional OAuth instance (@see PHPMailerOAuth)
|
||||||
* @return bool True if successfully authenticated.* @access public
|
* @return bool True if successfully authenticated.* @access public
|
||||||
|
* @see hello()
|
||||||
*/
|
*/
|
||||||
public function authenticate(
|
public function authenticate(
|
||||||
$username,
|
$username,
|
||||||
|
@ -554,8 +550,7 @@ class SMTP
|
||||||
* @access protected
|
* @access protected
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function hmac($data, $key)
|
protected function hmac($data, $key) {
|
||||||
{
|
|
||||||
if (function_exists('hash_hmac')) {
|
if (function_exists('hash_hmac')) {
|
||||||
return hash_hmac('md5', $data, $key);
|
return hash_hmac('md5', $data, $key);
|
||||||
}
|
}
|
||||||
|
@ -586,8 +581,7 @@ class SMTP
|
||||||
* @access public
|
* @access public
|
||||||
* @return boolean True if connected.
|
* @return boolean True if connected.
|
||||||
*/
|
*/
|
||||||
public function connected()
|
public function connected() {
|
||||||
{
|
|
||||||
if (is_resource($this->smtp_conn)) {
|
if (is_resource($this->smtp_conn)) {
|
||||||
$sock_status = stream_get_meta_data($this->smtp_conn);
|
$sock_status = stream_get_meta_data($this->smtp_conn);
|
||||||
if ($sock_status['eof']) {
|
if ($sock_status['eof']) {
|
||||||
|
@ -607,12 +601,11 @@ class SMTP
|
||||||
/**
|
/**
|
||||||
* Close the socket and clean up the state of the class.
|
* Close the socket and clean up the state of the class.
|
||||||
* Don't use this function without first trying to use QUIT.
|
* Don't use this function without first trying to use QUIT.
|
||||||
|
* @return void
|
||||||
* @see quit()
|
* @see quit()
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function close()
|
public function close() {
|
||||||
{
|
|
||||||
$this->setError('');
|
$this->setError('');
|
||||||
$this->server_caps = null;
|
$this->server_caps = null;
|
||||||
$this->helo_rply = null;
|
$this->helo_rply = null;
|
||||||
|
@ -636,8 +629,7 @@ class SMTP
|
||||||
* @access public
|
* @access public
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function data($msg_data)
|
public function data($msg_data) {
|
||||||
{
|
|
||||||
//This will use the standard timelimit
|
//This will use the standard timelimit
|
||||||
if (!$this->sendCommand('DATA', 'DATA', 354)) {
|
if (!$this->sendCommand('DATA', 'DATA', 354)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -725,8 +717,7 @@ class SMTP
|
||||||
* @access public
|
* @access public
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function hello($host = '')
|
public function hello($host = '') {
|
||||||
{
|
|
||||||
//Try extended hello first (RFC 2821)
|
//Try extended hello first (RFC 2821)
|
||||||
return (boolean)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host));
|
return (boolean)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host));
|
||||||
}
|
}
|
||||||
|
@ -734,14 +725,13 @@ class SMTP
|
||||||
/**
|
/**
|
||||||
* Send an SMTP HELO or EHLO command.
|
* Send an SMTP HELO or EHLO command.
|
||||||
* Low-level implementation used by hello()
|
* Low-level implementation used by hello()
|
||||||
* @see hello()
|
|
||||||
* @param string $hello The HELO string
|
* @param string $hello The HELO string
|
||||||
* @param string $host The hostname to say we are
|
* @param string $host The hostname to say we are
|
||||||
* @access protected
|
* @access protected
|
||||||
* @return boolean
|
* @return boolean
|
||||||
|
* @see hello()
|
||||||
*/
|
*/
|
||||||
protected function sendHello($hello, $host)
|
protected function sendHello($hello, $host) {
|
||||||
{
|
|
||||||
$noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250);
|
$noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250);
|
||||||
$this->helo_rply = $this->last_reply;
|
$this->helo_rply = $this->last_reply;
|
||||||
if ($noerror) {
|
if ($noerror) {
|
||||||
|
@ -758,8 +748,7 @@ class SMTP
|
||||||
* @access protected
|
* @access protected
|
||||||
* @param string $type - 'HELO' or 'EHLO'
|
* @param string $type - 'HELO' or 'EHLO'
|
||||||
*/
|
*/
|
||||||
protected function parseHelloFields($type)
|
protected function parseHelloFields($type) {
|
||||||
{
|
|
||||||
$this->server_caps = array();
|
$this->server_caps = array();
|
||||||
$lines = explode("\n", $this->helo_rply);
|
$lines = explode("\n", $this->helo_rply);
|
||||||
|
|
||||||
|
@ -805,8 +794,7 @@ class SMTP
|
||||||
* @access public
|
* @access public
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function mail($from)
|
public function mail($from) {
|
||||||
{
|
|
||||||
$useVerp = ($this->do_verp ? ' XVERP' : '');
|
$useVerp = ($this->do_verp ? ' XVERP' : '');
|
||||||
return $this->sendCommand(
|
return $this->sendCommand(
|
||||||
'MAIL FROM',
|
'MAIL FROM',
|
||||||
|
@ -823,8 +811,7 @@ class SMTP
|
||||||
* @access public
|
* @access public
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function quit($close_on_error = true)
|
public function quit($close_on_error = true) {
|
||||||
{
|
|
||||||
$noerror = $this->sendCommand('QUIT', 'QUIT', 221);
|
$noerror = $this->sendCommand('QUIT', 'QUIT', 221);
|
||||||
$err = $this->error; //Save any error
|
$err = $this->error; //Save any error
|
||||||
if ($noerror or $close_on_error) {
|
if ($noerror or $close_on_error) {
|
||||||
|
@ -843,8 +830,7 @@ class SMTP
|
||||||
* @access public
|
* @access public
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function recipient($address)
|
public function recipient($address) {
|
||||||
{
|
|
||||||
return $this->sendCommand(
|
return $this->sendCommand(
|
||||||
'RCPT TO',
|
'RCPT TO',
|
||||||
'RCPT TO:<' . $address . '>',
|
'RCPT TO:<' . $address . '>',
|
||||||
|
@ -859,8 +845,7 @@ class SMTP
|
||||||
* @access public
|
* @access public
|
||||||
* @return boolean True on success.
|
* @return boolean True on success.
|
||||||
*/
|
*/
|
||||||
public function reset()
|
public function reset() {
|
||||||
{
|
|
||||||
return $this->sendCommand('RSET', 'RSET', 250);
|
return $this->sendCommand('RSET', 'RSET', 250);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -872,8 +857,7 @@ class SMTP
|
||||||
* @access protected
|
* @access protected
|
||||||
* @return boolean True on success.
|
* @return boolean True on success.
|
||||||
*/
|
*/
|
||||||
protected function sendCommand($command, $commandstring, $expect)
|
protected function sendCommand($command, $commandstring, $expect) {
|
||||||
{
|
|
||||||
if (!$this->connected()) {
|
if (!$this->connected()) {
|
||||||
$this->setError("Called $command without being connected");
|
$this->setError("Called $command without being connected");
|
||||||
return false;
|
return false;
|
||||||
|
@ -937,8 +921,7 @@ class SMTP
|
||||||
* @access public
|
* @access public
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function sendAndMail($from)
|
public function sendAndMail($from) {
|
||||||
{
|
|
||||||
return $this->sendCommand('SAML', "SAML FROM:$from", 250);
|
return $this->sendCommand('SAML', "SAML FROM:$from", 250);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -948,8 +931,7 @@ class SMTP
|
||||||
* @access public
|
* @access public
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function verify($name)
|
public function verify($name) {
|
||||||
{
|
|
||||||
return $this->sendCommand('VRFY', "VRFY $name", array(250, 251));
|
return $this->sendCommand('VRFY', "VRFY $name", array(250, 251));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -959,8 +941,7 @@ class SMTP
|
||||||
* @access public
|
* @access public
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function noop()
|
public function noop() {
|
||||||
{
|
|
||||||
return $this->sendCommand('NOOP', 'NOOP', 250);
|
return $this->sendCommand('NOOP', 'NOOP', 250);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -973,8 +954,7 @@ class SMTP
|
||||||
* @access public
|
* @access public
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function turn()
|
public function turn() {
|
||||||
{
|
|
||||||
$this->setError('The SMTP TURN command is not implemented');
|
$this->setError('The SMTP TURN command is not implemented');
|
||||||
$this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT);
|
$this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT);
|
||||||
return false;
|
return false;
|
||||||
|
@ -986,8 +966,7 @@ class SMTP
|
||||||
* @access public
|
* @access public
|
||||||
* @return integer|boolean The number of bytes sent to the server or false on error
|
* @return integer|boolean The number of bytes sent to the server or false on error
|
||||||
*/
|
*/
|
||||||
public function client_send($data)
|
public function client_send($data) {
|
||||||
{
|
|
||||||
$this->edebug("CLIENT -> SERVER: $data", self::DEBUG_CLIENT);
|
$this->edebug("CLIENT -> SERVER: $data", self::DEBUG_CLIENT);
|
||||||
return fwrite($this->smtp_conn, $data);
|
return fwrite($this->smtp_conn, $data);
|
||||||
}
|
}
|
||||||
|
@ -997,8 +976,7 @@ class SMTP
|
||||||
* @access public
|
* @access public
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getError()
|
public function getError() {
|
||||||
{
|
|
||||||
return $this->error;
|
return $this->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1007,8 +985,7 @@ class SMTP
|
||||||
* @access public
|
* @access public
|
||||||
* @return array|null
|
* @return array|null
|
||||||
*/
|
*/
|
||||||
public function getServerExtList()
|
public function getServerExtList() {
|
||||||
{
|
|
||||||
return $this->server_caps;
|
return $this->server_caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1031,8 +1008,7 @@ class SMTP
|
||||||
* @param string $name Name of SMTP extension or 'HELO'|'EHLO'
|
* @param string $name Name of SMTP extension or 'HELO'|'EHLO'
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function getServerExt($name)
|
public function getServerExt($name) {
|
||||||
{
|
|
||||||
if (!$this->server_caps) {
|
if (!$this->server_caps) {
|
||||||
$this->setError('No HELO/EHLO was sent');
|
$this->setError('No HELO/EHLO was sent');
|
||||||
return null;
|
return null;
|
||||||
|
@ -1058,8 +1034,7 @@ class SMTP
|
||||||
* @access public
|
* @access public
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getLastReply()
|
public function getLastReply() {
|
||||||
{
|
|
||||||
return $this->last_reply;
|
return $this->last_reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1072,8 +1047,7 @@ class SMTP
|
||||||
* @access protected
|
* @access protected
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function get_lines()
|
protected function get_lines() {
|
||||||
{
|
|
||||||
// If the connection is bad, give up straight away
|
// If the connection is bad, give up straight away
|
||||||
if (!is_resource($this->smtp_conn)) {
|
if (!is_resource($this->smtp_conn)) {
|
||||||
return '';
|
return '';
|
||||||
|
@ -1119,8 +1093,7 @@ class SMTP
|
||||||
* Enable or disable VERP address generation.
|
* Enable or disable VERP address generation.
|
||||||
* @param boolean $enabled
|
* @param boolean $enabled
|
||||||
*/
|
*/
|
||||||
public function setVerp($enabled = false)
|
public function setVerp($enabled = false) {
|
||||||
{
|
|
||||||
$this->do_verp = $enabled;
|
$this->do_verp = $enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1128,8 +1101,7 @@ class SMTP
|
||||||
* Get VERP address generation mode.
|
* Get VERP address generation mode.
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function getVerp()
|
public function getVerp() {
|
||||||
{
|
|
||||||
return $this->do_verp;
|
return $this->do_verp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1140,8 +1112,7 @@ class SMTP
|
||||||
* @param string $smtp_code An associated SMTP error code
|
* @param string $smtp_code An associated SMTP error code
|
||||||
* @param string $smtp_code_ex Extended SMTP code
|
* @param string $smtp_code_ex Extended SMTP code
|
||||||
*/
|
*/
|
||||||
protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '')
|
protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '') {
|
||||||
{
|
|
||||||
$this->error = array(
|
$this->error = array(
|
||||||
'error' => $message,
|
'error' => $message,
|
||||||
'detail' => $detail,
|
'detail' => $detail,
|
||||||
|
@ -1154,8 +1125,7 @@ class SMTP
|
||||||
* Set debug output method.
|
* Set debug output method.
|
||||||
* @param string|callable $method The name of the mechanism to use for debugging output, or a callable to handle it.
|
* @param string|callable $method The name of the mechanism to use for debugging output, or a callable to handle it.
|
||||||
*/
|
*/
|
||||||
public function setDebugOutput($method = 'echo')
|
public function setDebugOutput($method = 'echo') {
|
||||||
{
|
|
||||||
$this->Debugoutput = $method;
|
$this->Debugoutput = $method;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1163,8 +1133,7 @@ class SMTP
|
||||||
* Get debug output method.
|
* Get debug output method.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getDebugOutput()
|
public function getDebugOutput() {
|
||||||
{
|
|
||||||
return $this->Debugoutput;
|
return $this->Debugoutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1172,8 +1141,7 @@ class SMTP
|
||||||
* Set debug output level.
|
* Set debug output level.
|
||||||
* @param integer $level
|
* @param integer $level
|
||||||
*/
|
*/
|
||||||
public function setDebugLevel($level = 0)
|
public function setDebugLevel($level = 0) {
|
||||||
{
|
|
||||||
$this->do_debug = $level;
|
$this->do_debug = $level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1181,8 +1149,7 @@ class SMTP
|
||||||
* Get debug output level.
|
* Get debug output level.
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function getDebugLevel()
|
public function getDebugLevel() {
|
||||||
{
|
|
||||||
return $this->do_debug;
|
return $this->do_debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1190,8 +1157,7 @@ class SMTP
|
||||||
* Set SMTP timeout.
|
* Set SMTP timeout.
|
||||||
* @param integer $timeout
|
* @param integer $timeout
|
||||||
*/
|
*/
|
||||||
public function setTimeout($timeout = 0)
|
public function setTimeout($timeout = 0) {
|
||||||
{
|
|
||||||
$this->Timeout = $timeout;
|
$this->Timeout = $timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1199,8 +1165,7 @@ class SMTP
|
||||||
* Get SMTP timeout.
|
* Get SMTP timeout.
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function getTimeout()
|
public function getTimeout() {
|
||||||
{
|
|
||||||
return $this->Timeout;
|
return $this->Timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1209,8 +1174,7 @@ class SMTP
|
||||||
* @param integer $errno The error number returned by PHP.
|
* @param integer $errno The error number returned by PHP.
|
||||||
* @param string $errmsg The error message returned by PHP.
|
* @param string $errmsg The error message returned by PHP.
|
||||||
*/
|
*/
|
||||||
protected function errorHandler($errno, $errmsg)
|
protected function errorHandler($errno, $errmsg) {
|
||||||
{
|
|
||||||
$notice = 'Connection: Failed to connect to server.';
|
$notice = 'Connection: Failed to connect to server.';
|
||||||
$this->setError(
|
$this->setError(
|
||||||
$notice,
|
$notice,
|
||||||
|
@ -1230,8 +1194,7 @@ class SMTP
|
||||||
* If no pattern has been matched, it will return false.
|
* If no pattern has been matched, it will return false.
|
||||||
* @return bool|null|string
|
* @return bool|null|string
|
||||||
*/
|
*/
|
||||||
public function getLastTransactionID()
|
public function getLastTransactionID() {
|
||||||
{
|
|
||||||
$reply = $this->getLastReply();
|
$reply = $this->getLastReply();
|
||||||
|
|
||||||
if (empty($reply)) {
|
if (empty($reply)) {
|
||||||
|
|
|
@ -14,8 +14,7 @@
|
||||||
*/
|
*/
|
||||||
error_reporting(1);
|
error_reporting(1);
|
||||||
|
|
||||||
function default_mail($admin_mail, $admin_name, $sent_mail, $subject, $body)
|
function default_mail($admin_mail, $admin_name, $sent_mail, $subject, $body) {
|
||||||
{
|
|
||||||
// Functions
|
// Functions
|
||||||
require_once('class.phpmailer.php');
|
require_once('class.phpmailer.php');
|
||||||
|
|
||||||
|
@ -48,8 +47,7 @@ function default_mail($admin_mail, $admin_name, $sent_mail, $subject, $body)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function smtp_mail($smtp_host, $smtp_port = 587, $smtp_auth, $smtp_user, $smtp_pass, $smtp_sec = 'tls', $admin_mail, $admin_name, $sent_mail, $subject, $body)
|
function smtp_mail($smtp_host, $smtp_port = 587, $smtp_auth, $smtp_user, $smtp_pass, $smtp_sec = 'tls', $admin_mail, $admin_name, $sent_mail, $subject, $body) {
|
||||||
{
|
|
||||||
require_once('class.phpmailer.php');
|
require_once('class.phpmailer.php');
|
||||||
require_once('class.smtp.php');
|
require_once('class.smtp.php');
|
||||||
$mail = new PHPMailer;
|
$mail = new PHPMailer;
|
||||||
|
@ -78,4 +76,5 @@ function smtp_mail($smtp_host, $smtp_port = 587, $smtp_auth, $smtp_user, $smtp_p
|
||||||
}
|
}
|
||||||
return $msg;
|
return $msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -21,8 +21,7 @@ require_once "Google/Http/Request.php";
|
||||||
* @author Chris Chabot <chabotc@google.com>
|
* @author Chris Chabot <chabotc@google.com>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
abstract class Google_Auth_Abstract
|
abstract class Google_Auth_Abstract {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* An utility function that first calls $this->auth->sign($request) and then
|
* An utility function that first calls $this->auth->sign($request) and then
|
||||||
* executes makeRequest() on that signed request. Used for when a request
|
* executes makeRequest() on that signed request. Used for when a request
|
||||||
|
@ -31,5 +30,6 @@ abstract class Google_Auth_Abstract
|
||||||
* @return Google_Http_Request $request
|
* @return Google_Http_Request $request
|
||||||
*/
|
*/
|
||||||
abstract public function authenticatedRequest(Google_Http_Request $request);
|
abstract public function authenticatedRequest(Google_Http_Request $request);
|
||||||
|
|
||||||
abstract public function sign(Google_Http_Request $request);
|
abstract public function sign(Google_Http_Request $request);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
* which is 5.3 and above only, so if you include this in a PHP 5.2
|
* which is 5.3 and above only, so if you include this in a PHP 5.2
|
||||||
* setup or one without 5.3 things will blow up.
|
* setup or one without 5.3 things will blow up.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use google\appengine\api\app_identity\AppIdentityService;
|
use google\appengine\api\app_identity\AppIdentityService;
|
||||||
|
|
||||||
require_once "Google/Auth/Abstract.php";
|
require_once "Google/Auth/Abstract.php";
|
||||||
|
@ -28,8 +29,7 @@ require_once "Google/Http/Request.php";
|
||||||
/**
|
/**
|
||||||
* Authentication via the Google App Engine App Identity service.
|
* Authentication via the Google App Engine App Identity service.
|
||||||
*/
|
*/
|
||||||
class Google_Auth_AppIdentity extends Google_Auth_Abstract
|
class Google_Auth_AppIdentity extends Google_Auth_Abstract {
|
||||||
{
|
|
||||||
const CACHE_PREFIX = "Google_Auth_AppIdentity::";
|
const CACHE_PREFIX = "Google_Auth_AppIdentity::";
|
||||||
const CACHE_LIFETIME = 1500;
|
const CACHE_LIFETIME = 1500;
|
||||||
private $key = null;
|
private $key = null;
|
||||||
|
@ -37,16 +37,14 @@ class Google_Auth_AppIdentity extends Google_Auth_Abstract
|
||||||
private $token = false;
|
private $token = false;
|
||||||
private $tokenScopes = false;
|
private $tokenScopes = false;
|
||||||
|
|
||||||
public function __construct(Google_Client $client, $config = null)
|
public function __construct(Google_Client $client, $config = null) {
|
||||||
{
|
|
||||||
$this->client = $client;
|
$this->client = $client;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve an access token for the scopes supplied.
|
* Retrieve an access token for the scopes supplied.
|
||||||
*/
|
*/
|
||||||
public function authenticateForScope($scopes)
|
public function authenticateForScope($scopes) {
|
||||||
{
|
|
||||||
if ($this->token && $this->tokenScopes == $scopes) {
|
if ($this->token && $this->tokenScopes == $scopes) {
|
||||||
return $this->token;
|
return $this->token;
|
||||||
}
|
}
|
||||||
|
@ -78,14 +76,12 @@ class Google_Auth_AppIdentity extends Google_Auth_Abstract
|
||||||
* @return Google_Http_Request The resulting HTTP response including the
|
* @return Google_Http_Request The resulting HTTP response including the
|
||||||
* responseHttpCode, responseHeaders and responseBody.
|
* responseHttpCode, responseHeaders and responseBody.
|
||||||
*/
|
*/
|
||||||
public function authenticatedRequest(Google_Http_Request $request)
|
public function authenticatedRequest(Google_Http_Request $request) {
|
||||||
{
|
|
||||||
$request = $this->sign($request);
|
$request = $this->sign($request);
|
||||||
return $this->io->makeRequest($request);
|
return $this->io->makeRequest($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sign(Google_Http_Request $request)
|
public function sign(Google_Http_Request $request) {
|
||||||
{
|
|
||||||
if (!$this->token) {
|
if (!$this->token) {
|
||||||
// No token, so nothing to do.
|
// No token, so nothing to do.
|
||||||
return $request;
|
return $request;
|
||||||
|
|
|
@ -24,8 +24,7 @@ require_once "Google/Utils.php";
|
||||||
*
|
*
|
||||||
* @author Chirag Shah <chirags@google.com>
|
* @author Chirag Shah <chirags@google.com>
|
||||||
*/
|
*/
|
||||||
class Google_Auth_AssertionCredentials
|
class Google_Auth_AssertionCredentials {
|
||||||
{
|
|
||||||
const MAX_TOKEN_LIFETIME_SECS = 3600;
|
const MAX_TOKEN_LIFETIME_SECS = 3600;
|
||||||
|
|
||||||
public $serviceAccountName;
|
public $serviceAccountName;
|
||||||
|
@ -75,8 +74,7 @@ class Google_Auth_AssertionCredentials
|
||||||
* Generate a unique key to represent this credential.
|
* Generate a unique key to represent this credential.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getCacheKey()
|
public function getCacheKey() {
|
||||||
{
|
|
||||||
if (!$this->useCache) {
|
if (!$this->useCache) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -88,8 +86,7 @@ class Google_Auth_AssertionCredentials
|
||||||
return md5($h);
|
return md5($h);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateAssertion()
|
public function generateAssertion() {
|
||||||
{
|
|
||||||
$now = time();
|
$now = time();
|
||||||
|
|
||||||
$jwtParams = array(
|
$jwtParams = array(
|
||||||
|
@ -114,8 +111,7 @@ class Google_Auth_AssertionCredentials
|
||||||
* @param array $payload
|
* @param array $payload
|
||||||
* @return string The signed JWT.
|
* @return string The signed JWT.
|
||||||
*/
|
*/
|
||||||
private function makeSignedJwt($payload)
|
private function makeSignedJwt($payload) {
|
||||||
{
|
|
||||||
$header = array('typ' => 'JWT', 'alg' => 'RS256');
|
$header = array('typ' => 'JWT', 'alg' => 'RS256');
|
||||||
|
|
||||||
$payload = json_encode($payload);
|
$payload = json_encode($payload);
|
||||||
|
|
|
@ -17,6 +17,5 @@
|
||||||
|
|
||||||
require_once "Google/Exception.php";
|
require_once "Google/Exception.php";
|
||||||
|
|
||||||
class Google_Auth_Exception extends Google_Exception
|
class Google_Auth_Exception extends Google_Exception {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,7 @@ require_once "Google/Auth/Exception.php";
|
||||||
*
|
*
|
||||||
* @author Brian Eaton <beaton@google.com>
|
* @author Brian Eaton <beaton@google.com>
|
||||||
*/
|
*/
|
||||||
class Google_Auth_LoginTicket
|
class Google_Auth_LoginTicket {
|
||||||
{
|
|
||||||
const USER_ATTR = "sub";
|
const USER_ATTR = "sub";
|
||||||
|
|
||||||
// Information from id token envelope.
|
// Information from id token envelope.
|
||||||
|
@ -38,19 +37,17 @@ class Google_Auth_LoginTicket
|
||||||
* @param string $envelope Header from a verified authentication token.
|
* @param string $envelope Header from a verified authentication token.
|
||||||
* @param string $payload Information from a verified authentication token.
|
* @param string $payload Information from a verified authentication token.
|
||||||
*/
|
*/
|
||||||
public function __construct($envelope, $payload)
|
public function __construct($envelope, $payload) {
|
||||||
{
|
|
||||||
$this->envelope = $envelope;
|
$this->envelope = $envelope;
|
||||||
$this->payload = $payload;
|
$this->payload = $payload;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the numeric identifier for the user.
|
* Returns the numeric identifier for the user.
|
||||||
* @throws Google_Auth_Exception
|
|
||||||
* @return
|
* @return
|
||||||
|
* @throws Google_Auth_Exception
|
||||||
*/
|
*/
|
||||||
public function getUserId()
|
public function getUserId() {
|
||||||
{
|
|
||||||
if (array_key_exists(self::USER_ATTR, $this->payload)) {
|
if (array_key_exists(self::USER_ATTR, $this->payload)) {
|
||||||
return $this->payload[self::USER_ATTR];
|
return $this->payload[self::USER_ATTR];
|
||||||
}
|
}
|
||||||
|
@ -62,8 +59,7 @@ class Google_Auth_LoginTicket
|
||||||
* various information about the user session.
|
* various information about the user session.
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getAttributes()
|
public function getAttributes() {
|
||||||
{
|
|
||||||
return array("envelope" => $this->envelope, "payload" => $this->payload);
|
return array("envelope" => $this->envelope, "payload" => $this->payload);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,8 +31,7 @@ require_once "Google/Verifier/Pem.php";
|
||||||
* @author Chirag Shah <chirags@google.com>
|
* @author Chirag Shah <chirags@google.com>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
class Google_Auth_OAuth2 extends Google_Auth_Abstract {
|
||||||
{
|
|
||||||
const OAUTH2_REVOKE_URI = 'https://accounts.google.com/o/oauth2/revoke';
|
const OAUTH2_REVOKE_URI = 'https://accounts.google.com/o/oauth2/revoke';
|
||||||
const OAUTH2_TOKEN_URI = 'https://accounts.google.com/o/oauth2/token';
|
const OAUTH2_TOKEN_URI = 'https://accounts.google.com/o/oauth2/token';
|
||||||
const OAUTH2_AUTH_URL = 'https://accounts.google.com/o/oauth2/auth';
|
const OAUTH2_AUTH_URL = 'https://accounts.google.com/o/oauth2/auth';
|
||||||
|
@ -63,8 +62,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
||||||
* Instantiates the class, but does not initiate the login flow, leaving it
|
* Instantiates the class, but does not initiate the login flow, leaving it
|
||||||
* to the discretion of the caller.
|
* to the discretion of the caller.
|
||||||
*/
|
*/
|
||||||
public function __construct(Google_Client $client)
|
public function __construct(Google_Client $client) {
|
||||||
{
|
|
||||||
$this->client = $client;
|
$this->client = $client;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,19 +76,17 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
||||||
* @return Google_Http_Request The resulting HTTP response including the
|
* @return Google_Http_Request The resulting HTTP response including the
|
||||||
* responseHttpCode, responseHeaders and responseBody.
|
* responseHttpCode, responseHeaders and responseBody.
|
||||||
*/
|
*/
|
||||||
public function authenticatedRequest(Google_Http_Request $request)
|
public function authenticatedRequest(Google_Http_Request $request) {
|
||||||
{
|
|
||||||
$request = $this->sign($request);
|
$request = $this->sign($request);
|
||||||
return $this->client->getIo()->makeRequest($request);
|
return $this->client->getIo()->makeRequest($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $code
|
* @param string $code
|
||||||
* @throws Google_Auth_Exception
|
|
||||||
* @return string
|
* @return string
|
||||||
|
* @throws Google_Auth_Exception
|
||||||
*/
|
*/
|
||||||
public function authenticate($code)
|
public function authenticate($code) {
|
||||||
{
|
|
||||||
if (strlen($code) == 0) {
|
if (strlen($code) == 0) {
|
||||||
throw new Google_Auth_Exception("Invalid code");
|
throw new Google_Auth_Exception("Invalid code");
|
||||||
}
|
}
|
||||||
|
@ -138,8 +134,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
||||||
* @param string $scope The scope is expressed as a list of space-delimited strings.
|
* @param string $scope The scope is expressed as a list of space-delimited strings.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function createAuthUrl($scope)
|
public function createAuthUrl($scope) {
|
||||||
{
|
|
||||||
$params = array(
|
$params = array(
|
||||||
'response_type' => 'code',
|
'response_type' => 'code',
|
||||||
'redirect_uri' => $this->client->getClassConfig($this, 'redirect_uri'),
|
'redirect_uri' => $this->client->getClassConfig($this, 'redirect_uri'),
|
||||||
|
@ -172,8 +167,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
||||||
* @param string $token
|
* @param string $token
|
||||||
* @throws Google_Auth_Exception
|
* @throws Google_Auth_Exception
|
||||||
*/
|
*/
|
||||||
public function setAccessToken($token)
|
public function setAccessToken($token) {
|
||||||
{
|
|
||||||
$token = json_decode($token, true);
|
$token = json_decode($token, true);
|
||||||
if ($token == null) {
|
if ($token == null) {
|
||||||
throw new Google_Auth_Exception('Could not json decode the token');
|
throw new Google_Auth_Exception('Could not json decode the token');
|
||||||
|
@ -184,18 +178,15 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
||||||
$this->token = $token;
|
$this->token = $token;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAccessToken()
|
public function getAccessToken() {
|
||||||
{
|
|
||||||
return json_encode($this->token);
|
return json_encode($this->token);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setState($state)
|
public function setState($state) {
|
||||||
{
|
|
||||||
$this->state = $state;
|
$this->state = $state;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setAssertionCredentials(Google_Auth_AssertionCredentials $creds)
|
public function setAssertionCredentials(Google_Auth_AssertionCredentials $creds) {
|
||||||
{
|
|
||||||
$this->assertionCredentials = $creds;
|
$this->assertionCredentials = $creds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,8 +196,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
||||||
* @return Google_Http_Request
|
* @return Google_Http_Request
|
||||||
* @throws Google_Auth_Exception
|
* @throws Google_Auth_Exception
|
||||||
*/
|
*/
|
||||||
public function sign(Google_Http_Request $request)
|
public function sign(Google_Http_Request $request) {
|
||||||
{
|
|
||||||
// add the developer key to the request before signing it
|
// add the developer key to the request before signing it
|
||||||
if ($this->client->getClassConfig($this, 'developer_key')) {
|
if ($this->client->getClassConfig($this, 'developer_key')) {
|
||||||
$request->setQueryParam('key', $this->client->getClassConfig($this, 'developer_key'));
|
$request->setQueryParam('key', $this->client->getClassConfig($this, 'developer_key'));
|
||||||
|
@ -247,8 +237,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
||||||
* @param string $refreshToken
|
* @param string $refreshToken
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function refreshToken($refreshToken)
|
public function refreshToken($refreshToken) {
|
||||||
{
|
|
||||||
$this->refreshTokenRequest(
|
$this->refreshTokenRequest(
|
||||||
array(
|
array(
|
||||||
'client_id' => $this->client->getClassConfig($this, 'client_id'),
|
'client_id' => $this->client->getClassConfig($this, 'client_id'),
|
||||||
|
@ -264,8 +253,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
||||||
* @param Google_Auth_AssertionCredentials $assertionCredentials optional.
|
* @param Google_Auth_AssertionCredentials $assertionCredentials optional.
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function refreshTokenWithAssertion($assertionCredentials = null)
|
public function refreshTokenWithAssertion($assertionCredentials = null) {
|
||||||
{
|
|
||||||
if (!$assertionCredentials) {
|
if (!$assertionCredentials) {
|
||||||
$assertionCredentials = $this->assertionCredentials;
|
$assertionCredentials = $this->assertionCredentials;
|
||||||
}
|
}
|
||||||
|
@ -302,8 +290,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function refreshTokenRequest($params)
|
private function refreshTokenRequest($params) {
|
||||||
{
|
|
||||||
$http = new Google_Http_Request(
|
$http = new Google_Http_Request(
|
||||||
self::OAUTH2_TOKEN_URI,
|
self::OAUTH2_TOKEN_URI,
|
||||||
'POST',
|
'POST',
|
||||||
|
@ -339,12 +326,11 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
||||||
/**
|
/**
|
||||||
* Revoke an OAuth2 access token or refresh token. This method will revoke the current access
|
* Revoke an OAuth2 access token or refresh token. This method will revoke the current access
|
||||||
* token, if a token isn't provided.
|
* token, if a token isn't provided.
|
||||||
* @throws Google_Auth_Exception
|
|
||||||
* @param string|null $token The token (access token or a refresh token) that should be revoked.
|
* @param string|null $token The token (access token or a refresh token) that should be revoked.
|
||||||
* @return boolean Returns True if the revocation was successful, otherwise False.
|
* @return boolean Returns True if the revocation was successful, otherwise False.
|
||||||
|
* @throws Google_Auth_Exception
|
||||||
*/
|
*/
|
||||||
public function revokeToken($token = null)
|
public function revokeToken($token = null) {
|
||||||
{
|
|
||||||
if (!$token) {
|
if (!$token) {
|
||||||
if (!$this->token) {
|
if (!$this->token) {
|
||||||
// Not initialized, no token to actually revoke
|
// Not initialized, no token to actually revoke
|
||||||
|
@ -376,8 +362,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
||||||
* Returns if the access_token is expired.
|
* Returns if the access_token is expired.
|
||||||
* @return bool Returns True if the access_token is expired.
|
* @return bool Returns True if the access_token is expired.
|
||||||
*/
|
*/
|
||||||
public function isAccessTokenExpired()
|
public function isAccessTokenExpired() {
|
||||||
{
|
|
||||||
if (!$this->token || !isset($this->token['created'])) {
|
if (!$this->token || !isset($this->token['created'])) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -392,8 +377,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
||||||
// Gets federated sign-on certificates to use for verifying identity tokens.
|
// Gets federated sign-on certificates to use for verifying identity tokens.
|
||||||
// Returns certs as array structure, where keys are key ids, and values
|
// Returns certs as array structure, where keys are key ids, and values
|
||||||
// are PEM encoded certificates.
|
// are PEM encoded certificates.
|
||||||
private function getFederatedSignOnCerts()
|
private function getFederatedSignOnCerts() {
|
||||||
{
|
|
||||||
return $this->retrieveCertsFromLocation(
|
return $this->retrieveCertsFromLocation(
|
||||||
$this->client->getClassConfig($this, 'federated_signon_certs_url')
|
$this->client->getClassConfig($this, 'federated_signon_certs_url')
|
||||||
);
|
);
|
||||||
|
@ -404,8 +388,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
||||||
* @param $url location
|
* @param $url location
|
||||||
* @return array certificates
|
* @return array certificates
|
||||||
*/
|
*/
|
||||||
public function retrieveCertsFromLocation($url)
|
public function retrieveCertsFromLocation($url) {
|
||||||
{
|
|
||||||
// If we're retrieving a local file, just grab it.
|
// If we're retrieving a local file, just grab it.
|
||||||
if ("http" != substr($url, 0, 4)) {
|
if ("http" != substr($url, 0, 4)) {
|
||||||
$file = file_get_contents($url);
|
$file = file_get_contents($url);
|
||||||
|
@ -448,8 +431,7 @@ class Google_Auth_OAuth2 extends Google_Auth_Abstract
|
||||||
* @param $audience
|
* @param $audience
|
||||||
* @return Google_Auth_LoginTicket
|
* @return Google_Auth_LoginTicket
|
||||||
*/
|
*/
|
||||||
public function verifyIdToken($id_token = null, $audience = null)
|
public function verifyIdToken($id_token = null, $audience = null) {
|
||||||
{
|
|
||||||
if (!$id_token) {
|
if (!$id_token) {
|
||||||
$id_token = $this->token['id_token'];
|
$id_token = $this->token['id_token'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,13 +25,11 @@ require_once "Google/Http/Request.php";
|
||||||
* @author Chris Chabot <chabotc@google.com>
|
* @author Chris Chabot <chabotc@google.com>
|
||||||
* @author Chirag Shah <chirags@google.com>
|
* @author Chirag Shah <chirags@google.com>
|
||||||
*/
|
*/
|
||||||
class Google_Auth_Simple extends Google_Auth_Abstract
|
class Google_Auth_Simple extends Google_Auth_Abstract {
|
||||||
{
|
|
||||||
private $key = null;
|
private $key = null;
|
||||||
private $client;
|
private $client;
|
||||||
|
|
||||||
public function __construct(Google_Client $client, $config = null)
|
public function __construct(Google_Client $client, $config = null) {
|
||||||
{
|
|
||||||
$this->client = $client;
|
$this->client = $client;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,14 +43,12 @@ class Google_Auth_Simple extends Google_Auth_Abstract
|
||||||
* @return Google_Http_Request The resulting HTTP response including the
|
* @return Google_Http_Request The resulting HTTP response including the
|
||||||
* responseHttpCode, responseHeaders and responseBody.
|
* responseHttpCode, responseHeaders and responseBody.
|
||||||
*/
|
*/
|
||||||
public function authenticatedRequest(Google_Http_Request $request)
|
public function authenticatedRequest(Google_Http_Request $request) {
|
||||||
{
|
|
||||||
$request = $this->sign($request);
|
$request = $this->sign($request);
|
||||||
return $this->io->makeRequest($request);
|
return $this->io->makeRequest($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sign(Google_Http_Request $request)
|
public function sign(Google_Http_Request $request) {
|
||||||
{
|
|
||||||
$key = $this->client->getClassConfig($this, 'developer_key');
|
$key = $this->client->getClassConfig($this, 'developer_key');
|
||||||
if ($key) {
|
if ($key) {
|
||||||
$request->setQueryParam('key', $key);
|
$request->setQueryParam('key', $key);
|
||||||
|
|
|
@ -20,8 +20,7 @@
|
||||||
*
|
*
|
||||||
* @author Chris Chabot <chabotc@google.com>
|
* @author Chris Chabot <chabotc@google.com>
|
||||||
*/
|
*/
|
||||||
abstract class Google_Cache_Abstract
|
abstract class Google_Cache_Abstract {
|
||||||
{
|
|
||||||
|
|
||||||
abstract public function __construct(Google_Client $client);
|
abstract public function __construct(Google_Client $client);
|
||||||
|
|
||||||
|
|
|
@ -26,10 +26,8 @@ require_once "Google/Cache/Exception.php";
|
||||||
*
|
*
|
||||||
* @author Chris Chabot <chabotc@google.com>
|
* @author Chris Chabot <chabotc@google.com>
|
||||||
*/
|
*/
|
||||||
class Google_Cache_Apc extends Google_Cache_Abstract
|
class Google_Cache_Apc extends Google_Cache_Abstract {
|
||||||
{
|
public function __construct(Google_Client $client) {
|
||||||
public function __construct(Google_Client $client)
|
|
||||||
{
|
|
||||||
if (!function_exists('apc_add')) {
|
if (!function_exists('apc_add')) {
|
||||||
throw new Google_Cache_Exception("Apc functions not available");
|
throw new Google_Cache_Exception("Apc functions not available");
|
||||||
}
|
}
|
||||||
|
@ -38,8 +36,7 @@ class Google_Cache_Apc extends Google_Cache_Abstract
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
public function get($key, $expiration = false)
|
public function get($key, $expiration = false) {
|
||||||
{
|
|
||||||
$ret = apc_fetch($key);
|
$ret = apc_fetch($key);
|
||||||
if ($ret === false) {
|
if ($ret === false) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -54,8 +51,7 @@ class Google_Cache_Apc extends Google_Cache_Abstract
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
public function set($key, $value)
|
public function set($key, $value) {
|
||||||
{
|
|
||||||
$rc = apc_store($key, array('time' => time(), 'data' => $value));
|
$rc = apc_store($key, array('time' => time(), 'data' => $value));
|
||||||
if ($rc == false) {
|
if ($rc == false) {
|
||||||
throw new Google_Cache_Exception("Couldn't store data");
|
throw new Google_Cache_Exception("Couldn't store data");
|
||||||
|
@ -66,8 +62,7 @@ class Google_Cache_Apc extends Google_Cache_Abstract
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @param String $key
|
* @param String $key
|
||||||
*/
|
*/
|
||||||
public function delete($key)
|
public function delete($key) {
|
||||||
{
|
|
||||||
apc_delete($key);
|
apc_delete($key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,5 @@
|
||||||
*/
|
*/
|
||||||
require_once "Google/Exception.php";
|
require_once "Google/Exception.php";
|
||||||
|
|
||||||
class Google_Cache_Exception extends Google_Exception
|
class Google_Cache_Exception extends Google_Exception {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,19 +26,17 @@ require_once "Google/Cache/Exception.php";
|
||||||
*
|
*
|
||||||
* @author Chris Chabot <chabotc@google.com>
|
* @author Chris Chabot <chabotc@google.com>
|
||||||
*/
|
*/
|
||||||
class Google_Cache_File extends Google_Cache_Abstract
|
|
||||||
{
|
class Google_Cache_File extends Google_Cache_Abstract {
|
||||||
const MAX_LOCK_RETRIES = 10;
|
const MAX_LOCK_RETRIES = 10;
|
||||||
private $path;
|
private $path;
|
||||||
private $fh;
|
private $fh;
|
||||||
|
|
||||||
public function __construct(Google_Client $client)
|
public function __construct(Google_Client $client) {
|
||||||
{
|
|
||||||
$this->path = $client->getClassConfig($this, 'directory');
|
$this->path = $client->getClassConfig($this, 'directory');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get($key, $expiration = false)
|
public function get($key, $expiration = false) {
|
||||||
{
|
|
||||||
$storageFile = $this->getCacheFile($key);
|
$storageFile = $this->getCacheFile($key);
|
||||||
$data = false;
|
$data = false;
|
||||||
|
|
||||||
|
@ -63,8 +61,7 @@ class Google_Cache_File extends Google_Cache_Abstract
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function set($key, $value)
|
public function set($key, $value) {
|
||||||
{
|
|
||||||
$storageFile = $this->getWriteableCacheFile($key);
|
$storageFile = $this->getWriteableCacheFile($key);
|
||||||
if ($this->acquireWriteLock($storageFile)) {
|
if ($this->acquireWriteLock($storageFile)) {
|
||||||
// We serialize the whole request object, since we don't only want the
|
// We serialize the whole request object, since we don't only want the
|
||||||
|
@ -75,26 +72,22 @@ class Google_Cache_File extends Google_Cache_Abstract
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete($key)
|
public function delete($key) {
|
||||||
{
|
|
||||||
$file = $this->getCacheFile($key);
|
$file = $this->getCacheFile($key);
|
||||||
if (file_exists($file) && !unlink($file)) {
|
if (file_exists($file) && !unlink($file)) {
|
||||||
throw new Google_Cache_Exception("Cache file could not be deleted");
|
throw new Google_Cache_Exception("Cache file could not be deleted");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getWriteableCacheFile($file)
|
private function getWriteableCacheFile($file) {
|
||||||
{
|
|
||||||
return $this->getCacheFile($file, true);
|
return $this->getCacheFile($file, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getCacheFile($file, $forWrite = false)
|
private function getCacheFile($file, $forWrite = false) {
|
||||||
{
|
|
||||||
return $this->getCacheDir($file, $forWrite) . '/' . md5($file);
|
return $this->getCacheDir($file, $forWrite) . '/' . md5($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getCacheDir($file, $forWrite)
|
private function getCacheDir($file, $forWrite) {
|
||||||
{
|
|
||||||
// use the first 2 characters of the hash as a directory prefix
|
// use the first 2 characters of the hash as a directory prefix
|
||||||
// this should prevent slowdowns due to huge directory listings
|
// this should prevent slowdowns due to huge directory listings
|
||||||
// and thus give some basic amount of scalability
|
// and thus give some basic amount of scalability
|
||||||
|
@ -107,13 +100,11 @@ class Google_Cache_File extends Google_Cache_Abstract
|
||||||
return $storageDir;
|
return $storageDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function acquireReadLock($storageFile)
|
private function acquireReadLock($storageFile) {
|
||||||
{
|
|
||||||
return $this->acquireLock(LOCK_SH, $storageFile);
|
return $this->acquireLock(LOCK_SH, $storageFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function acquireWriteLock($storageFile)
|
private function acquireWriteLock($storageFile) {
|
||||||
{
|
|
||||||
$rc = $this->acquireLock(LOCK_EX, $storageFile);
|
$rc = $this->acquireLock(LOCK_EX, $storageFile);
|
||||||
if (!$rc) {
|
if (!$rc) {
|
||||||
$this->delete($storageFile);
|
$this->delete($storageFile);
|
||||||
|
@ -121,8 +112,7 @@ class Google_Cache_File extends Google_Cache_Abstract
|
||||||
return $rc;
|
return $rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function acquireLock($type, $storageFile)
|
private function acquireLock($type, $storageFile) {
|
||||||
{
|
|
||||||
$mode = $type == LOCK_EX ? "w" : "r";
|
$mode = $type == LOCK_EX ? "w" : "r";
|
||||||
$this->fh = fopen($storageFile, $mode);
|
$this->fh = fopen($storageFile, $mode);
|
||||||
$count = 0;
|
$count = 0;
|
||||||
|
@ -136,8 +126,7 @@ class Google_Cache_File extends Google_Cache_Abstract
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function unlock($storageFile)
|
public function unlock($storageFile) {
|
||||||
{
|
|
||||||
if ($this->fh) {
|
if ($this->fh) {
|
||||||
flock($this->fh, LOCK_UN);
|
flock($this->fh, LOCK_UN);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,15 +28,13 @@ require_once "Google/Cache/Exception.php";
|
||||||
*
|
*
|
||||||
* @author Chris Chabot <chabotc@google.com>
|
* @author Chris Chabot <chabotc@google.com>
|
||||||
*/
|
*/
|
||||||
class Google_Cache_Memcache extends Google_Cache_Abstract
|
class Google_Cache_Memcache extends Google_Cache_Abstract {
|
||||||
{
|
|
||||||
private $connection = false;
|
private $connection = false;
|
||||||
private $mc = false;
|
private $mc = false;
|
||||||
private $host;
|
private $host;
|
||||||
private $port;
|
private $port;
|
||||||
|
|
||||||
public function __construct(Google_Client $client)
|
public function __construct(Google_Client $client) {
|
||||||
{
|
|
||||||
if (!function_exists('memcache_connect') && !class_exists("Memcached")) {
|
if (!function_exists('memcache_connect') && !class_exists("Memcached")) {
|
||||||
throw new Google_Cache_Exception("Memcache functions not available");
|
throw new Google_Cache_Exception("Memcache functions not available");
|
||||||
}
|
}
|
||||||
|
@ -56,8 +54,7 @@ class Google_Cache_Memcache extends Google_Cache_Abstract
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
public function get($key, $expiration = false)
|
public function get($key, $expiration = false) {
|
||||||
{
|
|
||||||
$this->connect();
|
$this->connect();
|
||||||
$ret = false;
|
$ret = false;
|
||||||
if ($this->mc) {
|
if ($this->mc) {
|
||||||
|
@ -81,8 +78,7 @@ class Google_Cache_Memcache extends Google_Cache_Abstract
|
||||||
* @param string $value
|
* @param string $value
|
||||||
* @throws Google_Cache_Exception
|
* @throws Google_Cache_Exception
|
||||||
*/
|
*/
|
||||||
public function set($key, $value)
|
public function set($key, $value) {
|
||||||
{
|
|
||||||
$this->connect();
|
$this->connect();
|
||||||
// we store it with the cache_time default expiration so objects will at
|
// we store it with the cache_time default expiration so objects will at
|
||||||
// least get cleaned eventually.
|
// least get cleaned eventually.
|
||||||
|
@ -102,8 +98,7 @@ class Google_Cache_Memcache extends Google_Cache_Abstract
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @param String $key
|
* @param String $key
|
||||||
*/
|
*/
|
||||||
public function delete($key)
|
public function delete($key) {
|
||||||
{
|
|
||||||
$this->connect();
|
$this->connect();
|
||||||
if ($this->mc) {
|
if ($this->mc) {
|
||||||
$this->mc->delete($key, 0);
|
$this->mc->delete($key, 0);
|
||||||
|
@ -116,8 +111,7 @@ class Google_Cache_Memcache extends Google_Cache_Abstract
|
||||||
* Lazy initialiser for memcache connection. Uses pconnect for to take
|
* Lazy initialiser for memcache connection. Uses pconnect for to take
|
||||||
* advantage of the persistence pool where possible.
|
* advantage of the persistence pool where possible.
|
||||||
*/
|
*/
|
||||||
private function connect()
|
private function connect() {
|
||||||
{
|
|
||||||
if ($this->connection) {
|
if ($this->connection) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,26 +22,22 @@ require_once "Google/Cache/Exception.php";
|
||||||
* A blank storage class, for cases where caching is not
|
* A blank storage class, for cases where caching is not
|
||||||
* required.
|
* required.
|
||||||
*/
|
*/
|
||||||
class Google_Cache_Null extends Google_Cache_Abstract
|
class Google_Cache_Null extends Google_Cache_Abstract {
|
||||||
{
|
public function __construct(Google_Client $client) {
|
||||||
public function __construct(Google_Client $client)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
public function get($key, $expiration = false)
|
public function get($key, $expiration = false) {
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
public function set($key, $value)
|
public function set($key, $value) {
|
||||||
{
|
|
||||||
// Nop.
|
// Nop.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,8 +45,7 @@ class Google_Cache_Null extends Google_Cache_Abstract
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @param String $key
|
* @param String $key
|
||||||
*/
|
*/
|
||||||
public function delete($key)
|
public function delete($key) {
|
||||||
{
|
|
||||||
// Nop.
|
// Nop.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,7 @@ require_once 'Google/Service/Resource.php';
|
||||||
* @author Chris Chabot <chabotc@google.com>
|
* @author Chris Chabot <chabotc@google.com>
|
||||||
* @author Chirag Shah <chirags@google.com>
|
* @author Chirag Shah <chirags@google.com>
|
||||||
*/
|
*/
|
||||||
class Google_Client
|
class Google_Client {
|
||||||
{
|
|
||||||
const LIBVER = "1.0.5-beta";
|
const LIBVER = "1.0.5-beta";
|
||||||
const USER_AGENT_SUFFIX = "google-api-php-client/";
|
const USER_AGENT_SUFFIX = "google-api-php-client/";
|
||||||
/**
|
/**
|
||||||
|
@ -78,8 +77,7 @@ class Google_Client
|
||||||
*
|
*
|
||||||
* @param $config Google_Config or string for the ini file to load
|
* @param $config Google_Config or string for the ini file to load
|
||||||
*/
|
*/
|
||||||
public function __construct($config = null)
|
public function __construct($config = null) {
|
||||||
{
|
|
||||||
if (is_string($config) && strlen($config)) {
|
if (is_string($config) && strlen($config)) {
|
||||||
$config = new Google_Config($config);
|
$config = new Google_Config($config);
|
||||||
} elseif (!($config instanceof Google_Config)) {
|
} elseif (!($config instanceof Google_Config)) {
|
||||||
|
@ -112,8 +110,7 @@ class Google_Client
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getLibraryVersion()
|
public function getLibraryVersion() {
|
||||||
{
|
|
||||||
return self::LIBVER;
|
return self::LIBVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,8 +121,7 @@ class Google_Client
|
||||||
* @param $code string code from accounts.google.com
|
* @param $code string code from accounts.google.com
|
||||||
* @return string token
|
* @return string token
|
||||||
*/
|
*/
|
||||||
public function authenticate($code)
|
public function authenticate($code) {
|
||||||
{
|
|
||||||
$this->authenticated = true;
|
$this->authenticated = true;
|
||||||
return $this->getAuth()->authenticate($code);
|
return $this->getAuth()->authenticate($code);
|
||||||
}
|
}
|
||||||
|
@ -137,8 +133,7 @@ class Google_Client
|
||||||
* Console.
|
* Console.
|
||||||
* @param string $json the configuration json
|
* @param string $json the configuration json
|
||||||
*/
|
*/
|
||||||
public function setAuthConfig($json)
|
public function setAuthConfig($json) {
|
||||||
{
|
|
||||||
$data = json_decode($json);
|
$data = json_decode($json);
|
||||||
$key = isset($data->installed) ? 'installed' : 'web';
|
$key = isset($data->installed) ? 'installed' : 'web';
|
||||||
if (!isset($data->$key)) {
|
if (!isset($data->$key)) {
|
||||||
|
@ -158,8 +153,7 @@ class Google_Client
|
||||||
* Console.
|
* Console.
|
||||||
* @param string $file the file location of the client json
|
* @param string $file the file location of the client json
|
||||||
*/
|
*/
|
||||||
public function setAuthConfigFile($file)
|
public function setAuthConfigFile($file) {
|
||||||
{
|
|
||||||
$this->setAuthConfig(file_get_contents($file));
|
$this->setAuthConfig(file_get_contents($file));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,8 +161,7 @@ class Google_Client
|
||||||
* @return array
|
* @return array
|
||||||
* @visible For Testing
|
* @visible For Testing
|
||||||
*/
|
*/
|
||||||
public function prepareScopes()
|
public function prepareScopes() {
|
||||||
{
|
|
||||||
if (empty($this->requestedScopes)) {
|
if (empty($this->requestedScopes)) {
|
||||||
throw new Google_Auth_Exception("No scopes specified");
|
throw new Google_Auth_Exception("No scopes specified");
|
||||||
}
|
}
|
||||||
|
@ -183,8 +176,7 @@ class Google_Client
|
||||||
* {"access_token":"TOKEN", "refresh_token":"TOKEN", "token_type":"Bearer",
|
* {"access_token":"TOKEN", "refresh_token":"TOKEN", "token_type":"Bearer",
|
||||||
* "expires_in":3600, "id_token":"TOKEN", "created":1320790426}
|
* "expires_in":3600, "id_token":"TOKEN", "created":1320790426}
|
||||||
*/
|
*/
|
||||||
public function setAccessToken($accessToken)
|
public function setAccessToken($accessToken) {
|
||||||
{
|
|
||||||
if ($accessToken == 'null') {
|
if ($accessToken == 'null') {
|
||||||
$accessToken = null;
|
$accessToken = null;
|
||||||
}
|
}
|
||||||
|
@ -192,13 +184,11 @@ class Google_Client
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the authenticator object
|
* Set the authenticator object
|
||||||
* @param Google_Auth_Abstract $auth
|
* @param Google_Auth_Abstract $auth
|
||||||
*/
|
*/
|
||||||
public function setAuth(Google_Auth_Abstract $auth)
|
public function setAuth(Google_Auth_Abstract $auth) {
|
||||||
{
|
|
||||||
$this->config->setAuthClass(get_class($auth));
|
$this->config->setAuthClass(get_class($auth));
|
||||||
$this->auth = $auth;
|
$this->auth = $auth;
|
||||||
}
|
}
|
||||||
|
@ -207,8 +197,7 @@ class Google_Client
|
||||||
* Set the IO object
|
* Set the IO object
|
||||||
* @param Google_Io_Abstract $auth
|
* @param Google_Io_Abstract $auth
|
||||||
*/
|
*/
|
||||||
public function setIo(Google_Io_Abstract $io)
|
public function setIo(Google_Io_Abstract $io) {
|
||||||
{
|
|
||||||
$this->config->setIoClass(get_class($io));
|
$this->config->setIoClass(get_class($io));
|
||||||
$this->io = $io;
|
$this->io = $io;
|
||||||
}
|
}
|
||||||
|
@ -217,8 +206,7 @@ class Google_Client
|
||||||
* Set the Cache object
|
* Set the Cache object
|
||||||
* @param Google_Cache_Abstract $auth
|
* @param Google_Cache_Abstract $auth
|
||||||
*/
|
*/
|
||||||
public function setCache(Google_Cache_Abstract $cache)
|
public function setCache(Google_Cache_Abstract $cache) {
|
||||||
{
|
|
||||||
$this->config->setCacheClass(get_class($cache));
|
$this->config->setCacheClass(get_class($cache));
|
||||||
$this->cache = $cache;
|
$this->cache = $cache;
|
||||||
}
|
}
|
||||||
|
@ -227,8 +215,7 @@ class Google_Client
|
||||||
* Construct the OAuth 2.0 authorization request URI.
|
* Construct the OAuth 2.0 authorization request URI.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function createAuthUrl()
|
public function createAuthUrl() {
|
||||||
{
|
|
||||||
$scopes = $this->prepareScopes();
|
$scopes = $this->prepareScopes();
|
||||||
return $this->getAuth()->createAuthUrl($scopes);
|
return $this->getAuth()->createAuthUrl($scopes);
|
||||||
}
|
}
|
||||||
|
@ -239,8 +226,7 @@ class Google_Client
|
||||||
* {"access_token":"TOKEN", "refresh_token":"TOKEN", "token_type":"Bearer",
|
* {"access_token":"TOKEN", "refresh_token":"TOKEN", "token_type":"Bearer",
|
||||||
* "expires_in":3600,"id_token":"TOKEN", "created":1320790426}
|
* "expires_in":3600,"id_token":"TOKEN", "created":1320790426}
|
||||||
*/
|
*/
|
||||||
public function getAccessToken()
|
public function getAccessToken() {
|
||||||
{
|
|
||||||
$token = $this->getAuth()->getAccessToken();
|
$token = $this->getAuth()->getAccessToken();
|
||||||
// The response is json encoded, so could be the string null.
|
// The response is json encoded, so could be the string null.
|
||||||
// It is arguable whether this check should be here or lower
|
// It is arguable whether this check should be here or lower
|
||||||
|
@ -252,8 +238,7 @@ class Google_Client
|
||||||
* Returns if the access_token is expired.
|
* Returns if the access_token is expired.
|
||||||
* @return bool Returns True if the access_token is expired.
|
* @return bool Returns True if the access_token is expired.
|
||||||
*/
|
*/
|
||||||
public function isAccessTokenExpired()
|
public function isAccessTokenExpired() {
|
||||||
{
|
|
||||||
return $this->getAuth()->isAccessTokenExpired();
|
return $this->getAuth()->isAccessTokenExpired();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,8 +247,7 @@ class Google_Client
|
||||||
* @see http://tools.ietf.org/html/draft-ietf-oauth-v2-22#section-3.1.2.2
|
* @see http://tools.ietf.org/html/draft-ietf-oauth-v2-22#section-3.1.2.2
|
||||||
* @param string $state
|
* @param string $state
|
||||||
*/
|
*/
|
||||||
public function setState($state)
|
public function setState($state) {
|
||||||
{
|
|
||||||
$this->getAuth()->setState($state);
|
$this->getAuth()->setState($state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,8 +256,7 @@ class Google_Client
|
||||||
* {@code "offline"} to request offline access from the user.
|
* {@code "offline"} to request offline access from the user.
|
||||||
* {@code "online"} to request online access from the user.
|
* {@code "online"} to request online access from the user.
|
||||||
*/
|
*/
|
||||||
public function setAccessType($accessType)
|
public function setAccessType($accessType) {
|
||||||
{
|
|
||||||
$this->config->setAccessType($accessType);
|
$this->config->setAccessType($accessType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,8 +265,7 @@ class Google_Client
|
||||||
* {@code "force"} to force the approval UI to appear. (This is the default value)
|
* {@code "force"} to force the approval UI to appear. (This is the default value)
|
||||||
* {@code "auto"} to request auto-approval when possible.
|
* {@code "auto"} to request auto-approval when possible.
|
||||||
*/
|
*/
|
||||||
public function setApprovalPrompt($approvalPrompt)
|
public function setApprovalPrompt($approvalPrompt) {
|
||||||
{
|
|
||||||
$this->config->setApprovalPrompt($approvalPrompt);
|
$this->config->setApprovalPrompt($approvalPrompt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,8 +273,7 @@ class Google_Client
|
||||||
* Set the login hint, email address or sub id.
|
* Set the login hint, email address or sub id.
|
||||||
* @param string $loginHint
|
* @param string $loginHint
|
||||||
*/
|
*/
|
||||||
public function setLoginHint($loginHint)
|
public function setLoginHint($loginHint) {
|
||||||
{
|
|
||||||
$this->config->setLoginHint($loginHint);
|
$this->config->setLoginHint($loginHint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,8 +281,7 @@ class Google_Client
|
||||||
* Set the application name, this is included in the User-Agent HTTP header.
|
* Set the application name, this is included in the User-Agent HTTP header.
|
||||||
* @param string $applicationName
|
* @param string $applicationName
|
||||||
*/
|
*/
|
||||||
public function setApplicationName($applicationName)
|
public function setApplicationName($applicationName) {
|
||||||
{
|
|
||||||
$this->config->setApplicationName($applicationName);
|
$this->config->setApplicationName($applicationName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,8 +289,7 @@ class Google_Client
|
||||||
* Set the OAuth 2.0 Client ID.
|
* Set the OAuth 2.0 Client ID.
|
||||||
* @param string $clientId
|
* @param string $clientId
|
||||||
*/
|
*/
|
||||||
public function setClientId($clientId)
|
public function setClientId($clientId) {
|
||||||
{
|
|
||||||
$this->config->setClientId($clientId);
|
$this->config->setClientId($clientId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,8 +297,7 @@ class Google_Client
|
||||||
* Set the OAuth 2.0 Client Secret.
|
* Set the OAuth 2.0 Client Secret.
|
||||||
* @param string $clientSecret
|
* @param string $clientSecret
|
||||||
*/
|
*/
|
||||||
public function setClientSecret($clientSecret)
|
public function setClientSecret($clientSecret) {
|
||||||
{
|
|
||||||
$this->config->setClientSecret($clientSecret);
|
$this->config->setClientSecret($clientSecret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,8 +305,7 @@ class Google_Client
|
||||||
* Set the OAuth 2.0 Redirect URI.
|
* Set the OAuth 2.0 Redirect URI.
|
||||||
* @param string $redirectUri
|
* @param string $redirectUri
|
||||||
*/
|
*/
|
||||||
public function setRedirectUri($redirectUri)
|
public function setRedirectUri($redirectUri) {
|
||||||
{
|
|
||||||
$this->config->setRedirectUri($redirectUri);
|
$this->config->setRedirectUri($redirectUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,8 +317,7 @@ class Google_Client
|
||||||
*
|
*
|
||||||
* @param array $requestVisibleActions Array of app activity types
|
* @param array $requestVisibleActions Array of app activity types
|
||||||
*/
|
*/
|
||||||
public function setRequestVisibleActions($requestVisibleActions)
|
public function setRequestVisibleActions($requestVisibleActions) {
|
||||||
{
|
|
||||||
if (is_array($requestVisibleActions)) {
|
if (is_array($requestVisibleActions)) {
|
||||||
$requestVisibleActions = join(" ", $requestVisibleActions);
|
$requestVisibleActions = join(" ", $requestVisibleActions);
|
||||||
}
|
}
|
||||||
|
@ -353,8 +329,7 @@ class Google_Client
|
||||||
* @see http://code.google.com/apis/console-help/#generatingdevkeys
|
* @see http://code.google.com/apis/console-help/#generatingdevkeys
|
||||||
* @param string $developerKey
|
* @param string $developerKey
|
||||||
*/
|
*/
|
||||||
public function setDeveloperKey($developerKey)
|
public function setDeveloperKey($developerKey) {
|
||||||
{
|
|
||||||
$this->config->setDeveloperKey($developerKey);
|
$this->config->setDeveloperKey($developerKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,33 +338,30 @@ class Google_Client
|
||||||
* @param string $refreshToken
|
* @param string $refreshToken
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function refreshToken($refreshToken)
|
public function refreshToken($refreshToken) {
|
||||||
{
|
|
||||||
return $this->getAuth()->refreshToken($refreshToken);
|
return $this->getAuth()->refreshToken($refreshToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Revoke an OAuth2 access token or refresh token. This method will revoke the current access
|
* Revoke an OAuth2 access token or refresh token. This method will revoke the current access
|
||||||
* token, if a token isn't provided.
|
* token, if a token isn't provided.
|
||||||
* @throws Google_Auth_Exception
|
|
||||||
* @param string|null $token The token (access token or a refresh token) that should be revoked.
|
* @param string|null $token The token (access token or a refresh token) that should be revoked.
|
||||||
* @return boolean Returns True if the revocation was successful, otherwise False.
|
* @return boolean Returns True if the revocation was successful, otherwise False.
|
||||||
|
* @throws Google_Auth_Exception
|
||||||
*/
|
*/
|
||||||
public function revokeToken($token = null)
|
public function revokeToken($token = null) {
|
||||||
{
|
|
||||||
return $this->getAuth()->revokeToken($token);
|
return $this->getAuth()->revokeToken($token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify an id_token. This method will verify the current id_token, if one
|
* Verify an id_token. This method will verify the current id_token, if one
|
||||||
* isn't provided.
|
* isn't provided.
|
||||||
* @throws Google_Auth_Exception
|
|
||||||
* @param string|null $token The token (id_token) that should be verified.
|
* @param string|null $token The token (id_token) that should be verified.
|
||||||
* @return Google_Auth_LoginTicket Returns an apiLoginTicket if the verification was
|
* @return Google_Auth_LoginTicket Returns an apiLoginTicket if the verification was
|
||||||
* successful.
|
* successful.
|
||||||
|
* @throws Google_Auth_Exception
|
||||||
*/
|
*/
|
||||||
public function verifyIdToken($token = null)
|
public function verifyIdToken($token = null) {
|
||||||
{
|
|
||||||
return $this->getAuth()->verifyIdToken($token);
|
return $this->getAuth()->verifyIdToken($token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -403,8 +375,7 @@ class Google_Client
|
||||||
* @param [$max_expiry] the max lifetime of a token, defaults to MAX_TOKEN_LIFETIME_SECS
|
* @param [$max_expiry] the max lifetime of a token, defaults to MAX_TOKEN_LIFETIME_SECS
|
||||||
* @return token information if valid, false if not
|
* @return token information if valid, false if not
|
||||||
*/
|
*/
|
||||||
public function verifySignedJwt($id_token, $cert_location, $audience, $issuer, $max_expiry = null)
|
public function verifySignedJwt($id_token, $cert_location, $audience, $issuer, $max_expiry = null) {
|
||||||
{
|
|
||||||
$auth = new Google_Auth_OAuth2($this);
|
$auth = new Google_Auth_OAuth2($this);
|
||||||
$certs = $auth->retrieveCertsFromLocation($cert_location);
|
$certs = $auth->retrieveCertsFromLocation($cert_location);
|
||||||
return $auth->verifySignedJwtWithCerts($id_token, $certs, $audience, $issuer, $max_expiry);
|
return $auth->verifySignedJwtWithCerts($id_token, $certs, $audience, $issuer, $max_expiry);
|
||||||
|
@ -414,8 +385,7 @@ class Google_Client
|
||||||
* @param Google_Auth_AssertionCredentials $creds
|
* @param Google_Auth_AssertionCredentials $creds
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setAssertionCredentials(Google_Auth_AssertionCredentials $creds)
|
public function setAssertionCredentials(Google_Auth_AssertionCredentials $creds) {
|
||||||
{
|
|
||||||
$this->getAuth()->setAssertionCredentials($creds);
|
$this->getAuth()->setAssertionCredentials($creds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -425,8 +395,7 @@ class Google_Client
|
||||||
* @param array $scopes , ie: array('https://www.googleapis.com/auth/plus.login',
|
* @param array $scopes , ie: array('https://www.googleapis.com/auth/plus.login',
|
||||||
* 'https://www.googleapis.com/auth/moderator')
|
* 'https://www.googleapis.com/auth/moderator')
|
||||||
*/
|
*/
|
||||||
public function setScopes($scopes)
|
public function setScopes($scopes) {
|
||||||
{
|
|
||||||
$this->requestedScopes = array();
|
$this->requestedScopes = array();
|
||||||
$this->addScope($scopes);
|
$this->addScope($scopes);
|
||||||
}
|
}
|
||||||
|
@ -438,8 +407,7 @@ class Google_Client
|
||||||
* will each be appended.
|
* will each be appended.
|
||||||
* @param $scope_or_scopes string|array e.g. "profile"
|
* @param $scope_or_scopes string|array e.g. "profile"
|
||||||
*/
|
*/
|
||||||
public function addScope($scope_or_scopes)
|
public function addScope($scope_or_scopes) {
|
||||||
{
|
|
||||||
if (is_string($scope_or_scopes) && !in_array($scope_or_scopes, $this->requestedScopes)) {
|
if (is_string($scope_or_scopes) && !in_array($scope_or_scopes, $this->requestedScopes)) {
|
||||||
$this->requestedScopes[] = $scope_or_scopes;
|
$this->requestedScopes[] = $scope_or_scopes;
|
||||||
} elseif (is_array($scope_or_scopes)) {
|
} elseif (is_array($scope_or_scopes)) {
|
||||||
|
@ -454,8 +422,7 @@ class Google_Client
|
||||||
* @return array the list of scopes
|
* @return array the list of scopes
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function getScopes()
|
public function getScopes() {
|
||||||
{
|
|
||||||
return $this->requestedScopes;
|
return $this->requestedScopes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -466,8 +433,7 @@ class Google_Client
|
||||||
* @param boolean $useBatch True if the batch support should
|
* @param boolean $useBatch True if the batch support should
|
||||||
* be enabled. Defaults to False.
|
* be enabled. Defaults to False.
|
||||||
*/
|
*/
|
||||||
public function setUseBatch($useBatch)
|
public function setUseBatch($useBatch) {
|
||||||
{
|
|
||||||
// This is actually an alias for setDefer.
|
// This is actually an alias for setDefer.
|
||||||
$this->setDefer($useBatch);
|
$this->setDefer($useBatch);
|
||||||
}
|
}
|
||||||
|
@ -478,8 +444,7 @@ class Google_Client
|
||||||
*
|
*
|
||||||
* @param boolean $defer True if calls should not be executed right away.
|
* @param boolean $defer True if calls should not be executed right away.
|
||||||
*/
|
*/
|
||||||
public function setDefer($defer)
|
public function setDefer($defer) {
|
||||||
{
|
|
||||||
$this->deferExecution = $defer;
|
$this->deferExecution = $defer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -488,8 +453,7 @@ class Google_Client
|
||||||
*
|
*
|
||||||
* @returns object of the type of the expected class or array.
|
* @returns object of the type of the expected class or array.
|
||||||
*/
|
*/
|
||||||
public function execute($request)
|
public function execute($request) {
|
||||||
{
|
|
||||||
if ($request instanceof Google_Http_Request) {
|
if ($request instanceof Google_Http_Request) {
|
||||||
$request->setUserAgent(
|
$request->setUserAgent(
|
||||||
$this->getApplicationName()
|
$this->getApplicationName()
|
||||||
|
@ -512,16 +476,14 @@ class Google_Client
|
||||||
* Whether or not to return raw requests
|
* Whether or not to return raw requests
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function shouldDefer()
|
public function shouldDefer() {
|
||||||
{
|
|
||||||
return $this->deferExecution;
|
return $this->deferExecution;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Google_Auth_Abstract Authentication implementation
|
* @return Google_Auth_Abstract Authentication implementation
|
||||||
*/
|
*/
|
||||||
public function getAuth()
|
public function getAuth() {
|
||||||
{
|
|
||||||
if (!isset($this->auth)) {
|
if (!isset($this->auth)) {
|
||||||
$class = $this->config->getAuthClass();
|
$class = $this->config->getAuthClass();
|
||||||
$this->auth = new $class($this);
|
$this->auth = new $class($this);
|
||||||
|
@ -532,8 +494,7 @@ class Google_Client
|
||||||
/**
|
/**
|
||||||
* @return Google_IO_Abstract IO implementation
|
* @return Google_IO_Abstract IO implementation
|
||||||
*/
|
*/
|
||||||
public function getIo()
|
public function getIo() {
|
||||||
{
|
|
||||||
if (!isset($this->io)) {
|
if (!isset($this->io)) {
|
||||||
$class = $this->config->getIoClass();
|
$class = $this->config->getIoClass();
|
||||||
$this->io = new $class($this);
|
$this->io = new $class($this);
|
||||||
|
@ -544,8 +505,7 @@ class Google_Client
|
||||||
/**
|
/**
|
||||||
* @return Google_Cache_Abstract Cache implementation
|
* @return Google_Cache_Abstract Cache implementation
|
||||||
*/
|
*/
|
||||||
public function getCache()
|
public function getCache() {
|
||||||
{
|
|
||||||
if (!isset($this->cache)) {
|
if (!isset($this->cache)) {
|
||||||
$class = $this->config->getCacheClass();
|
$class = $this->config->getCacheClass();
|
||||||
$this->cache = new $class($this);
|
$this->cache = new $class($this);
|
||||||
|
@ -558,8 +518,7 @@ class Google_Client
|
||||||
* @param $class string|object - class or instance of class to retrieve
|
* @param $class string|object - class or instance of class to retrieve
|
||||||
* @param $key string optional - key to retrieve
|
* @param $key string optional - key to retrieve
|
||||||
*/
|
*/
|
||||||
public function getClassConfig($class, $key = null)
|
public function getClassConfig($class, $key = null) {
|
||||||
{
|
|
||||||
if (!is_string($class)) {
|
if (!is_string($class)) {
|
||||||
$class = get_class($class);
|
$class = get_class($class);
|
||||||
}
|
}
|
||||||
|
@ -575,8 +534,7 @@ class Google_Client
|
||||||
* @param $value optional - if $config is a key, the value
|
* @param $value optional - if $config is a key, the value
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function setClassConfig($class, $config, $value = null)
|
public function setClassConfig($class, $config, $value = null) {
|
||||||
{
|
|
||||||
if (!is_string($class)) {
|
if (!is_string($class)) {
|
||||||
$class = get_class($class);
|
$class = get_class($class);
|
||||||
}
|
}
|
||||||
|
@ -587,16 +545,14 @@ class Google_Client
|
||||||
/**
|
/**
|
||||||
* @return string the base URL to use for calls to the APIs
|
* @return string the base URL to use for calls to the APIs
|
||||||
*/
|
*/
|
||||||
public function getBasePath()
|
public function getBasePath() {
|
||||||
{
|
|
||||||
return $this->config->getBasePath();
|
return $this->config->getBasePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string the name of the application
|
* @return string the name of the application
|
||||||
*/
|
*/
|
||||||
public function getApplicationName()
|
public function getApplicationName() {
|
||||||
{
|
|
||||||
return $this->config->getApplicationName();
|
return $this->config->getApplicationName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -604,8 +560,7 @@ class Google_Client
|
||||||
* Are we running in Google AppEngine?
|
* Are we running in Google AppEngine?
|
||||||
* return bool
|
* return bool
|
||||||
*/
|
*/
|
||||||
public function isAppEngine()
|
public function isAppEngine() {
|
||||||
{
|
|
||||||
return (isset($_SERVER['SERVER_SOFTWARE']) &&
|
return (isset($_SERVER['SERVER_SOFTWARE']) &&
|
||||||
strpos($_SERVER['SERVER_SOFTWARE'], 'Google App Engine') !== false);
|
strpos($_SERVER['SERVER_SOFTWARE'], 'Google App Engine') !== false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,60 +7,51 @@ require_once "Google/Model.php";
|
||||||
* exposes the items array for iteration, so you can just
|
* exposes the items array for iteration, so you can just
|
||||||
* iterate over the object rather than a reference inside.
|
* iterate over the object rather than a reference inside.
|
||||||
*/
|
*/
|
||||||
class Google_Collection extends Google_Model implements Iterator, Countable
|
class Google_Collection extends Google_Model implements Iterator, Countable {
|
||||||
{
|
|
||||||
protected $collection_key = 'items';
|
protected $collection_key = 'items';
|
||||||
|
|
||||||
public function rewind()
|
public function rewind() {
|
||||||
{
|
|
||||||
if (isset($this->modelData[$this->collection_key])
|
if (isset($this->modelData[$this->collection_key])
|
||||||
&& is_array($this->modelData[$this->collection_key])) {
|
&& is_array($this->modelData[$this->collection_key])) {
|
||||||
reset($this->modelData[$this->collection_key]);
|
reset($this->modelData[$this->collection_key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function current()
|
public function current() {
|
||||||
{
|
|
||||||
$this->coerceType($this->key());
|
$this->coerceType($this->key());
|
||||||
if (is_array($this->modelData[$this->collection_key])) {
|
if (is_array($this->modelData[$this->collection_key])) {
|
||||||
return current($this->modelData[$this->collection_key]);
|
return current($this->modelData[$this->collection_key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function key()
|
public function key() {
|
||||||
{
|
|
||||||
if (isset($this->modelData[$this->collection_key])
|
if (isset($this->modelData[$this->collection_key])
|
||||||
&& is_array($this->modelData[$this->collection_key])) {
|
&& is_array($this->modelData[$this->collection_key])) {
|
||||||
return key($this->modelData[$this->collection_key]);
|
return key($this->modelData[$this->collection_key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function next()
|
public function next() {
|
||||||
{
|
|
||||||
return next($this->modelData[$this->collection_key]);
|
return next($this->modelData[$this->collection_key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function valid()
|
public function valid() {
|
||||||
{
|
|
||||||
$key = $this->key();
|
$key = $this->key();
|
||||||
return $key !== null && $key !== false;
|
return $key !== null && $key !== false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function count()
|
public function count() {
|
||||||
{
|
|
||||||
return count($this->modelData[$this->collection_key]);
|
return count($this->modelData[$this->collection_key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetExists ($offset)
|
public function offsetExists($offset) {
|
||||||
{
|
|
||||||
if (!is_numeric($offset)) {
|
if (!is_numeric($offset)) {
|
||||||
return parent::offsetExists($offset);
|
return parent::offsetExists($offset);
|
||||||
}
|
}
|
||||||
return isset($this->modelData[$this->collection_key][$offset]);
|
return isset($this->modelData[$this->collection_key][$offset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetGet($offset)
|
public function offsetGet($offset) {
|
||||||
{
|
|
||||||
if (!is_numeric($offset)) {
|
if (!is_numeric($offset)) {
|
||||||
return parent::offsetGet($offset);
|
return parent::offsetGet($offset);
|
||||||
}
|
}
|
||||||
|
@ -68,24 +59,21 @@ class Google_Collection extends Google_Model implements Iterator, Countable
|
||||||
return $this->modelData[$this->collection_key][$offset];
|
return $this->modelData[$this->collection_key][$offset];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetSet($offset, $value)
|
public function offsetSet($offset, $value) {
|
||||||
{
|
|
||||||
if (!is_numeric($offset)) {
|
if (!is_numeric($offset)) {
|
||||||
return parent::offsetSet($offset, $value);
|
return parent::offsetSet($offset, $value);
|
||||||
}
|
}
|
||||||
$this->modelData[$this->collection_key][$offset] = $value;
|
$this->modelData[$this->collection_key][$offset] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetUnset($offset)
|
public function offsetUnset($offset) {
|
||||||
{
|
|
||||||
if (!is_numeric($offset)) {
|
if (!is_numeric($offset)) {
|
||||||
return parent::offsetUnset($offset);
|
return parent::offsetUnset($offset);
|
||||||
}
|
}
|
||||||
unset($this->modelData[$this->collection_key][$offset]);
|
unset($this->modelData[$this->collection_key][$offset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function coerceType($offset)
|
private function coerceType($offset) {
|
||||||
{
|
|
||||||
$typeKey = $this->keyType($this->collection_key);
|
$typeKey = $this->keyType($this->collection_key);
|
||||||
if (isset($this->$typeKey) && !is_object($this->modelData[$this->collection_key][$offset])) {
|
if (isset($this->$typeKey) && !is_object($this->modelData[$this->collection_key][$offset])) {
|
||||||
$type = $this->$typeKey;
|
$type = $this->$typeKey;
|
||||||
|
|
|
@ -18,8 +18,7 @@
|
||||||
/**
|
/**
|
||||||
* A class to contain the library configuration for the Google API client.
|
* A class to contain the library configuration for the Google API client.
|
||||||
*/
|
*/
|
||||||
class Google_Config
|
class Google_Config {
|
||||||
{
|
|
||||||
const GZIP_DISABLED = true;
|
const GZIP_DISABLED = true;
|
||||||
const GZIP_ENABLED = false;
|
const GZIP_ENABLED = false;
|
||||||
const GZIP_UPLOADS_ENABLED = true;
|
const GZIP_UPLOADS_ENABLED = true;
|
||||||
|
@ -34,8 +33,7 @@ class Google_Config
|
||||||
*
|
*
|
||||||
* @param [$ini_file_location] - optional - The location of the ini file to load
|
* @param [$ini_file_location] - optional - The location of the ini file to load
|
||||||
*/
|
*/
|
||||||
public function __construct($ini_file_location = null)
|
public function __construct($ini_file_location = null) {
|
||||||
{
|
|
||||||
require_once('../config.php');
|
require_once('../config.php');
|
||||||
|
|
||||||
$this->configuration = array(
|
$this->configuration = array(
|
||||||
|
@ -94,8 +92,7 @@ class Google_Config
|
||||||
|
|
||||||
// Definition of service specific values like scopes, oauth token URLs,
|
// Definition of service specific values like scopes, oauth token URLs,
|
||||||
// etc. Example:
|
// etc. Example:
|
||||||
'services' => array(
|
'services' => array(),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
if ($ini_file_location) {
|
if ($ini_file_location) {
|
||||||
$ini = parse_ini_file($ini_file_location, true);
|
$ini = parse_ini_file($ini_file_location, true);
|
||||||
|
@ -113,8 +110,7 @@ class Google_Config
|
||||||
* @param $config string key or an array of configuration values
|
* @param $config string key or an array of configuration values
|
||||||
* @param $value optional - if $config is a key, the value
|
* @param $value optional - if $config is a key, the value
|
||||||
*/
|
*/
|
||||||
public function setClassConfig($class, $config, $value = null)
|
public function setClassConfig($class, $config, $value = null) {
|
||||||
{
|
|
||||||
if (!is_array($config)) {
|
if (!is_array($config)) {
|
||||||
if (!isset($this->configuration['classes'][$class])) {
|
if (!isset($this->configuration['classes'][$class])) {
|
||||||
$this->configuration['classes'][$class] = array();
|
$this->configuration['classes'][$class] = array();
|
||||||
|
@ -125,8 +121,7 @@ class Google_Config
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getClassConfig($class, $key = null)
|
public function getClassConfig($class, $key = null) {
|
||||||
{
|
|
||||||
if (!isset($this->configuration['classes'][$class])) {
|
if (!isset($this->configuration['classes'][$class])) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -141,8 +136,7 @@ class Google_Config
|
||||||
* Return the configured cache class.
|
* Return the configured cache class.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getCacheClass()
|
public function getCacheClass() {
|
||||||
{
|
|
||||||
return $this->configuration['cache_class'];
|
return $this->configuration['cache_class'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,8 +144,7 @@ class Google_Config
|
||||||
* Return the configured Auth class.
|
* Return the configured Auth class.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getAuthClass()
|
public function getAuthClass() {
|
||||||
{
|
|
||||||
return $this->configuration['auth_class'];
|
return $this->configuration['auth_class'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,8 +153,7 @@ class Google_Config
|
||||||
*
|
*
|
||||||
* @param $class the class name to set
|
* @param $class the class name to set
|
||||||
*/
|
*/
|
||||||
public function setAuthClass($class)
|
public function setAuthClass($class) {
|
||||||
{
|
|
||||||
$prev = $this->configuration['auth_class'];
|
$prev = $this->configuration['auth_class'];
|
||||||
if (!isset($this->configuration['classes'][$class]) &&
|
if (!isset($this->configuration['classes'][$class]) &&
|
||||||
isset($this->configuration['classes'][$prev])) {
|
isset($this->configuration['classes'][$prev])) {
|
||||||
|
@ -176,8 +168,7 @@ class Google_Config
|
||||||
*
|
*
|
||||||
* @param $class the class name to set
|
* @param $class the class name to set
|
||||||
*/
|
*/
|
||||||
public function setIoClass($class)
|
public function setIoClass($class) {
|
||||||
{
|
|
||||||
$prev = $this->configuration['io_class'];
|
$prev = $this->configuration['io_class'];
|
||||||
if (!isset($this->configuration['classes'][$class]) &&
|
if (!isset($this->configuration['classes'][$class]) &&
|
||||||
isset($this->configuration['classes'][$prev])) {
|
isset($this->configuration['classes'][$prev])) {
|
||||||
|
@ -192,8 +183,7 @@ class Google_Config
|
||||||
*
|
*
|
||||||
* @param $class the class name to set
|
* @param $class the class name to set
|
||||||
*/
|
*/
|
||||||
public function setCacheClass($class)
|
public function setCacheClass($class) {
|
||||||
{
|
|
||||||
$prev = $this->configuration['cache_class'];
|
$prev = $this->configuration['cache_class'];
|
||||||
if (!isset($this->configuration['classes'][$class]) &&
|
if (!isset($this->configuration['classes'][$class]) &&
|
||||||
isset($this->configuration['classes'][$prev])) {
|
isset($this->configuration['classes'][$prev])) {
|
||||||
|
@ -207,8 +197,7 @@ class Google_Config
|
||||||
* Return the configured IO class.
|
* Return the configured IO class.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getIoClass()
|
public function getIoClass() {
|
||||||
{
|
|
||||||
return $this->configuration['io_class'];
|
return $this->configuration['io_class'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,16 +205,14 @@ class Google_Config
|
||||||
* Set the application name, this is included in the User-Agent HTTP header.
|
* Set the application name, this is included in the User-Agent HTTP header.
|
||||||
* @param string $name
|
* @param string $name
|
||||||
*/
|
*/
|
||||||
public function setApplicationName($name)
|
public function setApplicationName($name) {
|
||||||
{
|
|
||||||
$this->configuration['application_name'] = $name;
|
$this->configuration['application_name'] = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string the name of the application
|
* @return string the name of the application
|
||||||
*/
|
*/
|
||||||
public function getApplicationName()
|
public function getApplicationName() {
|
||||||
{
|
|
||||||
return $this->configuration['application_name'];
|
return $this->configuration['application_name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,8 +220,7 @@ class Google_Config
|
||||||
* Set the client ID for the auth class.
|
* Set the client ID for the auth class.
|
||||||
* @param $key string - the API console client ID
|
* @param $key string - the API console client ID
|
||||||
*/
|
*/
|
||||||
public function setClientId($clientId)
|
public function setClientId($clientId) {
|
||||||
{
|
|
||||||
$this->setAuthConfig('client_id', $clientId);
|
$this->setAuthConfig('client_id', $clientId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,8 +228,7 @@ class Google_Config
|
||||||
* Set the client secret for the auth class.
|
* Set the client secret for the auth class.
|
||||||
* @param $key string - the API console client secret
|
* @param $key string - the API console client secret
|
||||||
*/
|
*/
|
||||||
public function setClientSecret($secret)
|
public function setClientSecret($secret) {
|
||||||
{
|
|
||||||
$this->setAuthConfig('client_secret', $secret);
|
$this->setAuthConfig('client_secret', $secret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,8 +237,7 @@ class Google_Config
|
||||||
* Javascript based sign in flow, this should be the string 'postmessage'.
|
* Javascript based sign in flow, this should be the string 'postmessage'.
|
||||||
* @param $key string - the URI that users should be redirected to
|
* @param $key string - the URI that users should be redirected to
|
||||||
*/
|
*/
|
||||||
public function setRedirectUri($uri)
|
public function setRedirectUri($uri) {
|
||||||
{
|
|
||||||
$this->setAuthConfig('redirect_uri', $uri);
|
$this->setAuthConfig('redirect_uri', $uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,8 +245,7 @@ class Google_Config
|
||||||
* Set the app activities for the auth class.
|
* Set the app activities for the auth class.
|
||||||
* @param $rva string a space separated list of app activity types
|
* @param $rva string a space separated list of app activity types
|
||||||
*/
|
*/
|
||||||
public function setRequestVisibleActions($rva)
|
public function setRequestVisibleActions($rva) {
|
||||||
{
|
|
||||||
$this->setAuthConfig('request_visible_actions', $rva);
|
$this->setAuthConfig('request_visible_actions', $rva);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,8 +253,7 @@ class Google_Config
|
||||||
* Set the the access type requested (offline or online.)
|
* Set the the access type requested (offline or online.)
|
||||||
* @param $access string - the access type
|
* @param $access string - the access type
|
||||||
*/
|
*/
|
||||||
public function setAccessType($access)
|
public function setAccessType($access) {
|
||||||
{
|
|
||||||
$this->setAuthConfig('access_type', $access);
|
$this->setAuthConfig('access_type', $access);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,8 +261,7 @@ class Google_Config
|
||||||
* Set when to show the approval prompt (auto or force)
|
* Set when to show the approval prompt (auto or force)
|
||||||
* @param $approval string - the approval request
|
* @param $approval string - the approval request
|
||||||
*/
|
*/
|
||||||
public function setApprovalPrompt($approval)
|
public function setApprovalPrompt($approval) {
|
||||||
{
|
|
||||||
$this->setAuthConfig('approval_prompt', $approval);
|
$this->setAuthConfig('approval_prompt', $approval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,8 +269,7 @@ class Google_Config
|
||||||
* Set the login hint (email address or sub identifier)
|
* Set the login hint (email address or sub identifier)
|
||||||
* @param $hint string
|
* @param $hint string
|
||||||
*/
|
*/
|
||||||
public function setLoginHint($hint)
|
public function setLoginHint($hint) {
|
||||||
{
|
|
||||||
$this->setAuthConfig('login_hint', $hint);
|
$this->setAuthConfig('login_hint', $hint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,16 +278,14 @@ class Google_Config
|
||||||
* from the client ID - if it looks like a URL, its a client ID!
|
* from the client ID - if it looks like a URL, its a client ID!
|
||||||
* @param $key string - the API console developer key
|
* @param $key string - the API console developer key
|
||||||
*/
|
*/
|
||||||
public function setDeveloperKey($key)
|
public function setDeveloperKey($key) {
|
||||||
{
|
|
||||||
$this->setAuthConfig('developer_key', $key);
|
$this->setAuthConfig('developer_key', $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string the base URL to use for API calls
|
* @return string the base URL to use for API calls
|
||||||
*/
|
*/
|
||||||
public function getBasePath()
|
public function getBasePath() {
|
||||||
{
|
|
||||||
return $this->configuration['base_path'];
|
return $this->configuration['base_path'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -316,8 +294,7 @@ class Google_Config
|
||||||
* @param $key - the key to set
|
* @param $key - the key to set
|
||||||
* @param $value - the parameter value
|
* @param $value - the parameter value
|
||||||
*/
|
*/
|
||||||
private function setAuthConfig($key, $value)
|
private function setAuthConfig($key, $value) {
|
||||||
{
|
|
||||||
if (!isset($this->configuration['classes'][$this->getAuthClass()])) {
|
if (!isset($this->configuration['classes'][$this->getAuthClass()])) {
|
||||||
$this->configuration['classes'][$this->getAuthClass()] = array();
|
$this->configuration['classes'][$this->getAuthClass()] = array();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,5 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Google_Exception extends Exception
|
class Google_Exception extends Exception {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,7 @@ require_once 'Google/Http/REST.php';
|
||||||
/**
|
/**
|
||||||
* @author Chirag Shah <chirags@google.com>
|
* @author Chirag Shah <chirags@google.com>
|
||||||
*/
|
*/
|
||||||
class Google_Http_Batch
|
class Google_Http_Batch {
|
||||||
{
|
|
||||||
/** @var string Multipart Boundary. */
|
/** @var string Multipart Boundary. */
|
||||||
private $boundary;
|
private $boundary;
|
||||||
|
|
||||||
|
@ -37,8 +36,7 @@ class Google_Http_Batch
|
||||||
|
|
||||||
private $base_path;
|
private $base_path;
|
||||||
|
|
||||||
public function __construct(Google_Client $client, $boundary = false)
|
public function __construct(Google_Client $client, $boundary = false) {
|
||||||
{
|
|
||||||
$this->client = $client;
|
$this->client = $client;
|
||||||
$this->base_path = $this->client->getBasePath();
|
$this->base_path = $this->client->getBasePath();
|
||||||
$this->expected_classes = array();
|
$this->expected_classes = array();
|
||||||
|
@ -46,8 +44,7 @@ class Google_Http_Batch
|
||||||
$this->boundary = str_replace('"', '', $boundary);
|
$this->boundary = str_replace('"', '', $boundary);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function add(Google_Http_Request $request, $key = false)
|
public function add(Google_Http_Request $request, $key = false) {
|
||||||
{
|
|
||||||
if (false == $key) {
|
if (false == $key) {
|
||||||
$key = mt_rand();
|
$key = mt_rand();
|
||||||
}
|
}
|
||||||
|
@ -55,8 +52,7 @@ class Google_Http_Batch
|
||||||
$this->requests[$key] = $request;
|
$this->requests[$key] = $request;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function execute()
|
public function execute() {
|
||||||
{
|
|
||||||
$body = '';
|
$body = '';
|
||||||
|
|
||||||
/** @var Google_Http_Request $req */
|
/** @var Google_Http_Request $req */
|
||||||
|
@ -81,8 +77,7 @@ class Google_Http_Batch
|
||||||
return $this->parseResponse($response);
|
return $this->parseResponse($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function parseResponse(Google_Http_Request $response)
|
public function parseResponse(Google_Http_Request $response) {
|
||||||
{
|
|
||||||
$contentType = $response->getResponseHeader('content-type');
|
$contentType = $response->getResponseHeader('content-type');
|
||||||
$contentType = explode(';', $contentType);
|
$contentType = explode(';', $contentType);
|
||||||
$boundary = false;
|
$boundary = false;
|
||||||
|
|
|
@ -22,8 +22,7 @@ require_once 'Google/Http/Request.php';
|
||||||
* implementation is guided by the guidance offered in rfc2616-sec13.
|
* implementation is guided by the guidance offered in rfc2616-sec13.
|
||||||
* @author Chirag Shah <chirags@google.com>
|
* @author Chirag Shah <chirags@google.com>
|
||||||
*/
|
*/
|
||||||
class Google_Http_CacheParser
|
class Google_Http_CacheParser {
|
||||||
{
|
|
||||||
public static $CACHEABLE_HTTP_METHODS = array('GET', 'HEAD');
|
public static $CACHEABLE_HTTP_METHODS = array('GET', 'HEAD');
|
||||||
public static $CACHEABLE_STATUS_CODES = array('200', '203', '300', '301');
|
public static $CACHEABLE_STATUS_CODES = array('200', '203', '300', '301');
|
||||||
|
|
||||||
|
@ -35,8 +34,7 @@ class Google_Http_CacheParser
|
||||||
* @return bool True if the request is cacheable.
|
* @return bool True if the request is cacheable.
|
||||||
* False if the request is uncacheable.
|
* False if the request is uncacheable.
|
||||||
*/
|
*/
|
||||||
public static function isRequestCacheable(Google_Http_Request $resp)
|
public static function isRequestCacheable(Google_Http_Request $resp) {
|
||||||
{
|
|
||||||
$method = $resp->getRequestMethod();
|
$method = $resp->getRequestMethod();
|
||||||
if (!in_array($method, self::$CACHEABLE_HTTP_METHODS)) {
|
if (!in_array($method, self::$CACHEABLE_HTTP_METHODS)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -61,8 +59,7 @@ class Google_Http_CacheParser
|
||||||
* @return bool True if the response is cacheable.
|
* @return bool True if the response is cacheable.
|
||||||
* False if the response is un-cacheable.
|
* False if the response is un-cacheable.
|
||||||
*/
|
*/
|
||||||
public static function isResponseCacheable(Google_Http_Request $resp)
|
public static function isResponseCacheable(Google_Http_Request $resp) {
|
||||||
{
|
|
||||||
// First, check if the HTTP request was cacheable before inspecting the
|
// First, check if the HTTP request was cacheable before inspecting the
|
||||||
// HTTP response.
|
// HTTP response.
|
||||||
if (false == self::isRequestCacheable($resp)) {
|
if (false == self::isRequestCacheable($resp)) {
|
||||||
|
@ -113,8 +110,7 @@ class Google_Http_CacheParser
|
||||||
* @return bool True if the HTTP response is considered to be expired.
|
* @return bool True if the HTTP response is considered to be expired.
|
||||||
* False if it is considered to be fresh.
|
* False if it is considered to be fresh.
|
||||||
*/
|
*/
|
||||||
public static function isExpired(Google_Http_Request $resp)
|
public static function isExpired(Google_Http_Request $resp) {
|
||||||
{
|
|
||||||
// HTTP/1.1 clients and caches MUST treat other invalid date formats,
|
// HTTP/1.1 clients and caches MUST treat other invalid date formats,
|
||||||
// especially including the value “0”, as in the past.
|
// especially including the value “0”, as in the past.
|
||||||
$parsedExpires = false;
|
$parsedExpires = false;
|
||||||
|
@ -174,8 +170,7 @@ class Google_Http_CacheParser
|
||||||
* @param Google_Http_Request $response
|
* @param Google_Http_Request $response
|
||||||
* @return bool True if the entry is expired, else return false.
|
* @return bool True if the entry is expired, else return false.
|
||||||
*/
|
*/
|
||||||
public static function mustRevalidate(Google_Http_Request $response)
|
public static function mustRevalidate(Google_Http_Request $response) {
|
||||||
{
|
|
||||||
// [13.3] When a cache has a stale entry that it would like to use as a
|
// [13.3] When a cache has a stale entry that it would like to use as a
|
||||||
// response to a client's request, it first has to check with the origin
|
// response to a client's request, it first has to check with the origin
|
||||||
// server to see if its cached entry is still usable.
|
// server to see if its cached entry is still usable.
|
||||||
|
|
|
@ -25,8 +25,7 @@ require_once 'Google/Utils.php';
|
||||||
* @author Chirag Shah <chirags@google.com>
|
* @author Chirag Shah <chirags@google.com>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class Google_Http_MediaFileUpload
|
class Google_Http_MediaFileUpload {
|
||||||
{
|
|
||||||
const UPLOAD_MEDIA_TYPE = 'media';
|
const UPLOAD_MEDIA_TYPE = 'media';
|
||||||
const UPLOAD_MULTIPART_TYPE = 'multipart';
|
const UPLOAD_MULTIPART_TYPE = 'multipart';
|
||||||
const UPLOAD_RESUMABLE_TYPE = 'resumable';
|
const UPLOAD_RESUMABLE_TYPE = 'resumable';
|
||||||
|
@ -104,8 +103,7 @@ class Google_Http_MediaFileUpload
|
||||||
* Set the size of the file that is being uploaded.
|
* Set the size of the file that is being uploaded.
|
||||||
* @param $size - int file size in bytes
|
* @param $size - int file size in bytes
|
||||||
*/
|
*/
|
||||||
public function setFileSize($size)
|
public function setFileSize($size) {
|
||||||
{
|
|
||||||
$this->size = $size;
|
$this->size = $size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,8 +111,7 @@ class Google_Http_MediaFileUpload
|
||||||
* Return the progress on the upload
|
* Return the progress on the upload
|
||||||
* @return int progress in bytes uploaded.
|
* @return int progress in bytes uploaded.
|
||||||
*/
|
*/
|
||||||
public function getProgress()
|
public function getProgress() {
|
||||||
{
|
|
||||||
return $this->progress;
|
return $this->progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,8 +119,7 @@ class Google_Http_MediaFileUpload
|
||||||
* Return the HTTP result code from the last call made.
|
* Return the HTTP result code from the last call made.
|
||||||
* @return int code
|
* @return int code
|
||||||
*/
|
*/
|
||||||
public function getHttpResultCode()
|
public function getHttpResultCode() {
|
||||||
{
|
|
||||||
return $this->httpResultCode;
|
return $this->httpResultCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,8 +128,7 @@ class Google_Http_MediaFileUpload
|
||||||
* @param [$chunk] the next set of bytes to send. If false will used $data passed
|
* @param [$chunk] the next set of bytes to send. If false will used $data passed
|
||||||
* at construct time.
|
* at construct time.
|
||||||
*/
|
*/
|
||||||
public function nextChunk($chunk = false)
|
public function nextChunk($chunk = false) {
|
||||||
{
|
|
||||||
if (false == $this->resumeUri) {
|
if (false == $this->resumeUri) {
|
||||||
$this->resumeUri = $this->getResumeUri();
|
$this->resumeUri = $this->getResumeUri();
|
||||||
}
|
}
|
||||||
|
@ -192,8 +187,7 @@ class Google_Http_MediaFileUpload
|
||||||
* @return array|bool
|
* @return array|bool
|
||||||
* @visible for testing
|
* @visible for testing
|
||||||
*/
|
*/
|
||||||
private function process()
|
private function process() {
|
||||||
{
|
|
||||||
$postBody = false;
|
$postBody = false;
|
||||||
$contentType = false;
|
$contentType = false;
|
||||||
|
|
||||||
|
@ -237,8 +231,7 @@ class Google_Http_MediaFileUpload
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function transformToUploadUrl()
|
private function transformToUploadUrl() {
|
||||||
{
|
|
||||||
$base = $this->request->getBaseComponent();
|
$base = $this->request->getBaseComponent();
|
||||||
$this->request->setBaseComponent($base . '/upload');
|
$this->request->setBaseComponent($base . '/upload');
|
||||||
}
|
}
|
||||||
|
@ -252,8 +245,7 @@ class Google_Http_MediaFileUpload
|
||||||
* @return string
|
* @return string
|
||||||
* @visible for testing
|
* @visible for testing
|
||||||
*/
|
*/
|
||||||
public function getUploadType($meta)
|
public function getUploadType($meta) {
|
||||||
{
|
|
||||||
if ($this->resumable) {
|
if ($this->resumable) {
|
||||||
return self::UPLOAD_RESUMABLE_TYPE;
|
return self::UPLOAD_RESUMABLE_TYPE;
|
||||||
}
|
}
|
||||||
|
@ -265,8 +257,7 @@ class Google_Http_MediaFileUpload
|
||||||
return self::UPLOAD_MULTIPART_TYPE;
|
return self::UPLOAD_MULTIPART_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getResumeUri()
|
private function getResumeUri() {
|
||||||
{
|
|
||||||
$result = null;
|
$result = null;
|
||||||
$body = $this->request->getPostBody();
|
$body = $this->request->getPostBody();
|
||||||
if ($body) {
|
if ($body) {
|
||||||
|
|
|
@ -26,8 +26,7 @@ require_once 'Google/Utils/URITemplate.php';
|
||||||
* @author Chris Chabot <chabotc@google.com>
|
* @author Chris Chabot <chabotc@google.com>
|
||||||
* @author Chirag Shah <chirags@google.com>
|
* @author Chirag Shah <chirags@google.com>
|
||||||
*/
|
*/
|
||||||
class Google_Http_REST
|
class Google_Http_REST {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Executes a Google_Http_Request
|
* Executes a Google_Http_Request
|
||||||
*
|
*
|
||||||
|
@ -37,8 +36,7 @@ class Google_Http_REST
|
||||||
* @throws Google_Service_Exception on server side error (ie: not authenticated,
|
* @throws Google_Service_Exception on server side error (ie: not authenticated,
|
||||||
* invalid or malformed post body, invalid url)
|
* invalid or malformed post body, invalid url)
|
||||||
*/
|
*/
|
||||||
public static function execute(Google_Client $client, Google_Http_Request $req)
|
public static function execute(Google_Client $client, Google_Http_Request $req) {
|
||||||
{
|
|
||||||
$httpRequest = $client->getIo()->makeRequest($req);
|
$httpRequest = $client->getIo()->makeRequest($req);
|
||||||
$httpRequest->setExpectedClass($req->getExpectedClass());
|
$httpRequest->setExpectedClass($req->getExpectedClass());
|
||||||
return self::decodeHttpResponse($httpRequest);
|
return self::decodeHttpResponse($httpRequest);
|
||||||
|
@ -47,12 +45,11 @@ class Google_Http_REST
|
||||||
/**
|
/**
|
||||||
* Decode an HTTP Response.
|
* Decode an HTTP Response.
|
||||||
* @static
|
* @static
|
||||||
* @throws Google_Service_Exception
|
|
||||||
* @param Google_Http_Request $response The http response to be decoded.
|
* @param Google_Http_Request $response The http response to be decoded.
|
||||||
* @return mixed|null
|
* @return mixed|null
|
||||||
|
* @throws Google_Service_Exception
|
||||||
*/
|
*/
|
||||||
public static function decodeHttpResponse($response)
|
public static function decodeHttpResponse($response) {
|
||||||
{
|
|
||||||
$code = $response->getResponseHttpCode();
|
$code = $response->getResponseHttpCode();
|
||||||
$body = $response->getResponseBody();
|
$body = $response->getResponseBody();
|
||||||
$decoded = null;
|
$decoded = null;
|
||||||
|
@ -103,8 +100,7 @@ class Google_Http_REST
|
||||||
* @param array $params
|
* @param array $params
|
||||||
* @return string $requestUrl
|
* @return string $requestUrl
|
||||||
*/
|
*/
|
||||||
public static function createRequestUri($servicePath, $restPath, $params)
|
public static function createRequestUri($servicePath, $restPath, $params) {
|
||||||
{
|
|
||||||
$requestUrl = $servicePath . $restPath;
|
$requestUrl = $servicePath . $restPath;
|
||||||
$uriTemplateVars = array();
|
$uriTemplateVars = array();
|
||||||
$queryVars = array();
|
$queryVars = array();
|
||||||
|
|
|
@ -25,8 +25,7 @@ require_once 'Google/Utils.php';
|
||||||
* @author Chirag Shah <chirags@google.com>
|
* @author Chirag Shah <chirags@google.com>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class Google_Http_Request
|
class Google_Http_Request {
|
||||||
{
|
|
||||||
const GZIP_UA = " (gzip)";
|
const GZIP_UA = " (gzip)";
|
||||||
|
|
||||||
private $batchHeaders = array(
|
private $batchHeaders = array(
|
||||||
|
@ -69,8 +68,7 @@ class Google_Http_Request
|
||||||
* used by the OAuth signing class to calculate the base string
|
* used by the OAuth signing class to calculate the base string
|
||||||
* @return string The base url component of the $url.
|
* @return string The base url component of the $url.
|
||||||
*/
|
*/
|
||||||
public function getBaseComponent()
|
public function getBaseComponent() {
|
||||||
{
|
|
||||||
return $this->baseComponent;
|
return $this->baseComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,16 +76,14 @@ class Google_Http_Request
|
||||||
* Set the base URL that path and query parameters will be added to.
|
* Set the base URL that path and query parameters will be added to.
|
||||||
* @param $baseComponent string
|
* @param $baseComponent string
|
||||||
*/
|
*/
|
||||||
public function setBaseComponent($baseComponent)
|
public function setBaseComponent($baseComponent) {
|
||||||
{
|
|
||||||
$this->baseComponent = $baseComponent;
|
$this->baseComponent = $baseComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable support for gzipped responses with this request.
|
* Enable support for gzipped responses with this request.
|
||||||
*/
|
*/
|
||||||
public function enableGzip()
|
public function enableGzip() {
|
||||||
{
|
|
||||||
$this->setRequestHeaders(array("Accept-Encoding" => "gzip"));
|
$this->setRequestHeaders(array("Accept-Encoding" => "gzip"));
|
||||||
$this->canGzip = true;
|
$this->canGzip = true;
|
||||||
$this->setUserAgent($this->userAgent);
|
$this->setUserAgent($this->userAgent);
|
||||||
|
@ -96,8 +92,7 @@ class Google_Http_Request
|
||||||
/**
|
/**
|
||||||
* Disable support for gzip responses with this request.
|
* Disable support for gzip responses with this request.
|
||||||
*/
|
*/
|
||||||
public function disableGzip()
|
public function disableGzip() {
|
||||||
{
|
|
||||||
if (
|
if (
|
||||||
isset($this->requestHeaders['accept-encoding']) &&
|
isset($this->requestHeaders['accept-encoding']) &&
|
||||||
$this->requestHeaders['accept-encoding'] == "gzip"
|
$this->requestHeaders['accept-encoding'] == "gzip"
|
||||||
|
@ -112,8 +107,7 @@ class Google_Http_Request
|
||||||
* Can this request accept a gzip response?
|
* Can this request accept a gzip response?
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function canGzip()
|
public function canGzip() {
|
||||||
{
|
|
||||||
return $this->canGzip;
|
return $this->canGzip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,8 +116,7 @@ class Google_Http_Request
|
||||||
* url used by the OAuth signing class to calculate the signature
|
* url used by the OAuth signing class to calculate the signature
|
||||||
* @return array Query parameters in the query string.
|
* @return array Query parameters in the query string.
|
||||||
*/
|
*/
|
||||||
public function getQueryParams()
|
public function getQueryParams() {
|
||||||
{
|
|
||||||
return $this->queryParams;
|
return $this->queryParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,40 +125,35 @@ class Google_Http_Request
|
||||||
* @param $key - string to set, does not need to be URL encoded
|
* @param $key - string to set, does not need to be URL encoded
|
||||||
* @param $value - string to set, does not need to be URL encoded
|
* @param $value - string to set, does not need to be URL encoded
|
||||||
*/
|
*/
|
||||||
public function setQueryParam($key, $value)
|
public function setQueryParam($key, $value) {
|
||||||
{
|
|
||||||
$this->queryParams[$key] = $value;
|
$this->queryParams[$key] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string HTTP Response Code.
|
* @return string HTTP Response Code.
|
||||||
*/
|
*/
|
||||||
public function getResponseHttpCode()
|
public function getResponseHttpCode() {
|
||||||
{
|
|
||||||
return (int)$this->responseHttpCode;
|
return (int)$this->responseHttpCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $responseHttpCode HTTP Response Code.
|
* @param int $responseHttpCode HTTP Response Code.
|
||||||
*/
|
*/
|
||||||
public function setResponseHttpCode($responseHttpCode)
|
public function setResponseHttpCode($responseHttpCode) {
|
||||||
{
|
|
||||||
$this->responseHttpCode = $responseHttpCode;
|
$this->responseHttpCode = $responseHttpCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return $responseHeaders (array) HTTP Response Headers.
|
* @return $responseHeaders (array) HTTP Response Headers.
|
||||||
*/
|
*/
|
||||||
public function getResponseHeaders()
|
public function getResponseHeaders() {
|
||||||
{
|
|
||||||
return $this->responseHeaders;
|
return $this->responseHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string HTTP Response Body
|
* @return string HTTP Response Body
|
||||||
*/
|
*/
|
||||||
public function getResponseBody()
|
public function getResponseBody() {
|
||||||
{
|
|
||||||
return $this->responseBody;
|
return $this->responseBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,8 +162,7 @@ class Google_Http_Request
|
||||||
*
|
*
|
||||||
* @param $class string the class name
|
* @param $class string the class name
|
||||||
*/
|
*/
|
||||||
public function setExpectedClass($class)
|
public function setExpectedClass($class) {
|
||||||
{
|
|
||||||
$this->expectedClass = $class;
|
$this->expectedClass = $class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,8 +170,7 @@ class Google_Http_Request
|
||||||
* Retrieve the expected class the response should expect.
|
* Retrieve the expected class the response should expect.
|
||||||
* @return string class name
|
* @return string class name
|
||||||
*/
|
*/
|
||||||
public function getExpectedClass()
|
public function getExpectedClass() {
|
||||||
{
|
|
||||||
return $this->expectedClass;
|
return $this->expectedClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,8 +178,7 @@ class Google_Http_Request
|
||||||
* @param array $headers The HTTP response headers
|
* @param array $headers The HTTP response headers
|
||||||
* to be normalized.
|
* to be normalized.
|
||||||
*/
|
*/
|
||||||
public function setResponseHeaders($headers)
|
public function setResponseHeaders($headers) {
|
||||||
{
|
|
||||||
$headers = Google_Utils::normalize($headers);
|
$headers = Google_Utils::normalize($headers);
|
||||||
if ($this->responseHeaders) {
|
if ($this->responseHeaders) {
|
||||||
$headers = array_merge($this->responseHeaders, $headers);
|
$headers = array_merge($this->responseHeaders, $headers);
|
||||||
|
@ -207,8 +192,7 @@ class Google_Http_Request
|
||||||
* @return array|boolean Returns the requested HTTP header or
|
* @return array|boolean Returns the requested HTTP header or
|
||||||
* false if unavailable.
|
* false if unavailable.
|
||||||
*/
|
*/
|
||||||
public function getResponseHeader($key)
|
public function getResponseHeader($key) {
|
||||||
{
|
|
||||||
return isset($this->responseHeaders[$key])
|
return isset($this->responseHeaders[$key])
|
||||||
? $this->responseHeaders[$key]
|
? $this->responseHeaders[$key]
|
||||||
: false;
|
: false;
|
||||||
|
@ -217,16 +201,14 @@ class Google_Http_Request
|
||||||
/**
|
/**
|
||||||
* @param string $responseBody The HTTP response body.
|
* @param string $responseBody The HTTP response body.
|
||||||
*/
|
*/
|
||||||
public function setResponseBody($responseBody)
|
public function setResponseBody($responseBody) {
|
||||||
{
|
|
||||||
$this->responseBody = $responseBody;
|
$this->responseBody = $responseBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string $url The request URL.
|
* @return string $url The request URL.
|
||||||
*/
|
*/
|
||||||
public function getUrl()
|
public function getUrl() {
|
||||||
{
|
|
||||||
return $this->baseComponent . $this->path .
|
return $this->baseComponent . $this->path .
|
||||||
(count($this->queryParams) ?
|
(count($this->queryParams) ?
|
||||||
"?" . $this->buildQuery($this->queryParams) :
|
"?" . $this->buildQuery($this->queryParams) :
|
||||||
|
@ -236,16 +218,14 @@ class Google_Http_Request
|
||||||
/**
|
/**
|
||||||
* @return string $method HTTP Request Method.
|
* @return string $method HTTP Request Method.
|
||||||
*/
|
*/
|
||||||
public function getRequestMethod()
|
public function getRequestMethod() {
|
||||||
{
|
|
||||||
return $this->requestMethod;
|
return $this->requestMethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array $headers HTTP Request Headers.
|
* @return array $headers HTTP Request Headers.
|
||||||
*/
|
*/
|
||||||
public function getRequestHeaders()
|
public function getRequestHeaders() {
|
||||||
{
|
|
||||||
return $this->requestHeaders;
|
return $this->requestHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,8 +234,7 @@ class Google_Http_Request
|
||||||
* @return array|boolean Returns the requested HTTP header or
|
* @return array|boolean Returns the requested HTTP header or
|
||||||
* false if unavailable.
|
* false if unavailable.
|
||||||
*/
|
*/
|
||||||
public function getRequestHeader($key)
|
public function getRequestHeader($key) {
|
||||||
{
|
|
||||||
return isset($this->requestHeaders[$key])
|
return isset($this->requestHeaders[$key])
|
||||||
? $this->requestHeaders[$key]
|
? $this->requestHeaders[$key]
|
||||||
: false;
|
: false;
|
||||||
|
@ -264,16 +243,14 @@ class Google_Http_Request
|
||||||
/**
|
/**
|
||||||
* @return string $postBody HTTP Request Body.
|
* @return string $postBody HTTP Request Body.
|
||||||
*/
|
*/
|
||||||
public function getPostBody()
|
public function getPostBody() {
|
||||||
{
|
|
||||||
return $this->postBody;
|
return $this->postBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $url the url to set
|
* @param string $url the url to set
|
||||||
*/
|
*/
|
||||||
public function setUrl($url)
|
public function setUrl($url) {
|
||||||
{
|
|
||||||
if (substr($url, 0, 4) != 'http') {
|
if (substr($url, 0, 4) != 'http') {
|
||||||
// Force the path become relative.
|
// Force the path become relative.
|
||||||
if (substr($url, 0, 1) !== '/') {
|
if (substr($url, 0, 1) !== '/') {
|
||||||
|
@ -301,8 +278,7 @@ class Google_Http_Request
|
||||||
* it to upper-case, as required by HTTP.
|
* it to upper-case, as required by HTTP.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function setRequestMethod($method)
|
public function setRequestMethod($method) {
|
||||||
{
|
|
||||||
$this->requestMethod = strtoupper($method);
|
$this->requestMethod = strtoupper($method);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,8 +286,7 @@ class Google_Http_Request
|
||||||
* @param array $headers The HTTP request headers
|
* @param array $headers The HTTP request headers
|
||||||
* to be set and normalized.
|
* to be set and normalized.
|
||||||
*/
|
*/
|
||||||
public function setRequestHeaders($headers)
|
public function setRequestHeaders($headers) {
|
||||||
{
|
|
||||||
$headers = Google_Utils::normalize($headers);
|
$headers = Google_Utils::normalize($headers);
|
||||||
if ($this->requestHeaders) {
|
if ($this->requestHeaders) {
|
||||||
$headers = array_merge($this->requestHeaders, $headers);
|
$headers = array_merge($this->requestHeaders, $headers);
|
||||||
|
@ -322,8 +297,7 @@ class Google_Http_Request
|
||||||
/**
|
/**
|
||||||
* @param string $postBody the postBody to set
|
* @param string $postBody the postBody to set
|
||||||
*/
|
*/
|
||||||
public function setPostBody($postBody)
|
public function setPostBody($postBody) {
|
||||||
{
|
|
||||||
$this->postBody = $postBody;
|
$this->postBody = $postBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -331,8 +305,7 @@ class Google_Http_Request
|
||||||
* Set the User-Agent Header.
|
* Set the User-Agent Header.
|
||||||
* @param string $userAgent The User-Agent.
|
* @param string $userAgent The User-Agent.
|
||||||
*/
|
*/
|
||||||
public function setUserAgent($userAgent)
|
public function setUserAgent($userAgent) {
|
||||||
{
|
|
||||||
$this->userAgent = $userAgent;
|
$this->userAgent = $userAgent;
|
||||||
if ($this->canGzip) {
|
if ($this->canGzip) {
|
||||||
$this->userAgent = $userAgent . self::GZIP_UA;
|
$this->userAgent = $userAgent . self::GZIP_UA;
|
||||||
|
@ -342,8 +315,7 @@ class Google_Http_Request
|
||||||
/**
|
/**
|
||||||
* @return string The User-Agent.
|
* @return string The User-Agent.
|
||||||
*/
|
*/
|
||||||
public function getUserAgent()
|
public function getUserAgent() {
|
||||||
{
|
|
||||||
return $this->userAgent;
|
return $this->userAgent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,8 +325,7 @@ class Google_Http_Request
|
||||||
* cache key unique per authenticated user, else use the plain request url
|
* cache key unique per authenticated user, else use the plain request url
|
||||||
* @return string The md5 hash of the request cache key.
|
* @return string The md5 hash of the request cache key.
|
||||||
*/
|
*/
|
||||||
public function getCacheKey()
|
public function getCacheKey() {
|
||||||
{
|
|
||||||
$key = $this->getUrl();
|
$key = $this->getUrl();
|
||||||
|
|
||||||
if (isset($this->accessKey)) {
|
if (isset($this->accessKey)) {
|
||||||
|
@ -368,8 +339,7 @@ class Google_Http_Request
|
||||||
return md5($key);
|
return md5($key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getParsedCacheControl()
|
public function getParsedCacheControl() {
|
||||||
{
|
|
||||||
$parsed = array();
|
$parsed = array();
|
||||||
$rawCacheControl = $this->getResponseHeader('cache-control');
|
$rawCacheControl = $this->getResponseHeader('cache-control');
|
||||||
if ($rawCacheControl) {
|
if ($rawCacheControl) {
|
||||||
|
@ -384,8 +354,7 @@ class Google_Http_Request
|
||||||
* @param string $id
|
* @param string $id
|
||||||
* @return string A string representation of the HTTP Request.
|
* @return string A string representation of the HTTP Request.
|
||||||
*/
|
*/
|
||||||
public function toBatchString($id)
|
public function toBatchString($id) {
|
||||||
{
|
|
||||||
$str = '';
|
$str = '';
|
||||||
$path = parse_url($this->getUrl(), PHP_URL_PATH) . "?" .
|
$path = parse_url($this->getUrl(), PHP_URL_PATH) . "?" .
|
||||||
http_build_query($this->queryParams);
|
http_build_query($this->queryParams);
|
||||||
|
@ -416,8 +385,7 @@ class Google_Http_Request
|
||||||
* with the same name.
|
* with the same name.
|
||||||
* @param $string - the query string to parse
|
* @param $string - the query string to parse
|
||||||
*/
|
*/
|
||||||
private function parseQuery($string)
|
private function parseQuery($string) {
|
||||||
{
|
|
||||||
$return = array();
|
$return = array();
|
||||||
$parts = explode("&", $string);
|
$parts = explode("&", $string);
|
||||||
foreach ($parts as $part) {
|
foreach ($parts as $part) {
|
||||||
|
@ -440,8 +408,7 @@ class Google_Http_Request
|
||||||
* duplicate keys.
|
* duplicate keys.
|
||||||
* @param $parts array of key value pairs
|
* @param $parts array of key value pairs
|
||||||
*/
|
*/
|
||||||
private function buildQuery($parts)
|
private function buildQuery($parts) {
|
||||||
{
|
|
||||||
$return = array();
|
$return = array();
|
||||||
foreach ($parts as $key => $value) {
|
foreach ($parts as $key => $value) {
|
||||||
if (is_array($value)) {
|
if (is_array($value)) {
|
||||||
|
@ -460,8 +427,7 @@ class Google_Http_Request
|
||||||
* parameters in there, which avoids length issues with longer query
|
* parameters in there, which avoids length issues with longer query
|
||||||
* params.
|
* params.
|
||||||
*/
|
*/
|
||||||
public function maybeMoveParametersToBody()
|
public function maybeMoveParametersToBody() {
|
||||||
{
|
|
||||||
if ($this->getRequestMethod() == "POST" && empty($this->postBody)) {
|
if ($this->getRequestMethod() == "POST" && empty($this->postBody)) {
|
||||||
$this->setRequestHeaders(
|
$this->setRequestHeaders(
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -24,8 +24,7 @@ require_once 'Google/IO/Exception.php';
|
||||||
require_once 'Google/Http/CacheParser.php';
|
require_once 'Google/Http/CacheParser.php';
|
||||||
require_once 'Google/Http/Request.php';
|
require_once 'Google/Http/Request.php';
|
||||||
|
|
||||||
abstract class Google_IO_Abstract
|
abstract class Google_IO_Abstract {
|
||||||
{
|
|
||||||
const UNKNOWN_CODE = 0;
|
const UNKNOWN_CODE = 0;
|
||||||
const FORM_URLENCODED = 'application/x-www-form-urlencoded';
|
const FORM_URLENCODED = 'application/x-www-form-urlencoded';
|
||||||
private static $CONNECTION_ESTABLISHED_HEADERS = array(
|
private static $CONNECTION_ESTABLISHED_HEADERS = array(
|
||||||
|
@ -37,8 +36,7 @@ abstract class Google_IO_Abstract
|
||||||
/** @var Google_Client */
|
/** @var Google_Client */
|
||||||
protected $client;
|
protected $client;
|
||||||
|
|
||||||
public function __construct(Google_Client $client)
|
public function __construct(Google_Client $client) {
|
||||||
{
|
|
||||||
$this->client = $client;
|
$this->client = $client;
|
||||||
$timeout = $client->getClassConfig('Google_IO_Abstract', 'request_timeout_seconds');
|
$timeout = $client->getClassConfig('Google_IO_Abstract', 'request_timeout_seconds');
|
||||||
if ($timeout > 0) {
|
if ($timeout > 0) {
|
||||||
|
@ -89,8 +87,7 @@ abstract class Google_IO_Abstract
|
||||||
* @return bool Returns true if the insertion was successful.
|
* @return bool Returns true if the insertion was successful.
|
||||||
* Otherwise, return false.
|
* Otherwise, return false.
|
||||||
*/
|
*/
|
||||||
public function setCachedRequest(Google_Http_Request $request)
|
public function setCachedRequest(Google_Http_Request $request) {
|
||||||
{
|
|
||||||
// Determine if the request is cacheable.
|
// Determine if the request is cacheable.
|
||||||
if (Google_Http_CacheParser::isResponseCacheable($request)) {
|
if (Google_Http_CacheParser::isResponseCacheable($request)) {
|
||||||
$this->client->getCache()->set($request->getCacheKey(), $request);
|
$this->client->getCache()->set($request->getCacheKey(), $request);
|
||||||
|
@ -108,8 +105,7 @@ abstract class Google_IO_Abstract
|
||||||
* response headers and response body filled in
|
* response headers and response body filled in
|
||||||
* @throws Google_IO_Exception on curl or IO error
|
* @throws Google_IO_Exception on curl or IO error
|
||||||
*/
|
*/
|
||||||
public function makeRequest(Google_Http_Request $request)
|
public function makeRequest(Google_Http_Request $request) {
|
||||||
{
|
|
||||||
// First, check to see if we have a valid cached version.
|
// First, check to see if we have a valid cached version.
|
||||||
$cached = $this->getCachedRequest($request);
|
$cached = $this->getCachedRequest($request);
|
||||||
if ($cached !== false && $cached instanceof Google_Http_Request) {
|
if ($cached !== false && $cached instanceof Google_Http_Request) {
|
||||||
|
@ -149,8 +145,7 @@ abstract class Google_IO_Abstract
|
||||||
* @return Google_Http_Request|bool Returns the cached object or
|
* @return Google_Http_Request|bool Returns the cached object or
|
||||||
* false if the operation was unsuccessful.
|
* false if the operation was unsuccessful.
|
||||||
*/
|
*/
|
||||||
public function getCachedRequest(Google_Http_Request $request)
|
public function getCachedRequest(Google_Http_Request $request) {
|
||||||
{
|
|
||||||
if (false === Google_Http_CacheParser::isRequestCacheable($request)) {
|
if (false === Google_Http_CacheParser::isRequestCacheable($request)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -164,8 +159,7 @@ abstract class Google_IO_Abstract
|
||||||
* @param Google_Http_Request $request
|
* @param Google_Http_Request $request
|
||||||
* @return Google_Http_Request Processed request with the enclosed entity.
|
* @return Google_Http_Request Processed request with the enclosed entity.
|
||||||
*/
|
*/
|
||||||
public function processEntityRequest(Google_Http_Request $request)
|
public function processEntityRequest(Google_Http_Request $request) {
|
||||||
{
|
|
||||||
$postBody = $request->getPostBody();
|
$postBody = $request->getPostBody();
|
||||||
$contentType = $request->getRequestHeader("content-type");
|
$contentType = $request->getRequestHeader("content-type");
|
||||||
|
|
||||||
|
@ -198,8 +192,7 @@ abstract class Google_IO_Abstract
|
||||||
* return bool If the cached object needs to be revalidated, false if it is
|
* return bool If the cached object needs to be revalidated, false if it is
|
||||||
* still current and can be re-used.
|
* still current and can be re-used.
|
||||||
*/
|
*/
|
||||||
protected function checkMustRevalidateCachedRequest($cached, $request)
|
protected function checkMustRevalidateCachedRequest($cached, $request) {
|
||||||
{
|
|
||||||
if (Google_Http_CacheParser::mustRevalidate($cached)) {
|
if (Google_Http_CacheParser::mustRevalidate($cached)) {
|
||||||
$addHeaders = array();
|
$addHeaders = array();
|
||||||
if ($cached->getResponseHeader('etag')) {
|
if ($cached->getResponseHeader('etag')) {
|
||||||
|
@ -222,8 +215,7 @@ abstract class Google_IO_Abstract
|
||||||
* @param Google_HttpRequest $cached A previously cached response.
|
* @param Google_HttpRequest $cached A previously cached response.
|
||||||
* @param mixed Associative array of response headers from the last request.
|
* @param mixed Associative array of response headers from the last request.
|
||||||
*/
|
*/
|
||||||
protected function updateCachedRequest($cached, $responseHeaders)
|
protected function updateCachedRequest($cached, $responseHeaders) {
|
||||||
{
|
|
||||||
if (isset($responseHeaders['connection'])) {
|
if (isset($responseHeaders['connection'])) {
|
||||||
$hopByHop = array_merge(
|
$hopByHop = array_merge(
|
||||||
self::$HOP_BY_HOP,
|
self::$HOP_BY_HOP,
|
||||||
|
@ -250,8 +242,7 @@ abstract class Google_IO_Abstract
|
||||||
* @param $headerSize
|
* @param $headerSize
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function parseHttpResponse($respData, $headerSize)
|
public function parseHttpResponse($respData, $headerSize) {
|
||||||
{
|
|
||||||
// check proxy header
|
// check proxy header
|
||||||
foreach (self::$CONNECTION_ESTABLISHED_HEADERS as $established_header) {
|
foreach (self::$CONNECTION_ESTABLISHED_HEADERS as $established_header) {
|
||||||
if (stripos($respData, $established_header) !== false) {
|
if (stripos($respData, $established_header) !== false) {
|
||||||
|
@ -283,8 +274,7 @@ abstract class Google_IO_Abstract
|
||||||
* @param rawHeaders array or string
|
* @param rawHeaders array or string
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getHttpResponseHeaders($rawHeaders)
|
public function getHttpResponseHeaders($rawHeaders) {
|
||||||
{
|
|
||||||
if (is_array($rawHeaders)) {
|
if (is_array($rawHeaders)) {
|
||||||
return $this->parseArrayHeaders($rawHeaders);
|
return $this->parseArrayHeaders($rawHeaders);
|
||||||
} else {
|
} else {
|
||||||
|
@ -292,8 +282,7 @@ abstract class Google_IO_Abstract
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function parseStringHeaders($rawHeaders)
|
private function parseStringHeaders($rawHeaders) {
|
||||||
{
|
|
||||||
$headers = array();
|
$headers = array();
|
||||||
$responseHeaderLines = explode("\r\n", $rawHeaders);
|
$responseHeaderLines = explode("\r\n", $rawHeaders);
|
||||||
foreach ($responseHeaderLines as $headerLine) {
|
foreach ($responseHeaderLines as $headerLine) {
|
||||||
|
@ -310,8 +299,7 @@ abstract class Google_IO_Abstract
|
||||||
return $headers;
|
return $headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function parseArrayHeaders($rawHeaders)
|
private function parseArrayHeaders($rawHeaders) {
|
||||||
{
|
|
||||||
$header_count = count($rawHeaders);
|
$header_count = count($rawHeaders);
|
||||||
$headers = array();
|
$headers = array();
|
||||||
|
|
||||||
|
|
|
@ -23,12 +23,12 @@
|
||||||
|
|
||||||
require_once 'Google/IO/Abstract.php';
|
require_once 'Google/IO/Abstract.php';
|
||||||
|
|
||||||
class Google_IO_Curl extends Google_IO_Abstract
|
class Google_IO_Curl extends Google_IO_Abstract {
|
||||||
{
|
|
||||||
// cURL hex representation of version 7.30.0
|
// cURL hex representation of version 7.30.0
|
||||||
const NO_QUIRK_VERSION = 0x071E00;
|
const NO_QUIRK_VERSION = 0x071E00;
|
||||||
|
|
||||||
private $options = array();
|
private $options = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute an HTTP Request
|
* Execute an HTTP Request
|
||||||
*
|
*
|
||||||
|
@ -37,8 +37,7 @@ class Google_IO_Curl extends Google_IO_Abstract
|
||||||
* response headers and response body filled in
|
* response headers and response body filled in
|
||||||
* @throws Google_IO_Exception on curl or IO error
|
* @throws Google_IO_Exception on curl or IO error
|
||||||
*/
|
*/
|
||||||
public function executeRequest(Google_Http_Request $request)
|
public function executeRequest(Google_Http_Request $request) {
|
||||||
{
|
|
||||||
$curl = curl_init();
|
$curl = curl_init();
|
||||||
|
|
||||||
if ($request->getPostBody()) {
|
if ($request->getPostBody()) {
|
||||||
|
@ -93,8 +92,7 @@ class Google_IO_Curl extends Google_IO_Abstract
|
||||||
* Set options that update the transport implementation's behavior.
|
* Set options that update the transport implementation's behavior.
|
||||||
* @param $options
|
* @param $options
|
||||||
*/
|
*/
|
||||||
public function setOptions($options)
|
public function setOptions($options) {
|
||||||
{
|
|
||||||
$this->options = $options + $this->options;
|
$this->options = $options + $this->options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,8 +100,7 @@ class Google_IO_Curl extends Google_IO_Abstract
|
||||||
* Set the maximum request time in seconds.
|
* Set the maximum request time in seconds.
|
||||||
* @param $timeout in seconds
|
* @param $timeout in seconds
|
||||||
*/
|
*/
|
||||||
public function setTimeout($timeout)
|
public function setTimeout($timeout) {
|
||||||
{
|
|
||||||
// Since this timeout is really for putting a bound on the time
|
// Since this timeout is really for putting a bound on the time
|
||||||
// we'll set them both to the same. If you need to specify a longer
|
// we'll set them both to the same. If you need to specify a longer
|
||||||
// CURLOPT_TIMEOUT, or a tigher CONNECTTIMEOUT, the best thing to
|
// CURLOPT_TIMEOUT, or a tigher CONNECTTIMEOUT, the best thing to
|
||||||
|
@ -116,8 +113,7 @@ class Google_IO_Curl extends Google_IO_Abstract
|
||||||
* Get the maximum request time in seconds.
|
* Get the maximum request time in seconds.
|
||||||
* @return timeout in seconds
|
* @return timeout in seconds
|
||||||
*/
|
*/
|
||||||
public function getTimeout()
|
public function getTimeout() {
|
||||||
{
|
|
||||||
return $this->options[CURLOPT_TIMEOUT];
|
return $this->options[CURLOPT_TIMEOUT];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,8 +124,7 @@ class Google_IO_Curl extends Google_IO_Abstract
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
protected function needsQuirk()
|
protected function needsQuirk() {
|
||||||
{
|
|
||||||
$ver = curl_version();
|
$ver = curl_version();
|
||||||
$versionNum = $ver['version_number'];
|
$versionNum = $ver['version_number'];
|
||||||
return $versionNum < Google_IO_Curl::NO_QUIRK_VERSION;
|
return $versionNum < Google_IO_Curl::NO_QUIRK_VERSION;
|
||||||
|
|
|
@ -17,6 +17,5 @@
|
||||||
|
|
||||||
require_once 'Google/Exception.php';
|
require_once 'Google/Exception.php';
|
||||||
|
|
||||||
class Google_IO_Exception extends Google_Exception
|
class Google_IO_Exception extends Google_Exception {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,7 @@
|
||||||
|
|
||||||
require_once 'Google/IO/Abstract.php';
|
require_once 'Google/IO/Abstract.php';
|
||||||
|
|
||||||
class Google_IO_Stream extends Google_IO_Abstract
|
class Google_IO_Stream extends Google_IO_Abstract {
|
||||||
{
|
|
||||||
const TIMEOUT = "timeout";
|
const TIMEOUT = "timeout";
|
||||||
const ZLIB = "compress.zlib://";
|
const ZLIB = "compress.zlib://";
|
||||||
private $options = array();
|
private $options = array();
|
||||||
|
@ -48,8 +47,7 @@ class Google_IO_Stream extends Google_IO_Abstract
|
||||||
* response headers and response body filled in
|
* response headers and response body filled in
|
||||||
* @throws Google_IO_Exception on curl or IO error
|
* @throws Google_IO_Exception on curl or IO error
|
||||||
*/
|
*/
|
||||||
public function executeRequest(Google_Http_Request $request)
|
public function executeRequest(Google_Http_Request $request) {
|
||||||
{
|
|
||||||
$default_options = stream_context_get_options(stream_context_get_default());
|
$default_options = stream_context_get_options(stream_context_get_default());
|
||||||
|
|
||||||
$requestHttpContext = array_key_exists('http', $default_options) ?
|
$requestHttpContext = array_key_exists('http', $default_options) ?
|
||||||
|
@ -150,8 +148,7 @@ class Google_IO_Stream extends Google_IO_Abstract
|
||||||
* Set options that update the transport implementation's behavior.
|
* Set options that update the transport implementation's behavior.
|
||||||
* @param $options
|
* @param $options
|
||||||
*/
|
*/
|
||||||
public function setOptions($options)
|
public function setOptions($options) {
|
||||||
{
|
|
||||||
$this->options = $options + $this->options;
|
$this->options = $options + $this->options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,8 +156,7 @@ class Google_IO_Stream extends Google_IO_Abstract
|
||||||
* Method to handle errors, used for error handling around
|
* Method to handle errors, used for error handling around
|
||||||
* stream connection methods.
|
* stream connection methods.
|
||||||
*/
|
*/
|
||||||
public function trapError($errno, $errstr)
|
public function trapError($errno, $errstr) {
|
||||||
{
|
|
||||||
$this->trappedErrorNumber = $errno;
|
$this->trappedErrorNumber = $errno;
|
||||||
$this->trappedErrorString = $errstr;
|
$this->trappedErrorString = $errstr;
|
||||||
}
|
}
|
||||||
|
@ -169,8 +165,7 @@ class Google_IO_Stream extends Google_IO_Abstract
|
||||||
* Set the maximum request time in seconds.
|
* Set the maximum request time in seconds.
|
||||||
* @param $timeout in seconds
|
* @param $timeout in seconds
|
||||||
*/
|
*/
|
||||||
public function setTimeout($timeout)
|
public function setTimeout($timeout) {
|
||||||
{
|
|
||||||
$this->options[self::TIMEOUT] = $timeout;
|
$this->options[self::TIMEOUT] = $timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,8 +173,7 @@ class Google_IO_Stream extends Google_IO_Abstract
|
||||||
* Get the maximum request time in seconds.
|
* Get the maximum request time in seconds.
|
||||||
* @return timeout in seconds
|
* @return timeout in seconds
|
||||||
*/
|
*/
|
||||||
public function getTimeout()
|
public function getTimeout() {
|
||||||
{
|
|
||||||
return $this->options[self::TIMEOUT];
|
return $this->options[self::TIMEOUT];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,13 +184,11 @@ class Google_IO_Stream extends Google_IO_Abstract
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
protected function needsQuirk()
|
protected function needsQuirk() {
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getHttpResponseCode($response_headers)
|
protected function getHttpResponseCode($response_headers) {
|
||||||
{
|
|
||||||
$header_count = count($response_headers);
|
$header_count = count($response_headers);
|
||||||
|
|
||||||
for ($i = 0; $i < $header_count; $i++) {
|
for ($i = 0; $i < $header_count; $i++) {
|
||||||
|
|
|
@ -23,8 +23,7 @@
|
||||||
* @author Chirag Shah <chirags@google.com>
|
* @author Chirag Shah <chirags@google.com>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class Google_Model implements ArrayAccess
|
class Google_Model implements ArrayAccess {
|
||||||
{
|
|
||||||
protected $modelData = array();
|
protected $modelData = array();
|
||||||
protected $processed = array();
|
protected $processed = array();
|
||||||
|
|
||||||
|
@ -32,8 +31,7 @@ class Google_Model implements ArrayAccess
|
||||||
* Polymorphic - accepts a variable number of arguments dependent
|
* Polymorphic - accepts a variable number of arguments dependent
|
||||||
* on the type of the model subclass.
|
* on the type of the model subclass.
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct() {
|
||||||
{
|
|
||||||
if (func_num_args() == 1 && is_array(func_get_arg(0))) {
|
if (func_num_args() == 1 && is_array(func_get_arg(0))) {
|
||||||
// Initialize the model with the array's contents.
|
// Initialize the model with the array's contents.
|
||||||
$array = func_get_arg(0);
|
$array = func_get_arg(0);
|
||||||
|
@ -41,8 +39,7 @@ class Google_Model implements ArrayAccess
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __get($key)
|
public function __get($key) {
|
||||||
{
|
|
||||||
$keyTypeName = $this->keyType($key);
|
$keyTypeName = $this->keyType($key);
|
||||||
$keyDataType = $this->dataType($key);
|
$keyDataType = $this->dataType($key);
|
||||||
if (isset($this->$keyTypeName) && !isset($this->processed[$key])) {
|
if (isset($this->$keyTypeName) && !isset($this->processed[$key])) {
|
||||||
|
@ -84,8 +81,7 @@ class Google_Model implements ArrayAccess
|
||||||
* @param array $array Used to seed this object's properties.
|
* @param array $array Used to seed this object's properties.
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function mapTypes($array)
|
protected function mapTypes($array) {
|
||||||
{
|
|
||||||
// Hard initilise simple types, lazy load more complex ones.
|
// Hard initilise simple types, lazy load more complex ones.
|
||||||
foreach ($array as $key => $val) {
|
foreach ($array as $key => $val) {
|
||||||
if (!property_exists($this, $this->keyType($key)) &&
|
if (!property_exists($this, $this->keyType($key)) &&
|
||||||
|
@ -107,8 +103,7 @@ class Google_Model implements ArrayAccess
|
||||||
* due to the usage of reflection, but shouldn't be called
|
* due to the usage of reflection, but shouldn't be called
|
||||||
* a whole lot, and is the most straightforward way to filter.
|
* a whole lot, and is the most straightforward way to filter.
|
||||||
*/
|
*/
|
||||||
public function toSimpleObject()
|
public function toSimpleObject() {
|
||||||
{
|
|
||||||
$object = new stdClass();
|
$object = new stdClass();
|
||||||
|
|
||||||
// Process all other data.
|
// Process all other data.
|
||||||
|
@ -137,8 +132,7 @@ class Google_Model implements ArrayAccess
|
||||||
* Handle different types of values, primarily
|
* Handle different types of values, primarily
|
||||||
* other objects and map and array data types.
|
* other objects and map and array data types.
|
||||||
*/
|
*/
|
||||||
private function getSimpleValue($value)
|
private function getSimpleValue($value) {
|
||||||
{
|
|
||||||
if ($value instanceof Google_Model) {
|
if ($value instanceof Google_Model) {
|
||||||
return $value->toSimpleObject();
|
return $value->toSimpleObject();
|
||||||
} elseif (is_array($value)) {
|
} elseif (is_array($value)) {
|
||||||
|
@ -159,8 +153,7 @@ class Google_Model implements ArrayAccess
|
||||||
* @param array $array
|
* @param array $array
|
||||||
* @return bool True if the array is associative.
|
* @return bool True if the array is associative.
|
||||||
*/
|
*/
|
||||||
protected function isAssociativeArray($array)
|
protected function isAssociativeArray($array) {
|
||||||
{
|
|
||||||
if (!is_array($array)) {
|
if (!is_array($array)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -180,8 +173,7 @@ class Google_Model implements ArrayAccess
|
||||||
* @param $item
|
* @param $item
|
||||||
* @return object The object from the item.
|
* @return object The object from the item.
|
||||||
*/
|
*/
|
||||||
private function createObjectFromName($name, $item)
|
private function createObjectFromName($name, $item) {
|
||||||
{
|
|
||||||
$type = $this->$name;
|
$type = $this->$name;
|
||||||
return new $type($item);
|
return new $type($item);
|
||||||
}
|
}
|
||||||
|
@ -192,8 +184,7 @@ class Google_Model implements ArrayAccess
|
||||||
* @param array $obj Items that should be validated.
|
* @param array $obj Items that should be validated.
|
||||||
* @param string $method Method expecting an array as an argument.
|
* @param string $method Method expecting an array as an argument.
|
||||||
*/
|
*/
|
||||||
public function assertIsArray($obj, $method)
|
public function assertIsArray($obj, $method) {
|
||||||
{
|
|
||||||
if ($obj && !is_array($obj)) {
|
if ($obj && !is_array($obj)) {
|
||||||
throw new Google_Exception(
|
throw new Google_Exception(
|
||||||
"Incorrect parameter type passed to $method(). Expected an array."
|
"Incorrect parameter type passed to $method(). Expected an array."
|
||||||
|
@ -201,20 +192,17 @@ class Google_Model implements ArrayAccess
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetExists($offset)
|
public function offsetExists($offset) {
|
||||||
{
|
|
||||||
return isset($this->$offset) || isset($this->modelData[$offset]);
|
return isset($this->$offset) || isset($this->modelData[$offset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetGet($offset)
|
public function offsetGet($offset) {
|
||||||
{
|
|
||||||
return isset($this->$offset) ?
|
return isset($this->$offset) ?
|
||||||
$this->$offset :
|
$this->$offset :
|
||||||
$this->__get($offset);
|
$this->__get($offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetSet($offset, $value)
|
public function offsetSet($offset, $value) {
|
||||||
{
|
|
||||||
if (property_exists($this, $offset)) {
|
if (property_exists($this, $offset)) {
|
||||||
$this->$offset = $value;
|
$this->$offset = $value;
|
||||||
} else {
|
} else {
|
||||||
|
@ -223,28 +211,23 @@ class Google_Model implements ArrayAccess
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetUnset($offset)
|
public function offsetUnset($offset) {
|
||||||
{
|
|
||||||
unset($this->modelData[$offset]);
|
unset($this->modelData[$offset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function keyType($key)
|
protected function keyType($key) {
|
||||||
{
|
|
||||||
return $key . "Type";
|
return $key . "Type";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function dataType($key)
|
protected function dataType($key) {
|
||||||
{
|
|
||||||
return $key . "DataType";
|
return $key . "DataType";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __isset($key)
|
public function __isset($key) {
|
||||||
{
|
|
||||||
return isset($this->modelData[$key]);
|
return isset($this->modelData[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __unset($key)
|
public function __unset($key) {
|
||||||
{
|
|
||||||
unset($this->modelData[$key]);
|
unset($this->modelData[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,16 +15,14 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Google_Service
|
class Google_Service {
|
||||||
{
|
|
||||||
public $version;
|
public $version;
|
||||||
public $servicePath;
|
public $servicePath;
|
||||||
public $availableScopes;
|
public $availableScopes;
|
||||||
public $resource;
|
public $resource;
|
||||||
private $client;
|
private $client;
|
||||||
|
|
||||||
public function __construct(Google_Client $client)
|
public function __construct(Google_Client $client) {
|
||||||
{
|
|
||||||
$this->client = $client;
|
$this->client = $client;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,8 +30,7 @@ class Google_Service
|
||||||
* Return the associated Google_Client class.
|
* Return the associated Google_Client class.
|
||||||
* @return Google_Client
|
* @return Google_Client
|
||||||
*/
|
*/
|
||||||
public function getClient()
|
public function getClient() {
|
||||||
{
|
|
||||||
return $this->client;
|
return $this->client;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -29,8 +29,7 @@
|
||||||
*
|
*
|
||||||
* @author Google, Inc.
|
* @author Google, Inc.
|
||||||
*/
|
*/
|
||||||
class Google_Service_Admin extends Google_Service
|
class Google_Service_Admin extends Google_Service {
|
||||||
{
|
|
||||||
/** Manage email messages of users on your domain. */
|
/** Manage email messages of users on your domain. */
|
||||||
const EMAIL_MIGRATION = "https://www.googleapis.com/auth/email.migration";
|
const EMAIL_MIGRATION = "https://www.googleapis.com/auth/email.migration";
|
||||||
|
|
||||||
|
@ -42,8 +41,7 @@ class Google_Service_Admin extends Google_Service
|
||||||
*
|
*
|
||||||
* @param Google_Client $client
|
* @param Google_Client $client
|
||||||
*/
|
*/
|
||||||
public function __construct(Google_Client $client)
|
public function __construct(Google_Client $client) {
|
||||||
{
|
|
||||||
parent::__construct($client);
|
parent::__construct($client);
|
||||||
$this->servicePath = 'email/v2/users/';
|
$this->servicePath = 'email/v2/users/';
|
||||||
$this->version = 'email_migration_v2';
|
$this->version = 'email_migration_v2';
|
||||||
|
@ -81,8 +79,7 @@ class Google_Service_Admin extends Google_Service
|
||||||
* $mail = $adminService->mail;
|
* $mail = $adminService->mail;
|
||||||
* </code>
|
* </code>
|
||||||
*/
|
*/
|
||||||
class Google_Service_Admin_Mail_Resource extends Google_Service_Resource
|
class Google_Service_Admin_Mail_Resource extends Google_Service_Resource {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Insert Mail into Google's Gmail backends (mail.insert)
|
* Insert Mail into Google's Gmail backends (mail.insert)
|
||||||
|
@ -92,8 +89,7 @@ class Google_Service_Admin_Mail_Resource extends Google_Service_Resource
|
||||||
* @param Google_MailItem $postBody
|
* @param Google_MailItem $postBody
|
||||||
* @param array $optParams Optional parameters.
|
* @param array $optParams Optional parameters.
|
||||||
*/
|
*/
|
||||||
public function insert($userKey, Google_Service_Admin_MailItem $postBody, $optParams = array())
|
public function insert($userKey, Google_Service_Admin_MailItem $postBody, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('userKey' => $userKey, 'postBody' => $postBody);
|
$params = array('userKey' => $userKey, 'postBody' => $postBody);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('insert', array($params));
|
return $this->call('insert', array($params));
|
||||||
|
@ -101,10 +97,7 @@ class Google_Service_Admin_Mail_Resource extends Google_Service_Resource
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class Google_Service_Admin_MailItem extends Google_Collection {
|
||||||
|
|
||||||
class Google_Service_Admin_MailItem extends Google_Collection
|
|
||||||
{
|
|
||||||
public $isDeleted;
|
public $isDeleted;
|
||||||
public $isDraft;
|
public $isDraft;
|
||||||
public $isInbox;
|
public $isInbox;
|
||||||
|
@ -115,93 +108,75 @@ class Google_Service_Admin_MailItem extends Google_Collection
|
||||||
public $kind;
|
public $kind;
|
||||||
public $labels;
|
public $labels;
|
||||||
|
|
||||||
public function setIsDeleted($isDeleted)
|
public function setIsDeleted($isDeleted) {
|
||||||
{
|
|
||||||
$this->isDeleted = $isDeleted;
|
$this->isDeleted = $isDeleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIsDeleted()
|
public function getIsDeleted() {
|
||||||
{
|
|
||||||
return $this->isDeleted;
|
return $this->isDeleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setIsDraft($isDraft)
|
public function setIsDraft($isDraft) {
|
||||||
{
|
|
||||||
$this->isDraft = $isDraft;
|
$this->isDraft = $isDraft;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIsDraft()
|
public function getIsDraft() {
|
||||||
{
|
|
||||||
return $this->isDraft;
|
return $this->isDraft;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setIsInbox($isInbox)
|
public function setIsInbox($isInbox) {
|
||||||
{
|
|
||||||
$this->isInbox = $isInbox;
|
$this->isInbox = $isInbox;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIsInbox()
|
public function getIsInbox() {
|
||||||
{
|
|
||||||
return $this->isInbox;
|
return $this->isInbox;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setIsSent($isSent)
|
public function setIsSent($isSent) {
|
||||||
{
|
|
||||||
$this->isSent = $isSent;
|
$this->isSent = $isSent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIsSent()
|
public function getIsSent() {
|
||||||
{
|
|
||||||
return $this->isSent;
|
return $this->isSent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setIsStarred($isStarred)
|
public function setIsStarred($isStarred) {
|
||||||
{
|
|
||||||
$this->isStarred = $isStarred;
|
$this->isStarred = $isStarred;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIsStarred()
|
public function getIsStarred() {
|
||||||
{
|
|
||||||
return $this->isStarred;
|
return $this->isStarred;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setIsTrash($isTrash)
|
public function setIsTrash($isTrash) {
|
||||||
{
|
|
||||||
$this->isTrash = $isTrash;
|
$this->isTrash = $isTrash;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIsTrash()
|
public function getIsTrash() {
|
||||||
{
|
|
||||||
return $this->isTrash;
|
return $this->isTrash;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setIsUnread($isUnread)
|
public function setIsUnread($isUnread) {
|
||||||
{
|
|
||||||
$this->isUnread = $isUnread;
|
$this->isUnread = $isUnread;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIsUnread()
|
public function getIsUnread() {
|
||||||
{
|
|
||||||
return $this->isUnread;
|
return $this->isUnread;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setLabels($labels)
|
public function setLabels($labels) {
|
||||||
{
|
|
||||||
$this->labels = $labels;
|
$this->labels = $labels;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLabels()
|
public function getLabels() {
|
||||||
{
|
|
||||||
return $this->labels;
|
return $this->labels;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -29,8 +29,7 @@
|
||||||
*
|
*
|
||||||
* @author Google, Inc.
|
* @author Google, Inc.
|
||||||
*/
|
*/
|
||||||
class Google_Service_AppState extends Google_Service
|
class Google_Service_AppState extends Google_Service {
|
||||||
{
|
|
||||||
/** View and manage your data for this application. */
|
/** View and manage your data for this application. */
|
||||||
const APPSTATE = "https://www.googleapis.com/auth/appstate";
|
const APPSTATE = "https://www.googleapis.com/auth/appstate";
|
||||||
|
|
||||||
|
@ -42,8 +41,7 @@ class Google_Service_AppState extends Google_Service
|
||||||
*
|
*
|
||||||
* @param Google_Client $client
|
* @param Google_Client $client
|
||||||
*/
|
*/
|
||||||
public function __construct(Google_Client $client)
|
public function __construct(Google_Client $client) {
|
||||||
{
|
|
||||||
parent::__construct($client);
|
parent::__construct($client);
|
||||||
$this->servicePath = 'appstate/v1/';
|
$this->servicePath = 'appstate/v1/';
|
||||||
$this->version = 'v1';
|
$this->version = 'v1';
|
||||||
|
@ -128,8 +126,7 @@ class Google_Service_AppState extends Google_Service
|
||||||
* $states = $appstateService->states;
|
* $states = $appstateService->states;
|
||||||
* </code>
|
* </code>
|
||||||
*/
|
*/
|
||||||
class Google_Service_AppState_States_Resource extends Google_Service_Resource
|
class Google_Service_AppState_States_Resource extends Google_Service_Resource {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears (sets to empty) the data for the passed key if and only if the passed
|
* Clears (sets to empty) the data for the passed key if and only if the passed
|
||||||
|
@ -144,12 +141,12 @@ class Google_Service_AppState_States_Resource extends Google_Service_Resource
|
||||||
* The version of the data to be cleared. Version strings are returned by the server.
|
* The version of the data to be cleared. Version strings are returned by the server.
|
||||||
* @return Google_Service_AppState_WriteResult
|
* @return Google_Service_AppState_WriteResult
|
||||||
*/
|
*/
|
||||||
public function clear($stateKey, $optParams = array())
|
public function clear($stateKey, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('stateKey' => $stateKey);
|
$params = array('stateKey' => $stateKey);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('clear', array($params), "Google_Service_AppState_WriteResult");
|
return $this->call('clear', array($params), "Google_Service_AppState_WriteResult");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes a key and the data associated with it. The key is removed and no
|
* Deletes a key and the data associated with it. The key is removed and no
|
||||||
* longer counts against the key quota. Note that since this method is not safe
|
* longer counts against the key quota. Note that since this method is not safe
|
||||||
|
@ -161,12 +158,12 @@ class Google_Service_AppState_States_Resource extends Google_Service_Resource
|
||||||
* The key for the data to be retrieved.
|
* The key for the data to be retrieved.
|
||||||
* @param array $optParams Optional parameters.
|
* @param array $optParams Optional parameters.
|
||||||
*/
|
*/
|
||||||
public function delete($stateKey, $optParams = array())
|
public function delete($stateKey, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('stateKey' => $stateKey);
|
$params = array('stateKey' => $stateKey);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('delete', array($params));
|
return $this->call('delete', array($params));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the data corresponding to the passed key. If the key does not exist
|
* Retrieves the data corresponding to the passed key. If the key does not exist
|
||||||
* on the server, an HTTP 404 will be returned. (states.get)
|
* on the server, an HTTP 404 will be returned. (states.get)
|
||||||
|
@ -176,12 +173,12 @@ class Google_Service_AppState_States_Resource extends Google_Service_Resource
|
||||||
* @param array $optParams Optional parameters.
|
* @param array $optParams Optional parameters.
|
||||||
* @return Google_Service_AppState_GetResponse
|
* @return Google_Service_AppState_GetResponse
|
||||||
*/
|
*/
|
||||||
public function get($stateKey, $optParams = array())
|
public function get($stateKey, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('stateKey' => $stateKey);
|
$params = array('stateKey' => $stateKey);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('get', array($params), "Google_Service_AppState_GetResponse");
|
return $this->call('get', array($params), "Google_Service_AppState_GetResponse");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lists all the states keys, and optionally the state data. (states.listStates)
|
* Lists all the states keys, and optionally the state data. (states.listStates)
|
||||||
*
|
*
|
||||||
|
@ -191,12 +188,12 @@ class Google_Service_AppState_States_Resource extends Google_Service_Resource
|
||||||
* Whether to include the full data in addition to the version number
|
* Whether to include the full data in addition to the version number
|
||||||
* @return Google_Service_AppState_ListResponse
|
* @return Google_Service_AppState_ListResponse
|
||||||
*/
|
*/
|
||||||
public function listStates($optParams = array())
|
public function listStates($optParams = array()) {
|
||||||
{
|
|
||||||
$params = array();
|
$params = array();
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('list', array($params), "Google_Service_AppState_ListResponse");
|
return $this->call('list', array($params), "Google_Service_AppState_ListResponse");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the data associated with the input key if and only if the passed
|
* Update the data associated with the input key if and only if the passed
|
||||||
* version matches the currently stored version. This method is safe in the face
|
* version matches the currently stored version. This method is safe in the face
|
||||||
|
@ -213,8 +210,7 @@ class Google_Service_AppState_States_Resource extends Google_Service_Resource
|
||||||
* server for this key, the update will succeed irrespective of the value of this parameter.
|
* server for this key, the update will succeed irrespective of the value of this parameter.
|
||||||
* @return Google_Service_AppState_WriteResult
|
* @return Google_Service_AppState_WriteResult
|
||||||
*/
|
*/
|
||||||
public function update($stateKey, Google_Service_AppState_UpdateRequest $postBody, $optParams = array())
|
public function update($stateKey, Google_Service_AppState_UpdateRequest $postBody, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('stateKey' => $stateKey, 'postBody' => $postBody);
|
$params = array('stateKey' => $stateKey, 'postBody' => $postBody);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('update', array($params), "Google_Service_AppState_WriteResult");
|
return $this->call('update', array($params), "Google_Service_AppState_WriteResult");
|
||||||
|
@ -222,153 +218,123 @@ class Google_Service_AppState_States_Resource extends Google_Service_Resource
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class Google_Service_AppState_GetResponse extends Google_Model {
|
||||||
|
|
||||||
class Google_Service_AppState_GetResponse extends Google_Model
|
|
||||||
{
|
|
||||||
public $currentStateVersion;
|
public $currentStateVersion;
|
||||||
public $data;
|
public $data;
|
||||||
public $kind;
|
public $kind;
|
||||||
public $stateKey;
|
public $stateKey;
|
||||||
|
|
||||||
public function setCurrentStateVersion($currentStateVersion)
|
public function setCurrentStateVersion($currentStateVersion) {
|
||||||
{
|
|
||||||
$this->currentStateVersion = $currentStateVersion;
|
$this->currentStateVersion = $currentStateVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCurrentStateVersion()
|
public function getCurrentStateVersion() {
|
||||||
{
|
|
||||||
return $this->currentStateVersion;
|
return $this->currentStateVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setData($data)
|
public function setData($data) {
|
||||||
{
|
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getData()
|
public function getData() {
|
||||||
{
|
|
||||||
return $this->data;
|
return $this->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setStateKey($stateKey)
|
public function setStateKey($stateKey) {
|
||||||
{
|
|
||||||
$this->stateKey = $stateKey;
|
$this->stateKey = $stateKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getStateKey()
|
public function getStateKey() {
|
||||||
{
|
|
||||||
return $this->stateKey;
|
return $this->stateKey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_AppState_ListResponse extends Google_Collection
|
class Google_Service_AppState_ListResponse extends Google_Collection {
|
||||||
{
|
|
||||||
protected $itemsType = 'Google_Service_AppState_GetResponse';
|
protected $itemsType = 'Google_Service_AppState_GetResponse';
|
||||||
protected $itemsDataType = 'array';
|
protected $itemsDataType = 'array';
|
||||||
public $kind;
|
public $kind;
|
||||||
public $maximumKeyCount;
|
public $maximumKeyCount;
|
||||||
|
|
||||||
public function setItems($items)
|
public function setItems($items) {
|
||||||
{
|
|
||||||
$this->items = $items;
|
$this->items = $items;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getItems()
|
public function getItems() {
|
||||||
{
|
|
||||||
return $this->items;
|
return $this->items;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setMaximumKeyCount($maximumKeyCount)
|
public function setMaximumKeyCount($maximumKeyCount) {
|
||||||
{
|
|
||||||
$this->maximumKeyCount = $maximumKeyCount;
|
$this->maximumKeyCount = $maximumKeyCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMaximumKeyCount()
|
public function getMaximumKeyCount() {
|
||||||
{
|
|
||||||
return $this->maximumKeyCount;
|
return $this->maximumKeyCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_AppState_UpdateRequest extends Google_Model
|
class Google_Service_AppState_UpdateRequest extends Google_Model {
|
||||||
{
|
|
||||||
public $data;
|
public $data;
|
||||||
public $kind;
|
public $kind;
|
||||||
|
|
||||||
public function setData($data)
|
public function setData($data) {
|
||||||
{
|
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getData()
|
public function getData() {
|
||||||
{
|
|
||||||
return $this->data;
|
return $this->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_AppState_WriteResult extends Google_Model
|
class Google_Service_AppState_WriteResult extends Google_Model {
|
||||||
{
|
|
||||||
public $currentStateVersion;
|
public $currentStateVersion;
|
||||||
public $kind;
|
public $kind;
|
||||||
public $stateKey;
|
public $stateKey;
|
||||||
|
|
||||||
public function setCurrentStateVersion($currentStateVersion)
|
public function setCurrentStateVersion($currentStateVersion) {
|
||||||
{
|
|
||||||
$this->currentStateVersion = $currentStateVersion;
|
$this->currentStateVersion = $currentStateVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCurrentStateVersion()
|
public function getCurrentStateVersion() {
|
||||||
{
|
|
||||||
return $this->currentStateVersion;
|
return $this->currentStateVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setStateKey($stateKey)
|
public function setStateKey($stateKey) {
|
||||||
{
|
|
||||||
$this->stateKey = $stateKey;
|
$this->stateKey = $stateKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getStateKey()
|
public function getStateKey() {
|
||||||
{
|
|
||||||
return $this->stateKey;
|
return $this->stateKey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,7 @@
|
||||||
*
|
*
|
||||||
* @author Google, Inc.
|
* @author Google, Inc.
|
||||||
*/
|
*/
|
||||||
class Google_Service_Appsactivity extends Google_Service
|
class Google_Service_Appsactivity extends Google_Service {
|
||||||
{
|
|
||||||
/** View historical activity for Google services. */
|
/** View historical activity for Google services. */
|
||||||
const ACTIVITY = "https://www.googleapis.com/auth/activity";
|
const ACTIVITY = "https://www.googleapis.com/auth/activity";
|
||||||
/** View and manage the files and documents in your Google Drive. */
|
/** View and manage the files and documents in your Google Drive. */
|
||||||
|
@ -48,8 +47,7 @@ class Google_Service_Appsactivity extends Google_Service
|
||||||
*
|
*
|
||||||
* @param Google_Client $client
|
* @param Google_Client $client
|
||||||
*/
|
*/
|
||||||
public function __construct(Google_Client $client)
|
public function __construct(Google_Client $client) {
|
||||||
{
|
|
||||||
parent::__construct($client);
|
parent::__construct($client);
|
||||||
$this->servicePath = 'appsactivity/v1/';
|
$this->servicePath = 'appsactivity/v1/';
|
||||||
$this->version = 'v1';
|
$this->version = 'v1';
|
||||||
|
@ -110,8 +108,7 @@ class Google_Service_Appsactivity extends Google_Service
|
||||||
* $activities = $appsactivityService->activities;
|
* $activities = $appsactivityService->activities;
|
||||||
* </code>
|
* </code>
|
||||||
*/
|
*/
|
||||||
class Google_Service_Appsactivity_Activities_Resource extends Google_Service_Resource
|
class Google_Service_Appsactivity_Activities_Resource extends Google_Service_Resource {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of activities visible to the current logged in user. Visible
|
* Returns a list of activities visible to the current logged in user. Visible
|
||||||
|
@ -140,12 +137,11 @@ class Google_Service_Appsactivity_Activities_Resource extends Google_Service_Res
|
||||||
* Identifies the Drive item to return activities for.
|
* Identifies the Drive item to return activities for.
|
||||||
* @opt_param string source
|
* @opt_param string source
|
||||||
* The Google service from which to return activities. Possible values of source are:
|
* The Google service from which to return activities. Possible values of source are:
|
||||||
-
|
* -
|
||||||
* drive.google.com
|
* drive.google.com
|
||||||
* @return Google_Service_Appsactivity_ListActivitiesResponse
|
* @return Google_Service_Appsactivity_ListActivitiesResponse
|
||||||
*/
|
*/
|
||||||
public function listActivities($optParams = array())
|
public function listActivities($optParams = array()) {
|
||||||
{
|
|
||||||
$params = array();
|
$params = array();
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('list', array($params), "Google_Service_Appsactivity_ListActivitiesResponse");
|
return $this->call('list', array($params), "Google_Service_Appsactivity_ListActivitiesResponse");
|
||||||
|
@ -153,38 +149,30 @@ class Google_Service_Appsactivity_Activities_Resource extends Google_Service_Res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class Google_Service_Appsactivity_Activity extends Google_Collection {
|
||||||
|
|
||||||
class Google_Service_Appsactivity_Activity extends Google_Collection
|
|
||||||
{
|
|
||||||
protected $combinedEventType = 'Google_Service_Appsactivity_Event';
|
protected $combinedEventType = 'Google_Service_Appsactivity_Event';
|
||||||
protected $combinedEventDataType = '';
|
protected $combinedEventDataType = '';
|
||||||
protected $singleEventsType = 'Google_Service_Appsactivity_Event';
|
protected $singleEventsType = 'Google_Service_Appsactivity_Event';
|
||||||
protected $singleEventsDataType = 'array';
|
protected $singleEventsDataType = 'array';
|
||||||
|
|
||||||
public function setCombinedEvent(Google_Service_Appsactivity_Event $combinedEvent)
|
public function setCombinedEvent(Google_Service_Appsactivity_Event $combinedEvent) {
|
||||||
{
|
|
||||||
$this->combinedEvent = $combinedEvent;
|
$this->combinedEvent = $combinedEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCombinedEvent()
|
public function getCombinedEvent() {
|
||||||
{
|
|
||||||
return $this->combinedEvent;
|
return $this->combinedEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setSingleEvents($singleEvents)
|
public function setSingleEvents($singleEvents) {
|
||||||
{
|
|
||||||
$this->singleEvents = $singleEvents;
|
$this->singleEvents = $singleEvents;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSingleEvents()
|
public function getSingleEvents() {
|
||||||
{
|
|
||||||
return $this->singleEvents;
|
return $this->singleEvents;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Appsactivity_Event extends Google_Collection
|
class Google_Service_Appsactivity_Event extends Google_Collection {
|
||||||
{
|
|
||||||
public $additionalEventTypes;
|
public $additionalEventTypes;
|
||||||
public $eventTimeMillis;
|
public $eventTimeMillis;
|
||||||
public $fromUserDeletion;
|
public $fromUserDeletion;
|
||||||
|
@ -200,191 +188,155 @@ class Google_Service_Appsactivity_Event extends Google_Collection
|
||||||
protected $userType = 'Google_Service_Appsactivity_User';
|
protected $userType = 'Google_Service_Appsactivity_User';
|
||||||
protected $userDataType = '';
|
protected $userDataType = '';
|
||||||
|
|
||||||
public function setAdditionalEventTypes($additionalEventTypes)
|
public function setAdditionalEventTypes($additionalEventTypes) {
|
||||||
{
|
|
||||||
$this->additionalEventTypes = $additionalEventTypes;
|
$this->additionalEventTypes = $additionalEventTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAdditionalEventTypes()
|
public function getAdditionalEventTypes() {
|
||||||
{
|
|
||||||
return $this->additionalEventTypes;
|
return $this->additionalEventTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setEventTimeMillis($eventTimeMillis)
|
public function setEventTimeMillis($eventTimeMillis) {
|
||||||
{
|
|
||||||
$this->eventTimeMillis = $eventTimeMillis;
|
$this->eventTimeMillis = $eventTimeMillis;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEventTimeMillis()
|
public function getEventTimeMillis() {
|
||||||
{
|
|
||||||
return $this->eventTimeMillis;
|
return $this->eventTimeMillis;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setFromUserDeletion($fromUserDeletion)
|
public function setFromUserDeletion($fromUserDeletion) {
|
||||||
{
|
|
||||||
$this->fromUserDeletion = $fromUserDeletion;
|
$this->fromUserDeletion = $fromUserDeletion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFromUserDeletion()
|
public function getFromUserDeletion() {
|
||||||
{
|
|
||||||
return $this->fromUserDeletion;
|
return $this->fromUserDeletion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setMove(Google_Service_Appsactivity_Move $move)
|
public function setMove(Google_Service_Appsactivity_Move $move) {
|
||||||
{
|
|
||||||
$this->move = $move;
|
$this->move = $move;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMove()
|
public function getMove() {
|
||||||
{
|
|
||||||
return $this->move;
|
return $this->move;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setPermissionChanges($permissionChanges)
|
public function setPermissionChanges($permissionChanges) {
|
||||||
{
|
|
||||||
$this->permissionChanges = $permissionChanges;
|
$this->permissionChanges = $permissionChanges;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPermissionChanges()
|
public function getPermissionChanges() {
|
||||||
{
|
|
||||||
return $this->permissionChanges;
|
return $this->permissionChanges;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setPrimaryEventType($primaryEventType)
|
public function setPrimaryEventType($primaryEventType) {
|
||||||
{
|
|
||||||
$this->primaryEventType = $primaryEventType;
|
$this->primaryEventType = $primaryEventType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPrimaryEventType()
|
public function getPrimaryEventType() {
|
||||||
{
|
|
||||||
return $this->primaryEventType;
|
return $this->primaryEventType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setRename(Google_Service_Appsactivity_Rename $rename)
|
public function setRename(Google_Service_Appsactivity_Rename $rename) {
|
||||||
{
|
|
||||||
$this->rename = $rename;
|
$this->rename = $rename;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRename()
|
public function getRename() {
|
||||||
{
|
|
||||||
return $this->rename;
|
return $this->rename;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTarget(Google_Service_Appsactivity_Target $target)
|
public function setTarget(Google_Service_Appsactivity_Target $target) {
|
||||||
{
|
|
||||||
$this->target = $target;
|
$this->target = $target;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTarget()
|
public function getTarget() {
|
||||||
{
|
|
||||||
return $this->target;
|
return $this->target;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUser(Google_Service_Appsactivity_User $user)
|
public function setUser(Google_Service_Appsactivity_User $user) {
|
||||||
{
|
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUser()
|
public function getUser() {
|
||||||
{
|
|
||||||
return $this->user;
|
return $this->user;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Appsactivity_ListActivitiesResponse extends Google_Collection
|
class Google_Service_Appsactivity_ListActivitiesResponse extends Google_Collection {
|
||||||
{
|
|
||||||
protected $activitiesType = 'Google_Service_Appsactivity_Activity';
|
protected $activitiesType = 'Google_Service_Appsactivity_Activity';
|
||||||
protected $activitiesDataType = 'array';
|
protected $activitiesDataType = 'array';
|
||||||
public $nextPageToken;
|
public $nextPageToken;
|
||||||
|
|
||||||
public function setActivities($activities)
|
public function setActivities($activities) {
|
||||||
{
|
|
||||||
$this->activities = $activities;
|
$this->activities = $activities;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getActivities()
|
public function getActivities() {
|
||||||
{
|
|
||||||
return $this->activities;
|
return $this->activities;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNextPageToken($nextPageToken)
|
public function setNextPageToken($nextPageToken) {
|
||||||
{
|
|
||||||
$this->nextPageToken = $nextPageToken;
|
$this->nextPageToken = $nextPageToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNextPageToken()
|
public function getNextPageToken() {
|
||||||
{
|
|
||||||
return $this->nextPageToken;
|
return $this->nextPageToken;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Appsactivity_Move extends Google_Collection
|
class Google_Service_Appsactivity_Move extends Google_Collection {
|
||||||
{
|
|
||||||
protected $addedParentsType = 'Google_Service_Appsactivity_Parent';
|
protected $addedParentsType = 'Google_Service_Appsactivity_Parent';
|
||||||
protected $addedParentsDataType = 'array';
|
protected $addedParentsDataType = 'array';
|
||||||
protected $removedParentsType = 'Google_Service_Appsactivity_Parent';
|
protected $removedParentsType = 'Google_Service_Appsactivity_Parent';
|
||||||
protected $removedParentsDataType = 'array';
|
protected $removedParentsDataType = 'array';
|
||||||
|
|
||||||
public function setAddedParents($addedParents)
|
public function setAddedParents($addedParents) {
|
||||||
{
|
|
||||||
$this->addedParents = $addedParents;
|
$this->addedParents = $addedParents;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAddedParents()
|
public function getAddedParents() {
|
||||||
{
|
|
||||||
return $this->addedParents;
|
return $this->addedParents;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setRemovedParents($removedParents)
|
public function setRemovedParents($removedParents) {
|
||||||
{
|
|
||||||
$this->removedParents = $removedParents;
|
$this->removedParents = $removedParents;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRemovedParents()
|
public function getRemovedParents() {
|
||||||
{
|
|
||||||
return $this->removedParents;
|
return $this->removedParents;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Appsactivity_Parent extends Google_Model
|
class Google_Service_Appsactivity_Parent extends Google_Model {
|
||||||
{
|
|
||||||
public $id;
|
public $id;
|
||||||
public $isRoot;
|
public $isRoot;
|
||||||
public $title;
|
public $title;
|
||||||
|
|
||||||
public function setId($id)
|
public function setId($id) {
|
||||||
{
|
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId()
|
public function getId() {
|
||||||
{
|
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setIsRoot($isRoot)
|
public function setIsRoot($isRoot) {
|
||||||
{
|
|
||||||
$this->isRoot = $isRoot;
|
$this->isRoot = $isRoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIsRoot()
|
public function getIsRoot() {
|
||||||
{
|
|
||||||
return $this->isRoot;
|
return $this->isRoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTitle($title)
|
public function setTitle($title) {
|
||||||
{
|
|
||||||
$this->title = $title;
|
$this->title = $title;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitle()
|
public function getTitle() {
|
||||||
{
|
|
||||||
return $this->title;
|
return $this->title;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Appsactivity_Permission extends Google_Model
|
class Google_Service_Appsactivity_Permission extends Google_Model {
|
||||||
{
|
|
||||||
public $name;
|
public $name;
|
||||||
public $permissionId;
|
public $permissionId;
|
||||||
public $role;
|
public $role;
|
||||||
|
@ -393,196 +345,159 @@ class Google_Service_Appsactivity_Permission extends Google_Model
|
||||||
protected $userDataType = '';
|
protected $userDataType = '';
|
||||||
public $withLink;
|
public $withLink;
|
||||||
|
|
||||||
public function setName($name)
|
public function setName($name) {
|
||||||
{
|
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName()
|
public function getName() {
|
||||||
{
|
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setPermissionId($permissionId)
|
public function setPermissionId($permissionId) {
|
||||||
{
|
|
||||||
$this->permissionId = $permissionId;
|
$this->permissionId = $permissionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPermissionId()
|
public function getPermissionId() {
|
||||||
{
|
|
||||||
return $this->permissionId;
|
return $this->permissionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setRole($role)
|
public function setRole($role) {
|
||||||
{
|
|
||||||
$this->role = $role;
|
$this->role = $role;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRole()
|
public function getRole() {
|
||||||
{
|
|
||||||
return $this->role;
|
return $this->role;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setType($type)
|
public function setType($type) {
|
||||||
{
|
|
||||||
$this->type = $type;
|
$this->type = $type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getType()
|
public function getType() {
|
||||||
{
|
|
||||||
return $this->type;
|
return $this->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUser(Google_Service_Appsactivity_User $user)
|
public function setUser(Google_Service_Appsactivity_User $user) {
|
||||||
{
|
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUser()
|
public function getUser() {
|
||||||
{
|
|
||||||
return $this->user;
|
return $this->user;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setWithLink($withLink)
|
public function setWithLink($withLink) {
|
||||||
{
|
|
||||||
$this->withLink = $withLink;
|
$this->withLink = $withLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getWithLink()
|
public function getWithLink() {
|
||||||
{
|
|
||||||
return $this->withLink;
|
return $this->withLink;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Appsactivity_PermissionChange extends Google_Collection
|
class Google_Service_Appsactivity_PermissionChange extends Google_Collection {
|
||||||
{
|
|
||||||
protected $addedPermissionsType = 'Google_Service_Appsactivity_Permission';
|
protected $addedPermissionsType = 'Google_Service_Appsactivity_Permission';
|
||||||
protected $addedPermissionsDataType = 'array';
|
protected $addedPermissionsDataType = 'array';
|
||||||
protected $removedPermissionsType = 'Google_Service_Appsactivity_Permission';
|
protected $removedPermissionsType = 'Google_Service_Appsactivity_Permission';
|
||||||
protected $removedPermissionsDataType = 'array';
|
protected $removedPermissionsDataType = 'array';
|
||||||
|
|
||||||
public function setAddedPermissions($addedPermissions)
|
public function setAddedPermissions($addedPermissions) {
|
||||||
{
|
|
||||||
$this->addedPermissions = $addedPermissions;
|
$this->addedPermissions = $addedPermissions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAddedPermissions()
|
public function getAddedPermissions() {
|
||||||
{
|
|
||||||
return $this->addedPermissions;
|
return $this->addedPermissions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setRemovedPermissions($removedPermissions)
|
public function setRemovedPermissions($removedPermissions) {
|
||||||
{
|
|
||||||
$this->removedPermissions = $removedPermissions;
|
$this->removedPermissions = $removedPermissions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRemovedPermissions()
|
public function getRemovedPermissions() {
|
||||||
{
|
|
||||||
return $this->removedPermissions;
|
return $this->removedPermissions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Appsactivity_Photo extends Google_Model
|
class Google_Service_Appsactivity_Photo extends Google_Model {
|
||||||
{
|
|
||||||
public $url;
|
public $url;
|
||||||
|
|
||||||
public function setUrl($url)
|
public function setUrl($url) {
|
||||||
{
|
|
||||||
$this->url = $url;
|
$this->url = $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUrl()
|
public function getUrl() {
|
||||||
{
|
|
||||||
return $this->url;
|
return $this->url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Appsactivity_Rename extends Google_Model
|
class Google_Service_Appsactivity_Rename extends Google_Model {
|
||||||
{
|
|
||||||
public $newTitle;
|
public $newTitle;
|
||||||
public $oldTitle;
|
public $oldTitle;
|
||||||
|
|
||||||
public function setNewTitle($newTitle)
|
public function setNewTitle($newTitle) {
|
||||||
{
|
|
||||||
$this->newTitle = $newTitle;
|
$this->newTitle = $newTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNewTitle()
|
public function getNewTitle() {
|
||||||
{
|
|
||||||
return $this->newTitle;
|
return $this->newTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setOldTitle($oldTitle)
|
public function setOldTitle($oldTitle) {
|
||||||
{
|
|
||||||
$this->oldTitle = $oldTitle;
|
$this->oldTitle = $oldTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOldTitle()
|
public function getOldTitle() {
|
||||||
{
|
|
||||||
return $this->oldTitle;
|
return $this->oldTitle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Appsactivity_Target extends Google_Model
|
class Google_Service_Appsactivity_Target extends Google_Model {
|
||||||
{
|
|
||||||
public $id;
|
public $id;
|
||||||
public $mimeType;
|
public $mimeType;
|
||||||
public $name;
|
public $name;
|
||||||
|
|
||||||
public function setId($id)
|
public function setId($id) {
|
||||||
{
|
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId()
|
public function getId() {
|
||||||
{
|
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setMimeType($mimeType)
|
public function setMimeType($mimeType) {
|
||||||
{
|
|
||||||
$this->mimeType = $mimeType;
|
$this->mimeType = $mimeType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMimeType()
|
public function getMimeType() {
|
||||||
{
|
|
||||||
return $this->mimeType;
|
return $this->mimeType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setName($name)
|
public function setName($name) {
|
||||||
{
|
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName()
|
public function getName() {
|
||||||
{
|
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Appsactivity_User extends Google_Model
|
class Google_Service_Appsactivity_User extends Google_Model {
|
||||||
{
|
|
||||||
public $name;
|
public $name;
|
||||||
protected $photoType = 'Google_Service_Appsactivity_Photo';
|
protected $photoType = 'Google_Service_Appsactivity_Photo';
|
||||||
protected $photoDataType = '';
|
protected $photoDataType = '';
|
||||||
|
|
||||||
public function setName($name)
|
public function setName($name) {
|
||||||
{
|
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName()
|
public function getName() {
|
||||||
{
|
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setPhoto(Google_Service_Appsactivity_Photo $photo)
|
public function setPhoto(Google_Service_Appsactivity_Photo $photo) {
|
||||||
{
|
|
||||||
$this->photo = $photo;
|
$this->photo = $photo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPhoto()
|
public function getPhoto() {
|
||||||
{
|
|
||||||
return $this->photo;
|
return $this->photo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,7 @@
|
||||||
*
|
*
|
||||||
* @author Google, Inc.
|
* @author Google, Inc.
|
||||||
*/
|
*/
|
||||||
class Google_Service_Audit extends Google_Service
|
class Google_Service_Audit extends Google_Service {
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
public $activities;
|
public $activities;
|
||||||
|
@ -41,8 +40,7 @@ class Google_Service_Audit extends Google_Service
|
||||||
*
|
*
|
||||||
* @param Google_Client $client
|
* @param Google_Client $client
|
||||||
*/
|
*/
|
||||||
public function __construct(Google_Client $client)
|
public function __construct(Google_Client $client) {
|
||||||
{
|
|
||||||
parent::__construct($client);
|
parent::__construct($client);
|
||||||
$this->servicePath = 'apps/reporting/audit/v1/';
|
$this->servicePath = 'apps/reporting/audit/v1/';
|
||||||
$this->version = 'v1';
|
$this->version = 'v1';
|
||||||
|
@ -121,8 +119,7 @@ class Google_Service_Audit extends Google_Service
|
||||||
* $activities = $auditService->activities;
|
* $activities = $auditService->activities;
|
||||||
* </code>
|
* </code>
|
||||||
*/
|
*/
|
||||||
class Google_Service_Audit_Activities_Resource extends Google_Service_Resource
|
class Google_Service_Audit_Activities_Resource extends Google_Service_Resource {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a list of activities for a specific customer and application.
|
* Retrieves a list of activities for a specific customer and application.
|
||||||
|
@ -155,8 +152,7 @@ class Google_Service_Audit_Activities_Resource extends Google_Service_Resource
|
||||||
* Next page URL.
|
* Next page URL.
|
||||||
* @return Google_Service_Audit_Activities
|
* @return Google_Service_Audit_Activities
|
||||||
*/
|
*/
|
||||||
public function listActivities($customerId, $applicationId, $optParams = array())
|
public function listActivities($customerId, $applicationId, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('customerId' => $customerId, 'applicationId' => $applicationId);
|
$params = array('customerId' => $customerId, 'applicationId' => $applicationId);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('list', array($params), "Google_Service_Audit_Activities");
|
return $this->call('list', array($params), "Google_Service_Audit_Activities");
|
||||||
|
@ -164,48 +160,38 @@ class Google_Service_Audit_Activities_Resource extends Google_Service_Resource
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class Google_Service_Audit_Activities extends Google_Collection {
|
||||||
|
|
||||||
class Google_Service_Audit_Activities extends Google_Collection
|
|
||||||
{
|
|
||||||
protected $itemsType = 'Google_Service_Audit_Activity';
|
protected $itemsType = 'Google_Service_Audit_Activity';
|
||||||
protected $itemsDataType = 'array';
|
protected $itemsDataType = 'array';
|
||||||
public $kind;
|
public $kind;
|
||||||
public $next;
|
public $next;
|
||||||
|
|
||||||
public function setItems($items)
|
public function setItems($items) {
|
||||||
{
|
|
||||||
$this->items = $items;
|
$this->items = $items;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getItems()
|
public function getItems() {
|
||||||
{
|
|
||||||
return $this->items;
|
return $this->items;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNext($next)
|
public function setNext($next) {
|
||||||
{
|
|
||||||
$this->next = $next;
|
$this->next = $next;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNext()
|
public function getNext() {
|
||||||
{
|
|
||||||
return $this->next;
|
return $this->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Audit_Activity extends Google_Collection
|
class Google_Service_Audit_Activity extends Google_Collection {
|
||||||
{
|
|
||||||
protected $actorType = 'Google_Service_Audit_ActivityActor';
|
protected $actorType = 'Google_Service_Audit_ActivityActor';
|
||||||
protected $actorDataType = '';
|
protected $actorDataType = '';
|
||||||
protected $eventsType = 'Google_Service_Audit_ActivityEvents';
|
protected $eventsType = 'Google_Service_Audit_ActivityEvents';
|
||||||
|
@ -216,223 +202,181 @@ class Google_Service_Audit_Activity extends Google_Collection
|
||||||
public $kind;
|
public $kind;
|
||||||
public $ownerDomain;
|
public $ownerDomain;
|
||||||
|
|
||||||
public function setActor(Google_Service_Audit_ActivityActor $actor)
|
public function setActor(Google_Service_Audit_ActivityActor $actor) {
|
||||||
{
|
|
||||||
$this->actor = $actor;
|
$this->actor = $actor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getActor()
|
public function getActor() {
|
||||||
{
|
|
||||||
return $this->actor;
|
return $this->actor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setEvents($events)
|
public function setEvents($events) {
|
||||||
{
|
|
||||||
$this->events = $events;
|
$this->events = $events;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEvents()
|
public function getEvents() {
|
||||||
{
|
|
||||||
return $this->events;
|
return $this->events;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setId(Google_Service_Audit_ActivityId $id)
|
public function setId(Google_Service_Audit_ActivityId $id) {
|
||||||
{
|
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId()
|
public function getId() {
|
||||||
{
|
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setIpAddress($ipAddress)
|
public function setIpAddress($ipAddress) {
|
||||||
{
|
|
||||||
$this->ipAddress = $ipAddress;
|
$this->ipAddress = $ipAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIpAddress()
|
public function getIpAddress() {
|
||||||
{
|
|
||||||
return $this->ipAddress;
|
return $this->ipAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setOwnerDomain($ownerDomain)
|
public function setOwnerDomain($ownerDomain) {
|
||||||
{
|
|
||||||
$this->ownerDomain = $ownerDomain;
|
$this->ownerDomain = $ownerDomain;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOwnerDomain()
|
public function getOwnerDomain() {
|
||||||
{
|
|
||||||
return $this->ownerDomain;
|
return $this->ownerDomain;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Audit_ActivityActor extends Google_Model
|
class Google_Service_Audit_ActivityActor extends Google_Model {
|
||||||
{
|
|
||||||
public $applicationId;
|
public $applicationId;
|
||||||
public $callerType;
|
public $callerType;
|
||||||
public $email;
|
public $email;
|
||||||
public $key;
|
public $key;
|
||||||
|
|
||||||
public function setApplicationId($applicationId)
|
public function setApplicationId($applicationId) {
|
||||||
{
|
|
||||||
$this->applicationId = $applicationId;
|
$this->applicationId = $applicationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getApplicationId()
|
public function getApplicationId() {
|
||||||
{
|
|
||||||
return $this->applicationId;
|
return $this->applicationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setCallerType($callerType)
|
public function setCallerType($callerType) {
|
||||||
{
|
|
||||||
$this->callerType = $callerType;
|
$this->callerType = $callerType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCallerType()
|
public function getCallerType() {
|
||||||
{
|
|
||||||
return $this->callerType;
|
return $this->callerType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setEmail($email)
|
public function setEmail($email) {
|
||||||
{
|
|
||||||
$this->email = $email;
|
$this->email = $email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEmail()
|
public function getEmail() {
|
||||||
{
|
|
||||||
return $this->email;
|
return $this->email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setKey($key)
|
public function setKey($key) {
|
||||||
{
|
|
||||||
$this->key = $key;
|
$this->key = $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKey()
|
public function getKey() {
|
||||||
{
|
|
||||||
return $this->key;
|
return $this->key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Audit_ActivityEvents extends Google_Collection
|
class Google_Service_Audit_ActivityEvents extends Google_Collection {
|
||||||
{
|
|
||||||
public $eventType;
|
public $eventType;
|
||||||
public $name;
|
public $name;
|
||||||
protected $parametersType = 'Google_Service_Audit_ActivityEventsParameters';
|
protected $parametersType = 'Google_Service_Audit_ActivityEventsParameters';
|
||||||
protected $parametersDataType = 'array';
|
protected $parametersDataType = 'array';
|
||||||
|
|
||||||
public function setEventType($eventType)
|
public function setEventType($eventType) {
|
||||||
{
|
|
||||||
$this->eventType = $eventType;
|
$this->eventType = $eventType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEventType()
|
public function getEventType() {
|
||||||
{
|
|
||||||
return $this->eventType;
|
return $this->eventType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setName($name)
|
public function setName($name) {
|
||||||
{
|
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName()
|
public function getName() {
|
||||||
{
|
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setParameters($parameters)
|
public function setParameters($parameters) {
|
||||||
{
|
|
||||||
$this->parameters = $parameters;
|
$this->parameters = $parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getParameters()
|
public function getParameters() {
|
||||||
{
|
|
||||||
return $this->parameters;
|
return $this->parameters;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Audit_ActivityEventsParameters extends Google_Model
|
class Google_Service_Audit_ActivityEventsParameters extends Google_Model {
|
||||||
{
|
|
||||||
public $name;
|
public $name;
|
||||||
public $value;
|
public $value;
|
||||||
|
|
||||||
public function setName($name)
|
public function setName($name) {
|
||||||
{
|
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName()
|
public function getName() {
|
||||||
{
|
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setValue($value)
|
public function setValue($value) {
|
||||||
{
|
|
||||||
$this->value = $value;
|
$this->value = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getValue()
|
public function getValue() {
|
||||||
{
|
|
||||||
return $this->value;
|
return $this->value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Audit_ActivityId extends Google_Model
|
class Google_Service_Audit_ActivityId extends Google_Model {
|
||||||
{
|
|
||||||
public $applicationId;
|
public $applicationId;
|
||||||
public $customerId;
|
public $customerId;
|
||||||
public $time;
|
public $time;
|
||||||
public $uniqQualifier;
|
public $uniqQualifier;
|
||||||
|
|
||||||
public function setApplicationId($applicationId)
|
public function setApplicationId($applicationId) {
|
||||||
{
|
|
||||||
$this->applicationId = $applicationId;
|
$this->applicationId = $applicationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getApplicationId()
|
public function getApplicationId() {
|
||||||
{
|
|
||||||
return $this->applicationId;
|
return $this->applicationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setCustomerId($customerId)
|
public function setCustomerId($customerId) {
|
||||||
{
|
|
||||||
$this->customerId = $customerId;
|
$this->customerId = $customerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCustomerId()
|
public function getCustomerId() {
|
||||||
{
|
|
||||||
return $this->customerId;
|
return $this->customerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTime($time)
|
public function setTime($time) {
|
||||||
{
|
|
||||||
$this->time = $time;
|
$this->time = $time;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTime()
|
public function getTime() {
|
||||||
{
|
|
||||||
return $this->time;
|
return $this->time;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUniqQualifier($uniqQualifier)
|
public function setUniqQualifier($uniqQualifier) {
|
||||||
{
|
|
||||||
$this->uniqQualifier = $uniqQualifier;
|
$this->uniqQualifier = $uniqQualifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUniqQualifier()
|
public function getUniqQualifier() {
|
||||||
{
|
|
||||||
return $this->uniqQualifier;
|
return $this->uniqQualifier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,7 @@
|
||||||
*
|
*
|
||||||
* @author Google, Inc.
|
* @author Google, Inc.
|
||||||
*/
|
*/
|
||||||
class Google_Service_Autoscaler extends Google_Service
|
class Google_Service_Autoscaler extends Google_Service {
|
||||||
{
|
|
||||||
/** View and manage your Google Compute Engine resources. */
|
/** View and manage your Google Compute Engine resources. */
|
||||||
const COMPUTE = "https://www.googleapis.com/auth/compute";
|
const COMPUTE = "https://www.googleapis.com/auth/compute";
|
||||||
/** View your Google Compute Engine resources. */
|
/** View your Google Compute Engine resources. */
|
||||||
|
@ -45,8 +44,7 @@ class Google_Service_Autoscaler extends Google_Service
|
||||||
*
|
*
|
||||||
* @param Google_Client $client
|
* @param Google_Client $client
|
||||||
*/
|
*/
|
||||||
public function __construct(Google_Client $client)
|
public function __construct(Google_Client $client) {
|
||||||
{
|
|
||||||
parent::__construct($client);
|
parent::__construct($client);
|
||||||
$this->servicePath = 'autoscaler/v1beta2/';
|
$this->servicePath = 'autoscaler/v1beta2/';
|
||||||
$this->version = 'v1beta2';
|
$this->version = 'v1beta2';
|
||||||
|
@ -273,8 +271,7 @@ class Google_Service_Autoscaler extends Google_Service
|
||||||
* $autoscalers = $autoscalerService->autoscalers;
|
* $autoscalers = $autoscalerService->autoscalers;
|
||||||
* </code>
|
* </code>
|
||||||
*/
|
*/
|
||||||
class Google_Service_Autoscaler_Autoscalers_Resource extends Google_Service_Resource
|
class Google_Service_Autoscaler_Autoscalers_Resource extends Google_Service_Resource {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes the specified Autoscaler resource. (autoscalers.delete)
|
* Deletes the specified Autoscaler resource. (autoscalers.delete)
|
||||||
|
@ -288,12 +285,12 @@ class Google_Service_Autoscaler_Autoscalers_Resource extends Google_Service_Reso
|
||||||
* @param array $optParams Optional parameters.
|
* @param array $optParams Optional parameters.
|
||||||
* @return Google_Service_Autoscaler_Operation
|
* @return Google_Service_Autoscaler_Operation
|
||||||
*/
|
*/
|
||||||
public function delete($project, $zone, $autoscaler, $optParams = array())
|
public function delete($project, $zone, $autoscaler, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'zone' => $zone, 'autoscaler' => $autoscaler);
|
$params = array('project' => $project, 'zone' => $zone, 'autoscaler' => $autoscaler);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('delete', array($params), "Google_Service_Autoscaler_Operation");
|
return $this->call('delete', array($params), "Google_Service_Autoscaler_Operation");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the specified Autoscaler resource. (autoscalers.get)
|
* Gets the specified Autoscaler resource. (autoscalers.get)
|
||||||
*
|
*
|
||||||
|
@ -306,12 +303,12 @@ class Google_Service_Autoscaler_Autoscalers_Resource extends Google_Service_Reso
|
||||||
* @param array $optParams Optional parameters.
|
* @param array $optParams Optional parameters.
|
||||||
* @return Google_Service_Autoscaler_Autoscaler
|
* @return Google_Service_Autoscaler_Autoscaler
|
||||||
*/
|
*/
|
||||||
public function get($project, $zone, $autoscaler, $optParams = array())
|
public function get($project, $zone, $autoscaler, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'zone' => $zone, 'autoscaler' => $autoscaler);
|
$params = array('project' => $project, 'zone' => $zone, 'autoscaler' => $autoscaler);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('get', array($params), "Google_Service_Autoscaler_Autoscaler");
|
return $this->call('get', array($params), "Google_Service_Autoscaler_Autoscaler");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds new Autoscaler resource. (autoscalers.insert)
|
* Adds new Autoscaler resource. (autoscalers.insert)
|
||||||
*
|
*
|
||||||
|
@ -323,12 +320,12 @@ class Google_Service_Autoscaler_Autoscalers_Resource extends Google_Service_Reso
|
||||||
* @param array $optParams Optional parameters.
|
* @param array $optParams Optional parameters.
|
||||||
* @return Google_Service_Autoscaler_Operation
|
* @return Google_Service_Autoscaler_Operation
|
||||||
*/
|
*/
|
||||||
public function insert($project, $zone, Google_Service_Autoscaler_Autoscaler $postBody, $optParams = array())
|
public function insert($project, $zone, Google_Service_Autoscaler_Autoscaler $postBody, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'zone' => $zone, 'postBody' => $postBody);
|
$params = array('project' => $project, 'zone' => $zone, 'postBody' => $postBody);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('insert', array($params), "Google_Service_Autoscaler_Operation");
|
return $this->call('insert', array($params), "Google_Service_Autoscaler_Operation");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lists all Autoscaler resources in this zone. (autoscalers.listAutoscalers)
|
* Lists all Autoscaler resources in this zone. (autoscalers.listAutoscalers)
|
||||||
*
|
*
|
||||||
|
@ -346,12 +343,12 @@ class Google_Service_Autoscaler_Autoscalers_Resource extends Google_Service_Reso
|
||||||
*
|
*
|
||||||
* @return Google_Service_Autoscaler_AutoscalerListResponse
|
* @return Google_Service_Autoscaler_AutoscalerListResponse
|
||||||
*/
|
*/
|
||||||
public function listAutoscalers($project, $zone, $optParams = array())
|
public function listAutoscalers($project, $zone, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'zone' => $zone);
|
$params = array('project' => $project, 'zone' => $zone);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('list', array($params), "Google_Service_Autoscaler_AutoscalerListResponse");
|
return $this->call('list', array($params), "Google_Service_Autoscaler_AutoscalerListResponse");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the entire content of the Autoscaler resource. This method supports
|
* Update the entire content of the Autoscaler resource. This method supports
|
||||||
* patch semantics. (autoscalers.patch)
|
* patch semantics. (autoscalers.patch)
|
||||||
|
@ -366,12 +363,12 @@ class Google_Service_Autoscaler_Autoscalers_Resource extends Google_Service_Reso
|
||||||
* @param array $optParams Optional parameters.
|
* @param array $optParams Optional parameters.
|
||||||
* @return Google_Service_Autoscaler_Operation
|
* @return Google_Service_Autoscaler_Operation
|
||||||
*/
|
*/
|
||||||
public function patch($project, $zone, $autoscaler, Google_Service_Autoscaler_Autoscaler $postBody, $optParams = array())
|
public function patch($project, $zone, $autoscaler, Google_Service_Autoscaler_Autoscaler $postBody, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'zone' => $zone, 'autoscaler' => $autoscaler, 'postBody' => $postBody);
|
$params = array('project' => $project, 'zone' => $zone, 'autoscaler' => $autoscaler, 'postBody' => $postBody);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('patch', array($params), "Google_Service_Autoscaler_Operation");
|
return $this->call('patch', array($params), "Google_Service_Autoscaler_Operation");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the entire content of the Autoscaler resource. (autoscalers.update)
|
* Update the entire content of the Autoscaler resource. (autoscalers.update)
|
||||||
*
|
*
|
||||||
|
@ -385,8 +382,7 @@ class Google_Service_Autoscaler_Autoscalers_Resource extends Google_Service_Reso
|
||||||
* @param array $optParams Optional parameters.
|
* @param array $optParams Optional parameters.
|
||||||
* @return Google_Service_Autoscaler_Operation
|
* @return Google_Service_Autoscaler_Operation
|
||||||
*/
|
*/
|
||||||
public function update($project, $zone, $autoscaler, Google_Service_Autoscaler_Autoscaler $postBody, $optParams = array())
|
public function update($project, $zone, $autoscaler, Google_Service_Autoscaler_Autoscaler $postBody, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'zone' => $zone, 'autoscaler' => $autoscaler, 'postBody' => $postBody);
|
$params = array('project' => $project, 'zone' => $zone, 'autoscaler' => $autoscaler, 'postBody' => $postBody);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('update', array($params), "Google_Service_Autoscaler_Operation");
|
return $this->call('update', array($params), "Google_Service_Autoscaler_Operation");
|
||||||
|
@ -401,8 +397,7 @@ class Google_Service_Autoscaler_Autoscalers_Resource extends Google_Service_Reso
|
||||||
* $zoneOperations = $autoscalerService->zoneOperations;
|
* $zoneOperations = $autoscalerService->zoneOperations;
|
||||||
* </code>
|
* </code>
|
||||||
*/
|
*/
|
||||||
class Google_Service_Autoscaler_ZoneOperations_Resource extends Google_Service_Resource
|
class Google_Service_Autoscaler_ZoneOperations_Resource extends Google_Service_Resource {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes the specified zone-specific operation resource.
|
* Deletes the specified zone-specific operation resource.
|
||||||
|
@ -416,12 +411,12 @@ class Google_Service_Autoscaler_ZoneOperations_Resource extends Google_Service_R
|
||||||
*
|
*
|
||||||
* @param array $optParams Optional parameters.
|
* @param array $optParams Optional parameters.
|
||||||
*/
|
*/
|
||||||
public function delete($project, $zone, $operation, $optParams = array())
|
public function delete($project, $zone, $operation, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'zone' => $zone, 'operation' => $operation);
|
$params = array('project' => $project, 'zone' => $zone, 'operation' => $operation);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('delete', array($params));
|
return $this->call('delete', array($params));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the specified zone-specific operation resource.
|
* Retrieves the specified zone-specific operation resource.
|
||||||
* (zoneOperations.get)
|
* (zoneOperations.get)
|
||||||
|
@ -435,12 +430,12 @@ class Google_Service_Autoscaler_ZoneOperations_Resource extends Google_Service_R
|
||||||
* @param array $optParams Optional parameters.
|
* @param array $optParams Optional parameters.
|
||||||
* @return Google_Service_Autoscaler_Operation
|
* @return Google_Service_Autoscaler_Operation
|
||||||
*/
|
*/
|
||||||
public function get($project, $zone, $operation, $optParams = array())
|
public function get($project, $zone, $operation, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'zone' => $zone, 'operation' => $operation);
|
$params = array('project' => $project, 'zone' => $zone, 'operation' => $operation);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('get', array($params), "Google_Service_Autoscaler_Operation");
|
return $this->call('get', array($params), "Google_Service_Autoscaler_Operation");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the list of operation resources contained within the specified
|
* Retrieves the list of operation resources contained within the specified
|
||||||
* zone. (zoneOperations.listZoneOperations)
|
* zone. (zoneOperations.listZoneOperations)
|
||||||
|
@ -459,8 +454,7 @@ class Google_Service_Autoscaler_ZoneOperations_Resource extends Google_Service_R
|
||||||
*
|
*
|
||||||
* @return Google_Service_Autoscaler_OperationList
|
* @return Google_Service_Autoscaler_OperationList
|
||||||
*/
|
*/
|
||||||
public function listZoneOperations($project, $zone, $optParams = array())
|
public function listZoneOperations($project, $zone, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'zone' => $zone);
|
$params = array('project' => $project, 'zone' => $zone);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('list', array($params), "Google_Service_Autoscaler_OperationList");
|
return $this->call('list', array($params), "Google_Service_Autoscaler_OperationList");
|
||||||
|
@ -468,10 +462,7 @@ class Google_Service_Autoscaler_ZoneOperations_Resource extends Google_Service_R
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class Google_Service_Autoscaler_Autoscaler extends Google_Model {
|
||||||
|
|
||||||
class Google_Service_Autoscaler_Autoscaler extends Google_Model
|
|
||||||
{
|
|
||||||
protected $autoscalingPolicyType = 'Google_Service_Autoscaler_AutoscalingPolicy';
|
protected $autoscalingPolicyType = 'Google_Service_Autoscaler_AutoscalingPolicy';
|
||||||
protected $autoscalingPolicyDataType = '';
|
protected $autoscalingPolicyDataType = '';
|
||||||
public $creationTimestamp;
|
public $creationTimestamp;
|
||||||
|
@ -481,106 +472,86 @@ class Google_Service_Autoscaler_Autoscaler extends Google_Model
|
||||||
public $selfLink;
|
public $selfLink;
|
||||||
public $target;
|
public $target;
|
||||||
|
|
||||||
public function setAutoscalingPolicy(Google_Service_Autoscaler_AutoscalingPolicy $autoscalingPolicy)
|
public function setAutoscalingPolicy(Google_Service_Autoscaler_AutoscalingPolicy $autoscalingPolicy) {
|
||||||
{
|
|
||||||
$this->autoscalingPolicy = $autoscalingPolicy;
|
$this->autoscalingPolicy = $autoscalingPolicy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAutoscalingPolicy()
|
public function getAutoscalingPolicy() {
|
||||||
{
|
|
||||||
return $this->autoscalingPolicy;
|
return $this->autoscalingPolicy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setCreationTimestamp($creationTimestamp)
|
public function setCreationTimestamp($creationTimestamp) {
|
||||||
{
|
|
||||||
$this->creationTimestamp = $creationTimestamp;
|
$this->creationTimestamp = $creationTimestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCreationTimestamp()
|
public function getCreationTimestamp() {
|
||||||
{
|
|
||||||
return $this->creationTimestamp;
|
return $this->creationTimestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDescription($description)
|
public function setDescription($description) {
|
||||||
{
|
|
||||||
$this->description = $description;
|
$this->description = $description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDescription()
|
public function getDescription() {
|
||||||
{
|
|
||||||
return $this->description;
|
return $this->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setId($id)
|
public function setId($id) {
|
||||||
{
|
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId()
|
public function getId() {
|
||||||
{
|
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setName($name)
|
public function setName($name) {
|
||||||
{
|
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName()
|
public function getName() {
|
||||||
{
|
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setSelfLink($selfLink)
|
public function setSelfLink($selfLink) {
|
||||||
{
|
|
||||||
$this->selfLink = $selfLink;
|
$this->selfLink = $selfLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSelfLink()
|
public function getSelfLink() {
|
||||||
{
|
|
||||||
return $this->selfLink;
|
return $this->selfLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTarget($target)
|
public function setTarget($target) {
|
||||||
{
|
|
||||||
$this->target = $target;
|
$this->target = $target;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTarget()
|
public function getTarget() {
|
||||||
{
|
|
||||||
return $this->target;
|
return $this->target;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Autoscaler_AutoscalerListResponse extends Google_Collection
|
class Google_Service_Autoscaler_AutoscalerListResponse extends Google_Collection {
|
||||||
{
|
|
||||||
protected $itemsType = 'Google_Service_Autoscaler_Autoscaler';
|
protected $itemsType = 'Google_Service_Autoscaler_Autoscaler';
|
||||||
protected $itemsDataType = 'array';
|
protected $itemsDataType = 'array';
|
||||||
public $nextPageToken;
|
public $nextPageToken;
|
||||||
|
|
||||||
public function setItems($items)
|
public function setItems($items) {
|
||||||
{
|
|
||||||
$this->items = $items;
|
$this->items = $items;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getItems()
|
public function getItems() {
|
||||||
{
|
|
||||||
return $this->items;
|
return $this->items;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNextPageToken($nextPageToken)
|
public function setNextPageToken($nextPageToken) {
|
||||||
{
|
|
||||||
$this->nextPageToken = $nextPageToken;
|
$this->nextPageToken = $nextPageToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNextPageToken()
|
public function getNextPageToken() {
|
||||||
{
|
|
||||||
return $this->nextPageToken;
|
return $this->nextPageToken;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Autoscaler_AutoscalingPolicy extends Google_Collection
|
class Google_Service_Autoscaler_AutoscalingPolicy extends Google_Collection {
|
||||||
{
|
|
||||||
public $coolDownPeriodSec;
|
public $coolDownPeriodSec;
|
||||||
protected $cpuUtilizationType = 'Google_Service_Autoscaler_AutoscalingPolicyCpuUtilization';
|
protected $cpuUtilizationType = 'Google_Service_Autoscaler_AutoscalingPolicyCpuUtilization';
|
||||||
protected $cpuUtilizationDataType = '';
|
protected $cpuUtilizationDataType = '';
|
||||||
|
@ -591,125 +562,101 @@ class Google_Service_Autoscaler_AutoscalingPolicy extends Google_Collection
|
||||||
public $maxNumReplicas;
|
public $maxNumReplicas;
|
||||||
public $minNumReplicas;
|
public $minNumReplicas;
|
||||||
|
|
||||||
public function setCoolDownPeriodSec($coolDownPeriodSec)
|
public function setCoolDownPeriodSec($coolDownPeriodSec) {
|
||||||
{
|
|
||||||
$this->coolDownPeriodSec = $coolDownPeriodSec;
|
$this->coolDownPeriodSec = $coolDownPeriodSec;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCoolDownPeriodSec()
|
public function getCoolDownPeriodSec() {
|
||||||
{
|
|
||||||
return $this->coolDownPeriodSec;
|
return $this->coolDownPeriodSec;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setCpuUtilization(Google_Service_Autoscaler_AutoscalingPolicyCpuUtilization $cpuUtilization)
|
public function setCpuUtilization(Google_Service_Autoscaler_AutoscalingPolicyCpuUtilization $cpuUtilization) {
|
||||||
{
|
|
||||||
$this->cpuUtilization = $cpuUtilization;
|
$this->cpuUtilization = $cpuUtilization;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCpuUtilization()
|
public function getCpuUtilization() {
|
||||||
{
|
|
||||||
return $this->cpuUtilization;
|
return $this->cpuUtilization;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setCustomMetricUtilizations($customMetricUtilizations)
|
public function setCustomMetricUtilizations($customMetricUtilizations) {
|
||||||
{
|
|
||||||
$this->customMetricUtilizations = $customMetricUtilizations;
|
$this->customMetricUtilizations = $customMetricUtilizations;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCustomMetricUtilizations()
|
public function getCustomMetricUtilizations() {
|
||||||
{
|
|
||||||
return $this->customMetricUtilizations;
|
return $this->customMetricUtilizations;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setLoadBalancingUtilization(Google_Service_Autoscaler_AutoscalingPolicyLoadBalancingUtilization $loadBalancingUtilization)
|
public function setLoadBalancingUtilization(Google_Service_Autoscaler_AutoscalingPolicyLoadBalancingUtilization $loadBalancingUtilization) {
|
||||||
{
|
|
||||||
$this->loadBalancingUtilization = $loadBalancingUtilization;
|
$this->loadBalancingUtilization = $loadBalancingUtilization;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLoadBalancingUtilization()
|
public function getLoadBalancingUtilization() {
|
||||||
{
|
|
||||||
return $this->loadBalancingUtilization;
|
return $this->loadBalancingUtilization;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setMaxNumReplicas($maxNumReplicas)
|
public function setMaxNumReplicas($maxNumReplicas) {
|
||||||
{
|
|
||||||
$this->maxNumReplicas = $maxNumReplicas;
|
$this->maxNumReplicas = $maxNumReplicas;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMaxNumReplicas()
|
public function getMaxNumReplicas() {
|
||||||
{
|
|
||||||
return $this->maxNumReplicas;
|
return $this->maxNumReplicas;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setMinNumReplicas($minNumReplicas)
|
public function setMinNumReplicas($minNumReplicas) {
|
||||||
{
|
|
||||||
$this->minNumReplicas = $minNumReplicas;
|
$this->minNumReplicas = $minNumReplicas;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMinNumReplicas()
|
public function getMinNumReplicas() {
|
||||||
{
|
|
||||||
return $this->minNumReplicas;
|
return $this->minNumReplicas;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Autoscaler_AutoscalingPolicyCpuUtilization extends Google_Model
|
class Google_Service_Autoscaler_AutoscalingPolicyCpuUtilization extends Google_Model {
|
||||||
{
|
|
||||||
public $utilizationTarget;
|
public $utilizationTarget;
|
||||||
|
|
||||||
public function setUtilizationTarget($utilizationTarget)
|
public function setUtilizationTarget($utilizationTarget) {
|
||||||
{
|
|
||||||
$this->utilizationTarget = $utilizationTarget;
|
$this->utilizationTarget = $utilizationTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUtilizationTarget()
|
public function getUtilizationTarget() {
|
||||||
{
|
|
||||||
return $this->utilizationTarget;
|
return $this->utilizationTarget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Autoscaler_AutoscalingPolicyCustomMetricUtilization extends Google_Model
|
class Google_Service_Autoscaler_AutoscalingPolicyCustomMetricUtilization extends Google_Model {
|
||||||
{
|
|
||||||
public $metric;
|
public $metric;
|
||||||
public $utilizationTarget;
|
public $utilizationTarget;
|
||||||
|
|
||||||
public function setMetric($metric)
|
public function setMetric($metric) {
|
||||||
{
|
|
||||||
$this->metric = $metric;
|
$this->metric = $metric;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMetric()
|
public function getMetric() {
|
||||||
{
|
|
||||||
return $this->metric;
|
return $this->metric;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUtilizationTarget($utilizationTarget)
|
public function setUtilizationTarget($utilizationTarget) {
|
||||||
{
|
|
||||||
$this->utilizationTarget = $utilizationTarget;
|
$this->utilizationTarget = $utilizationTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUtilizationTarget()
|
public function getUtilizationTarget() {
|
||||||
{
|
|
||||||
return $this->utilizationTarget;
|
return $this->utilizationTarget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Autoscaler_AutoscalingPolicyLoadBalancingUtilization extends Google_Model
|
class Google_Service_Autoscaler_AutoscalingPolicyLoadBalancingUtilization extends Google_Model {
|
||||||
{
|
|
||||||
public $utilizationTarget;
|
public $utilizationTarget;
|
||||||
|
|
||||||
public function setUtilizationTarget($utilizationTarget)
|
public function setUtilizationTarget($utilizationTarget) {
|
||||||
{
|
|
||||||
$this->utilizationTarget = $utilizationTarget;
|
$this->utilizationTarget = $utilizationTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUtilizationTarget()
|
public function getUtilizationTarget() {
|
||||||
{
|
|
||||||
return $this->utilizationTarget;
|
return $this->utilizationTarget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Autoscaler_Operation extends Google_Collection
|
class Google_Service_Autoscaler_Operation extends Google_Collection {
|
||||||
{
|
|
||||||
public $clientOperationId;
|
public $clientOperationId;
|
||||||
public $creationTimestamp;
|
public $creationTimestamp;
|
||||||
public $endTime;
|
public $endTime;
|
||||||
|
@ -735,282 +682,227 @@ class Google_Service_Autoscaler_Operation extends Google_Collection
|
||||||
protected $warningsDataType = 'array';
|
protected $warningsDataType = 'array';
|
||||||
public $zone;
|
public $zone;
|
||||||
|
|
||||||
public function setClientOperationId($clientOperationId)
|
public function setClientOperationId($clientOperationId) {
|
||||||
{
|
|
||||||
$this->clientOperationId = $clientOperationId;
|
$this->clientOperationId = $clientOperationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getClientOperationId()
|
public function getClientOperationId() {
|
||||||
{
|
|
||||||
return $this->clientOperationId;
|
return $this->clientOperationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setCreationTimestamp($creationTimestamp)
|
public function setCreationTimestamp($creationTimestamp) {
|
||||||
{
|
|
||||||
$this->creationTimestamp = $creationTimestamp;
|
$this->creationTimestamp = $creationTimestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCreationTimestamp()
|
public function getCreationTimestamp() {
|
||||||
{
|
|
||||||
return $this->creationTimestamp;
|
return $this->creationTimestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setEndTime($endTime)
|
public function setEndTime($endTime) {
|
||||||
{
|
|
||||||
$this->endTime = $endTime;
|
$this->endTime = $endTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEndTime()
|
public function getEndTime() {
|
||||||
{
|
|
||||||
return $this->endTime;
|
return $this->endTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setError(Google_Service_Autoscaler_OperationError $error)
|
public function setError(Google_Service_Autoscaler_OperationError $error) {
|
||||||
{
|
|
||||||
$this->error = $error;
|
$this->error = $error;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getError()
|
public function getError() {
|
||||||
{
|
|
||||||
return $this->error;
|
return $this->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setHttpErrorMessage($httpErrorMessage)
|
public function setHttpErrorMessage($httpErrorMessage) {
|
||||||
{
|
|
||||||
$this->httpErrorMessage = $httpErrorMessage;
|
$this->httpErrorMessage = $httpErrorMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHttpErrorMessage()
|
public function getHttpErrorMessage() {
|
||||||
{
|
|
||||||
return $this->httpErrorMessage;
|
return $this->httpErrorMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setHttpErrorStatusCode($httpErrorStatusCode)
|
public function setHttpErrorStatusCode($httpErrorStatusCode) {
|
||||||
{
|
|
||||||
$this->httpErrorStatusCode = $httpErrorStatusCode;
|
$this->httpErrorStatusCode = $httpErrorStatusCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHttpErrorStatusCode()
|
public function getHttpErrorStatusCode() {
|
||||||
{
|
|
||||||
return $this->httpErrorStatusCode;
|
return $this->httpErrorStatusCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setId($id)
|
public function setId($id) {
|
||||||
{
|
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId()
|
public function getId() {
|
||||||
{
|
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setInsertTime($insertTime)
|
public function setInsertTime($insertTime) {
|
||||||
{
|
|
||||||
$this->insertTime = $insertTime;
|
$this->insertTime = $insertTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getInsertTime()
|
public function getInsertTime() {
|
||||||
{
|
|
||||||
return $this->insertTime;
|
return $this->insertTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setName($name)
|
public function setName($name) {
|
||||||
{
|
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName()
|
public function getName() {
|
||||||
{
|
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setOperationType($operationType)
|
public function setOperationType($operationType) {
|
||||||
{
|
|
||||||
$this->operationType = $operationType;
|
$this->operationType = $operationType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOperationType()
|
public function getOperationType() {
|
||||||
{
|
|
||||||
return $this->operationType;
|
return $this->operationType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setProgress($progress)
|
public function setProgress($progress) {
|
||||||
{
|
|
||||||
$this->progress = $progress;
|
$this->progress = $progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getProgress()
|
public function getProgress() {
|
||||||
{
|
|
||||||
return $this->progress;
|
return $this->progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setRegion($region)
|
public function setRegion($region) {
|
||||||
{
|
|
||||||
$this->region = $region;
|
$this->region = $region;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRegion()
|
public function getRegion() {
|
||||||
{
|
|
||||||
return $this->region;
|
return $this->region;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setSelfLink($selfLink)
|
public function setSelfLink($selfLink) {
|
||||||
{
|
|
||||||
$this->selfLink = $selfLink;
|
$this->selfLink = $selfLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSelfLink()
|
public function getSelfLink() {
|
||||||
{
|
|
||||||
return $this->selfLink;
|
return $this->selfLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setStartTime($startTime)
|
public function setStartTime($startTime) {
|
||||||
{
|
|
||||||
$this->startTime = $startTime;
|
$this->startTime = $startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getStartTime()
|
public function getStartTime() {
|
||||||
{
|
|
||||||
return $this->startTime;
|
return $this->startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setStatus($status)
|
public function setStatus($status) {
|
||||||
{
|
|
||||||
$this->status = $status;
|
$this->status = $status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getStatus()
|
public function getStatus() {
|
||||||
{
|
|
||||||
return $this->status;
|
return $this->status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setStatusMessage($statusMessage)
|
public function setStatusMessage($statusMessage) {
|
||||||
{
|
|
||||||
$this->statusMessage = $statusMessage;
|
$this->statusMessage = $statusMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getStatusMessage()
|
public function getStatusMessage() {
|
||||||
{
|
|
||||||
return $this->statusMessage;
|
return $this->statusMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTargetId($targetId)
|
public function setTargetId($targetId) {
|
||||||
{
|
|
||||||
$this->targetId = $targetId;
|
$this->targetId = $targetId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTargetId()
|
public function getTargetId() {
|
||||||
{
|
|
||||||
return $this->targetId;
|
return $this->targetId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTargetLink($targetLink)
|
public function setTargetLink($targetLink) {
|
||||||
{
|
|
||||||
$this->targetLink = $targetLink;
|
$this->targetLink = $targetLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTargetLink()
|
public function getTargetLink() {
|
||||||
{
|
|
||||||
return $this->targetLink;
|
return $this->targetLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUser($user)
|
public function setUser($user) {
|
||||||
{
|
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUser()
|
public function getUser() {
|
||||||
{
|
|
||||||
return $this->user;
|
return $this->user;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setWarnings($warnings)
|
public function setWarnings($warnings) {
|
||||||
{
|
|
||||||
$this->warnings = $warnings;
|
$this->warnings = $warnings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getWarnings()
|
public function getWarnings() {
|
||||||
{
|
|
||||||
return $this->warnings;
|
return $this->warnings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setZone($zone)
|
public function setZone($zone) {
|
||||||
{
|
|
||||||
$this->zone = $zone;
|
$this->zone = $zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getZone()
|
public function getZone() {
|
||||||
{
|
|
||||||
return $this->zone;
|
return $this->zone;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Autoscaler_OperationError extends Google_Collection
|
class Google_Service_Autoscaler_OperationError extends Google_Collection {
|
||||||
{
|
|
||||||
protected $errorsType = 'Google_Service_Autoscaler_OperationErrorErrors';
|
protected $errorsType = 'Google_Service_Autoscaler_OperationErrorErrors';
|
||||||
protected $errorsDataType = 'array';
|
protected $errorsDataType = 'array';
|
||||||
|
|
||||||
public function setErrors($errors)
|
public function setErrors($errors) {
|
||||||
{
|
|
||||||
$this->errors = $errors;
|
$this->errors = $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getErrors()
|
public function getErrors() {
|
||||||
{
|
|
||||||
return $this->errors;
|
return $this->errors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Autoscaler_OperationErrorErrors extends Google_Model
|
class Google_Service_Autoscaler_OperationErrorErrors extends Google_Model {
|
||||||
{
|
|
||||||
public $code;
|
public $code;
|
||||||
public $location;
|
public $location;
|
||||||
public $message;
|
public $message;
|
||||||
|
|
||||||
public function setCode($code)
|
public function setCode($code) {
|
||||||
{
|
|
||||||
$this->code = $code;
|
$this->code = $code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCode()
|
public function getCode() {
|
||||||
{
|
|
||||||
return $this->code;
|
return $this->code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setLocation($location)
|
public function setLocation($location) {
|
||||||
{
|
|
||||||
$this->location = $location;
|
$this->location = $location;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLocation()
|
public function getLocation() {
|
||||||
{
|
|
||||||
return $this->location;
|
return $this->location;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setMessage($message)
|
public function setMessage($message) {
|
||||||
{
|
|
||||||
$this->message = $message;
|
$this->message = $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMessage()
|
public function getMessage() {
|
||||||
{
|
|
||||||
return $this->message;
|
return $this->message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Autoscaler_OperationList extends Google_Collection
|
class Google_Service_Autoscaler_OperationList extends Google_Collection {
|
||||||
{
|
|
||||||
public $id;
|
public $id;
|
||||||
protected $itemsType = 'Google_Service_Autoscaler_Operation';
|
protected $itemsType = 'Google_Service_Autoscaler_Operation';
|
||||||
protected $itemsDataType = 'array';
|
protected $itemsDataType = 'array';
|
||||||
|
@ -1018,117 +910,95 @@ class Google_Service_Autoscaler_OperationList extends Google_Collection
|
||||||
public $nextPageToken;
|
public $nextPageToken;
|
||||||
public $selfLink;
|
public $selfLink;
|
||||||
|
|
||||||
public function setId($id)
|
public function setId($id) {
|
||||||
{
|
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId()
|
public function getId() {
|
||||||
{
|
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setItems($items)
|
public function setItems($items) {
|
||||||
{
|
|
||||||
$this->items = $items;
|
$this->items = $items;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getItems()
|
public function getItems() {
|
||||||
{
|
|
||||||
return $this->items;
|
return $this->items;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNextPageToken($nextPageToken)
|
public function setNextPageToken($nextPageToken) {
|
||||||
{
|
|
||||||
$this->nextPageToken = $nextPageToken;
|
$this->nextPageToken = $nextPageToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNextPageToken()
|
public function getNextPageToken() {
|
||||||
{
|
|
||||||
return $this->nextPageToken;
|
return $this->nextPageToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setSelfLink($selfLink)
|
public function setSelfLink($selfLink) {
|
||||||
{
|
|
||||||
$this->selfLink = $selfLink;
|
$this->selfLink = $selfLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSelfLink()
|
public function getSelfLink() {
|
||||||
{
|
|
||||||
return $this->selfLink;
|
return $this->selfLink;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Autoscaler_OperationWarnings extends Google_Collection
|
class Google_Service_Autoscaler_OperationWarnings extends Google_Collection {
|
||||||
{
|
|
||||||
public $code;
|
public $code;
|
||||||
protected $dataType = 'Google_Service_Autoscaler_OperationWarningsData';
|
protected $dataType = 'Google_Service_Autoscaler_OperationWarningsData';
|
||||||
protected $dataDataType = 'array';
|
protected $dataDataType = 'array';
|
||||||
public $message;
|
public $message;
|
||||||
|
|
||||||
public function setCode($code)
|
public function setCode($code) {
|
||||||
{
|
|
||||||
$this->code = $code;
|
$this->code = $code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCode()
|
public function getCode() {
|
||||||
{
|
|
||||||
return $this->code;
|
return $this->code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setData($data)
|
public function setData($data) {
|
||||||
{
|
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getData()
|
public function getData() {
|
||||||
{
|
|
||||||
return $this->data;
|
return $this->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setMessage($message)
|
public function setMessage($message) {
|
||||||
{
|
|
||||||
$this->message = $message;
|
$this->message = $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMessage()
|
public function getMessage() {
|
||||||
{
|
|
||||||
return $this->message;
|
return $this->message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Autoscaler_OperationWarningsData extends Google_Model
|
class Google_Service_Autoscaler_OperationWarningsData extends Google_Model {
|
||||||
{
|
|
||||||
public $key;
|
public $key;
|
||||||
public $value;
|
public $value;
|
||||||
|
|
||||||
public function setKey($key)
|
public function setKey($key) {
|
||||||
{
|
|
||||||
$this->key = $key;
|
$this->key = $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKey()
|
public function getKey() {
|
||||||
{
|
|
||||||
return $this->key;
|
return $this->key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setValue($value)
|
public function setValue($value) {
|
||||||
{
|
|
||||||
$this->value = $value;
|
$this->value = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getValue()
|
public function getValue() {
|
||||||
{
|
|
||||||
return $this->value;
|
return $this->value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -29,8 +29,7 @@
|
||||||
*
|
*
|
||||||
* @author Google, Inc.
|
* @author Google, Inc.
|
||||||
*/
|
*/
|
||||||
class Google_Service_CloudMonitoring extends Google_Service
|
class Google_Service_CloudMonitoring extends Google_Service {
|
||||||
{
|
|
||||||
/** View monitoring data for all of your Google Cloud and API projects. */
|
/** View monitoring data for all of your Google Cloud and API projects. */
|
||||||
const MONITORING_READONLY = "https://www.googleapis.com/auth/monitoring.readonly";
|
const MONITORING_READONLY = "https://www.googleapis.com/auth/monitoring.readonly";
|
||||||
|
|
||||||
|
@ -44,8 +43,7 @@ class Google_Service_CloudMonitoring extends Google_Service
|
||||||
*
|
*
|
||||||
* @param Google_Client $client
|
* @param Google_Client $client
|
||||||
*/
|
*/
|
||||||
public function __construct(Google_Client $client)
|
public function __construct(Google_Client $client) {
|
||||||
{
|
|
||||||
parent::__construct($client);
|
parent::__construct($client);
|
||||||
$this->servicePath = 'cloudmonitoring/v2beta1/projects/';
|
$this->servicePath = 'cloudmonitoring/v2beta1/projects/';
|
||||||
$this->version = 'v2beta1';
|
$this->version = 'v2beta1';
|
||||||
|
@ -197,8 +195,7 @@ class Google_Service_CloudMonitoring extends Google_Service
|
||||||
* $metricDescriptors = $cloudmonitoringService->metricDescriptors;
|
* $metricDescriptors = $cloudmonitoringService->metricDescriptors;
|
||||||
* </code>
|
* </code>
|
||||||
*/
|
*/
|
||||||
class Google_Service_CloudMonitoring_MetricDescriptors_Resource extends Google_Service_Resource
|
class Google_Service_CloudMonitoring_MetricDescriptors_Resource extends Google_Service_Resource {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List metric descriptors that match the query. If the query is not set, then
|
* List metric descriptors that match the query. If the query is not set, then
|
||||||
|
@ -224,8 +221,7 @@ class Google_Service_CloudMonitoring_MetricDescriptors_Resource extends Google_S
|
||||||
* field, no metrics are returned.
|
* field, no metrics are returned.
|
||||||
* @return Google_Service_CloudMonitoring_ListMetricDescriptorsResponse
|
* @return Google_Service_CloudMonitoring_ListMetricDescriptorsResponse
|
||||||
*/
|
*/
|
||||||
public function listMetricDescriptors($project, $optParams = array())
|
public function listMetricDescriptors($project, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project);
|
$params = array('project' => $project);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('list', array($params), "Google_Service_CloudMonitoring_ListMetricDescriptorsResponse");
|
return $this->call('list', array($params), "Google_Service_CloudMonitoring_ListMetricDescriptorsResponse");
|
||||||
|
@ -240,8 +236,7 @@ class Google_Service_CloudMonitoring_MetricDescriptors_Resource extends Google_S
|
||||||
* $timeseries = $cloudmonitoringService->timeseries;
|
* $timeseries = $cloudmonitoringService->timeseries;
|
||||||
* </code>
|
* </code>
|
||||||
*/
|
*/
|
||||||
class Google_Service_CloudMonitoring_Timeseries_Resource extends Google_Service_Resource
|
class Google_Service_CloudMonitoring_Timeseries_Resource extends Google_Service_Resource {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List the data points of the time series that match the metric and labels
|
* List the data points of the time series that match the metric and labels
|
||||||
|
@ -266,23 +261,23 @@ class Google_Service_CloudMonitoring_Timeseries_Resource extends Google_Service_
|
||||||
* Length of the time interval to query, which is an alternative way to declare the interval:
|
* Length of the time interval to query, which is an alternative way to declare the interval:
|
||||||
* (youngest - timespan, youngest]. The timespan and oldest parameters should not be used together.
|
* (youngest - timespan, youngest]. The timespan and oldest parameters should not be used together.
|
||||||
* Units:
|
* Units:
|
||||||
- s: second
|
* - s: second
|
||||||
- m: minute
|
* - m: minute
|
||||||
- h: hour
|
* - h: hour
|
||||||
- d: day
|
* - d: day
|
||||||
- w: week Examples: 2s, 3m, 4w. Only
|
* - w: week Examples: 2s, 3m, 4w. Only
|
||||||
* one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead.
|
* one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead.
|
||||||
If neither
|
* If neither
|
||||||
* oldest nor timespan is specified, the default time interval will be (youngest - 4 hours,
|
* oldest nor timespan is specified, the default time interval will be (youngest - 4 hours,
|
||||||
* youngest].
|
* youngest].
|
||||||
* @opt_param string labels
|
* @opt_param string labels
|
||||||
* A collection of labels for the matching time series, which are represented as:
|
* A collection of labels for the matching time series, which are represented as:
|
||||||
- key==value:
|
* - key==value:
|
||||||
* key equals the value
|
* key equals the value
|
||||||
- key=~value: key regex matches the value
|
* - key=~value: key regex matches the value
|
||||||
- key!=value: key does not
|
* - key!=value: key does not
|
||||||
* equal the value
|
* equal the value
|
||||||
- key!~value: key regex does not match the value For example, to list all of
|
* - key!~value: key regex does not match the value For example, to list all of
|
||||||
* the time series descriptors for the region us-central1, you could specify:
|
* the time series descriptors for the region us-central1, you could specify:
|
||||||
* label=cloud.googleapis.com%2Flocation=~us-central1.*
|
* label=cloud.googleapis.com%2Flocation=~us-central1.*
|
||||||
* @opt_param string pageToken
|
* @opt_param string pageToken
|
||||||
|
@ -294,8 +289,7 @@ class Google_Service_CloudMonitoring_Timeseries_Resource extends Google_Service_
|
||||||
* youngest]
|
* youngest]
|
||||||
* @return Google_Service_CloudMonitoring_ListTimeseriesResponse
|
* @return Google_Service_CloudMonitoring_ListTimeseriesResponse
|
||||||
*/
|
*/
|
||||||
public function listTimeseries($project, $metric, $youngest, $optParams = array())
|
public function listTimeseries($project, $metric, $youngest, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'metric' => $metric, 'youngest' => $youngest);
|
$params = array('project' => $project, 'metric' => $metric, 'youngest' => $youngest);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('list', array($params), "Google_Service_CloudMonitoring_ListTimeseriesResponse");
|
return $this->call('list', array($params), "Google_Service_CloudMonitoring_ListTimeseriesResponse");
|
||||||
|
@ -310,8 +304,7 @@ class Google_Service_CloudMonitoring_Timeseries_Resource extends Google_Service_
|
||||||
* $timeseriesDescriptors = $cloudmonitoringService->timeseriesDescriptors;
|
* $timeseriesDescriptors = $cloudmonitoringService->timeseriesDescriptors;
|
||||||
* </code>
|
* </code>
|
||||||
*/
|
*/
|
||||||
class Google_Service_CloudMonitoring_TimeseriesDescriptors_Resource extends Google_Service_Resource
|
class Google_Service_CloudMonitoring_TimeseriesDescriptors_Resource extends Google_Service_Resource {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List the descriptors of the time series that match the metric and labels
|
* List the descriptors of the time series that match the metric and labels
|
||||||
|
@ -337,23 +330,23 @@ class Google_Service_CloudMonitoring_TimeseriesDescriptors_Resource extends Goog
|
||||||
* Length of the time interval to query, which is an alternative way to declare the interval:
|
* Length of the time interval to query, which is an alternative way to declare the interval:
|
||||||
* (youngest - timespan, youngest]. The timespan and oldest parameters should not be used together.
|
* (youngest - timespan, youngest]. The timespan and oldest parameters should not be used together.
|
||||||
* Units:
|
* Units:
|
||||||
- s: second
|
* - s: second
|
||||||
- m: minute
|
* - m: minute
|
||||||
- h: hour
|
* - h: hour
|
||||||
- d: day
|
* - d: day
|
||||||
- w: week Examples: 2s, 3m, 4w. Only
|
* - w: week Examples: 2s, 3m, 4w. Only
|
||||||
* one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead.
|
* one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead.
|
||||||
If neither
|
* If neither
|
||||||
* oldest nor timespan is specified, the default time interval will be (youngest - 4 hours,
|
* oldest nor timespan is specified, the default time interval will be (youngest - 4 hours,
|
||||||
* youngest].
|
* youngest].
|
||||||
* @opt_param string labels
|
* @opt_param string labels
|
||||||
* A collection of labels for the matching time series, which are represented as:
|
* A collection of labels for the matching time series, which are represented as:
|
||||||
- key==value:
|
* - key==value:
|
||||||
* key equals the value
|
* key equals the value
|
||||||
- key=~value: key regex matches the value
|
* - key=~value: key regex matches the value
|
||||||
- key!=value: key does not
|
* - key!=value: key does not
|
||||||
* equal the value
|
* equal the value
|
||||||
- key!~value: key regex does not match the value For example, to list all of
|
* - key!~value: key regex does not match the value For example, to list all of
|
||||||
* the time series descriptors for the region us-central1, you could specify:
|
* the time series descriptors for the region us-central1, you could specify:
|
||||||
* label=cloud.googleapis.com%2Flocation=~us-central1.*
|
* label=cloud.googleapis.com%2Flocation=~us-central1.*
|
||||||
* @opt_param string pageToken
|
* @opt_param string pageToken
|
||||||
|
@ -365,8 +358,7 @@ class Google_Service_CloudMonitoring_TimeseriesDescriptors_Resource extends Goog
|
||||||
* youngest]
|
* youngest]
|
||||||
* @return Google_Service_CloudMonitoring_ListTimeseriesDescriptorsResponse
|
* @return Google_Service_CloudMonitoring_ListTimeseriesDescriptorsResponse
|
||||||
*/
|
*/
|
||||||
public function listTimeseriesDescriptors($project, $metric, $youngest, $optParams = array())
|
public function listTimeseriesDescriptors($project, $metric, $youngest, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'metric' => $metric, 'youngest' => $youngest);
|
$params = array('project' => $project, 'metric' => $metric, 'youngest' => $youngest);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('list', array($params), "Google_Service_CloudMonitoring_ListTimeseriesDescriptorsResponse");
|
return $this->call('list', array($params), "Google_Service_CloudMonitoring_ListTimeseriesDescriptorsResponse");
|
||||||
|
@ -374,78 +366,62 @@ class Google_Service_CloudMonitoring_TimeseriesDescriptors_Resource extends Goog
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class Google_Service_CloudMonitoring_ListMetricDescriptorsRequest extends Google_Model {
|
||||||
|
|
||||||
class Google_Service_CloudMonitoring_ListMetricDescriptorsRequest extends Google_Model
|
|
||||||
{
|
|
||||||
public $kind;
|
public $kind;
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_CloudMonitoring_ListMetricDescriptorsResponse extends Google_Collection
|
class Google_Service_CloudMonitoring_ListMetricDescriptorsResponse extends Google_Collection {
|
||||||
{
|
|
||||||
public $kind;
|
public $kind;
|
||||||
protected $metricsType = 'Google_Service_CloudMonitoring_MetricDescriptor';
|
protected $metricsType = 'Google_Service_CloudMonitoring_MetricDescriptor';
|
||||||
protected $metricsDataType = 'array';
|
protected $metricsDataType = 'array';
|
||||||
public $nextPageToken;
|
public $nextPageToken;
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setMetrics($metrics)
|
public function setMetrics($metrics) {
|
||||||
{
|
|
||||||
$this->metrics = $metrics;
|
$this->metrics = $metrics;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMetrics()
|
public function getMetrics() {
|
||||||
{
|
|
||||||
return $this->metrics;
|
return $this->metrics;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNextPageToken($nextPageToken)
|
public function setNextPageToken($nextPageToken) {
|
||||||
{
|
|
||||||
$this->nextPageToken = $nextPageToken;
|
$this->nextPageToken = $nextPageToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNextPageToken()
|
public function getNextPageToken() {
|
||||||
{
|
|
||||||
return $this->nextPageToken;
|
return $this->nextPageToken;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_CloudMonitoring_ListTimeseriesDescriptorsRequest extends Google_Model
|
class Google_Service_CloudMonitoring_ListTimeseriesDescriptorsRequest extends Google_Model {
|
||||||
{
|
|
||||||
public $kind;
|
public $kind;
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_CloudMonitoring_ListTimeseriesDescriptorsResponse extends Google_Collection
|
class Google_Service_CloudMonitoring_ListTimeseriesDescriptorsResponse extends Google_Collection {
|
||||||
{
|
|
||||||
public $kind;
|
public $kind;
|
||||||
public $nextPageToken;
|
public $nextPageToken;
|
||||||
public $oldest;
|
public $oldest;
|
||||||
|
@ -453,74 +429,60 @@ class Google_Service_CloudMonitoring_ListTimeseriesDescriptorsResponse extends G
|
||||||
protected $timeseriesDataType = 'array';
|
protected $timeseriesDataType = 'array';
|
||||||
public $youngest;
|
public $youngest;
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNextPageToken($nextPageToken)
|
public function setNextPageToken($nextPageToken) {
|
||||||
{
|
|
||||||
$this->nextPageToken = $nextPageToken;
|
$this->nextPageToken = $nextPageToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNextPageToken()
|
public function getNextPageToken() {
|
||||||
{
|
|
||||||
return $this->nextPageToken;
|
return $this->nextPageToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setOldest($oldest)
|
public function setOldest($oldest) {
|
||||||
{
|
|
||||||
$this->oldest = $oldest;
|
$this->oldest = $oldest;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOldest()
|
public function getOldest() {
|
||||||
{
|
|
||||||
return $this->oldest;
|
return $this->oldest;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTimeseries($timeseries)
|
public function setTimeseries($timeseries) {
|
||||||
{
|
|
||||||
$this->timeseries = $timeseries;
|
$this->timeseries = $timeseries;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTimeseries()
|
public function getTimeseries() {
|
||||||
{
|
|
||||||
return $this->timeseries;
|
return $this->timeseries;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setYoungest($youngest)
|
public function setYoungest($youngest) {
|
||||||
{
|
|
||||||
$this->youngest = $youngest;
|
$this->youngest = $youngest;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getYoungest()
|
public function getYoungest() {
|
||||||
{
|
|
||||||
return $this->youngest;
|
return $this->youngest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_CloudMonitoring_ListTimeseriesRequest extends Google_Model
|
class Google_Service_CloudMonitoring_ListTimeseriesRequest extends Google_Model {
|
||||||
{
|
|
||||||
public $kind;
|
public $kind;
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_CloudMonitoring_ListTimeseriesResponse extends Google_Collection
|
class Google_Service_CloudMonitoring_ListTimeseriesResponse extends Google_Collection {
|
||||||
{
|
|
||||||
public $kind;
|
public $kind;
|
||||||
public $nextPageToken;
|
public $nextPageToken;
|
||||||
public $oldest;
|
public $oldest;
|
||||||
|
@ -528,59 +490,48 @@ class Google_Service_CloudMonitoring_ListTimeseriesResponse extends Google_Colle
|
||||||
protected $timeseriesDataType = 'array';
|
protected $timeseriesDataType = 'array';
|
||||||
public $youngest;
|
public $youngest;
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNextPageToken($nextPageToken)
|
public function setNextPageToken($nextPageToken) {
|
||||||
{
|
|
||||||
$this->nextPageToken = $nextPageToken;
|
$this->nextPageToken = $nextPageToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNextPageToken()
|
public function getNextPageToken() {
|
||||||
{
|
|
||||||
return $this->nextPageToken;
|
return $this->nextPageToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setOldest($oldest)
|
public function setOldest($oldest) {
|
||||||
{
|
|
||||||
$this->oldest = $oldest;
|
$this->oldest = $oldest;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOldest()
|
public function getOldest() {
|
||||||
{
|
|
||||||
return $this->oldest;
|
return $this->oldest;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTimeseries($timeseries)
|
public function setTimeseries($timeseries) {
|
||||||
{
|
|
||||||
$this->timeseries = $timeseries;
|
$this->timeseries = $timeseries;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTimeseries()
|
public function getTimeseries() {
|
||||||
{
|
|
||||||
return $this->timeseries;
|
return $this->timeseries;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setYoungest($youngest)
|
public function setYoungest($youngest) {
|
||||||
{
|
|
||||||
$this->youngest = $youngest;
|
$this->youngest = $youngest;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getYoungest()
|
public function getYoungest() {
|
||||||
{
|
|
||||||
return $this->youngest;
|
return $this->youngest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_CloudMonitoring_MetricDescriptor extends Google_Collection
|
class Google_Service_CloudMonitoring_MetricDescriptor extends Google_Collection {
|
||||||
{
|
|
||||||
public $description;
|
public $description;
|
||||||
protected $labelsType = 'Google_Service_CloudMonitoring_MetricDescriptorLabelDescriptor';
|
protected $labelsType = 'Google_Service_CloudMonitoring_MetricDescriptorLabelDescriptor';
|
||||||
protected $labelsDataType = 'array';
|
protected $labelsDataType = 'array';
|
||||||
|
@ -589,111 +540,90 @@ class Google_Service_CloudMonitoring_MetricDescriptor extends Google_Collection
|
||||||
protected $typeDescriptorType = 'Google_Service_CloudMonitoring_MetricDescriptorTypeDescriptor';
|
protected $typeDescriptorType = 'Google_Service_CloudMonitoring_MetricDescriptorTypeDescriptor';
|
||||||
protected $typeDescriptorDataType = '';
|
protected $typeDescriptorDataType = '';
|
||||||
|
|
||||||
public function setDescription($description)
|
public function setDescription($description) {
|
||||||
{
|
|
||||||
$this->description = $description;
|
$this->description = $description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDescription()
|
public function getDescription() {
|
||||||
{
|
|
||||||
return $this->description;
|
return $this->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setLabels($labels)
|
public function setLabels($labels) {
|
||||||
{
|
|
||||||
$this->labels = $labels;
|
$this->labels = $labels;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLabels()
|
public function getLabels() {
|
||||||
{
|
|
||||||
return $this->labels;
|
return $this->labels;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setName($name)
|
public function setName($name) {
|
||||||
{
|
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName()
|
public function getName() {
|
||||||
{
|
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setProject($project)
|
public function setProject($project) {
|
||||||
{
|
|
||||||
$this->project = $project;
|
$this->project = $project;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getProject()
|
public function getProject() {
|
||||||
{
|
|
||||||
return $this->project;
|
return $this->project;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTypeDescriptor(Google_Service_CloudMonitoring_MetricDescriptorTypeDescriptor $typeDescriptor)
|
public function setTypeDescriptor(Google_Service_CloudMonitoring_MetricDescriptorTypeDescriptor $typeDescriptor) {
|
||||||
{
|
|
||||||
$this->typeDescriptor = $typeDescriptor;
|
$this->typeDescriptor = $typeDescriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTypeDescriptor()
|
public function getTypeDescriptor() {
|
||||||
{
|
|
||||||
return $this->typeDescriptor;
|
return $this->typeDescriptor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_CloudMonitoring_MetricDescriptorLabelDescriptor extends Google_Model
|
class Google_Service_CloudMonitoring_MetricDescriptorLabelDescriptor extends Google_Model {
|
||||||
{
|
|
||||||
public $description;
|
public $description;
|
||||||
public $key;
|
public $key;
|
||||||
|
|
||||||
public function setDescription($description)
|
public function setDescription($description) {
|
||||||
{
|
|
||||||
$this->description = $description;
|
$this->description = $description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDescription()
|
public function getDescription() {
|
||||||
{
|
|
||||||
return $this->description;
|
return $this->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setKey($key)
|
public function setKey($key) {
|
||||||
{
|
|
||||||
$this->key = $key;
|
$this->key = $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKey()
|
public function getKey() {
|
||||||
{
|
|
||||||
return $this->key;
|
return $this->key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_CloudMonitoring_MetricDescriptorTypeDescriptor extends Google_Model
|
class Google_Service_CloudMonitoring_MetricDescriptorTypeDescriptor extends Google_Model {
|
||||||
{
|
|
||||||
public $metricType;
|
public $metricType;
|
||||||
public $valueType;
|
public $valueType;
|
||||||
|
|
||||||
public function setMetricType($metricType)
|
public function setMetricType($metricType) {
|
||||||
{
|
|
||||||
$this->metricType = $metricType;
|
$this->metricType = $metricType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMetricType()
|
public function getMetricType() {
|
||||||
{
|
|
||||||
return $this->metricType;
|
return $this->metricType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setValueType($valueType)
|
public function setValueType($valueType) {
|
||||||
{
|
|
||||||
$this->valueType = $valueType;
|
$this->valueType = $valueType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getValueType()
|
public function getValueType() {
|
||||||
{
|
|
||||||
return $this->valueType;
|
return $this->valueType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_CloudMonitoring_Point extends Google_Model
|
class Google_Service_CloudMonitoring_Point extends Google_Model {
|
||||||
{
|
|
||||||
public $boolValue;
|
public $boolValue;
|
||||||
protected $distributionValueType = 'Google_Service_CloudMonitoring_PointDistribution';
|
protected $distributionValueType = 'Google_Service_CloudMonitoring_PointDistribution';
|
||||||
protected $distributionValueDataType = '';
|
protected $distributionValueDataType = '';
|
||||||
|
@ -703,79 +633,64 @@ class Google_Service_CloudMonitoring_Point extends Google_Model
|
||||||
public $start;
|
public $start;
|
||||||
public $stringValue;
|
public $stringValue;
|
||||||
|
|
||||||
public function setBoolValue($boolValue)
|
public function setBoolValue($boolValue) {
|
||||||
{
|
|
||||||
$this->boolValue = $boolValue;
|
$this->boolValue = $boolValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBoolValue()
|
public function getBoolValue() {
|
||||||
{
|
|
||||||
return $this->boolValue;
|
return $this->boolValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDistributionValue(Google_Service_CloudMonitoring_PointDistribution $distributionValue)
|
public function setDistributionValue(Google_Service_CloudMonitoring_PointDistribution $distributionValue) {
|
||||||
{
|
|
||||||
$this->distributionValue = $distributionValue;
|
$this->distributionValue = $distributionValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDistributionValue()
|
public function getDistributionValue() {
|
||||||
{
|
|
||||||
return $this->distributionValue;
|
return $this->distributionValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDoubleValue($doubleValue)
|
public function setDoubleValue($doubleValue) {
|
||||||
{
|
|
||||||
$this->doubleValue = $doubleValue;
|
$this->doubleValue = $doubleValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDoubleValue()
|
public function getDoubleValue() {
|
||||||
{
|
|
||||||
return $this->doubleValue;
|
return $this->doubleValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setEnd($end)
|
public function setEnd($end) {
|
||||||
{
|
|
||||||
$this->end = $end;
|
$this->end = $end;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEnd()
|
public function getEnd() {
|
||||||
{
|
|
||||||
return $this->end;
|
return $this->end;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setInt64Value($int64Value)
|
public function setInt64Value($int64Value) {
|
||||||
{
|
|
||||||
$this->int64Value = $int64Value;
|
$this->int64Value = $int64Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getInt64Value()
|
public function getInt64Value() {
|
||||||
{
|
|
||||||
return $this->int64Value;
|
return $this->int64Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setStart($start)
|
public function setStart($start) {
|
||||||
{
|
|
||||||
$this->start = $start;
|
$this->start = $start;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getStart()
|
public function getStart() {
|
||||||
{
|
|
||||||
return $this->start;
|
return $this->start;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setStringValue($stringValue)
|
public function setStringValue($stringValue) {
|
||||||
{
|
|
||||||
$this->stringValue = $stringValue;
|
$this->stringValue = $stringValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getStringValue()
|
public function getStringValue() {
|
||||||
{
|
|
||||||
return $this->stringValue;
|
return $this->stringValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_CloudMonitoring_PointDistribution extends Google_Collection
|
class Google_Service_CloudMonitoring_PointDistribution extends Google_Collection {
|
||||||
{
|
|
||||||
protected $bucketsType = 'Google_Service_CloudMonitoring_PointDistributionBucket';
|
protected $bucketsType = 'Google_Service_CloudMonitoring_PointDistributionBucket';
|
||||||
protected $bucketsDataType = 'array';
|
protected $bucketsDataType = 'array';
|
||||||
protected $overflowBucketType = 'Google_Service_CloudMonitoring_PointDistributionOverflowBucket';
|
protected $overflowBucketType = 'Google_Service_CloudMonitoring_PointDistributionOverflowBucket';
|
||||||
|
@ -783,192 +698,156 @@ class Google_Service_CloudMonitoring_PointDistribution extends Google_Collection
|
||||||
protected $underflowBucketType = 'Google_Service_CloudMonitoring_PointDistributionUnderflowBucket';
|
protected $underflowBucketType = 'Google_Service_CloudMonitoring_PointDistributionUnderflowBucket';
|
||||||
protected $underflowBucketDataType = '';
|
protected $underflowBucketDataType = '';
|
||||||
|
|
||||||
public function setBuckets($buckets)
|
public function setBuckets($buckets) {
|
||||||
{
|
|
||||||
$this->buckets = $buckets;
|
$this->buckets = $buckets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBuckets()
|
public function getBuckets() {
|
||||||
{
|
|
||||||
return $this->buckets;
|
return $this->buckets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setOverflowBucket(Google_Service_CloudMonitoring_PointDistributionOverflowBucket $overflowBucket)
|
public function setOverflowBucket(Google_Service_CloudMonitoring_PointDistributionOverflowBucket $overflowBucket) {
|
||||||
{
|
|
||||||
$this->overflowBucket = $overflowBucket;
|
$this->overflowBucket = $overflowBucket;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOverflowBucket()
|
public function getOverflowBucket() {
|
||||||
{
|
|
||||||
return $this->overflowBucket;
|
return $this->overflowBucket;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUnderflowBucket(Google_Service_CloudMonitoring_PointDistributionUnderflowBucket $underflowBucket)
|
public function setUnderflowBucket(Google_Service_CloudMonitoring_PointDistributionUnderflowBucket $underflowBucket) {
|
||||||
{
|
|
||||||
$this->underflowBucket = $underflowBucket;
|
$this->underflowBucket = $underflowBucket;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUnderflowBucket()
|
public function getUnderflowBucket() {
|
||||||
{
|
|
||||||
return $this->underflowBucket;
|
return $this->underflowBucket;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_CloudMonitoring_PointDistributionBucket extends Google_Model
|
class Google_Service_CloudMonitoring_PointDistributionBucket extends Google_Model {
|
||||||
{
|
|
||||||
public $count;
|
public $count;
|
||||||
public $lowerBound;
|
public $lowerBound;
|
||||||
public $upperBound;
|
public $upperBound;
|
||||||
|
|
||||||
public function setCount($count)
|
public function setCount($count) {
|
||||||
{
|
|
||||||
$this->count = $count;
|
$this->count = $count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCount()
|
public function getCount() {
|
||||||
{
|
|
||||||
return $this->count;
|
return $this->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setLowerBound($lowerBound)
|
public function setLowerBound($lowerBound) {
|
||||||
{
|
|
||||||
$this->lowerBound = $lowerBound;
|
$this->lowerBound = $lowerBound;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLowerBound()
|
public function getLowerBound() {
|
||||||
{
|
|
||||||
return $this->lowerBound;
|
return $this->lowerBound;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUpperBound($upperBound)
|
public function setUpperBound($upperBound) {
|
||||||
{
|
|
||||||
$this->upperBound = $upperBound;
|
$this->upperBound = $upperBound;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUpperBound()
|
public function getUpperBound() {
|
||||||
{
|
|
||||||
return $this->upperBound;
|
return $this->upperBound;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_CloudMonitoring_PointDistributionOverflowBucket extends Google_Model
|
class Google_Service_CloudMonitoring_PointDistributionOverflowBucket extends Google_Model {
|
||||||
{
|
|
||||||
public $count;
|
public $count;
|
||||||
public $lowerBound;
|
public $lowerBound;
|
||||||
|
|
||||||
public function setCount($count)
|
public function setCount($count) {
|
||||||
{
|
|
||||||
$this->count = $count;
|
$this->count = $count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCount()
|
public function getCount() {
|
||||||
{
|
|
||||||
return $this->count;
|
return $this->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setLowerBound($lowerBound)
|
public function setLowerBound($lowerBound) {
|
||||||
{
|
|
||||||
$this->lowerBound = $lowerBound;
|
$this->lowerBound = $lowerBound;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLowerBound()
|
public function getLowerBound() {
|
||||||
{
|
|
||||||
return $this->lowerBound;
|
return $this->lowerBound;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_CloudMonitoring_PointDistributionUnderflowBucket extends Google_Model
|
class Google_Service_CloudMonitoring_PointDistributionUnderflowBucket extends Google_Model {
|
||||||
{
|
|
||||||
public $count;
|
public $count;
|
||||||
public $upperBound;
|
public $upperBound;
|
||||||
|
|
||||||
public function setCount($count)
|
public function setCount($count) {
|
||||||
{
|
|
||||||
$this->count = $count;
|
$this->count = $count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCount()
|
public function getCount() {
|
||||||
{
|
|
||||||
return $this->count;
|
return $this->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUpperBound($upperBound)
|
public function setUpperBound($upperBound) {
|
||||||
{
|
|
||||||
$this->upperBound = $upperBound;
|
$this->upperBound = $upperBound;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUpperBound()
|
public function getUpperBound() {
|
||||||
{
|
|
||||||
return $this->upperBound;
|
return $this->upperBound;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_CloudMonitoring_Timeseries extends Google_Collection
|
class Google_Service_CloudMonitoring_Timeseries extends Google_Collection {
|
||||||
{
|
|
||||||
protected $pointsType = 'Google_Service_CloudMonitoring_Point';
|
protected $pointsType = 'Google_Service_CloudMonitoring_Point';
|
||||||
protected $pointsDataType = 'array';
|
protected $pointsDataType = 'array';
|
||||||
protected $timeseriesDescType = 'Google_Service_CloudMonitoring_TimeseriesDescriptor';
|
protected $timeseriesDescType = 'Google_Service_CloudMonitoring_TimeseriesDescriptor';
|
||||||
protected $timeseriesDescDataType = '';
|
protected $timeseriesDescDataType = '';
|
||||||
|
|
||||||
public function setPoints($points)
|
public function setPoints($points) {
|
||||||
{
|
|
||||||
$this->points = $points;
|
$this->points = $points;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPoints()
|
public function getPoints() {
|
||||||
{
|
|
||||||
return $this->points;
|
return $this->points;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTimeseriesDesc(Google_Service_CloudMonitoring_TimeseriesDescriptor $timeseriesDesc)
|
public function setTimeseriesDesc(Google_Service_CloudMonitoring_TimeseriesDescriptor $timeseriesDesc) {
|
||||||
{
|
|
||||||
$this->timeseriesDesc = $timeseriesDesc;
|
$this->timeseriesDesc = $timeseriesDesc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTimeseriesDesc()
|
public function getTimeseriesDesc() {
|
||||||
{
|
|
||||||
return $this->timeseriesDesc;
|
return $this->timeseriesDesc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_CloudMonitoring_TimeseriesDescriptor extends Google_Model
|
class Google_Service_CloudMonitoring_TimeseriesDescriptor extends Google_Model {
|
||||||
{
|
|
||||||
public $labels;
|
public $labels;
|
||||||
public $metric;
|
public $metric;
|
||||||
public $project;
|
public $project;
|
||||||
|
|
||||||
public function setLabels($labels)
|
public function setLabels($labels) {
|
||||||
{
|
|
||||||
$this->labels = $labels;
|
$this->labels = $labels;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLabels()
|
public function getLabels() {
|
||||||
{
|
|
||||||
return $this->labels;
|
return $this->labels;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setMetric($metric)
|
public function setMetric($metric) {
|
||||||
{
|
|
||||||
$this->metric = $metric;
|
$this->metric = $metric;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMetric()
|
public function getMetric() {
|
||||||
{
|
|
||||||
return $this->metric;
|
return $this->metric;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setProject($project)
|
public function setProject($project) {
|
||||||
{
|
|
||||||
$this->project = $project;
|
$this->project = $project;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getProject()
|
public function getProject() {
|
||||||
{
|
|
||||||
return $this->project;
|
return $this->project;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_CloudMonitoring_TimeseriesDescriptorLabels extends Google_Model
|
class Google_Service_CloudMonitoring_TimeseriesDescriptorLabels extends Google_Model {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -29,8 +29,7 @@
|
||||||
*
|
*
|
||||||
* @author Google, Inc.
|
* @author Google, Inc.
|
||||||
*/
|
*/
|
||||||
class Google_Service_Dns extends Google_Service
|
class Google_Service_Dns extends Google_Service {
|
||||||
{
|
|
||||||
/** View and manage your data across Google Cloud Platform services. */
|
/** View and manage your data across Google Cloud Platform services. */
|
||||||
const CLOUD_PLATFORM = "https://www.googleapis.com/auth/cloud-platform";
|
const CLOUD_PLATFORM = "https://www.googleapis.com/auth/cloud-platform";
|
||||||
/** View your DNS records hosted by Google Cloud DNS. */
|
/** View your DNS records hosted by Google Cloud DNS. */
|
||||||
|
@ -49,8 +48,7 @@ class Google_Service_Dns extends Google_Service
|
||||||
*
|
*
|
||||||
* @param Google_Client $client
|
* @param Google_Client $client
|
||||||
*/
|
*/
|
||||||
public function __construct(Google_Client $client)
|
public function __construct(Google_Client $client) {
|
||||||
{
|
|
||||||
parent::__construct($client);
|
parent::__construct($client);
|
||||||
$this->servicePath = 'dns/v1beta1/projects/';
|
$this->servicePath = 'dns/v1beta1/projects/';
|
||||||
$this->version = 'v1beta1';
|
$this->version = 'v1beta1';
|
||||||
|
@ -273,8 +271,7 @@ class Google_Service_Dns extends Google_Service
|
||||||
* $changes = $dnsService->changes;
|
* $changes = $dnsService->changes;
|
||||||
* </code>
|
* </code>
|
||||||
*/
|
*/
|
||||||
class Google_Service_Dns_Changes_Resource extends Google_Service_Resource
|
class Google_Service_Dns_Changes_Resource extends Google_Service_Resource {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Atomically update the ResourceRecordSet collection. (changes.create)
|
* Atomically update the ResourceRecordSet collection. (changes.create)
|
||||||
|
@ -287,12 +284,12 @@ class Google_Service_Dns_Changes_Resource extends Google_Service_Resource
|
||||||
* @param array $optParams Optional parameters.
|
* @param array $optParams Optional parameters.
|
||||||
* @return Google_Service_Dns_Change
|
* @return Google_Service_Dns_Change
|
||||||
*/
|
*/
|
||||||
public function create($project, $managedZone, Google_Service_Dns_Change $postBody, $optParams = array())
|
public function create($project, $managedZone, Google_Service_Dns_Change $postBody, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'managedZone' => $managedZone, 'postBody' => $postBody);
|
$params = array('project' => $project, 'managedZone' => $managedZone, 'postBody' => $postBody);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('create', array($params), "Google_Service_Dns_Change");
|
return $this->call('create', array($params), "Google_Service_Dns_Change");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch the representation of an existing Change. (changes.get)
|
* Fetch the representation of an existing Change. (changes.get)
|
||||||
*
|
*
|
||||||
|
@ -305,12 +302,12 @@ class Google_Service_Dns_Changes_Resource extends Google_Service_Resource
|
||||||
* @param array $optParams Optional parameters.
|
* @param array $optParams Optional parameters.
|
||||||
* @return Google_Service_Dns_Change
|
* @return Google_Service_Dns_Change
|
||||||
*/
|
*/
|
||||||
public function get($project, $managedZone, $changeId, $optParams = array())
|
public function get($project, $managedZone, $changeId, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'managedZone' => $managedZone, 'changeId' => $changeId);
|
$params = array('project' => $project, 'managedZone' => $managedZone, 'changeId' => $changeId);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('get', array($params), "Google_Service_Dns_Change");
|
return $this->call('get', array($params), "Google_Service_Dns_Change");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enumerate Changes to a ResourceRecordSet collection. (changes.listChanges)
|
* Enumerate Changes to a ResourceRecordSet collection. (changes.listChanges)
|
||||||
*
|
*
|
||||||
|
@ -332,8 +329,7 @@ class Google_Service_Dns_Changes_Resource extends Google_Service_Resource
|
||||||
* Sorting order direction: 'ascending' or 'descending'.
|
* Sorting order direction: 'ascending' or 'descending'.
|
||||||
* @return Google_Service_Dns_ChangesListResponse
|
* @return Google_Service_Dns_ChangesListResponse
|
||||||
*/
|
*/
|
||||||
public function listChanges($project, $managedZone, $optParams = array())
|
public function listChanges($project, $managedZone, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'managedZone' => $managedZone);
|
$params = array('project' => $project, 'managedZone' => $managedZone);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('list', array($params), "Google_Service_Dns_ChangesListResponse");
|
return $this->call('list', array($params), "Google_Service_Dns_ChangesListResponse");
|
||||||
|
@ -348,8 +344,7 @@ class Google_Service_Dns_Changes_Resource extends Google_Service_Resource
|
||||||
* $managedZones = $dnsService->managedZones;
|
* $managedZones = $dnsService->managedZones;
|
||||||
* </code>
|
* </code>
|
||||||
*/
|
*/
|
||||||
class Google_Service_Dns_ManagedZones_Resource extends Google_Service_Resource
|
class Google_Service_Dns_ManagedZones_Resource extends Google_Service_Resource {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new ManagedZone. (managedZones.create)
|
* Create a new ManagedZone. (managedZones.create)
|
||||||
|
@ -360,12 +355,12 @@ class Google_Service_Dns_ManagedZones_Resource extends Google_Service_Resource
|
||||||
* @param array $optParams Optional parameters.
|
* @param array $optParams Optional parameters.
|
||||||
* @return Google_Service_Dns_ManagedZone
|
* @return Google_Service_Dns_ManagedZone
|
||||||
*/
|
*/
|
||||||
public function create($project, Google_Service_Dns_ManagedZone $postBody, $optParams = array())
|
public function create($project, Google_Service_Dns_ManagedZone $postBody, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'postBody' => $postBody);
|
$params = array('project' => $project, 'postBody' => $postBody);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('create', array($params), "Google_Service_Dns_ManagedZone");
|
return $this->call('create', array($params), "Google_Service_Dns_ManagedZone");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete a previously created ManagedZone. (managedZones.delete)
|
* Delete a previously created ManagedZone. (managedZones.delete)
|
||||||
*
|
*
|
||||||
|
@ -375,12 +370,12 @@ class Google_Service_Dns_ManagedZones_Resource extends Google_Service_Resource
|
||||||
* Identifies the managed zone addressed by this request. Can be the managed zone name or id.
|
* Identifies the managed zone addressed by this request. Can be the managed zone name or id.
|
||||||
* @param array $optParams Optional parameters.
|
* @param array $optParams Optional parameters.
|
||||||
*/
|
*/
|
||||||
public function delete($project, $managedZone, $optParams = array())
|
public function delete($project, $managedZone, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'managedZone' => $managedZone);
|
$params = array('project' => $project, 'managedZone' => $managedZone);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('delete', array($params));
|
return $this->call('delete', array($params));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch the representation of an existing ManagedZone. (managedZones.get)
|
* Fetch the representation of an existing ManagedZone. (managedZones.get)
|
||||||
*
|
*
|
||||||
|
@ -391,12 +386,12 @@ class Google_Service_Dns_ManagedZones_Resource extends Google_Service_Resource
|
||||||
* @param array $optParams Optional parameters.
|
* @param array $optParams Optional parameters.
|
||||||
* @return Google_Service_Dns_ManagedZone
|
* @return Google_Service_Dns_ManagedZone
|
||||||
*/
|
*/
|
||||||
public function get($project, $managedZone, $optParams = array())
|
public function get($project, $managedZone, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'managedZone' => $managedZone);
|
$params = array('project' => $project, 'managedZone' => $managedZone);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('get', array($params), "Google_Service_Dns_ManagedZone");
|
return $this->call('get', array($params), "Google_Service_Dns_ManagedZone");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enumerate ManagedZones that have been created but not yet deleted.
|
* Enumerate ManagedZones that have been created but not yet deleted.
|
||||||
* (managedZones.listManagedZones)
|
* (managedZones.listManagedZones)
|
||||||
|
@ -413,8 +408,7 @@ class Google_Service_Dns_ManagedZones_Resource extends Google_Service_Resource
|
||||||
* many results to return.
|
* many results to return.
|
||||||
* @return Google_Service_Dns_ManagedZonesListResponse
|
* @return Google_Service_Dns_ManagedZonesListResponse
|
||||||
*/
|
*/
|
||||||
public function listManagedZones($project, $optParams = array())
|
public function listManagedZones($project, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project);
|
$params = array('project' => $project);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('list', array($params), "Google_Service_Dns_ManagedZonesListResponse");
|
return $this->call('list', array($params), "Google_Service_Dns_ManagedZonesListResponse");
|
||||||
|
@ -429,8 +423,7 @@ class Google_Service_Dns_ManagedZones_Resource extends Google_Service_Resource
|
||||||
* $projects = $dnsService->projects;
|
* $projects = $dnsService->projects;
|
||||||
* </code>
|
* </code>
|
||||||
*/
|
*/
|
||||||
class Google_Service_Dns_Projects_Resource extends Google_Service_Resource
|
class Google_Service_Dns_Projects_Resource extends Google_Service_Resource {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch the representation of an existing Project. (projects.get)
|
* Fetch the representation of an existing Project. (projects.get)
|
||||||
|
@ -440,8 +433,7 @@ class Google_Service_Dns_Projects_Resource extends Google_Service_Resource
|
||||||
* @param array $optParams Optional parameters.
|
* @param array $optParams Optional parameters.
|
||||||
* @return Google_Service_Dns_Project
|
* @return Google_Service_Dns_Project
|
||||||
*/
|
*/
|
||||||
public function get($project, $optParams = array())
|
public function get($project, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project);
|
$params = array('project' => $project);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('get', array($params), "Google_Service_Dns_Project");
|
return $this->call('get', array($params), "Google_Service_Dns_Project");
|
||||||
|
@ -456,8 +448,7 @@ class Google_Service_Dns_Projects_Resource extends Google_Service_Resource
|
||||||
* $resourceRecordSets = $dnsService->resourceRecordSets;
|
* $resourceRecordSets = $dnsService->resourceRecordSets;
|
||||||
* </code>
|
* </code>
|
||||||
*/
|
*/
|
||||||
class Google_Service_Dns_ResourceRecordSets_Resource extends Google_Service_Resource
|
class Google_Service_Dns_ResourceRecordSets_Resource extends Google_Service_Resource {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enumerate ResourceRecordSets that have been created but not yet deleted.
|
* Enumerate ResourceRecordSets that have been created but not yet deleted.
|
||||||
|
@ -482,8 +473,7 @@ class Google_Service_Dns_ResourceRecordSets_Resource extends Google_Service_Reso
|
||||||
* also be present.
|
* also be present.
|
||||||
* @return Google_Service_Dns_ResourceRecordSetsListResponse
|
* @return Google_Service_Dns_ResourceRecordSetsListResponse
|
||||||
*/
|
*/
|
||||||
public function listResourceRecordSets($project, $managedZone, $optParams = array())
|
public function listResourceRecordSets($project, $managedZone, $optParams = array()) {
|
||||||
{
|
|
||||||
$params = array('project' => $project, 'managedZone' => $managedZone);
|
$params = array('project' => $project, 'managedZone' => $managedZone);
|
||||||
$params = array_merge($params, $optParams);
|
$params = array_merge($params, $optParams);
|
||||||
return $this->call('list', array($params), "Google_Service_Dns_ResourceRecordSetsListResponse");
|
return $this->call('list', array($params), "Google_Service_Dns_ResourceRecordSetsListResponse");
|
||||||
|
@ -491,10 +481,7 @@ class Google_Service_Dns_ResourceRecordSets_Resource extends Google_Service_Reso
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class Google_Service_Dns_Change extends Google_Collection {
|
||||||
|
|
||||||
class Google_Service_Dns_Change extends Google_Collection
|
|
||||||
{
|
|
||||||
protected $additionsType = 'Google_Service_Dns_ResourceRecordSet';
|
protected $additionsType = 'Google_Service_Dns_ResourceRecordSet';
|
||||||
protected $additionsDataType = 'array';
|
protected $additionsDataType = 'array';
|
||||||
protected $deletionsType = 'Google_Service_Dns_ResourceRecordSet';
|
protected $deletionsType = 'Google_Service_Dns_ResourceRecordSet';
|
||||||
|
@ -504,107 +491,87 @@ class Google_Service_Dns_Change extends Google_Collection
|
||||||
public $startTime;
|
public $startTime;
|
||||||
public $status;
|
public $status;
|
||||||
|
|
||||||
public function setAdditions($additions)
|
public function setAdditions($additions) {
|
||||||
{
|
|
||||||
$this->additions = $additions;
|
$this->additions = $additions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAdditions()
|
public function getAdditions() {
|
||||||
{
|
|
||||||
return $this->additions;
|
return $this->additions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDeletions($deletions)
|
public function setDeletions($deletions) {
|
||||||
{
|
|
||||||
$this->deletions = $deletions;
|
$this->deletions = $deletions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDeletions()
|
public function getDeletions() {
|
||||||
{
|
|
||||||
return $this->deletions;
|
return $this->deletions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setId($id)
|
public function setId($id) {
|
||||||
{
|
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId()
|
public function getId() {
|
||||||
{
|
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setStartTime($startTime)
|
public function setStartTime($startTime) {
|
||||||
{
|
|
||||||
$this->startTime = $startTime;
|
$this->startTime = $startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getStartTime()
|
public function getStartTime() {
|
||||||
{
|
|
||||||
return $this->startTime;
|
return $this->startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setStatus($status)
|
public function setStatus($status) {
|
||||||
{
|
|
||||||
$this->status = $status;
|
$this->status = $status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getStatus()
|
public function getStatus() {
|
||||||
{
|
|
||||||
return $this->status;
|
return $this->status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Dns_ChangesListResponse extends Google_Collection
|
class Google_Service_Dns_ChangesListResponse extends Google_Collection {
|
||||||
{
|
|
||||||
protected $changesType = 'Google_Service_Dns_Change';
|
protected $changesType = 'Google_Service_Dns_Change';
|
||||||
protected $changesDataType = 'array';
|
protected $changesDataType = 'array';
|
||||||
public $kind;
|
public $kind;
|
||||||
public $nextPageToken;
|
public $nextPageToken;
|
||||||
|
|
||||||
public function setChanges($changes)
|
public function setChanges($changes) {
|
||||||
{
|
|
||||||
$this->changes = $changes;
|
$this->changes = $changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getChanges()
|
public function getChanges() {
|
||||||
{
|
|
||||||
return $this->changes;
|
return $this->changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNextPageToken($nextPageToken)
|
public function setNextPageToken($nextPageToken) {
|
||||||
{
|
|
||||||
$this->nextPageToken = $nextPageToken;
|
$this->nextPageToken = $nextPageToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNextPageToken()
|
public function getNextPageToken() {
|
||||||
{
|
|
||||||
return $this->nextPageToken;
|
return $this->nextPageToken;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Dns_ManagedZone extends Google_Collection
|
class Google_Service_Dns_ManagedZone extends Google_Collection {
|
||||||
{
|
|
||||||
public $creationTime;
|
public $creationTime;
|
||||||
public $description;
|
public $description;
|
||||||
public $dnsName;
|
public $dnsName;
|
||||||
|
@ -613,166 +580,135 @@ class Google_Service_Dns_ManagedZone extends Google_Collection
|
||||||
public $name;
|
public $name;
|
||||||
public $nameServers;
|
public $nameServers;
|
||||||
|
|
||||||
public function setCreationTime($creationTime)
|
public function setCreationTime($creationTime) {
|
||||||
{
|
|
||||||
$this->creationTime = $creationTime;
|
$this->creationTime = $creationTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCreationTime()
|
public function getCreationTime() {
|
||||||
{
|
|
||||||
return $this->creationTime;
|
return $this->creationTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDescription($description)
|
public function setDescription($description) {
|
||||||
{
|
|
||||||
$this->description = $description;
|
$this->description = $description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDescription()
|
public function getDescription() {
|
||||||
{
|
|
||||||
return $this->description;
|
return $this->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDnsName($dnsName)
|
public function setDnsName($dnsName) {
|
||||||
{
|
|
||||||
$this->dnsName = $dnsName;
|
$this->dnsName = $dnsName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDnsName()
|
public function getDnsName() {
|
||||||
{
|
|
||||||
return $this->dnsName;
|
return $this->dnsName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setId($id)
|
public function setId($id) {
|
||||||
{
|
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId()
|
public function getId() {
|
||||||
{
|
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setName($name)
|
public function setName($name) {
|
||||||
{
|
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName()
|
public function getName() {
|
||||||
{
|
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNameServers($nameServers)
|
public function setNameServers($nameServers) {
|
||||||
{
|
|
||||||
$this->nameServers = $nameServers;
|
$this->nameServers = $nameServers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNameServers()
|
public function getNameServers() {
|
||||||
{
|
|
||||||
return $this->nameServers;
|
return $this->nameServers;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Dns_ManagedZonesListResponse extends Google_Collection
|
class Google_Service_Dns_ManagedZonesListResponse extends Google_Collection {
|
||||||
{
|
|
||||||
public $kind;
|
public $kind;
|
||||||
protected $managedZonesType = 'Google_Service_Dns_ManagedZone';
|
protected $managedZonesType = 'Google_Service_Dns_ManagedZone';
|
||||||
protected $managedZonesDataType = 'array';
|
protected $managedZonesDataType = 'array';
|
||||||
public $nextPageToken;
|
public $nextPageToken;
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setManagedZones($managedZones)
|
public function setManagedZones($managedZones) {
|
||||||
{
|
|
||||||
$this->managedZones = $managedZones;
|
$this->managedZones = $managedZones;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getManagedZones()
|
public function getManagedZones() {
|
||||||
{
|
|
||||||
return $this->managedZones;
|
return $this->managedZones;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNextPageToken($nextPageToken)
|
public function setNextPageToken($nextPageToken) {
|
||||||
{
|
|
||||||
$this->nextPageToken = $nextPageToken;
|
$this->nextPageToken = $nextPageToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNextPageToken()
|
public function getNextPageToken() {
|
||||||
{
|
|
||||||
return $this->nextPageToken;
|
return $this->nextPageToken;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Dns_Project extends Google_Model
|
class Google_Service_Dns_Project extends Google_Model {
|
||||||
{
|
|
||||||
public $id;
|
public $id;
|
||||||
public $kind;
|
public $kind;
|
||||||
public $number;
|
public $number;
|
||||||
protected $quotaType = 'Google_Service_Dns_Quota';
|
protected $quotaType = 'Google_Service_Dns_Quota';
|
||||||
protected $quotaDataType = '';
|
protected $quotaDataType = '';
|
||||||
|
|
||||||
public function setId($id)
|
public function setId($id) {
|
||||||
{
|
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId()
|
public function getId() {
|
||||||
{
|
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNumber($number)
|
public function setNumber($number) {
|
||||||
{
|
|
||||||
$this->number = $number;
|
$this->number = $number;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNumber()
|
public function getNumber() {
|
||||||
{
|
|
||||||
return $this->number;
|
return $this->number;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setQuota(Google_Service_Dns_Quota $quota)
|
public function setQuota(Google_Service_Dns_Quota $quota) {
|
||||||
{
|
|
||||||
$this->quota = $quota;
|
$this->quota = $quota;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getQuota()
|
public function getQuota() {
|
||||||
{
|
|
||||||
return $this->quota;
|
return $this->quota;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Dns_Quota extends Google_Model
|
class Google_Service_Dns_Quota extends Google_Model {
|
||||||
{
|
|
||||||
public $kind;
|
public $kind;
|
||||||
public $managedZones;
|
public $managedZones;
|
||||||
public $resourceRecordsPerRrset;
|
public $resourceRecordsPerRrset;
|
||||||
|
@ -781,170 +717,138 @@ class Google_Service_Dns_Quota extends Google_Model
|
||||||
public $rrsetsPerManagedZone;
|
public $rrsetsPerManagedZone;
|
||||||
public $totalRrdataSizePerChange;
|
public $totalRrdataSizePerChange;
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setManagedZones($managedZones)
|
public function setManagedZones($managedZones) {
|
||||||
{
|
|
||||||
$this->managedZones = $managedZones;
|
$this->managedZones = $managedZones;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getManagedZones()
|
public function getManagedZones() {
|
||||||
{
|
|
||||||
return $this->managedZones;
|
return $this->managedZones;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setResourceRecordsPerRrset($resourceRecordsPerRrset)
|
public function setResourceRecordsPerRrset($resourceRecordsPerRrset) {
|
||||||
{
|
|
||||||
$this->resourceRecordsPerRrset = $resourceRecordsPerRrset;
|
$this->resourceRecordsPerRrset = $resourceRecordsPerRrset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getResourceRecordsPerRrset()
|
public function getResourceRecordsPerRrset() {
|
||||||
{
|
|
||||||
return $this->resourceRecordsPerRrset;
|
return $this->resourceRecordsPerRrset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setRrsetAdditionsPerChange($rrsetAdditionsPerChange)
|
public function setRrsetAdditionsPerChange($rrsetAdditionsPerChange) {
|
||||||
{
|
|
||||||
$this->rrsetAdditionsPerChange = $rrsetAdditionsPerChange;
|
$this->rrsetAdditionsPerChange = $rrsetAdditionsPerChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRrsetAdditionsPerChange()
|
public function getRrsetAdditionsPerChange() {
|
||||||
{
|
|
||||||
return $this->rrsetAdditionsPerChange;
|
return $this->rrsetAdditionsPerChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setRrsetDeletionsPerChange($rrsetDeletionsPerChange)
|
public function setRrsetDeletionsPerChange($rrsetDeletionsPerChange) {
|
||||||
{
|
|
||||||
$this->rrsetDeletionsPerChange = $rrsetDeletionsPerChange;
|
$this->rrsetDeletionsPerChange = $rrsetDeletionsPerChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRrsetDeletionsPerChange()
|
public function getRrsetDeletionsPerChange() {
|
||||||
{
|
|
||||||
return $this->rrsetDeletionsPerChange;
|
return $this->rrsetDeletionsPerChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setRrsetsPerManagedZone($rrsetsPerManagedZone)
|
public function setRrsetsPerManagedZone($rrsetsPerManagedZone) {
|
||||||
{
|
|
||||||
$this->rrsetsPerManagedZone = $rrsetsPerManagedZone;
|
$this->rrsetsPerManagedZone = $rrsetsPerManagedZone;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRrsetsPerManagedZone()
|
public function getRrsetsPerManagedZone() {
|
||||||
{
|
|
||||||
return $this->rrsetsPerManagedZone;
|
return $this->rrsetsPerManagedZone;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTotalRrdataSizePerChange($totalRrdataSizePerChange)
|
public function setTotalRrdataSizePerChange($totalRrdataSizePerChange) {
|
||||||
{
|
|
||||||
$this->totalRrdataSizePerChange = $totalRrdataSizePerChange;
|
$this->totalRrdataSizePerChange = $totalRrdataSizePerChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTotalRrdataSizePerChange()
|
public function getTotalRrdataSizePerChange() {
|
||||||
{
|
|
||||||
return $this->totalRrdataSizePerChange;
|
return $this->totalRrdataSizePerChange;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Dns_ResourceRecordSet extends Google_Collection
|
class Google_Service_Dns_ResourceRecordSet extends Google_Collection {
|
||||||
{
|
|
||||||
public $kind;
|
public $kind;
|
||||||
public $name;
|
public $name;
|
||||||
public $rrdatas;
|
public $rrdatas;
|
||||||
public $ttl;
|
public $ttl;
|
||||||
public $type;
|
public $type;
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setName($name)
|
public function setName($name) {
|
||||||
{
|
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName()
|
public function getName() {
|
||||||
{
|
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setRrdatas($rrdatas)
|
public function setRrdatas($rrdatas) {
|
||||||
{
|
|
||||||
$this->rrdatas = $rrdatas;
|
$this->rrdatas = $rrdatas;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRrdatas()
|
public function getRrdatas() {
|
||||||
{
|
|
||||||
return $this->rrdatas;
|
return $this->rrdatas;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTtl($ttl)
|
public function setTtl($ttl) {
|
||||||
{
|
|
||||||
$this->ttl = $ttl;
|
$this->ttl = $ttl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTtl()
|
public function getTtl() {
|
||||||
{
|
|
||||||
return $this->ttl;
|
return $this->ttl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setType($type)
|
public function setType($type) {
|
||||||
{
|
|
||||||
$this->type = $type;
|
$this->type = $type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getType()
|
public function getType() {
|
||||||
{
|
|
||||||
return $this->type;
|
return $this->type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Google_Service_Dns_ResourceRecordSetsListResponse extends Google_Collection
|
class Google_Service_Dns_ResourceRecordSetsListResponse extends Google_Collection {
|
||||||
{
|
|
||||||
public $kind;
|
public $kind;
|
||||||
public $nextPageToken;
|
public $nextPageToken;
|
||||||
protected $rrsetsType = 'Google_Service_Dns_ResourceRecordSet';
|
protected $rrsetsType = 'Google_Service_Dns_ResourceRecordSet';
|
||||||
protected $rrsetsDataType = 'array';
|
protected $rrsetsDataType = 'array';
|
||||||
|
|
||||||
public function setKind($kind)
|
public function setKind($kind) {
|
||||||
{
|
|
||||||
$this->kind = $kind;
|
$this->kind = $kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKind()
|
public function getKind() {
|
||||||
{
|
|
||||||
return $this->kind;
|
return $this->kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNextPageToken($nextPageToken)
|
public function setNextPageToken($nextPageToken) {
|
||||||
{
|
|
||||||
$this->nextPageToken = $nextPageToken;
|
$this->nextPageToken = $nextPageToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNextPageToken()
|
public function getNextPageToken() {
|
||||||
{
|
|
||||||
return $this->nextPageToken;
|
return $this->nextPageToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setRrsets($rrsets)
|
public function setRrsets($rrsets) {
|
||||||
{
|
|
||||||
$this->rrsets = $rrsets;
|
$this->rrsets = $rrsets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRrsets()
|
public function getRrsets() {
|
||||||
{
|
|
||||||
return $this->rrsets;
|
return $this->rrsets;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue