Skip to content

Commit 0ab9192

Browse files
authored
Merge pull request #39 from moufmouf/objects_scanner
Adding new scan-objects command
2 parents d2c1d34 + d801aad commit 0ab9192

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2084
-114
lines changed

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"generated/simplexml.php",
7676
"generated/sockets.php",
7777
"generated/sodium.php",
78+
"generated/solr.php",
7879
"generated/spl.php",
7980
"generated/sqlsrv.php",
8081
"generated/ssh2.php",
@@ -83,6 +84,7 @@
8384
"generated/strings.php",
8485
"generated/swoole.php",
8586
"generated/uodbc.php",
87+
"generated/uopz.php",
8688
"generated/url.php",
8789
"generated/var.php",
8890
"generated/xdiff.php",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
namespace Safe\Exceptions;
3+
4+
class SolrException extends AbstractSafeException
5+
{
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
namespace Safe\Exceptions;
3+
4+
class UopzException extends AbstractSafeException
5+
{
6+
}

generated/apc.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,37 @@
44

55
use Safe\Exceptions\ApcException;
66

7+
/**
8+
* Retrieves cached information and meta-data from APC's data store.
9+
*
10+
* @param string $cache_type If cache_type is "user",
11+
* information about the user cache will be returned.
12+
*
13+
* If cache_type is "filehits",
14+
* information about which files have been served from the bytecode cache
15+
* for the current request will be returned. This feature must be enabled at
16+
* compile time using --enable-filehits.
17+
*
18+
* If an invalid or no cache_type is specified, information about
19+
* the system cache (cached files) will be returned.
20+
* @param bool $limited If limited is TRUE, the
21+
* return value will exclude the individual list of cache entries. This
22+
* is useful when trying to optimize calls for statistics gathering.
23+
* @return array Array of cached data (and meta-data)
24+
* @throws ApcException
25+
*
26+
*/
27+
function apc_cache_info(string $cache_type = '', bool $limited = false): array
28+
{
29+
error_clear_last();
30+
$result = \apc_cache_info($cache_type, $limited);
31+
if ($result === false) {
32+
throw ApcException::createFromPhpError();
33+
}
34+
return $result;
35+
}
36+
37+
738
/**
839
* apc_cas updates an already existing integer value if the
940
* old parameter matches the currently stored value

generated/apcu.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@
44

55
use Safe\Exceptions\ApcuException;
66

7+
/**
8+
* Retrieves cached information and meta-data from APC's data store.
9+
*
10+
* @param bool $limited If limited is TRUE, the
11+
* return value will exclude the individual list of cache entries. This
12+
* is useful when trying to optimize calls for statistics gathering.
13+
* @return array Array of cached data (and meta-data)
14+
* @throws ApcuException
15+
*
16+
*/
17+
function apcu_cache_info(bool $limited = false): array
18+
{
19+
error_clear_last();
20+
$result = \apcu_cache_info($limited);
21+
if ($result === false) {
22+
throw ApcuException::createFromPhpError();
23+
}
24+
return $result;
25+
}
26+
27+
728
/**
829
* apcu_cas updates an already existing integer value if the
930
* old parameter matches the currently stored value

generated/datetime.php

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@
44

55
use Safe\Exceptions\DatetimeException;
66

7+
/**
8+
* Returns associative array with detailed info about given date.
9+
*
10+
* @param string $format Format accepted by DateTime::createFromFormat.
11+
* @param string $date String representing the date.
12+
* @return array Returns associative array with detailed info about given date.
13+
* @throws DatetimeException
14+
*
15+
*/
16+
function date_parse_from_format(string $format, string $date): array
17+
{
18+
error_clear_last();
19+
$result = \date_parse_from_format($format, $date);
20+
if ($result === false) {
21+
throw DatetimeException::createFromPhpError();
22+
}
23+
return $result;
24+
}
25+
26+
727
/**
828
*
929
*
@@ -383,6 +403,115 @@ function mktime(int $hour = null, int $minute = null, int $second = null, int $m
383403
}
384404

385405

406+
/**
407+
* strptime returns an array with the
408+
* date parsed, .
409+
*
410+
* Month and weekday names and other language dependent strings respect the
411+
* current locale set with setlocale (LC_TIME).
412+
*
413+
* @param string $date The string to parse (e.g. returned from strftime).
414+
* @param string $format The format used in date (e.g. the same as
415+
* used in strftime). Note that some of the format
416+
* options available to strftime may not have any
417+
* effect within strptime; the exact subset that are
418+
* supported will vary based on the operating system and C library in
419+
* use.
420+
*
421+
* For more information about the format options, read the
422+
* strftime page.
423+
* @return array Returns an array .
424+
*
425+
*
426+
* The following parameters are returned in the array
427+
*
428+
*
429+
*
430+
* parameters
431+
* Description
432+
*
433+
*
434+
*
435+
*
436+
* "tm_sec"
437+
* Seconds after the minute (0-61)
438+
*
439+
*
440+
* "tm_min"
441+
* Minutes after the hour (0-59)
442+
*
443+
*
444+
* "tm_hour"
445+
* Hour since midnight (0-23)
446+
*
447+
*
448+
* "tm_mday"
449+
* Day of the month (1-31)
450+
*
451+
*
452+
* "tm_mon"
453+
* Months since January (0-11)
454+
*
455+
*
456+
* "tm_year"
457+
* Years since 1900
458+
*
459+
*
460+
* "tm_wday"
461+
* Days since Sunday (0-6)
462+
*
463+
*
464+
* "tm_yday"
465+
* Days since January 1 (0-365)
466+
*
467+
*
468+
* "unparsed"
469+
* the date part which was not
470+
* recognized using the specified format
471+
*
472+
*
473+
*
474+
*
475+
* @throws DatetimeException
476+
*
477+
*/
478+
function strptime(string $date, string $format): array
479+
{
480+
error_clear_last();
481+
$result = \strptime($date, $format);
482+
if ($result === false) {
483+
throw DatetimeException::createFromPhpError();
484+
}
485+
return $result;
486+
}
487+
488+
489+
/**
490+
* Each parameter of this function uses the default time zone unless a
491+
* time zone is specified in that parameter. Be careful not to use
492+
* different time zones in each parameter unless that is intended.
493+
* See date_default_timezone_get on the various
494+
* ways to define the default time zone.
495+
*
496+
* @param string $time A date/time string. Valid formats are explained in Date and Time Formats.
497+
* @param int $now The timestamp which is used as a base for the calculation of relative
498+
* dates.
499+
* @return int Returns a timestamp on success, FALSE otherwise. Previous to PHP 5.1.0,
500+
* this function would return -1 on failure.
501+
* @throws DatetimeException
502+
*
503+
*/
504+
function strtotime(string $time, int $now = null): int
505+
{
506+
error_clear_last();
507+
$result = \strtotime($time, $now);
508+
if ($result === false) {
509+
throw DatetimeException::createFromPhpError();
510+
}
511+
return $result;
512+
}
513+
514+
386515
/**
387516
*
388517
*

generated/exec.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
*
1111
* @param resource $process The proc_open resource that will
1212
* be evaluated.
13-
* @return array An array of collected information on success, and FALSE
14-
* on failure. The returned array contains the following elements:
13+
* @return array An array of collected information on success, . The returned array contains the following elements:
1514
*
1615
*
1716
*
@@ -145,8 +144,7 @@ function proc_nice(int $increment): void
145144
* @param int $return_var If the return_var argument is present, then the
146145
* return status of the executed command will be written to this
147146
* variable.
148-
* @return string Returns the last line of the command output on success, and FALSE
149-
* on failure.
147+
* @return string Returns the last line of the command output on success, .
150148
* @throws ExecException
151149
*
152150
*/

generated/fileinfo.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,39 @@ function finfo_close($finfo): void
2121
}
2222

2323

24+
/**
25+
* Procedural style
26+
*
27+
* Object oriented style (constructor):
28+
*
29+
* This function opens a magic database and returns its resource.
30+
*
31+
* @param int $options One or disjunction of more Fileinfo
32+
* constants.
33+
* @param string $magic_file Name of a magic database file, usually something like
34+
* /path/to/magic.mime. If not specified, the
35+
* MAGIC environment variable is used. If the
36+
* environment variable isn't set, then PHP's bundled magic database will
37+
* be used.
38+
*
39+
* Passing NULL or an empty string will be equivalent to the default
40+
* value.
41+
* @return resource (Procedural style only)
42+
* Returns a magic database resource on success .
43+
* @throws FileinfoException
44+
*
45+
*/
46+
function finfo_open(int $options = FILEINFO_NONE, string $magic_file = null)
47+
{
48+
error_clear_last();
49+
$result = \finfo_open($options, $magic_file);
50+
if ($result === false) {
51+
throw FileinfoException::createFromPhpError();
52+
}
53+
return $result;
54+
}
55+
56+
2457
/**
2558
* Returns the MIME content type for a file as determined by using
2659
* information from the magic.mime file.

generated/filesystem.php

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,59 @@ function fileowner(string $filename): int
449449
}
450450

451451

452+
/**
453+
* flock allows you to perform a simple reader/writer
454+
* model which can be used on virtually every platform (including most Unix
455+
* derivatives and even Windows).
456+
*
457+
* On versions of PHP before 5.3.2, the lock is released also by
458+
* fclose (which is also called automatically when script
459+
* finished).
460+
*
461+
* PHP supports a portable way of locking complete files in an advisory way
462+
* (which means all accessing programs have to use the same way of locking
463+
* or it will not work). By default, this function will block until the
464+
* requested lock is acquired; this may be controlled with the LOCK_NB option documented below.
465+
*
466+
* @param resource $handle A file system pointer resource
467+
* that is typically created using fopen.
468+
* @param int $operation operation is one of the following:
469+
*
470+
*
471+
*
472+
* LOCK_SH to acquire a shared lock (reader).
473+
*
474+
*
475+
*
476+
*
477+
* LOCK_EX to acquire an exclusive lock (writer).
478+
*
479+
*
480+
*
481+
*
482+
* LOCK_UN to release a lock (shared or exclusive).
483+
*
484+
*
485+
*
486+
*
487+
* It is also possible to add LOCK_NB as a bitmask to one
488+
* of the above operations if you don't want flock to
489+
* block while locking.
490+
* @param int $wouldblock The optional third argument is set to 1 if the lock would block
491+
* (EWOULDBLOCK errno condition).
492+
* @throws FilesystemException
493+
*
494+
*/
495+
function flock($handle, int $operation, int &$wouldblock = null): void
496+
{
497+
error_clear_last();
498+
$result = \flock($handle, $operation, $wouldblock);
499+
if ($result === false) {
500+
throw FilesystemException::createFromPhpError();
501+
}
502+
}
503+
504+
452505
/**
453506
* fopen binds a named resource, specified by
454507
* filename, to a stream.
@@ -997,7 +1050,7 @@ function mkdir(string $pathname, int $mode = 0777, bool $recursive = false, $con
9971050
* and "none" are considered FALSE. "null" is converted to NULL
9981051
* in typed mode. Also, all numeric strings are converted to integer type if it is possible.
9991052
* @return array The settings are returned as an associative array on success,
1000-
* and FALSE on failure.
1053+
* .
10011054
* @throws FilesystemException
10021055
*
10031056
*/
@@ -1035,7 +1088,7 @@ function parse_ini_file(string $filename, bool $process_sections = false, int $s
10351088
* and "none" are considered FALSE. "null" is converted to NULL
10361089
* in typed mode. Also, all numeric strings are converted to integer type if it is possible.
10371090
* @return array The settings are returned as an associative array on success,
1038-
* and FALSE on failure.
1091+
* .
10391092
* @throws FilesystemException
10401093
*
10411094
*/

0 commit comments

Comments
 (0)