master
parent
f55d317bcc
commit
0bcfa563c0
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 111 KiB |
@ -0,0 +1,17 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
if (\file_exists(__DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php')) { |
||||||
|
require_once __DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php'; |
||||||
|
} |
||||||
|
|
||||||
|
spl_autoload_register(function ($class) { |
||||||
|
$name = \str_replace('AlibabaCloud\\Client\\', '', $class); |
||||||
|
$file = __DIR__ . \DIRECTORY_SEPARATOR . 'src' . \DIRECTORY_SEPARATOR . \str_replace('\\', \DIRECTORY_SEPARATOR, $name) . '.php'; |
||||||
|
if (\file_exists($file)) { |
||||||
|
require_once $file; |
||||||
|
|
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
return false; |
||||||
|
}); |
@ -1,116 +1,134 @@ |
|||||||
{ |
{ |
||||||
"name": "alibabacloud/client", |
"name": "alibabacloud/client", |
||||||
"homepage": "https://www.alibabacloud.com/", |
"homepage": "https://www.alibabacloud.com/", |
||||||
"description": "Alibaba Cloud Client for PHP - Use Alibaba Cloud in your PHP project", |
"description": "Alibaba Cloud Client for PHP - Use Alibaba Cloud in your PHP project", |
||||||
"keywords": [ |
"keywords": [ |
||||||
"sdk", |
"sdk", |
||||||
"tool", |
"tool", |
||||||
"cloud", |
"cloud", |
||||||
"client", |
"client", |
||||||
"aliyun", |
"aliyun", |
||||||
"library", |
"library", |
||||||
"alibaba", |
"alibaba", |
||||||
"alibabacloud" |
"alibabacloud" |
||||||
], |
], |
||||||
"type": "library", |
"type": "library", |
||||||
"license": "Apache-2.0", |
"license": "Apache-2.0", |
||||||
"support": { |
"support": { |
||||||
"source": "https://github.com/aliyun/openapi-sdk-php-client", |
"source": "https://github.com/aliyun/openapi-sdk-php-client", |
||||||
"issues": "https://github.com/aliyun/openapi-sdk-php-client/issues" |
"issues": "https://github.com/aliyun/openapi-sdk-php-client/issues" |
||||||
}, |
}, |
||||||
"authors": [ |
"authors": [ |
||||||
{ |
{ |
||||||
"name": "Alibaba Cloud SDK", |
"name": "Alibaba Cloud SDK", |
||||||
"email": "sdk-team@alibabacloud.com", |
"email": "sdk-team@alibabacloud.com", |
||||||
"homepage": "http://www.alibabacloud.com" |
"homepage": "http://www.alibabacloud.com" |
||||||
} |
} |
||||||
], |
], |
||||||
"require": { |
"require": { |
||||||
"php": ">=5.5", |
"php": ">=5.5", |
||||||
"ext-curl": "*", |
"ext-curl": "*", |
||||||
"ext-json": "*", |
"ext-json": "*", |
||||||
"ext-libxml": "*", |
"ext-libxml": "*", |
||||||
"ext-openssl": "*", |
"ext-openssl": "*", |
||||||
"ext-mbstring": "*", |
"ext-mbstring": "*", |
||||||
"ext-simplexml": "*", |
"ext-simplexml": "*", |
||||||
"ext-xmlwriter": "*", |
"ext-xmlwriter": "*", |
||||||
"guzzlehttp/guzzle": "^6.3", |
"guzzlehttp/guzzle": "^6.3|^7.0", |
||||||
"danielstjules/stringy": "^3.1", |
"mtdowling/jmespath.php": "^2.5", |
||||||
"mtdowling/jmespath.php": "^2.4", |
"adbario/php-dot-notation": "^2.4.1", |
||||||
"adbario/php-dot-notation": "^2.2", |
"clagiordano/weblibs-configmanager": "^1.0" |
||||||
"clagiordano/weblibs-configmanager": "^1.0" |
}, |
||||||
}, |
"require-dev": { |
||||||
"require-dev": { |
"ext-spl": "*", |
||||||
"ext-spl": "*", |
"ext-dom": "*", |
||||||
"ext-dom": "*", |
"ext-pcre": "*", |
||||||
"ext-pcre": "*", |
"psr/cache": "^1.0", |
||||||
"psr/cache": "^1.0", |
"ext-sockets": "*", |
||||||
"ext-sockets": "*", |
"drupal/coder": "^8.3", |
||||||
"drupal/coder": "^8.3", |
"symfony/dotenv": "^3.4", |
||||||
"symfony/dotenv": "^3.4", |
"league/climate": "^3.2.4", |
||||||
"league/climate": "^3.2.4", |
"phpunit/phpunit": "^5.7|^6.6|^7.5|^8.5|^9.5", |
||||||
"phpunit/phpunit": "^4.8.35|^5.4.3", |
"monolog/monolog": "^1.24", |
||||||
"monolog/monolog": "^1.24", |
"composer/composer": "^1.8", |
||||||
"composer/composer": "^1.8", |
"mikey179/vfsstream": "^1.6", |
||||||
"mikey179/vfsstream": "^1.6", |
"symfony/var-dumper": "^3.4" |
||||||
"symfony/var-dumper": "^3.4" |
}, |
||||||
}, |
"suggest": { |
||||||
"suggest": { |
"ext-sockets": "To use client-side monitoring" |
||||||
"ext-sockets": "To use client-side monitoring" |
}, |
||||||
}, |
"autoload": { |
||||||
"autoload": { |
"psr-4": { |
||||||
"psr-4": { |
"AlibabaCloud\\Client\\": "src" |
||||||
"AlibabaCloud\\Client\\": "src" |
|
||||||
}, |
|
||||||
"files": [ |
|
||||||
"src/Functions.php" |
|
||||||
] |
|
||||||
}, |
|
||||||
"autoload-dev": { |
|
||||||
"psr-4": { |
|
||||||
"AlibabaCloud\\Client\\Tests\\": "tests/" |
|
||||||
} |
|
||||||
}, |
|
||||||
"config": { |
|
||||||
"preferred-install": "dist", |
|
||||||
"optimize-autoloader": true |
|
||||||
}, |
|
||||||
"minimum-stability": "dev", |
|
||||||
"prefer-stable": true, |
|
||||||
"scripts-descriptions": { |
|
||||||
"cs": "Tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard.", |
|
||||||
"cbf": "Automatically correct coding standard violations.", |
|
||||||
"fixer": "Fixes code to follow standards.", |
|
||||||
"test": "Run all tests.", |
|
||||||
"unit": "Run Unit tests.", |
|
||||||
"feature": "Run Feature tests.", |
|
||||||
"clearCache": "Clear cache like coverage.", |
|
||||||
"coverage": "Show Coverage html.", |
|
||||||
"endpoints": "Update endpoints from OSS." |
|
||||||
}, |
}, |
||||||
"scripts": { |
"files": [ |
||||||
"cs": "phpcs --standard=PSR2 -n ./", |
"src/Functions.php" |
||||||
"cbf": "phpcbf --standard=PSR2 -n ./", |
] |
||||||
"fixer": "php-cs-fixer fix ./", |
}, |
||||||
"test": [ |
"autoload-dev": { |
||||||
"phpunit --colors=always" |
"psr-4": { |
||||||
], |
"AlibabaCloud\\Client\\Tests\\": "tests/" |
||||||
"unit": [ |
|
||||||
"@clearCache", |
|
||||||
"phpunit --testsuite=Unit --colors=always" |
|
||||||
], |
|
||||||
"feature": [ |
|
||||||
"@clearCache", |
|
||||||
"phpunit --testsuite=Feature --colors=always" |
|
||||||
], |
|
||||||
"coverage": "open cache/coverage/index.html", |
|
||||||
"clearCache": "rm -rf cache/*", |
|
||||||
"endpoints": [ |
|
||||||
"AlibabaCloud\\Client\\Regions\\LocationService::updateEndpoints", |
|
||||||
"@fixer" |
|
||||||
], |
|
||||||
"release": [ |
|
||||||
"AlibabaCloud\\Client\\Release::release" |
|
||||||
] |
|
||||||
} |
} |
||||||
|
}, |
||||||
|
"config": { |
||||||
|
"preferred-install": "dist", |
||||||
|
"optimize-autoloader": true, |
||||||
|
"allow-plugins": { |
||||||
|
"dealerdirect/phpcodesniffer-composer-installer": true |
||||||
|
} |
||||||
|
}, |
||||||
|
"minimum-stability": "dev", |
||||||
|
"prefer-stable": true, |
||||||
|
"scripts-descriptions": { |
||||||
|
"cs": "Tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard.", |
||||||
|
"cbf": "Automatically correct coding standard violations.", |
||||||
|
"fixer": "Fixes code to follow standards.", |
||||||
|
"test": "Run all tests.", |
||||||
|
"unit": "Run Unit tests.", |
||||||
|
"feature": "Run Feature tests.", |
||||||
|
"clearCache": "Clear cache like coverage.", |
||||||
|
"coverage": "Show Coverage html.", |
||||||
|
"endpoints": "Update endpoints from OSS." |
||||||
|
}, |
||||||
|
"scripts": { |
||||||
|
"cs": "phpcs --standard=PSR2 -n ./", |
||||||
|
"cbf": "phpcbf --standard=PSR2 -n ./", |
||||||
|
"fixer": "php-cs-fixer fix ./", |
||||||
|
"test": [ |
||||||
|
"phpunit --colors=always" |
||||||
|
], |
||||||
|
"test4HighVersion": [ |
||||||
|
"@clearCache", |
||||||
|
"phpunit --testsuite=Test4HighVersion --colors=always" |
||||||
|
], |
||||||
|
"test4LowVersion": [ |
||||||
|
"@clearCache", |
||||||
|
"phpunit --testsuite=Test4LowVersion --colors=always" |
||||||
|
], |
||||||
|
"unit4HighVersion": [ |
||||||
|
"@clearCache", |
||||||
|
"phpunit --testsuite=Unit4HighVersion --colors=always" |
||||||
|
], |
||||||
|
"unit4LowVersion": [ |
||||||
|
"@clearCache", |
||||||
|
"phpunit --testsuite=Unit4LowVersion --colors=always" |
||||||
|
], |
||||||
|
"feature4HighVersion": [ |
||||||
|
"@clearCache", |
||||||
|
"phpunit --testsuite=Feature4HighVersion --colors=always" |
||||||
|
], |
||||||
|
"feature4LowVersion": [ |
||||||
|
"@clearCache", |
||||||
|
"phpunit --testsuite=Feature4LowVersion --colors=always" |
||||||
|
], |
||||||
|
"coverage": "open cache/coverage/index.html", |
||||||
|
"clearCache": "rm -rf cache/*", |
||||||
|
"endpoints": [ |
||||||
|
"AlibabaCloud\\Client\\Regions\\LocationService::updateEndpoints", |
||||||
|
"@fixer" |
||||||
|
], |
||||||
|
"release": [ |
||||||
|
"AlibabaCloud\\Client\\Release::release" |
||||||
|
] |
||||||
|
} |
||||||
} |
} |
||||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,47 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace AlibabaCloud\Client\Support; |
||||||
|
|
||||||
|
/** |
||||||
|
* Class Stringy |
||||||
|
* |
||||||
|
* @package AlibabaCloud\Client\Support |
||||||
|
*/ |
||||||
|
class Stringy |
||||||
|
{ |
||||||
|
|
||||||
|
private static function _value($value, $default = '') |
||||||
|
{ |
||||||
|
return null === $value ? $default : $value; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* @param string $str |
||||||
|
* @param string $substr |
||||||
|
* |
||||||
|
* @return bool |
||||||
|
*/ |
||||||
|
public static function contains($str, $substr) |
||||||
|
{ |
||||||
|
return false !== strpos(self::_value($str), self::_value($substr)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* @param string $str |
||||||
|
* @param string $substr |
||||||
|
* |
||||||
|
* @return bool |
||||||
|
*/ |
||||||
|
public static function endsWith($str, $substr) |
||||||
|
{ |
||||||
|
$str = self::_value($str); |
||||||
|
$substr = self::_value($substr); |
||||||
|
$length = \strlen($substr); |
||||||
|
if (!$length) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
return substr($str, -$length) === $substr; |
||||||
|
} |
||||||
|
|
||||||
|
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue