git.cweiske.de
/
shpub.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More specific error message
[shpub.git]
/
src
/
shpub
/
Command
/
AbstractProps.php
diff --git
a/src/shpub/Command/AbstractProps.php
b/src/shpub/Command/AbstractProps.php
index d939aa75f1715818c69b563d787e8795749c1faa..e186819f49b26a907660a50854f87c028f9ee06f 100644
(file)
--- a/
src/shpub/Command/AbstractProps.php
+++ b/
src/shpub/Command/AbstractProps.php
@@
-3,6
+3,10
@@
namespace shpub;
/**
* Abstract command class that handles generic properties
/**
* Abstract command class that handles generic properties
+ *
+ * @author Christian Weiske <cweiske@cweiske.de>
+ * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
+ * @link http://cweiske.de/shpub.htm
*/
class Command_AbstractProps
{
*/
class Command_AbstractProps
{
@@
-94,7
+98,7
@@
class Command_AbstractProps
$cmd->addOption(
'syndication',
array(
$cmd->addOption(
'syndication',
array(
- 'short_name' => '-
s
',
+ 'short_name' => '-
u
',
'long_name' => '--syndication',
'description' => 'Syndication URL(s)',
'help_name' => 'URL',
'long_name' => '--syndication',
'description' => 'Syndication URL(s)',
'help_name' => 'URL',
@@
-121,7
+125,6
@@
class Command_AbstractProps
$cmd->addOption(
'html',
array(
$cmd->addOption(
'html',
array(
- 'short_name' => '-h',
'long_name' => '--html',
'description' => 'Text content is HTML',
'action' => 'StoreTrue',
'long_name' => '--html',
'description' => 'Text content is HTML',
'action' => 'StoreTrue',
@@
-149,32
+152,32
@@
class Command_AbstractProps
$this->handleOptJson($cmdRes, $req);
if ($cmdRes->options['published'] !== null) {
$this->handleOptJson($cmdRes, $req);
if ($cmdRes->options['published'] !== null) {
- $req->
req->addPostParameter
(
+ $req->
addProperty
(
'published', $cmdRes->options['published']
);
}
if ($cmdRes->options['updated'] !== null) {
'published', $cmdRes->options['published']
);
}
if ($cmdRes->options['updated'] !== null) {
- $req->
req->addPostParameter
(
+ $req->
addProperty
(
'updated', $cmdRes->options['updated']
);
}
if (count($cmdRes->options['categories'])) {
'updated', $cmdRes->options['updated']
);
}
if (count($cmdRes->options['categories'])) {
- $req->addP
ostParameter
(
+ $req->addP
roperty
(
'category', $cmdRes->options['categories']
);
}
if ($cmdRes->options['name'] !== null) {
'category', $cmdRes->options['categories']
);
}
if ($cmdRes->options['name'] !== null) {
- $req->
req->addPostParameter
(
+ $req->
addProperty
(
'name', $cmdRes->options['name']
);
}
if ($cmdRes->options['slug'] !== null) {
'name', $cmdRes->options['name']
);
}
if ($cmdRes->options['slug'] !== null) {
- $req->
req->addPostParameter
(
+ $req->
addProperty
(
'slug', $cmdRes->options['slug']
);
}
if (count($cmdRes->options['syndication'])) {
'slug', $cmdRes->options['slug']
);
}
if (count($cmdRes->options['syndication'])) {
- $req->addP
ostParameter
(
+ $req->addP
roperty
(
'syndication', $cmdRes->options['syndication']
);
}
'syndication', $cmdRes->options['syndication']
);
}
@@
-192,7
+195,7
@@
class Command_AbstractProps
$postParams[$propkey][] = $propval;
}
foreach ($postParams as $propkey => $propvals) {
$postParams[$propkey][] = $propval;
}
foreach ($postParams as $propkey => $propvals) {
- $req->addP
ostParameter
($propkey, $propvals);
+ $req->addP
roperty
($propkey, $propvals);
}
}
}
}
}
}
@@
-216,8
+219,9
@@
class Command_AbstractProps
foreach ($files as $filePath) {
if (strpos($filePath, '://') !== false) {
//url
foreach ($files as $filePath) {
if (strpos($filePath, '://') !== false) {
//url
+ $urlPath = parse_url($filePath, PHP_URL_PATH);
$mte = new \MIME_Type_Extension();
$mte = new \MIME_Type_Extension();
- $mimetype = $mte->getMIMEType($
file
Path);
+ $mimetype = $mte->getMIMEType($
url
Path);
$media = \MIME_Type::getMedia($mimetype);
if (!isset($urlList[$media])) {
Log::err('File type not allowed: ' . $mimetype);
$media = \MIME_Type::getMedia($mimetype);
if (!isset($urlList[$media])) {
Log::err('File type not allowed: ' . $mimetype);